/* ==========================================================================
   Pufflings — the Noticeboard (docs/STYLING.md).
   Loaded by base.html after site.css and before dark-mode.css.

   Every page's content area is a corkboard (.corkboard, on <main>) inside the wooden
   frame, and everything on it is pinned paper:
     .sheet    big flat sections (forms, tables, tools, long text), a pin in each top corner
     .notice   small side notes, one centred pin
     .bulletin cards in grids, one pin; grids of many use .calm (no tilt)
   plus wooden plaques/signs for titles, price tags, filter chips, goal bars, popups and
   polaroids. Existing .card / .panel pages take the sheet look below, so pages that have
   not been rebuilt yet still sit on the board properly.

   Rules (§4.2): colours are tokens (the hex here is decoration that never carries
   text: pin heads, nail heads, the cork and felt, shadows); tilt only via .tilt-N;
   no tilt on sheets, forms, tables or the house editor; every new text/fill pair is in
   apps/common/tests_contrast.py.
   ========================================================================== */

/* ---------- 1. The board ---------- */
.corkboard{
  position:relative;
  background-color:#c79b6c;
  background-image:
    radial-gradient(rgba(111,79,51,.28) 1px, transparent 1.6px),
    radial-gradient(rgba(255,240,220,.18) 1px, transparent 1.6px);
  background-size:9px 9px, 13px 13px;
  background-position:0 0, 4px 6px;
  border:3px solid var(--wood-edge);
  border-radius:20px;
  box-shadow:inset 0 0 0 4px rgba(255,255,255,.18), inset 0 0 24px rgba(111,79,51,.35);
  padding:34px 28px 30px;
}
/* <main class="site-main corkboard"> lines up with the nav plank above it. */
.site-main.corkboard{ width:auto; margin:0 4px; min-width:0; }

/* Moonlit felt (§6, owner's choice 2026-10-29): blue-violet felt instead of cork. */
:root[data-theme="dark"] .corkboard{
  background-color:#2a2650;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.08) 0 2px, transparent 2px 6px);
  background-size:auto;
  border-color:#05060d;
  box-shadow:inset 0 0 0 4px rgba(155,140,255,.08), inset 0 0 30px rgba(0,0,0,.5);
}

/* Text pinned straight to the board (a count line, a breadcrumb, a back link) is cream.
   Cream on bare cork is only 2.3:1, so in light mode it sits on a small dark-wood label
   (60% overlay, 6:1 on the lightest cork fleck; tests_contrast.py). The felt is dark
   enough on its own. Only direct children, so nothing inside a sheet inherits it. */
