/* Local palette: one-off colours for this page, named by role. Global tokens live in style.css. */
:root {
  --so-letter-body-bg: #e9e2c8;
  --so-trophy-shelf-bg: #b07a4a;
  --so-trophy-shelf-bg-2: #fff8ec;
  --so-album-page-glow: #e7d9ad;
  --so-slot-empty-edge: #c9b98a;
  --so-panel-bg: #bfe8ff;
  --so-stars-ink: #e0a100;
  --so-tiles-bg: #ffe9a8;
  --so-snap-bg: #ffe896;
}
/* Social + collections + Gazette pages. Loaded via page({head}) by mail/lookup/collections/gazette routes,
   plus home, login/register, land pages and the error pages in server.js for their page-scoped rules. */

/* Tabs (album pages, mail folders) */
.album-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.head-row + .album-tabs { margin-top: 12px; } /* score tables: the tabs sit under the Play / All games buttons */
.album-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border: 2px solid var(--ink); border-radius: 999px; background: #fff;
  font: 600 .98rem var(--display); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
}
.album-tabs a[aria-current="page"] { background: var(--pick); }
.album-tabs small { color: var(--muted); font-weight: 600; }

/* Mail */
.mail-table tr.unread td { font-weight: 800; background: var(--hi-soft); }
.mail-pick { width: 1%; }
.mail-pick label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; } /* whole square is the tap target */
.mail-who { display: flex; align-items: center; gap: 8px; } /* a span inside the td: flex on the td itself breaks the table row */
.mail-who svg { flex: none; border-radius: 50%; background: var(--tint); }
.mail-date { white-space: nowrap; }
.mail-note { margin-top: 12px; } /* the sent folder has no delete row between table and note */
.mail-form { display: grid; gap: 12px; max-width: 640px; }
.letter-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.letter-head h1 { margin: 0; }
.letter-head svg { flex: none; }
.letter-body {
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px 18px; margin-bottom: 16px;
  /* one ruled line under each 28px text line: the tile starts at the 16px top padding */
  background: linear-gradient(transparent 27px, var(--so-letter-body-bg) 27px) 0 16px / 100% 28px, var(--parchment);
  border: 2px solid var(--ink); border-radius: var(--r-tile);
  line-height: 28px;
}
@media (max-width: 560px) {
  /* Phones: each letter is a two-line row, [pick] sender . date over the subject */
  .mail-table, .mail-table tbody { display: block; }
  .mail-table thead { display: none; }
  .mail-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 10px 12px; }
  .mail-table.mail-sent tr { grid-template-columns: minmax(0, 1fr) auto; }
  .mail-table tbody tr.unread { background: var(--hi-soft); }
  .mail-table tr + tr { border-top: 1px solid var(--rule); }
  .table.mail-table tr > td { padding: 0; border: 0; background: none; width: auto; }
  .mail-pick { grid-row: span 3; }
  .mail-from { grid-column: 2 / -1; }
  .mail-sent .mail-from { grid-column: 1 / -1; }
  .mail-who svg { width: 28px; height: 28px; }
  .mail-subject { grid-column: 2 / -1; }
  .mail-sent .mail-subject { grid-column: 1 / -1; }
  .mail-date { grid-column: 2 / -1; font-size: var(--fs-xs); color: var(--muted); } /* third line: a right-hand date squeezed long senders into four-line names */
  .mail-sent .mail-date { grid-column: 1 / -1; }
}

/* Profile card + pet scrapbook */
.lookup-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lookup-head h1 { margin: 0; }
.lookup-avatar svg { border: var(--line) solid var(--ink); border-radius: 50%; background: linear-gradient(var(--land-from), var(--land-to)); box-shadow: var(--shadow-sm); }
.lookup-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.lookup-stats div { background: var(--tint); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 4px 12px; }
.lookup-stats dt { font: 600 var(--fs-xs) var(--display); color: var(--muted); }
.lookup-stats dd { margin: 0; font-weight: 800; }
/* Phones: profile head is a centred hero; the text column may shrink so long usernames wrap instead of pushing the page wide */
@media (max-width: 560px) {
  .lookup-head { flex-direction: column; text-align: center; gap: 12px; }
  .lookup-head > div { max-width: 100%; min-width: 0; }
  .lookup-head h1 { overflow-wrap: anywhere; }
  .lookup-head .lede { margin-inline: auto; }
  .lookup-head .lookup-stats div { text-align: left; }
  .lookup-head .btn-row { justify-content: center; }
}
@media (max-width: 560px) { .lookup-stats { display: grid; grid-template-columns: 1fr 1fr; } } /* 2x2, not 3 + 1 */
.petpage-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.petpage-head > svg { flex: none; }
.petpage-head > div { flex: 1 1 180px; min-width: 0; } /* keeps the pet beside its title on phones */
.petpage-head h1 { margin: 0; }
@media (max-width: 560px) {
  .petpage-head { gap: 10px; }
  .petpage-head > svg { width: 64px; height: 64px; }
  .petpage-head h1 { font-size: 1.6rem; }
}
.petpage-head .btn { margin-left: auto; }
.user-html { padding: 0; overflow: hidden; resize: vertical; min-height: 96px; border-end-end-radius: 6px; } /* height is set inline from frameHeight(); drag the corner for more */
.user-html .user-frame { height: 100%; }
.user-frame { display: block; width: 100%; border: 0; background: #fff; }

/* HTML editors */
.html-editor { display: grid; gap: 12px; }
.editor-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.editor-split textarea { font: 500 var(--fs-sm)/1.45 ui-monospace, 'SF Mono', Menlo, monospace; min-height: 420px; resize: vertical; }
.editor-split .user-frame { border: 2px solid var(--ink); border-radius: var(--r-tile); min-height: 420px; }
.editor-preview p { margin: 0 0 4px; font-weight: 700; } /* reads like the textarea's label, so both boxes start level */
@media (max-width: 560px) { .editor-split textarea, .editor-split .user-frame { min-height: 280px; } }
.avatar-picks { align-items: center; }
.avatar-picks .pick { padding: 4px; }

/* Avatars */
.avatar-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 560px) { .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } } /* 150px min made phones a one-tile column, 30 screens long */
.avatar-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 10px;
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r-tile); box-shadow: var(--shadow-sm);
}
.avatar-tile small { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.avatar-tile > :last-child { margin-top: auto; } /* the button or pill sits on the tile's floor */
.avatar-tile.current { background: var(--hi); box-shadow: 0 0 0 3px var(--pink), var(--shadow-sm); }
.avatar-pair { display: flex; align-items: flex-end; gap: 4px; } /* the portrait in the frame, and the unlock's pet face */
.avatar-tile .btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.locked svg { filter: grayscale(1) brightness(.35) opacity(.45); }
.lock-pill { background: var(--tint-2); }

/* Trophies */
.trophy-shelf {
  display: flex; flex-wrap: wrap; gap: 18px 12px; padding: 16px 12px 24px; /* dates sit above the 14px plank */
  background: linear-gradient(transparent calc(100% - 14px), var(--so-trophy-shelf-bg) calc(100% - 14px));
  border: 2px solid var(--ink); border-radius: var(--r-tile); background-color: var(--so-trophy-shelf-bg-2);
}
.trophy-shelf figure { margin: 0; width: 104px; display: grid; justify-items: center; text-align: center; }
.trophy-shelf figcaption { font: 600 var(--fs-sm)/1.2 var(--display); }
.trophy-shelf figcaption small { display: block; color: var(--muted); font: 600 var(--fs-xs) var(--body); }
.item-tile.locked b, .item-tile.locked small { color: var(--muted); }

/* Album */
.album-page {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; padding: 14px;
  background: var(--parchment); border: var(--line) solid var(--ink); border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 8px var(--so-album-page-glow); margin-bottom: 14px;
}
.slot { margin: 0; display: grid; justify-items: center; gap: 4px; padding: 8px; text-align: center; background: #fff; border: 2px solid var(--ink); border-radius: var(--r-sm); }
.slot figcaption { font: 600 var(--fs-xs)/1.2 var(--display); }
.slot-empty { background: transparent; border-style: dashed; border-color: var(--so-slot-empty-edge); }
.slot-empty svg { filter: brightness(0) opacity(.14); }
.slot-empty figcaption { color: var(--muted); }
@media (max-width: 560px) {
  .album-page { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .slot { padding: 6px 4px; }
  .slot svg { width: 100%; max-width: 64px; height: auto; }
}

/* Land pages: neighbours side by side, world map under them on phones */
.land-nav { align-items: center; }
@media (max-width: 560px) {
  .land-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .land-nav .btn { padding-inline: 12px; }
  .land-map { grid-column: 1 / -1; grid-row: 2; }
}

/* Register hints */
.auth-card label small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }

/* Error pages (server.js): a pet, what happened, a way back */
.oops h1 { color: var(--ink); }
.oops > svg { display: block; margin: 0 auto 4px; }
.oops p { max-width: 52ch; margin-inline: auto; }
.oops .btn-row { justify-content: center; }

/* Gazette: a cartoon broadsheet. Newsprint card, double-ruled masthead, section tabs, ruled columns. */
.paper {
  --news: #fbf6e6; --news-2: #f1e8cc; --red: #d8343a;
  background: radial-gradient(circle, color-mix(in oklab, var(--ink) 7%, transparent) .8px, transparent 1.2px) 0 0 / 6px 6px, var(--news);
  font-size: 1.02rem;
}
.masthead { text-align: center; border-bottom: 5px double var(--ink); padding-bottom: 8px; }
.masthead h1 { font-size: clamp(2.1rem, 7vw, 4rem); margin: 0; letter-spacing: .01em; color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.ears { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 4px; font: 600 var(--fs-sm) var(--display); text-transform: uppercase; letter-spacing: .06em; }
.dateline { margin: 6px 0 0; font-style: italic; border-top: 2px solid var(--ink); padding-top: 6px; }
.paper-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 18px; border-bottom: 3px solid var(--ink); scrollbar-width: none; }
.paper-tabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; font: 600 var(--fs-sm) var(--display); color: var(--ink); text-decoration: none; border: 3px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0; }
.paper-tabs a:hover { background: var(--news-2); }
.paper-tabs a[aria-current="page"] { background: var(--pick); border-color: var(--ink); }
.paper h2 { font-size: 1.3rem; }
.paper section + section { margin-top: 14px; }

.front { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 24px; }
.front-side { border-left: 2px solid var(--ink); padding-left: 20px; }
.front-side h2 { font-size: 1.1rem; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
/* Tablet: the sidebar under the lead, in two columns, instead of a tall strip beside a half-empty main column */
@media (min-width: 768px) and (max-width: 1024px) {
  .front { grid-template-columns: 1fr; }
  .front-side { border-left: 0; padding-left: 0; border-top: 3px double var(--ink); padding-top: 12px; columns: 2 260px; column-gap: 24px; }
  .front-side > * { break-inside: avoid; }
}
@media (max-width: 767px) { .front { grid-template-columns: 1fr; } .front-side { border-left: 0; padding-left: 0; border-top: 3px double var(--ink); padding-top: 12px; } }
.kicker { margin: 0 0 2px; font: 700 .78rem var(--display); text-transform: uppercase; letter-spacing: .12em; color: color-mix(in oklab, var(--ink) 65%, transparent); }
.kicker.is-real { color: var(--red); }
.kicker.is-real::before { content: '● '; }
.lead-story h2 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1.08; margin-bottom: 10px; }
.lead-body { display: flow-root; }
.lead-body .photo { float: left; margin: 0 18px 8px 0; }
@media (max-width: 560px) { .lead-body .photo { float: none; display: table; margin: 0 auto 12px; } .paper-tabs { flex-wrap: wrap; justify-content: center; gap: 12px; border-bottom: 0; } .paper-tabs a { display: inline-flex; align-items: center; min-height: 44px; border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px; } }
.dropcap::first-letter { float: left; font: 700 2.6em/1 var(--display); margin: 4px 10px 0 0; padding: 4px 10px; background: var(--sun); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }
.photo { margin: 0; display: inline-block; background: #fff; border: 3px solid var(--ink); padding: 6px 6px 2px; box-shadow: 4px 4px 0 var(--ink); rotate: -1.5deg; }
.photo svg { display: block; background: radial-gradient(circle, color-mix(in srgb, #000 7%, transparent) 1px, transparent 1.4px) 0 0 / 5px 5px, var(--news-2); }
.photo figcaption { font: italic 600 .8rem var(--body); text-align: center; }
.story .photo { float: right; margin: 0 0 6px 10px; rotate: 2deg; box-shadow: 3px 3px 0 var(--ink); }
.story { display: flow-root; }
.front .paper-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.front .story:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 2px dashed var(--rule); padding-top: 12px; }
@media (max-width: 560px) { .front .paper-cols { grid-template-columns: 1fr; } }
.story h3 { font-size: 1.15rem; margin-bottom: 4px; }
.paper-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 24px; margin: 16px 0; border-top: 2px solid var(--ink); padding-top: 14px; }
.paper-cols > section + section { margin-top: 0; border-left: 2px solid var(--rule); padding-left: 20px; }
@media (max-width: 560px) { .paper-cols > section + section { border-left: 0; padding-left: 0; border-top: 2px dashed var(--rule); padding-top: 12px; } }
.inside ul, .crier { list-style: none; padding: 0; margin: 0; }
.inside li + li, .crier li + li { border-top: 1px dashed var(--rule); }
.inside a { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; }
.inside a b { display: block; font-family: var(--display); color: var(--red); }
.inside a:hover { background: var(--hi); }
.crier li { padding: 6px 0; font-size: var(--fs-sm); }
.my-stars { background: var(--hi); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 8px 12px; }
.letter-q { background: var(--news-2); border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: start; }
.letter-q .star-chart { flex: none; margin-top: 4px; }
.letter-q p { margin: 4px 0; }
.wren-by { display: flex; gap: 8px; align-items: center; }
.wren-by svg { flex: none; }
/* Town news and the pet's weekly column */
.town-box h3 { margin: 8px 0 2px; font-size: var(--fs-sm); }
.town-news .kicker { margin-top: 0; }
.crier li small { margin-left: 6px; }
.pet-column { border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; }
.column-body { display: flex; gap: 18px; align-items: start; flex-wrap: wrap; }
.column-body > div { flex: 1 1 280px; }
.column-body .snap { flex: none; max-width: 160px; }
.diary { margin: 0 0 8px; padding-left: 20px; }
.signoff { font-style: italic; }
/* Town Poll ballots: each pet walks up in turn (is-fresh = just rang the bell) */
.ballots { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.ballots li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; background: var(--tint); border: 2px solid var(--ink); border-radius: var(--r-sm); }
.ballots li svg { flex: none; }
.ballots p { margin: 0; }
.ballots small { display: block; }
.ballots.is-fresh li { animation: ballot-in .5s calc(var(--i) * .7s) both ease-out; }
@keyframes ballot-in { from { opacity: 0; translate: -40px 0; } }
.reduce-motion .ballots.is-fresh li { animation: none; }

.comic { margin: 20px 0 0; border-top: 3px double var(--ink); padding-top: 12px; }
.comic .strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.panel { margin: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 230px; padding: 8px; border: 3px solid var(--ink); border-radius: 6px; background-color: var(--so-panel-bg); background-size: cover; overflow: hidden; }
.panel-cast { display: flex; justify-content: space-around; align-items: flex-end; }
.panel-cast > svg { width: 42%; height: auto; }
.panel-prop svg { display: block; width: 40px; height: auto; margin-bottom: 8px; }
@media (max-width: 560px) { .comic .strip { grid-template-columns: 1fr; } .panel { min-height: 0; } .panel-cast > svg { width: 30%; } }
.bubble { position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 6px 10px; margin: 0 0 14px; font-size: var(--fs-sm); }
.bubble::after { content: ''; position: absolute; bottom: -9px; left: 22%; width: 14px; height: 14px; background: #fff; border: 2px solid var(--ink); border-top: 0; border-left: 0; transform: rotate(45deg); }
.weather { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; font-size: var(--fs-sm); }
.front-main > .weather-box { margin-top: 18px; border-top: 3px double var(--ink); padding-top: 12px; }
.weather b { display: block; font-family: var(--display); }

.paper .table td:last-child { text-align: right; }
.mini-pet svg { width: 28px; height: auto; vertical-align: middle; margin-right: 6px; }
.sports { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); } /* min(): at 320 a 280px column is wider than the card */
.sports .table :is(th, td) { overflow-wrap: anywhere; } /* a long player name must not push the table past its column */
.sports .derby { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
.sports .derby td:first-child { white-space: nowrap; }
.sports .derby + section { border-left: 0; padding-left: 0; }
.mini-pet { display: inline-block; vertical-align: middle; }
.mini-pet svg { display: block; }
.sports .derby small { margin-left: 4px; }
.sports .table { width: 100%; }
.stars-grid ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 18px; }
.stars-grid li { display: flex; gap: 10px; align-items: flex-start; }
.stars-grid li p { margin: 2px 0 0; font-size: var(--fs-sm); }
.sign-pet { flex: none; width: 52px; }
.sign-pet svg { display: block; width: 100%; height: auto; }
.stars { color: var(--so-stars-ink); font-size: 1.3rem; letter-spacing: 2px; }
.review-body { display: flex; gap: 12px; align-items: flex-start; }
.review-body > svg { flex: none; }
.recipe-eq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 700 1.4rem var(--display); }
.ing { display: inline-flex; flex-direction: column; align-items: center; max-width: 84px; text-align: center; }
.ing small { font: 600 .75rem var(--body); }
.obits { border: 4px double var(--ink); padding: 10px 14px; background: #fff; }
.obits h2 { text-align: center; }
.obit { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.obit svg { flex: none; filter: grayscale(1); }
.obit p { margin: 0 0 10px; }

.puzzle { background: #fff; border: 3px solid var(--ink); border-radius: var(--r-sm); padding: 12px 16px; box-shadow: 4px 4px 0 var(--ink); }
.puzzle h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pz-done { display: inline-block; margin: 0 0 8px; padding: 2px 10px; background: var(--hi); border: 2px solid var(--ink); border-radius: 999px; font: 600 var(--fs-sm) var(--display); }
.jumble label { display: grid; gap: 4px; margin-bottom: 12px; }
.tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tiles b { width: 30px; height: 34px; display: grid; place-items: center; background: var(--so-tiles-bg); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 0 3px 0 var(--ink); font: 700 1.1rem var(--display); }
.tiles b:nth-child(odd) { rotate: -3deg; }
.tiles b:nth-child(3n) { rotate: 4deg; }
.jumble input { text-transform: uppercase; letter-spacing: .1em; max-width: 16ch; }
.answer { font: 700 1.1rem var(--display); letter-spacing: .1em; color: var(--red); }
.rebus-clue { font-size: clamp(2.4rem, 9vw, 3.4rem); margin: 4px 0; letter-spacing: .1em; }
.rebus-opts { display: flex; flex-wrap: wrap; gap: 12px; }
.spot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .spot-pair { grid-template-columns: 1fr; } }
.spot-side svg { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 8px; }
.spot-hit { cursor: pointer; }
.spot-ring { fill: none; stroke: var(--red); stroke-width: 5; opacity: 0; pointer-events: none; transition: opacity .2s; }
.spot-ring.found, .is-solved .spot-ring { opacity: 1; }
.spot-side.miss { animation: spot-miss .3s; }
@keyframes spot-miss { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }
@media (prefers-reduced-motion: reduce) { .spot-side.miss { animation: none; } }
.spot-count { font: 600 1.05rem var(--display); }

.classifieds ul { columns: 2 240px; column-gap: 12px; list-style: none; margin: 0; padding: 0; }
.classifieds li { break-inside: avoid; margin: 0 0 10px; padding: 8px 10px; border: 2px dashed var(--ink); background: #fff; font-size: var(--fs-sm); }
.classifieds b { font-family: var(--display); letter-spacing: .04em; }
.classifieds a { display: block; }
.parody-ad { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 3px solid var(--ink); background: hsl(var(--ad-hue) 90% 92%); } /* style-ok: colour computed from a per-element custom property */
.parody-ad h3 { margin: 0 0 4px; }
.ad-cta { font: 700 var(--fs-sm) var(--display); text-transform: uppercase; }
.back-issues { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.back-issues a { display: inline-block; padding: 4px 12px; color: var(--ink); text-decoration: none; }
.back-issues a:hover { background: var(--hi); color: var(--ink); }
.back-issues a[aria-current="page"] { background: var(--pick); }

/* Poll + POTD */
.poll-form { display: grid; gap: 10px; justify-items: start; }
.poll-bars { list-style: none; padding: 0; display: grid; gap: 10px; }
.poll-bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; }
.poll-bars li.mine > span:first-child { font-weight: 800; }
@media (max-width: 560px) { .poll-bars li { grid-template-columns: 1fr 3.2em; } .poll-bars li > .stat-bar { grid-column: 1 / -1; grid-row: 2; } }
.potd { text-align: center; }
.potd .lede { margin-inline: auto; } /* the lede's 62ch box sat left of centre */
.potd-stage { display: inline-block; padding: 12px 32px 0; border-radius: 50% 50% 20px 20px; background: radial-gradient(circle at 50% 30%, var(--sun-cream), var(--land-to)); border: var(--line) solid var(--ink); }
.potd .btn-row { justify-content: center; }
.potd-box { text-align: center; display: grid; align-content: center; justify-items: center; }
.potd-box h2 { margin-top: 0; }

/* Photo album: polaroids taped onto a page (services/album.js photoCard) */
.photo-page {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 18px;
  background: var(--parchment); border: var(--line) solid var(--ink); border-radius: var(--r-tile); margin-bottom: 14px;
}
.snap { margin: 0; padding: 8px 8px 10px; background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); rotate: var(--tilt, 0deg); display: grid; justify-items: center; gap: 6px; text-align: center; position: relative; }
.snap::before { content: ''; position: absolute; top: -9px; left: 50%; width: 46px; height: 16px; translate: -50% 0; rotate: -4deg; background: color-mix(in srgb, var(--so-snap-bg) 80%, transparent); border: 1px solid rgb(0 0 0 / .1); } /* tape */
.snap figcaption { font: 600 var(--fs-sm)/1.25 var(--display); }
.snap figcaption small { display: block; color: var(--muted); font: 600 var(--fs-xs) var(--body); }
.snap-art { display: grid; place-items: end center; overflow: hidden; position: relative; background: linear-gradient(var(--from), var(--to)); border: 1.5px solid var(--ink); }
.snap-art::before { content: ''; position: absolute; inset: 15% 10% 0; border-radius: 50%; background: radial-gradient(circle, rgb(255 250 205 / calc(var(--glow) * .95)) 0 25%, rgb(143 240 255 / calc(var(--glow) * .5)) 50%, transparent 70%); } /* style-ok: colour computed from a per-element custom property */
.snap-art svg { position: relative; }

/* Portrait and frames (/avatars) */
.portrait-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.portrait-head h1 { margin: 0 0 6px; }
.portrait-head > div:last-child { flex: 1 1 260px; }
.title-pick { margin: 12px 0 4px; flex-wrap: wrap; align-items: end; }
@media (max-width: 560px) { .portrait-head { justify-content: center; text-align: center; } .portrait-head .title-pick { justify-content: center; } } /* portrait, title and Wear it centred on phones */
.avatar-tile .title-tag, .trophy-shelf .title-tag, .item-tile .title-tag { margin: 2px 0 0; white-space: normal; border-radius: 12px; }
.avatar-tile .stat-bar { width: 100%; }

/* Pet rooms (/scrapbook/:name): a wall, a floor, lit by the pet's glow. Pieces sit by their centre (public/room.js). */
.room {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: var(--line) solid var(--ink); border-radius: var(--r-tile);
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, color-mix(in oklab, var(--wall) 80%, #fff) 38px 40px) top / 100% 62% no-repeat,
    linear-gradient(var(--trim), var(--trim)) 0 62% / 100% 8px no-repeat,
    linear-gradient(var(--wall), var(--wall)) top / 100% 62% no-repeat,
    repeating-linear-gradient(0deg, var(--floor) 0 22px, color-mix(in oklab, var(--floor) 85%, #000) 22px 24px);
}
.room::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: rgb(20 10 50 / calc((1 - var(--glow)) * .35)); } /* a dim pet, a dim room */ /* style-ok: colour computed from a per-element custom property */
.room-piece { position: absolute; translate: -50% -50%; line-height: 0; touch-action: none; user-select: none; }
.room-piece svg { max-width: 22vw; height: auto; }
.room[data-edit] .room-piece { cursor: grab; }
.room[data-edit] .room-piece:focus-visible { outline: 3px dashed var(--pink); outline-offset: 4px; }
.room-piece.is-dragging { cursor: grabbing; z-index: 2; filter: drop-shadow(4px 6px 0 rgb(0 0 0 / .25)); }
.room-piece.is-leaving { opacity: .4; }
.room-pet { display: block; position: relative; }
.room-pet::before { content: ''; position: absolute; inset: 10% 5% -5%; border-radius: 50%; background: radial-gradient(circle, rgb(255 250 205 / calc(var(--glow) * .95)) 0 25%, rgb(143 240 255 / calc(var(--glow) * .5)) 50%, transparent 70%); } /* style-ok: colour computed from a per-element custom property */
.room-pet svg { position: relative; }
.room-photo { display: block; padding: 4px 4px 10px; background: #fff; border: 1.5px solid var(--ink); rotate: -3deg; }
.room-photo .snap-art { border-width: 1px; }
.room + .room-form { margin-top: 12px; } /* the instructions don't touch the scene */
.room-form h3 { margin: 14px 0 6px; font-size: 1rem; }
.room-tray { display: flex; flex-wrap: wrap; gap: 12px; }
.tray-piece { padding: 6px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r-sm); cursor: pointer; line-height: 0; }
.tray-piece:hover { background: var(--hi-soft); }
.tray-piece svg { max-width: 110px; max-height: 64px; width: auto; height: auto; }
.room-unsaved { display: none; }
.room-form.is-dirty .room-unsaved { display: inline; }
@media (max-width: 560px) { .room-piece svg { max-width: 26vw; } }

/* Gazette on phones: clear air under the masthead rule; link rows and link buttons centred */
@media (max-width: 767px) {
  .paper-tabs { margin-top: 16px; }
  .paper .btn-row, .back-issues { justify-content: center; text-align: center; }
  .classifieds a { text-align: center; }
  .paper .link-line, .paper p:has(> a.btn:only-child), .card:has(.back-issues) > p:has(> a.btn) { text-align: center; }
}

/* Desktop: profile cards put the trophy cabinet and the guestbook side by side (.lookup-cols wraps them in lookup.js) */
@media (min-width: 1100px) {
  .lookup-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: stretch; }
  .lookup-cols > .card { margin: 0; }
  .mail-form { max-width: 760px; }
}