.corkboard > :is(h1, h2, h3, p, .breadcrumb, .page-back, .result-count, .board-note){
  color:#fff3dc; text-shadow:0 1px 0 rgba(0,0,0,.35);
  width:fit-content; max-width:100%; padding:2px 12px; border-radius:10px;
  background:rgba(60,40,22,.6);
}
:root[data-theme="dark"] .corkboard > :is(h1, h2, h3, p, .breadcrumb, .page-back, .result-count, .board-note){
  background:none; padding-left:0; padding-right:0;
}
.corkboard > :is(h1, h2, h3, p, .breadcrumb, .page-back, .result-count, .board-note) a{ color:#fff3dc; }
.corkboard > :is(.breadcrumb, .page-back, .result-count, .board-note){ font-weight:700; }

/* ---------- 2. Pins ---------- */
/* One look for real <span class="tack"> pins (templates/board/_tack.html) and the
   pseudo-element pins existing .card / .panel sheets get. Colours carry no meaning. */
.tack{
  --tack-fill:var(--rose-deep); --tack-ring:var(--rose-ink);
  position:absolute; z-index:3; top:-10px; left:50%; margin-left:-10px;
  width:20px; height:20px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #fff 0 2px, var(--tack-fill) 3px);
  border:2px solid var(--tack-ring); box-shadow:0 3px 0 rgba(0,0,0,.2);
  pointer-events:none;
}
.tack.mint{ --tack-fill:#9ed092; --tack-ring:#4f7d44; }
.tack.butter{ --tack-fill:#f2cf6b; --tack-ring:#9a7322; }
.tack.lilac{ --tack-fill:#b7a2e0; --tack-ring:#6b56a0; }
.tack.tl{ left:24px; margin-left:0; }
.tack.tr{ left:auto; right:24px; margin-left:0; }

/* ---------- 3. Paper: sheets, notices, bulletins ---------- */
.sheet, .notice, .bulletin{
  position:relative; background:var(--card); color:var(--ink);
  border:2.5px solid var(--line); border-radius:14px;
  box-shadow:0 4px 0 rgba(111,79,51,.28), 0 12px 20px rgba(60,40,20,.22);
}
:root[data-theme="dark"] :is(.sheet, .notice, .bulletin){
  box-shadow:0 4px 0 rgba(0,0,0,.35), 0 12px 20px rgba(0,0,0,.4);
}

.sheet{ padding:28px 28px 24px; min-width:0; }
.sheet h1{ font-size:28px; margin:0 0 4px; line-height:1.2; }
.sheet h2{ font-size:20px; margin:0 0 10px; }
.sheet .lede{ max-width:none; }
.sheet + .sheet{ margin-top:30px; }

.notice{ padding:24px 18px 16px; }
.notice h3{ font-size:19px; margin:0 0 6px; }
.notice p{ font-size:14px; line-height:1.55; color:var(--ink-soft); margin:0 0 10px; }
.notice p strong{ color:var(--ink); font-weight:800; }
.notice-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap:30px 24px; align-items:start; }

.bulletin{
  display:flex; flex-direction:column; gap:8px; text-decoration:none;
  padding:22px 16px 14px; transition:transform .14s ease, border-color .14s ease;
}
.bulletin:hover{ color:var(--ink); border-color:var(--rose-deep); transform:translateY(-3px); }
.bulletin .meta{ display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap;
  font-size:12px; font-weight:700; color:var(--ink-soft); }
.bulletin .meta > span{ min-width:0; overflow-wrap:anywhere; }
.bulletin h3{ font-size:18px; line-height:1.2; margin:0; overflow-wrap:anywhere; }
.bulletin p{ font-size:13.5px; line-height:1.5; color:var(--ink-soft); margin:0; }
.bulletin .cover{ position:relative; height:150px; border-radius:10px; border:2px solid var(--line); overflow:hidden;
  display:flex; align-items:center; justify-content:center; }
.bulletin :where(.cover){ background:var(--tint-butter); }
.bulletin .cover img{ width:100%; height:100%; object-fit:contain; }
.bulletin .cover img.px{ width:64px; height:64px; image-rendering:pixelated; }
.bulletin-head{ display:block; min-width:0; }
.bulletin-badge{ position:absolute; z-index:2; top:6px; right:6px; font-size:11.5px; font-weight:800; line-height:1.5;
  background:var(--card); color:var(--ink); border:1.5px solid var(--line); border-radius:999px; padding:0 8px; }
.bulletin > .bulletin-badge{ top:10px; right:10px; }
.bulletin .kicker{ display:block; font-family:"Fredoka"; font-size:11px; letter-spacing:.08em; color:var(--ink-soft); font-weight:500; }
.bulletin .more{ font-family:"Fredoka"; font-weight:500; font-size:13px; color:var(--rose-ink); margin-top:2px; }
.bulletin.pinned{ grid-column:span 2; }
.bulletin.closed{ filter:grayscale(.65); opacity:.8; }

/* A grid of cards is often a real list: <ul class="bulletin-grid calm"><li>{card}</li></ul>. */
ul.bulletin-grid{ list-style:none; margin:0; padding:0; }
.bulletin-grid > li{ display:flex; flex-direction:column; min-width:0; }
.bulletin-grid > li > .bulletin{ flex:1 1 auto; }
/* Every card in a row is as tall as the tallest one: a card missing a line (a Puffling with
   no traits has no rarity pill, a short name, no meta) must not come out smaller than its
   neighbours. The grid itself stays align-items:start for loose notices. */
ul.bulletin-grid > li{ align-self:stretch; }
/* The invisible stand-in for a missing tag pill (board/_bulletin_card.html, reserve_tag). */
.bulletin .tag-slot{ visibility:hidden; }
/* A card with nowhere to go (board/_bulletin_card.html without url) doesn't lift. */
.bulletin.static:hover{ transform:none; border-color:var(--line); }
/* An orphaned Seeker: greyed art AND a written warning (invariant #2), never blur alone. */
.bulletin.orphaned .cover > img{ filter:blur(2px) grayscale(1); opacity:.6; }
/* A status in words on a card ("Awaiting approval", "⚠ Orphaned"); wraps tidily on phones. */
.bulletin .status-badge{ display:inline-block; border-radius:10px; line-height:1.35; }
/* Pagination under a grid sits on its own pill of paper; every link is a 44px target. */
.board-pager{ display:flex; justify-content:center; margin-top:30px; }
.board-pager .pagination{ margin:0; background:var(--card); border:2.5px solid var(--line); border-radius:999px; padding:4px 12px;
  box-shadow:0 3px 0 rgba(111,79,51,.25); justify-content:center; }
.board-pager :is(.page-link, .page-number, .page-ellipsis){ display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; }
.board-pager .page-number-current{ border-radius:10px; }
/* Gentle empty state (board/_empty_note.html). */
.notice.board-empty{ max-width:440px; margin:10px auto 0; }
.notice.board-empty p{ margin:0 0 4px; }

.bulletin-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap:34px 26px; align-items:start; }
.bulletin-grid.calm, .calm .bulletin-grid{ gap:26px 18px; grid-template-columns:repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.calm .bulletin, .bulletin.calm{ padding:18px 12px 12px; }


/* A note's heading row with a "See all →" style link on the right. */
.notice-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.notice-head :is(h2, h3){ margin:0; }
.note-link{ display:inline-flex; align-items:center; min-height:44px; font-family:"Fredoka"; font-size:13.5px; font-weight:500;
  color:var(--rose-ink); text-decoration:none; }
.note-link:hover{ text-decoration:underline; color:var(--rose-ink); }

/* Layout helpers the mocks share */
.grid-3{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap:34px 24px; align-items:start; }
.detail-cols{ display:flex; flex-wrap:wrap; gap:28px; align-items:flex-start; }
.detail-main{ flex:999 1 560px; min-width:0; }
.detail-side{ flex:1 1 280px; min-width:0; display:flex; flex-direction:column; gap:30px; }
.empty-note{ text-align:center; padding:10px 6px; color:var(--ink-soft); }
.empty-note .big-emoji{ font-size:44px; display:block; margin-bottom:4px; }

/* ---------- 4. Tilt (garnish for small cards only, never sheets) ---------- */
.tilt-0{ transform:rotate(-1.2deg); }
.tilt-1{ transform:rotate(0.9deg); }
.tilt-2{ transform:rotate(-0.4deg); }
.tilt-3{ transform:rotate(1.5deg); }
.bulletin:is(.tilt-0, .tilt-1, .tilt-2, .tilt-3):hover{ transform:translateY(-3px); }
/* .calm grids never tilt, whatever the card asks for (they still lift on hover). */
.calm :is(.tilt-0, .tilt-1, .tilt-2, .tilt-3){ transform:none; }

/* ---------- 5. Existing sections take the sheet look ---------- */
/* .card and .panel are what every page built before the redesign uses, so restyling them
   here moves the whole site onto the board without template edits. They get the sheet's
   paper and shadow, and two corner pins from pseudo-elements. A template that adds its
   own <span class="tack"> loses the pseudo pins, so a card is never double-pinned. */
.card, .panel{
  position:relative; min-width:0;
  background:var(--card); color:var(--ink);
  border:2.5px solid var(--line); border-radius:14px;
  outline:none;
  box-shadow:0 4px 0 rgba(111,79,51,.28), 0 12px 20px rgba(60,40,20,.22);
}
.card{ padding:28px 28px 24px; margin:0 0 30px; }
.card:last-child{ margin-bottom:0; }
.card.narrow{ margin-left:auto; margin-right:auto; }
.panel{ padding:0; }
.panel-inner{ border:none; padding:28px 28px 24px; }
:root[data-theme="dark"] :is(.card, .panel){ box-shadow:0 4px 0 rgba(0,0,0,.35), 0 12px 20px rgba(0,0,0,.4); }

.card::before, .card::after, .panel::before, .panel::after{
  content:""; position:absolute; z-index:3; top:-10px; width:20px; height:20px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #fff 0 2px, var(--tack-fill) 3px);
  border:2px solid var(--tack-ring); box-shadow:0 3px 0 rgba(0,0,0,.2);
  pointer-events:none;
}
.card::before, .panel::before{ --tack-fill:var(--rose-deep); --tack-ring:var(--rose-ink); left:24px; }
.card::after, .panel::after{ --tack-fill:#9ed092; --tack-ring:#4f7d44; right:24px; }
.card:has(> .tack)::before, .card:has(> .tack)::after,
.panel:has(> .tack)::before, .panel:has(> .tack)::after{ content:none; }

/* A card inside a card, or in a .card-grid, is a bulletin: one centred pin, tighter. */
.card .card, .card-grid > .card{ margin:0; padding:22px 16px 16px; }
.card .card::after, .card-grid > .card::after{ content:none; }
.card .card::before, .card-grid > .card::before{ left:50%; margin-left:-10px; --tack-fill:#b7a2e0; --tack-ring:#6b56a0; }
.card-grid{ gap:34px 26px; }
.card-grid > .card:nth-child(4n+2)::before{ --tack-fill:#9ed092; --tack-ring:#4f7d44; }
.card-grid > .card:nth-child(4n+3)::before{ --tack-fill:#f2cf6b; --tack-ring:#9a7322; }
.card-grid > .card:nth-child(4n+4)::before{ --tack-fill:var(--rose-deep); --tack-ring:var(--rose-ink); }

/* The welcome/home two-column grid gets board spacing so pins have room. */
.corkboard > .content{ gap:30px 24px; }
/* Flash messages sit on the board as small notes. */
.corkboard > .messages{ margin:0 0 24px; }
.corkboard > .messages .message{ box-shadow:0 3px 0 rgba(111,79,51,.22); color:var(--ink); }

/* ---------- 6. Wooden plaques and signs ---------- */
/* Cut from the frame's own wood (static/images/background.webp) under a 45% dark-wood
   overlay so cream lettering clears AA on the lightest grain (tests_contrast.py checks
   it against the real texture). Two nail heads, a solid drop, no ropes. */
.board-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px 20px; flex-wrap:wrap; margin-bottom:24px; }
.section-label{ display:inline-block; margin:0 0 18px; }
.wood-plaque, .wood-sign{
  position:relative; display:inline-block;
  background-color:#805d41;
  background-image:linear-gradient(rgba(70,45,25,.45), rgba(70,45,25,.45)), url("../images/background.8d79dc423a90.webp");
  background-size:auto, 512px 512px;
  color:#fff4e4;
  border:3px solid var(--wood-edge); border-radius:12px;
  padding:10px 28px 12px;
  box-shadow:0 5px 0 var(--wood-shadow), inset 0 2px 0 rgba(255,255,255,.16), inset 0 -3px 8px rgba(0,0,0,.25);
}
:root[data-theme="dark"] :is(.wood-plaque, .wood-sign){
  background-color:#3a2c3e;
  background-image:linear-gradient(rgba(28,20,48,.62), rgba(28,20,48,.62)), url("../images/background.8d79dc423a90.webp");
}
.wood-plaque::before, .wood-plaque::after, .wood-sign::before, .wood-sign::after{
  content:""; position:absolute; top:10px; width:7px; height:7px; border-radius:50%;
  background:#3d2a1a; box-shadow:inset 0 1px 0 rgba(255,255,255,.3);
}
.wood-plaque::before, .wood-sign::before{ left:9px; }
.wood-plaque::after, .wood-sign::after{ right:9px; }
.wood-plaque :is(h1, h2, h3), .wood-sign :is(h1, h2, h3){ margin:0; color:#fff4e4; text-shadow:0 1px 0 rgba(0,0,0,.4); }
.wood-plaque p, .wood-sign p{ margin:2px 0 0; font-size:14.5px; font-weight:600; color:#fff4e4; text-shadow:0 1px 0 rgba(0,0,0,.35); }
.wood-plaque a, .wood-sign a{ color:#fff4e4; text-decoration:underline; }
.board-head .wood-plaque h1{ font-size:30px; line-height:1.15; }
.section-label .wood-plaque{ padding:4px 22px 6px; }
.section-label .wood-plaque h2{ font-size:19px; }
.wood-sign{ display:flex; flex-direction:column; align-items:center; gap:2px; width:fit-content; max-width:100%;
  margin:0 auto 24px; padding:12px 38px 14px; text-align:center; }
.wood-sign :is(h1, h2){ font-size:28px; }
/* One very long word (a name, a pasted URL) wraps instead of running off the paper. */
:is(.wood-plaque, .wood-sign) :is(h1, h2, h3), .sheet.char-info h1, .notice h3, .price-tag b{ overflow-wrap:anywhere; }

/* ---------- 7. Price tags (shop stock and buy-back) ---------- */
.price-tag{
  position:relative; display:flex; flex-direction:column; gap:6px; text-align:left;
  font:inherit; color:var(--ink); background:var(--card); border:2px solid var(--line);
  border-radius:6px 14px 14px 6px; padding:16px 14px 12px 22px; text-decoration:none; cursor:pointer;
  box-shadow:0 4px 0 rgba(111,79,51,.25), 0 10px 16px rgba(60,40,20,.22);
  transition:transform .14s ease, border-color .14s ease;
}
.price-tag::before{ content:""; position:absolute; left:7px; top:16px; width:9px; height:9px; border-radius:50%;
  background:var(--wood-dark); box-shadow:inset 0 1px 1px rgba(0,0,0,.4); }
.price-tag:hover{ color:var(--ink); border-color:var(--rose-deep); }
.price-tag .pt-img{ height:84px; display:flex; align-items:center; justify-content:center; border-radius:8px; }
.price-tag :where(.pt-img){ background:var(--tint-butter); }
.price-tag .pt-img img{ width:60px; height:60px; object-fit:contain; }
.price-tag b{ font-family:"Fredoka"; font-weight:600; font-size:15.5px; line-height:1.2; }
.price-tag small{ font-size:12px; font-weight:700; color:var(--ink-soft); }
.price-tag .cost{ display:flex; align-items:center; gap:6px; font-weight:800; font-size:14px; min-width:0; }
.price-tag .cost > span{ min-width:0; overflow-wrap:anywhere; }
.price-tag .cost img{ width:16px; height:16px; object-fit:contain; }
.price-tag:nth-child(odd){ transform:rotate(-1deg); }
.price-tag:nth-child(even){ transform:rotate(1.2deg); }
.price-tag.out{ filter:grayscale(.7); opacity:.65; }
.price-tag-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap:24px 18px; align-items:start; }
:root[data-theme="dark"] :is(.price-tag){ box-shadow:0 4px 0 rgba(0,0,0,.35), 0 10px 16px rgba(0,0,0,.4); }

/* ---------- 8. Tag pills and filter chips ---------- */
/* Background is the admin-chosen colour; text ALWAYS from the chip_ink filter:
   <span class="tag-pill" style="--chip: {{ c }}; --chip-ink: {{ c|chip_ink }}">. */
.tag-pill{ display:inline-block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
  padding:1px 10px; border-radius:12px; max-width:100%; overflow-wrap:anywhere;
  background:var(--chip, var(--ink-soft)); color:var(--chip-ink, var(--card)); border:1.5px solid rgba(0,0,0,.12); }
/* No `nowrap`: a long admin-named rarity or tag ("Legendary Moonlit Grove Exclusive") on a
   two-up phone card pushed the whole page sideways. Short pills still sit on one line; a
   long one wraps inside its card (12px corners, so a two-line pill isn't a lozenge). */

.filter-bar{ display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; background:var(--card); color:var(--ink);
  border:2.5px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:28px;
  box-shadow:0 3px 0 rgba(111,79,51,.25); }
.filter-bar .grow{ flex:1 1 260px; min-width:0; }
.filter-label{ font-size:12px; font-weight:800; color:var(--ink-soft); margin-right:2px; }
.chip-row{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.fchip{ display:inline-flex; align-items:center; gap:6px; font-family:"Nunito"; font-weight:800; font-size:13px;
  color:var(--ink); background:var(--parch-2); border:2px solid var(--line); border-radius:999px;
  padding:4px 14px; cursor:pointer; min-height:36px; text-decoration:none; }
.fchip:hover{ border-color:var(--rose-deep); color:var(--ink); }
.fchip.on, .fchip[aria-pressed="true"], .fchip[aria-current]{ background:var(--rose); border-color:var(--rose-deep); color:var(--on-accent); }
.fchip .sw{ width:10px; height:10px; border-radius:50%; border:1.5px solid rgba(0,0,0,.25); background:var(--chip, var(--ink-soft)); }
.fchip small{ font-weight:700; color:inherit; opacity:.8; }
/* A choice that would show nothing: dashed and muted, still pressable (never opacity —
   the label must keep its contrast: --ink-soft on the bar's --card). */
.fchip.is-empty{ border-style:dashed; background:transparent; color:var(--ink-soft); }
.fchip.is-empty small{ opacity:1; }
/* A bar whose extras fold away on phones (news, sales): .filter-more holds them, and
   .filter-more-toggle (phones only) opens it. Desktop shows them inline. */
.filter-more{ display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; justify-content:flex-end; flex:1 1 320px; min-width:0; }
.filter-more .filter-search{ flex:1 1 200px; min-width:0; }
.filter-bar div.filter-more, .filter-more div{ margin-bottom:0; }
.filter-more-toggle{ display:none; white-space:nowrap; }
.pf-search, .pf-select{ font:inherit; font-size:14px; color:var(--ink); background:var(--parch-2); border:2px solid var(--line);
  border-radius:10px; padding:6px 12px; min-height:40px; }
.pf-search{ width:100%; }
:root[data-theme="dark"] :is(.pf-search, .pf-select){ background:var(--parch-2); }

/* ---------- 9. Goal bar and countdown pill ---------- */
/* The label and "1,240 / 2,000" are always written out; the fill is never the only signal. */
.goal{ display:flex; flex-direction:column; gap:6px; }
.goal-top{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 10px; font-size:13.5px; font-weight:700; }
.goal-top .goal-count{ font-variant-numeric:tabular-nums; }
.goal-bar{ height:16px; background:var(--bg); border:2px solid var(--line); border-radius:999px; overflow:hidden; }
.goal-fill{ height:100%; max-width:100%; background:var(--accent); border-radius:999px; box-shadow:inset 0 -3px 0 rgba(0,0,0,.08); }
.goal.done .goal-fill{ background:var(--mint); }

.cd-pill{ display:inline-flex; align-items:baseline; gap:3px; font-family:"Fredoka"; font-weight:500; font-size:13px;
  color:var(--ink); background:var(--parch-2); border:2px solid var(--line); border-radius:999px; padding:1px 11px; white-space:nowrap; }
.cd-pill b{ font-weight:700; font-size:15px; }

/* Open / closed badge beside a countdown (sale page, news post, events, story page).
   The word carries it; the dot is decoration. */
.live-badge{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
  padding:1px 10px; border-radius:999px; background:var(--card); border:2px solid var(--line); color:var(--ink); }
.live-badge .pulse{ width:8px; height:8px; border-radius:50%; background:#3f7a4b; }
.live-badge.closed .pulse{ background:var(--ink-soft); }
:root[data-theme="dark"] .live-badge .pulse{ background:#7fd3a3; }

/* The dusk scene behind an event with no picture (story page): decoration
   only. The sky carries no text, so its fixed colours are fine in both themes. */
.event-art{ position:relative; overflow:hidden; background:linear-gradient(180deg, #3d3a6e 0%, #7d5f98 60%, #e9aa92 100%); }
.event-art .hill{ position:absolute; left:-10%; right:-10%; bottom:-60px; height:150px; border-radius:50%; background:#8fae7c; border-top:3px solid #6f8d5e; }
.event-art .big-moon{ position:absolute; top:30px; right:40px; width:96px; height:96px; border-radius:50%;
  background:radial-gradient(circle at 40% 35%, #fff6df, #f7d98f); box-shadow:0 0 0 14px rgba(251,233,200,.15), 0 0 60px rgba(251,222,150,.65); }
.event-art .lantern{ position:absolute; width:15px; height:21px; border-radius:7px; background:#f7c873; border:2px solid #b5763d; box-shadow:0 0 14px rgba(247,200,115,.85); }
.event-art .lantern.rose{ background:#f2a7b8; border-color:#a14f63; box-shadow:0 0 14px rgba(242,167,184,.8); }
.event-art .l1{ top:70px; left:16%; } .event-art .l2{ top:130px; left:46%; }
.event-art .dusk-star{ position:absolute; width:3px; height:3px; border-radius:50%; background:#fff3d6; box-shadow:0 0 6px #fff3d6; }
.event-art .s1{ top:40px; left:14%; } .event-art .s2{ top:96px; left:30%; }

/* ---------- 10. Guide notice (the one rose-filled thing on its page) ---------- */
.guide-note{ position:relative; display:flex; gap:22px; align-items:center; flex-wrap:wrap; background:var(--rose); color:var(--on-accent);
  border:3px solid var(--rose-ink); border-radius:14px; padding:28px 28px 24px; text-decoration:none;
  box-shadow:0 5px 0 var(--rose-ink), 0 14px 22px rgba(60,40,20,.25); }
:root[data-theme="dark"] .guide-note{ box-shadow:0 5px 0 #6e3f6e, 0 14px 22px rgba(0,0,0,.4); border-color:var(--rose-ink); }
.guide-note:hover{ color:var(--on-accent); }
.guide-note .guide-icon{ flex:0 0 auto; width:84px; height:84px; border-radius:24px; background:var(--card); border:3px solid var(--rose-ink);
  display:flex; align-items:center; justify-content:center; font-size:42px; }
.guide-note .guide-text{ flex:1 1 280px; min-width:0; }
.guide-note :is(h2, h3){ font-weight:700; font-size:27px; line-height:1.15; margin:0 0 4px; color:var(--on-accent); }
.guide-note p{ font-size:14.5px; line-height:1.55; margin:0; color:var(--on-accent); }
.guide-note .start{ display:inline-block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--on-accent);
  border:2px solid var(--on-accent); border-radius:999px; padding:0 9px; margin-bottom:6px; }
.guide-btn{ display:inline-flex; align-items:center; gap:8px; min-height:44px; background:var(--card); color:var(--rose-ink); border:3px solid var(--rose-ink);
  border-radius:999px; padding:8px 22px; font-family:"Fredoka"; font-weight:600; font-size:17px; text-decoration:none;
  box-shadow:0 3px 0 var(--rose-ink); white-space:nowrap; }
.guide-btn:hover{ color:var(--rose-ink); }
/* A small "All news →" style link on a note (rose ink on paper; ≥44px when it is a real link). */
.note-link{ font-family:"Fredoka"; font-size:13px; font-weight:500; color:var(--rose-ink); text-decoration:none; }
a.note-link{ display:inline-flex; align-items:center; min-height:44px; }
a.note-link:hover{ text-decoration:underline; }
/* The big New Player Guide notice (home, guide hub). */
.guide-note.big{ padding:34px 36px 30px; }
.guide-note.big .guide-icon{ width:96px; height:96px; font-size:48px; border-radius:26px; }
.guide-note.big :is(h2, h3){ font-size:34px; }
.guide-note.big p{ font-size:16px; }
.guide-note.big .guide-btn{ font-size:19px; padding:12px 28px; }
@media (max-width:480px){
  .guide-note.big{ padding:26px 18px 22px; }
  .guide-note.big .guide-icon{ width:72px; height:72px; font-size:36px; border-radius:20px; }
  .guide-note.big :is(h2, h3){ font-size:26px; }
  .guide-note.big .guide-btn{ font-size:17px; padding:10px 20px; }
}

/* ---------- 11. 2x2 picture grid ---------- */

/* ---------- 12. Fold: a sheet that opens (the item log) ---------- */
details.sheet.fold > summary{ cursor:pointer; list-style:none; display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:8px 12px; min-height:44px; }
details.sheet.fold > summary::-webkit-details-marker{ display:none; }
details.sheet.fold > summary :is(h2, h3){ margin:0; }
details.sheet.fold > summary .hint{ font-family:"Fredoka"; font-weight:500; font-size:13.5px; color:var(--rose-ink); }
details.sheet.fold[open] > summary{ margin-bottom:14px; }
details.sheet.fold[open] > summary .when-closed{ display:none; }
details.sheet.fold:not([open]) > summary .when-open{ display:none; }

/* ---------- 13. Popups: centred paper on desktop, a bottom sheet on phones ---------- */
/* Not pinned: it floats over the board. Close with ×, Esc or the backdrop. */
.modal-backdrop{ position:fixed; inset:0; z-index:200; background:rgba(40,28,18,.55);
  display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-paper{ position:relative; width:100%; max-width:480px; max-height:90vh; overflow:auto; background:var(--card); color:var(--ink);
  border:3px solid var(--wood-edge); border-radius:16px; padding:28px 22px 20px; box-shadow:0 20px 50px rgba(30,20,10,.45); }
:root[data-theme="dark"] .modal-backdrop{ background:rgba(5,4,15,.7); }
.modal-paper .modal-close, .modal-box .modal-close{ display:inline-flex; align-items:center; justify-content:center;
  top:6px; right:8px; min-width:44px; min-height:44px; font-size:22px; }

/* ---------- 14. Polaroids (NPC photos): light paper in both themes, fixed ink ---------- */
.polaroid{ position:relative; display:block; background:#fffdf7; padding:10px 10px 12px; text-decoration:none; color:#4a3c2f;
  border:1px solid rgba(111,79,51,.22); box-shadow:0 3px 0 rgba(111,79,51,.18), 0 12px 18px rgba(60,40,20,.25); transition:transform .14s ease; }
.polaroid:hover{ color:#4a3c2f; transform:translateY(-3px); }
.polaroid .photo{ aspect-ratio:1 / 1; border:1px solid rgba(111,79,51,.2); display:flex; align-items:center; justify-content:center; overflow:hidden; background:#f6dbe2; }
.polaroid .photo img{ width:100%; height:100%; object-fit:contain; }
.polaroid .caption{ display:block; text-align:center; font-family:"Fredoka"; font-weight:600; font-size:16px; line-height:1.2; margin-top:9px; }
.polaroid .caption small{ display:block; font-weight:500; font-size:11.5px; letter-spacing:.06em; color:#6e5946; }
.polaroid-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap:30px 24px; }

/* ---------- 15. Tables and paper tabs ---------- */
/* Wrap any wide table in .table-scroll: it scrolls inside its sheet, never the page. */
.table-scroll{ max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.board-table{ width:100%; border-collapse:collapse; font-size:14px; }
.board-table th{ text-align:left; font-family:"Fredoka"; font-weight:600; font-size:13px; color:var(--ink-soft); padding:8px 10px; border-bottom:2.5px solid var(--line); }
.board-table td{ padding:9px 10px; border-bottom:2px dashed var(--line); vertical-align:middle; }
.board-table tr:last-child td{ border-bottom:none; }
.board-table .num{ text-align:right; font-weight:800; font-variant-numeric:tabular-nums; }

.paper-tabs{ display:flex; gap:6px; flex-wrap:wrap; margin:0 0 -2px 14px; position:relative; z-index:1; }
.paper-tabs :is(a, button){ font-family:"Fredoka"; font-weight:500; font-size:14px; color:var(--ink); text-decoration:none; background:var(--parch-2);
  border:2.5px solid var(--line); border-bottom:none; border-radius:10px 10px 0 0; padding:8px 16px; min-height:44px; cursor:pointer; display:inline-flex; align-items:center; }
.paper-tabs :is(.on, [aria-current]){ background:var(--card); color:var(--rose-ink); }

/* ---------- 16. Focus and pressable feedback ---------- */
/* site.css's focus ring also sets border-radius:8px, which would square off a card's
   corners; keep the card's own shape and draw the ring outside it instead. */
:is(.bulletin, .price-tag, .polaroid, .guide-note, .fchip, .guide-btn, .paper-tabs a, .paper-tabs button):focus-visible{
  outline:3px solid var(--accent-dark); outline-offset:3px; box-shadow:none;
}
.bulletin:focus-visible{ border-radius:14px; }
.fchip:focus-visible, .guide-btn:focus-visible{ border-radius:999px; }
.price-tag:focus-visible{ border-radius:6px 14px 14px 6px; }
.polaroid:focus-visible{ border-radius:0; }
details.sheet.fold > summary:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:4px; border-radius:8px; }

/* ---------- 17. Phones (§5) ---------- */
@media (max-width:999px){
  .bulletin.pinned{ grid-column:auto; }
}
@media (max-width:640px){
  /* Tap targets on phones (§4.2 rule 5). */
  .fchip, .pf-search, .pf-select{ min-height:44px; }
  .button-sm{ display:inline-flex; align-items:center; justify-content:center; min-height:44px; }
  .detail-cols{ gap:30px; }
  /* Filters (§5): a chip group is ONE row that scrolls sideways, never four wrapped rows;
     folded extras open from their toggle. */
  .filter-more-toggle{ display:inline-flex; }
  .filter-more{ flex-basis:100%; justify-content:flex-start; }
  .filter-bar .chip-row:has(> .fchip){ flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none;
    width:100%; max-width:100%; min-width:0; padding:4px 3px; margin:-4px -3px; }
  .filter-bar .chip-row:has(> .fchip)::-webkit-scrollbar{ display:none; }
  .filter-bar .chip-row > :is(.fchip, .filter-label){ flex:0 0 auto; white-space:nowrap; }
  /* No tilt on phones for anything that carries text: cards are full-width or two-up there
     and a slant only makes reading harder (§4.2 rule 3). */
  :is(.bulletin, .notice):is(.tilt-0, .tilt-1, .tilt-2, .tilt-3),
  :is(.bulletin, .notice):is(.tilt-0, .tilt-1, .tilt-2, .tilt-3):hover{ transform:none; }
  /* Today's modals and the new popup both read as bottom sheets on phones. */
  .modal-backdrop, .modal-overlay{ align-items:flex-end; padding:0; }
  .modal-paper, .modal-box{ max-width:none; border-radius:18px 18px 0 0; border-bottom:none; max-height:85vh;
    padding:26px 16px 22px; }
}
@media (max-width:480px){
  .corkboard{ padding:24px 10px 18px; border-radius:16px; }
  .title-plaque .plaque-title{ font-size:24px; }
  .title-plaque{ margin-bottom:34px; padding:6px 18px 8px; }
  .server-clock{ left:8px; bottom:6px; padding:2px 8px; font-size:11px; }
  .server-clock-tz{ display:none; }
  .theme-toggle{ right:8px; bottom:6px; padding:4px 9px; }
  /* Only the current theme's knob on phones: a 44px round button that clears the plaque. */
  .banner .theme-toggle .moon-icon{ display:none; }
  :root[data-theme="dark"] .banner .theme-toggle .sun{ display:none; }
  :root[data-theme="dark"] .banner .theme-toggle .moon-icon{ display:flex; }
  .title-plaque .kicker{ font-size:9px; letter-spacing:.16em; }
  /* The welcome note shows the wallet; the nav keeps "☰ Menu", the bell and the name on one row. */
  .nav-wallet{ display:none; }
  /* Image card grids two across: the board's padding leaves ~290px at 390. */
  .puffling-grid, .item-grid, .trait-grid{ grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); }
  .sheet, .card, .panel-inner{ padding:22px 14px 16px; }
  .sheet h1, .card h1{ font-size:24px; }
  .card .card, .card-grid > .card{ padding:20px 12px 12px; }
  .notice{ padding:22px 14px 14px; }
  .card::before, .panel::before{ left:14px; }
  .card::after, .panel::after{ right:14px; }
  .tack.tl{ left:14px; } .tack.tr{ right:14px; }
  .board-head{ margin-bottom:18px; }
  .board-head .wood-plaque{ padding:8px 20px 10px; }
  .board-head .wood-plaque h1{ font-size:24px; }
  .wood-sign{ padding:10px 26px 12px; }
  .wood-sign :is(h1, h2){ font-size:22px; }
  .filter-bar{ padding:10px; }
  /* Image card grids two across; text card grids (.wide-cards) one across. */
  .bulletin-grid.calm, .calm .bulletin-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); gap:22px 12px; }
  .bulletin-grid.calm.wide-cards, .calm .bulletin-grid.wide-cards{ grid-template-columns:minmax(0,1fr); }
  .calm .bulletin h3, .bulletin-grid.calm .bulletin h3{ font-size:14.5px; }
  .bulletin-grid.calm.wide-cards .bulletin h3, .calm .bulletin-grid.wide-cards .bulletin h3{ font-size:17px; }
  .bulletin-grid.calm.wide-cards .bulletin .cover, .calm .bulletin-grid.wide-cards .bulletin .cover{ height:150px; }
  .calm .bulletin .cover{ height:110px; }
  .price-tag-grid, .polaroid-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); gap:18px 12px; }
  .price-tag .pt-img{ height:64px; }
  .polaroid .caption{ font-size:14px; }
  .guide-note{ padding:22px 16px 18px; gap:14px; }
  .guide-note .guide-icon{ width:60px; height:60px; font-size:30px; border-radius:18px; }
  .guide-note :is(h2, h3){ font-size:22px; }
  /* No tilt on sheets on phones, whatever class asked for it. */
  :is(.sheet, .card, .panel, details.sheet).tilt-0,
  :is(.sheet, .card, .panel, details.sheet).tilt-1,
  :is(.sheet, .card, .panel, details.sheet).tilt-2,
  :is(.sheet, .card, .panel, details.sheet).tilt-3{ transform:none; }
}

/* ---------- 18. Reduced motion: no hover lifts, no tilt animation ---------- */
@media (prefers-reduced-motion: reduce){
  .bulletin, .price-tag, .polaroid{ transition:none; }
  .bulletin:hover, .polaroid:hover{ transform:none; }
  /* A tilted card keeps its tilt on hover instead of lifting. */
  .tilt-0:hover{ transform:rotate(-1.2deg); }
  .tilt-1:hover{ transform:rotate(0.9deg); }
  .tilt-2:hover{ transform:rotate(-0.4deg); }
  .tilt-3:hover{ transform:rotate(1.5deg); }
  .calm :is(.bulletin, .notice):hover{ transform:none; }
}

/* ---------- 19. Tint and paper helpers ----------
   Last in the file so they beat each component's default mat (those use :where()).
   Text on a tint: --ink in light (≥5:1). The dark tints are mid-tone, where light ink
   fails, so text on them turns dark (--on-accent, ≥7.6:1). Never --ink-soft on a tint. */
.tint-rose{ background:var(--tint-rose); }
.tint-mint{ background:var(--tint-mint); }
.tint-lilac{ background:var(--tint-lilac); }
.tint-butter{ background:var(--tint-butter); }
.paper-warm{ background:var(--paper-warm); }
:root[data-theme="dark"] :is(.tint-rose, .tint-mint, .tint-lilac, .tint-butter){ color:var(--on-accent); }
