/* Pixelify Sans, self-hosted (SIL Open Font License, see /fonts/OFL.txt) */
@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/PixelifySans.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-002F, U+003A-10FFFF; /* no digits: the pixel 2/3/5 read like 8, so numbers use the plain font */ }
:root {
  --night: #181425; --night-2: #262b44; --night-3: #3a4466;
  --ink: #f4ead2; --ink-soft: #c0cbdc; --muted: #8b9bb4;
  --glow: #feae34; --glow-2: #f77622; --danger: #e43b44;
  --pix: 'Pixelify Sans', ui-rounded, system-ui, sans-serif;
  --radius: 12px;
  --tabs-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); line-height: 1.5;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(ellipse at 50% -10%, #2c2450 0%, var(--night) 55%) fixed, var(--night);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px);
}
h1, h2, .brand, .card-name, .btn, .pack { font-family: var(--pix); }
/* numbers stay in a plain font: the pixel face makes small 2/3/5 look like 8 */
.no, .count, .big-num, .stats dd, .pack-sub, [data-act=redeem] { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif !important; font-variant-numeric: tabular-nums; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; margin: .2em 0 .5em; outline: none; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .6em; }
a { color: var(--glow); }
code { font: .85em ui-monospace, Consolas, monospace; color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--glow); color: #000; padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 1080px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 1.3rem; font-weight: 700; }
.brand img { image-rendering: pixelated; border-radius: 6px; }
.proto-pill { font-size: .75rem; border: 1px solid var(--night-3); color: var(--ink-soft); padding: 3px 10px; border-radius: 99px; }
main { max-width: 1080px; margin: 0 auto; padding: 0 16px; outline: none; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.site-foot { max-width: 1080px; margin: 18px auto 0; padding: 0 16px 8px; text-align: center; font-size: .85rem; color: var(--muted); }
.site-foot a { color: var(--ink-soft); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.agree input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--glow); flex: none; }
/* tabs */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr);
  background: rgba(24, 20, 37, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--night-3);
  padding-bottom: env(safe-area-inset-bottom); }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabs-h); color: var(--muted); text-decoration: none; font-size: .72rem; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current] { color: var(--glow); }
.tabs a[aria-current] svg { fill: rgba(254, 174, 52, .2); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font: 700 .7rem/18px system-ui; text-align: center; }
@media (min-width: 820px) {
  /* floating pill that stays at the bottom, with breathing room above it */
  .tabs { inset: auto; position: sticky; bottom: 14px; max-width: 760px; margin: 32px auto 14px; border: 1px solid var(--night-3); border-radius: 99px;
    box-shadow: 0 8px 28px rgba(0,0,0,.45); }
  .tabs a { flex-direction: row; height: 46px; font-size: .85rem; gap: 6px; }
  .badge { top: 4px; left: auto; right: 10px; }
  body { padding-bottom: 32px; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px;
  border-radius: 10px; border: 2px solid var(--night-3); background: var(--night-2); color: var(--ink);
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.big { font-size: 1.15rem; min-height: 54px; padding: 10px 26px; }
.btn.glow { background: linear-gradient(180deg, var(--glow), var(--glow-2)); color: #2a1406; border-color: #ffd28a;
  box-shadow: 0 0 0 0 rgba(254, 174, 52, .5), 0 6px 22px rgba(247, 118, 34, .35); }
.btn.glow:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.on { background: #5a2238; border-color: #f6757a; }
.btn.danger { background: transparent; border-color: var(--danger); color: #ff8a90; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fine { color: var(--muted); font-size: .85rem; }
.notice { background: var(--night-2); border: 1px solid var(--night-3); border-left: 4px solid var(--glow); padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* pixel art */
.pix, .sprite img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; width: 100%; height: auto; user-select: none; }
.sprite { position: relative; overflow: hidden; aspect-ratio: 1; width: 100%; }
.sprite .strip { position: absolute; top: 0; left: 0; width: calc(var(--frames) * 100%); max-width: none; height: 100%;
  animation: play var(--dur) steps(var(--frames)) infinite; }
.sprite .still { display: none; }
@keyframes play { to { transform: translateX(-100%); } }
.reduce .sprite .strip { display: none; }
.reduce .sprite .still { display: block; }

/* habitats */
.hab-mossglen    { --h1: #265c42; --h2: #63c74d; --h3: #1b3a2c; }
.hab-tidepool    { --h1: #124e89; --h2: #2ce8f5; --h3: #0d2c4d; }
.hab-emberhearth { --h1: #a22633; --h2: #feae34; --h3: #4a1620; }
.hab-duskhollow  { --h1: #68386c; --h2: #f6757a; --h3: #2e1a3a; }
.hab-skyreach    { --h1: #5a6988; --h2: #c0cbdc; --h3: #2b3350; }
.hab-petalbright { --h1: #b55088; --h2: #fee761; --h3: #4a2040; }

/* card */
/* Rarity owns the frame; habitat owns the background tint. */
.card { --rb: #8b9bb4; --rb2: #5a6988; --band-ink: #181425;
  position: relative; display: flex; flex-direction: column; aspect-ratio: 5 / 7; width: 100%;
  padding: 8px; border-radius: var(--radius); text-decoration: none; color: var(--ink); overflow: hidden;
  background: linear-gradient(170deg, var(--h1), var(--h3)); border: 3px solid var(--rb);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.35); }
.card.rar-common   { --rb: #c0cbdc; --rb2: #8b9bb4; }
.card.rar-uncommon { --rb: #63c74d; --rb2: #3e8948; border-width: 4px; }
.card.rar-rare     { --rb: #2ce8f5; --rb2: #0099db; border-width: 4px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), 0 0 14px rgba(44, 232, 245, .35); }
.card.rar-epic     { --rb: #d77bd0; --rb2: #8a3c8e; --band-ink: #fff; border-width: 4px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), 0 0 0 1px #f6a5f0, 0 0 20px rgba(181, 80, 136, .6); }
.card.rar-legendary { --rb: #feae34; --rb2: #f77622; border-width: 5px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), 0 0 0 1px #fee761, 0 0 26px rgba(254, 174, 52, .7); }
.card.rar-legendary .art-window { background: radial-gradient(circle at 50% 42%, rgba(254,231,97,.45), rgba(247,118,34,.12) 70%), var(--h3); }
.card.rar-mythic   { --rb2: #b55088; border: 4px solid transparent;
  background: linear-gradient(170deg, #2c2450, #181425) padding-box,
              linear-gradient(135deg, #63c74d, #2ce8f5, #b55088, #feae34, #63c74d) border-box;
  box-shadow: 0 0 26px rgba(44, 232, 245, .5), 0 0 40px rgba(181, 80, 136, .35); }
.rar-band { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 6px -8px -8px; padding: 4px 8px;
  background: linear-gradient(90deg, var(--rb), var(--rb2)); color: var(--band-ink); font: 700 .78rem var(--pix); letter-spacing: .03em; text-transform: uppercase; }
.rar-band .pips { letter-spacing: .12em; font-size: 1.05em; }
.card.rar-mythic .rar-band { background: linear-gradient(90deg, #63c74d, #2ce8f5, #b55088, #feae34); }
/* foil sheen on legendary, mythic and every shiny */
.card.rar-legendary::after, .card.rar-mythic::after, .card.shiny::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.38) 47%, rgba(255,255,255,.05) 55%, transparent 65%);
  background-size: 300% 100%; mix-blend-mode: overlay; animation: sheen 4s ease-in-out infinite; }
.card.rar-mythic::after, .card.shiny::after { background: linear-gradient(115deg, transparent 25%, rgba(44,232,245,.35) 38%, rgba(254,174,52,.3) 48%, rgba(181,80,136,.35) 58%, transparent 72%);
  background-size: 300% 100%; mix-blend-mode: color-dodge; opacity: .55; }
@keyframes sheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }
a.card:hover { transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; gap: 4px; min-height: 18px; }
.no { font: 700 .8rem var(--pix); opacity: .9; }
.art-window { flex: 1; margin: 6px 0; border-radius: 8px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.28), rgba(255,255,255,.06) 70%), var(--h3);
  border: 2px solid rgba(0,0,0,.35); }
.art-window > :not(.shiny-tag):not(.sparkles) { width: 92%; }
.card-name { font-size: 1.05rem; font-weight: 700; line-height: 1.1; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.card-hab { font-size: .72rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rar { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 99px; background: rgba(0,0,0,.4); font-weight: 600; white-space: nowrap; }
.rar .mark { font-size: .85em; }
.rar-common .mark { color: #c0cbdc; } .rar-uncommon .mark { color: #63c74d; }
.rar-rare .mark { color: #2ce8f5; } .rar-epic .mark { color: #f6a5f0; } .rar-legendary .mark { color: #fee761; text-shadow: 0 0 6px #f77622; }
.rar-mythic .mark { color: #2ce8f5; text-shadow: 0 0 6px #b55088; }
.card.rar-mythic .art-window { background: radial-gradient(circle at 50% 40%, rgba(44,232,245,.35), rgba(181,80,136,.15) 70%), #1b2140; }
.count { position: absolute; right: 8px; top: 30px; z-index: 3; font: 700 .8rem var(--pix); background: var(--glow); color: #2a1406; padding: 0 6px; border-radius: 6px; }
.flag { position: absolute; z-index: 3; left: 50%; top: -10px; transform: translateX(-50%); font: 700 .75rem var(--pix); padding: 2px 10px; border-radius: 99px; }
.flag.new { background: #63c74d; color: #0d2a12; } .flag.dup { background: var(--night-3); color: var(--ink); }
.card.missing { background: var(--night-2); border: 2px dashed var(--night-3); box-shadow: none; color: var(--muted); }
.card.missing .art-window { background: rgba(0,0,0,.25); }
.silhouette { filter: brightness(0) invert(.25); opacity: .55; }

/* discover */
.hero { text-align: center; padding: 8px 0 12px; }
.lede { margin: 0 auto 18px; color: var(--ink-soft); font-size: 1.05rem; }
.showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 auto 22px; }
.show-item { background: linear-gradient(170deg, var(--h1), var(--h3)); border: 2px solid var(--h2); border-radius: 14px; padding: 6px 6px 8px; font: 600 .85rem var(--pix); }
@media (min-width: 700px) { .showcase { grid-template-columns: repeat(6, 1fr); } }
.steps { padding-left: 1.3em; display: grid; gap: 8px; }
.hab-list { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (min-width: 760px) { .hab-list { grid-template-columns: repeat(3, 1fr); } } /* six habitats: two rows of three */
.hab-list li { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: linear-gradient(170deg, var(--h1), var(--h3)); border: 2px solid var(--h2); }
.hab-list img { width: 64px; flex: none; }
.hab-list b { display: block; font-family: var(--pix); font-size: 1.05rem; }
.hab-list span { font-size: .85rem; color: var(--ink-soft); }

/* collection */
.progress-wrap p { margin: 0 0 6px; }
.progress { height: 14px; border-radius: 7px; background: var(--night-2); border: 1px solid var(--night-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--glow-2), var(--glow)); }
p.done { color: var(--glow); font-family: var(--pix); margin-top: 6px !important; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 16px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 99px; border: 1px solid var(--night-3); color: var(--ink-soft); text-decoration: none; font-size: .9rem; }
.chip[aria-current] { background: var(--glow); color: #2a1406; border-color: var(--glow); font-weight: 600; }
.select select { min-height: 40px; background: var(--night-2); color: var(--ink); border: 1px solid var(--night-3); border-radius: 8px; padding: 0 10px; font-size: .95rem; }
.album { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
@media (min-width: 600px) { .album { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
@media (max-width: 599px) {
  .album .card { padding: 5px; border-width: 2px; }
  .album .card-name { font-size: .8rem; }
  .album .card-hab { font-size: .62rem; }
  .album .rar-band { margin: 4px -5px -5px; padding: 2px 5px; font-size: .62rem; justify-content: center; }
  .album .rar-band .pips { font-size: .95rem; line-height: 1; }
  .album .rar-band .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .album .card-top .card-hab { display: none; }
  .album .art-window { margin: 4px 0; }
  .album .count { right: 5px; top: 24px; font-size: .7rem; }
  .album .fav-dot { left: 8px; top: 24px; }
}
.album li { position: relative; }
.album.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.album .none { grid-column: 1 / -1; color: var(--muted); }
.fav-dot { position: absolute; z-index: 3; left: 12px; top: 30px; color: #f6757a; font-size: .9rem; text-shadow: 0 1px 2px #000; }
.card.missing .rar-band { background: rgba(0,0,0,.3); color: var(--muted); }
.empty { text-align: center; padding: 18px; background: var(--night-2); border-radius: 12px; margin-bottom: 16px; }

/* detail */
.back { display: inline-block; margin-bottom: 10px; color: var(--ink-soft); text-decoration: none; }
.detail { display: grid; gap: 20px; }
.detail-card { max-width: 320px; width: 100%; margin: 0 auto; }
.detail-card .card-name { font-size: 1.5rem; }
.lore { font-size: 1.05rem; color: var(--ink-soft); font-style: italic; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 18px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.copies { list-style: none; padding: 0; display: grid; gap: 6px; }
.copies li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; background: var(--night-2); padding: 8px 10px; border-radius: 8px; font-size: .85rem; }
.copies span { color: var(--muted); } .copies code { line-height: 1.4; }
@media (min-width: 760px) { .detail { grid-template-columns: 340px 1fr; align-items: start; } .detail-card { position: sticky; top: 70px; } }

/* packs */
.pack-row { display: grid; gap: 20px; align-items: center; justify-items: center; text-align: center; }
@media (min-width: 700px) { .pack-row { grid-template-columns: 240px 1fr; justify-items: start; text-align: left; } }
.pack { position: relative; width: 200px; aspect-ratio: 5 / 7.4; border-radius: 10px 10px 14px 14px; padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: linear-gradient(160deg, #3a4466 0%, #262b44 45%, #68386c 100%); border: 3px solid #c0cbdc;
  box-shadow: inset 0 10px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.45); color: var(--ink); }
.pack::before { content: ''; position: absolute; inset: 6px 6px auto; height: 10px; background: repeating-linear-gradient(90deg, #c0cbdc 0 6px, transparent 6px 12px); opacity: .5; }
.pack img { width: 78%; filter: drop-shadow(0 0 14px rgba(44,232,245,.5)); }
.pack-set { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 10px; }
.pack-title { font-size: 1.6rem; font-weight: 700; color: var(--glow); text-shadow: 0 2px 0 #3e2731; }
.pack-sub { font-size: .85rem; color: var(--ink-soft); }
.big-num { font-size: 1.3rem; margin: 0 0 12px; } .big-num b { font-size: 2rem; color: var(--glow); }
.pack-row .btn { margin: 0 0 10px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 520px; font-size: .9rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--night-3); text-align: left; }
thead th { color: var(--muted); font-weight: 600; }

/* opening */
.opening { text-align: center; padding-top: 8px; }
.stage { min-height: 380px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; }
.pack-btn { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: grid; justify-items: center; gap: 14px; }
.pack-btn .pack { width: 230px; animation: float 3s ease-in-out infinite; }
.tap { font: 600 1.1rem var(--pix); color: var(--glow); }
@keyframes float { 50% { transform: translateY(-8px) rotate(-1deg); } }
.pack-btn.tearing .pack { animation: shake .7s ease-in; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: rotate(-4deg) scale(1.03); } 40% { transform: rotate(4deg) scale(1.06); }
  60% { transform: rotate(-3deg) scale(1.1); filter: brightness(1.4); } 100% { transform: scale(1.3); opacity: 0; filter: brightness(3); } }
.reveal-row { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 14px 10px; width: 100%; max-width: 920px;
  grid-template-columns: repeat(2, minmax(0, 168px)); justify-content: center; }
@media (min-width: 560px) { .reveal-row { grid-template-columns: repeat(3, minmax(0, 168px)); } }
@media (min-width: 900px) { .reveal-row { grid-template-columns: repeat(5, minmax(0, 168px)); } }
.flip { position: relative; width: 100%; aspect-ratio: 5 / 7; border: 0; padding: 0; background: none; cursor: pointer; color: inherit; }
/* 2D flip: back squeezes to nothing, then the front grows in. No 3D needed. */
.flip .face { position: absolute; inset: 0; display: block; transition: transform .2s ease-in; }
.flip .back { border-radius: var(--radius); border: 3px solid #c0cbdc; display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, #262b44 0 10px, #2e3454 10px 20px); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.flip:not(.flipped):hover .back { transform: translateY(-4px); }
.back-mark { font-size: 2.4rem; color: var(--glow); text-shadow: 0 0 12px var(--glow-2); }
.flip .front { transform: scaleX(0); }
.flip.flipped .back { transform: scaleX(0); }
.flip.flipped .front { transform: none; transition: transform .28s cubic-bezier(.3,.7,.3,1.3) .2s; }
.flip.instant .face { transition: none; }
/* build-up: a rare or mythic card glows through its back before you flip it */
.flip.rar-epic .back { border-color: #d77bd0; box-shadow: 0 0 16px rgba(181,80,136,.6); animation: pulse-epic 1.8s ease-in-out infinite; }
.flip.rar-legendary .back { border-color: #feae34; border-width: 4px; box-shadow: 0 0 22px rgba(254,174,52,.7); animation: pulse-gold 1.3s ease-in-out infinite; }
.flip.rar-mythic .back { border-color: #2ce8f5; animation: pulse-myth 1.4s ease-in-out infinite; }
.flip.rar-epic .back-mark { color: #f6a5f0; } .flip.rar-legendary .back-mark { color: #fee761; font-size: 3rem; } .flip.rar-mythic .back-mark { color: #2ce8f5; text-shadow: 0 0 14px #b55088; }
@keyframes pulse-gold { 50% { box-shadow: 0 0 36px rgba(254,174,52,1); } }
@keyframes pulse-epic { 50% { box-shadow: 0 0 26px rgba(215,123,208,.85); } }
@keyframes pulse-myth { 0%,100% { box-shadow: 0 0 22px rgba(44,232,245,.7); } 50% { box-shadow: 0 0 34px rgba(181,80,136,.9); } }
.flip.charge .back { animation: charge .7s ease-in forwards; }
@keyframes charge { 0% { transform: none; } 25% { transform: rotate(-3deg) scale(1.03); } 50% { transform: rotate(3deg) scale(1.06); } 75% { transform: rotate(-2deg) scale(1.09); filter: brightness(1.5); } 100% { transform: scale(1.12); filter: brightness(2.2); } }
.flip:disabled { cursor: default; }
.flip.flipped.rar-epic::after, .flip.flipped.rar-legendary::after, .flip.flipped.rar-mythic::after { content: ''; position: absolute; inset: -14px; z-index: -1; border-radius: 24px; pointer-events: none;
  background: radial-gradient(circle, rgba(254,231,97,.55), transparent 70%); animation: burst 1.2s ease-out forwards; }
.flip.flipped.rar-mythic::after { background: conic-gradient(from 0deg, #63c74d, #2ce8f5, #b55088, #feae34, #63c74d); filter: blur(14px); opacity: .7; animation: burst 1.6s ease-out forwards, spin 4s linear infinite; }
@keyframes burst { from { transform: scale(.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: .5; } }
@keyframes spin { to { rotate: 360deg; } }
.reveal-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.summary { margin-top: 20px; font-size: 1.1rem; } .summary .row { justify-content: center; }

/* profile */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.stats div { background: var(--night-2); border-radius: 10px; padding: 12px; }
.stats dt { color: var(--muted); font-size: .85rem; } .stats dd { margin: 0; font: 700 1.6rem var(--pix); color: var(--glow); }
.radio { border: 1px solid var(--night-3); border-radius: 10px; padding: 10px 14px; display: grid; gap: 6px; }
.radio label { display: flex; gap: 8px; align-items: center; min-height: 36px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--night); padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: .25s; pointer-events: none; z-index: 30; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog.confirm { background: var(--night-2); color: var(--ink); border: 1px solid var(--night-3); border-radius: 14px; max-width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }

.reduce *, .reduce *::before, .reduce *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
.reduce .flip.flipped::after, .reduce .card::after { display: none; }

/* binder */
.binder { position: relative; margin: 6px auto 0; padding: 14px 14px 14px 30px; border-radius: 14px; outline-offset: 4px;
  background: linear-gradient(135deg, #3e2731, #2a1a24 60%, #3e2731); box-shadow: inset 0 0 0 2px rgba(0,0,0,.4), 0 14px 34px rgba(0,0,0,.5);
  touch-action: pan-y; user-select: none; }
.binder::before { /* stitched cover edge */
  content: ''; position: absolute; inset: 6px; border: 2px dashed rgba(234, 212, 170, .22); border-radius: 10px; pointer-events: none; }
.binder-pages { position: relative; display: grid; gap: 0; perspective: 1400px; }
.binder-pages.span-2 { grid-template-columns: 1fr 1fr; }
.page { position: relative; padding: 12px 12px 26px; background: linear-gradient(180deg, #262b44, #20243a); border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 0 #151225; min-height: 100%; }
.page.blank { background: repeating-linear-gradient(45deg, #20243a 0 12px, #23283f 12px 24px); }
/* rings: down the left edge on one page, down the spine on a spread */
.binder::after { content: ''; position: absolute; top: 12%; bottom: 12%; left: 9px; width: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #c0cbdc 0 4px, #5a6988 5px 6px, transparent 7px) 0 0 / 14px 25% repeat-y;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.5)); }
.binder.spread { padding-left: 14px; }
.binder.spread::after { left: calc(50% - 7px); }
.span-2 .page:first-child { border-radius: 6px 2px 2px 6px; box-shadow: inset -18px 0 22px -16px rgba(0,0,0,.6), 0 2px 0 #151225; }
.span-2 .page:nth-child(2) { border-radius: 2px 6px 6px 2px; box-shadow: inset 18px 0 22px -16px rgba(0,0,0,.6), 0 2px 0 #151225; }
.sleeves { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
.sleeve { position: relative; padding: 4px; border-radius: 10px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.sleeve::after { /* plastic sleeve gloss */
  content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; z-index: 4;
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.06)); }
.empty-sleeve { aspect-ratio: 5 / 7; box-sizing: content-box; }
.sleeve .fav-dot { left: 14px; top: 34px; }
.page-no { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font: .75rem system-ui; color: var(--muted); }
.binder-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 4px; }
.binder-nav .turn { font-size: 1.6rem; width: 52px; padding: 0; }
.binder-nav .turn:disabled { opacity: .35; cursor: default; }
.page-label { min-width: 130px; text-align: center; color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 599px) { .binder { padding: 10px 8px 10px 26px; } .page { padding: 8px 8px 22px; } .sleeves { gap: 5px !important; } .sleeve { padding: 3px; } }

/* page-turn sheets: a page folding toward the spine, then the next opening out of it */
.turn-sheet { position: absolute; top: 0; bottom: 0; z-index: 5; pointer-events: none; }
.turn-sheet .page { height: 100%; }
.turn-sheet.slot-full { left: 0; right: 0; }
.turn-sheet.slot-left { left: 0; width: 50%; }
.turn-sheet.slot-right { left: 50%; width: 50%; }
.turn-sheet::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: 6px; }
.fold-left   { transform-origin: left center;  animation: fold .34s ease-in forwards; }
.fold-right  { transform-origin: right center; animation: fold .34s ease-in forwards; }
.unfold-left  { transform-origin: left center;  transform: scaleX(0); animation: unfold .34s ease-out forwards; }
.unfold-right { transform-origin: right center; transform: scaleX(0); animation: unfold .34s ease-out forwards; }
.fold-left::after, .fold-right::after { background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.1)); animation: shade-in .34s ease-in forwards; }
.unfold-left::after, .unfold-right::after { background: linear-gradient(90deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); animation: shade-out .34s ease-out forwards; }
@keyframes fold   { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes unfold { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shade-in  { to { opacity: 1; } }
@keyframes shade-out { from { opacity: 1; } to { opacity: 0; } }

.flip.flipped.rar-epic::after { background: radial-gradient(circle, rgba(215,123,208,.6), transparent 70%); }

/* shinies: alternate colours, sparkles, holo sheen */
.shiny-tag { position: absolute; left: 6px; top: 6px; z-index: 3; width: auto !important; font: 700 .68rem var(--pix); padding: 1px 6px; border-radius: 99px;
  background: linear-gradient(90deg, #fee761, #f6a5f0, #2ce8f5); color: #181425; }
.art-window { position: relative; }
.sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 2; width: auto !important; }
.sparkles i { position: absolute; font-style: normal; color: #fff; text-shadow: 0 0 6px #fee761, 0 0 10px #2ce8f5; animation: twinkle 1.8s ease-in-out infinite; }
.sparkles i:nth-child(1) { left: 12%; top: 16%; font-size: 1.1rem; }
.sparkles i:nth-child(2) { right: 12%; top: 30%; font-size: .8rem; animation-delay: .5s; }
.sparkles i:nth-child(3) { left: 22%; bottom: 14%; font-size: .9rem; animation-delay: 1s; }
.sparkles i:nth-child(4) { right: 20%; bottom: 22%; font-size: 1.2rem; animation-delay: 1.4s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
.has-shiny { position: absolute; z-index: 3; right: 10px; bottom: 34px; color: #fee761; text-shadow: 0 0 6px #f6a5f0; font-size: .9rem; }
.album .has-shiny { right: 6px; bottom: 22px; font-size: .75rem; }
.flag.shiny { background: linear-gradient(90deg, #fee761, #f6a5f0, #2ce8f5); color: #181425; white-space: nowrap; }
.shiny-word { background: linear-gradient(90deg, #fee761, #f6a5f0, #2ce8f5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flip.flipped.is-shiny .front::before { content: '✦  ✧  ✦'; position: absolute; left: 0; right: 0; top: -26px; z-index: 6; text-align: center; color: #fff;
  font-size: 1.3rem; letter-spacing: .3em; text-shadow: 0 0 8px #fee761, 0 0 14px #2ce8f5; pointer-events: none; animation: shiny-pop 1.4s ease-out forwards; }
@keyframes shiny-pop { 0% { opacity: 0; transform: translateY(14px) scale(.5); } 30% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-16px) scale(1); } }
.variant-toggle { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.shiny-row th, .shiny-row td { color: var(--ink); }
.shiny-row .mark { color: #fee761; }
.reduce .sparkles, .reduce .flip.flipped.is-shiny .front::before { display: none; }

/* the Lantern Keepers on Discover */
.keepers { text-align: center; }
.keepers > p { margin: 0 auto 14px; color: var(--ink-soft); }
.keeper-list { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 170px)); justify-content: center; }
@media (min-width: 760px) { .keeper-list { grid-template-columns: repeat(4, minmax(0, 190px)); } }

/* ---------- server mode: accounts, buying, swaps ---------- */
.auth { max-width: 460px; margin: 0 auto; }
.auth .chips { margin-bottom: 16px; }
.auth-form, .find { display: grid; gap: 14px; }
.auth-form label, .find label { display: grid; gap: 6px; font-weight: 600; }
.auth-form input, .find input, .buy select { min-height: 46px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--night-3);
  background: var(--night-2); color: var(--ink); font-size: 1rem; width: 100%; }
.auth-form input:focus-visible, .find input:focus-visible { border-color: var(--glow); outline: none; }
.form-error { color: #ff8a90; font-weight: 600; margin: 0; }
.recovery-code { font: 700 clamp(1.1rem, 5vw, 1.6rem) ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center;
  padding: 16px; border-radius: 12px; background: var(--night-2); border: 2px dashed var(--glow); color: var(--glow); word-break: break-all; }
.switch { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 12px 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--glow); }
.auth .btn.big { width: 100%; }
.test-pill { font: 600 .7rem system-ui; vertical-align: middle; padding: 2px 8px; border-radius: 99px; background: #3e8948; color: #fff; }
.buy { margin-top: 26px; padding: 16px; border-radius: 14px; background: var(--night-2); border: 1px solid var(--night-3); }
.buy h2 { margin-top: 0; }
.buy-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.buy-row label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.buy select { width: auto; min-width: 80px; }
.buy .total b { font-size: 1.3rem; color: var(--glow); font-family: system-ui; }
.notice.ok { border-left-color: #63c74d; }
.find { grid-template-columns: 1fr auto; align-items: end; margin: 14px 0 6px; }
.swaps { list-style: none; padding: 0; display: grid; gap: 12px; }
.swap-row { background: var(--night-2); border: 1px solid var(--night-3); border-radius: 12px; padding: 12px; }
.swap-row:not(.open) { opacity: .7; }
.swap-row p { margin: 0 0 8px; }
.swap-cards { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.swap-cards figure { margin: 0; text-align: center; font-size: .8rem; color: var(--ink-soft); }
.swap-arrow { font-size: 1.8rem; color: var(--glow); }
.swap-row .state { color: var(--muted); font-weight: 600; }
.mini { width: 110px; }
.mini .card { padding: 5px; border-width: 2px; }
.mini .card-name { font-size: .8rem; } .mini .card-hab { display: none; }
.mini .rar-band { margin: 4px -5px -5px; padding: 2px 5px; font-size: .6rem; justify-content: center; }
.mini .rar-band .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pick-grid { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.pick { background: none; border: 3px solid transparent; border-radius: 14px; padding: 2px; cursor: pointer; color: inherit; }
.pick:hover { border-color: var(--night-3); }
.pick[aria-pressed="true"] { border-color: var(--glow); box-shadow: 0 0 16px rgba(254,174,52,.5); }
.pick .mini { width: 100%; }
.step2 { margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); box-shadow: none; }

/* ---------- play ---------- */
.light-icon { color: var(--glow); text-shadow: 0 0 8px var(--glow-2); }
.light-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 0 0 16px;
  border-radius: 12px; background: var(--night-2); border: 1px solid var(--night-3); }
.light-bar p { margin: 0; } .light-bar b { font: 700 1.3rem system-ui; color: var(--glow); }
.play-grid { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.play-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(160deg, var(--night-3), var(--night-2)); border: 2px solid var(--night-3); }
.play-card:hover { border-color: var(--glow); }
.play-art { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.3); }
.play-art img { width: 100%; height: 100%; object-fit: cover; }
.puzzle-card .play-art img { width: 80%; height: auto; object-fit: contain; }
.play-text b { display: block; font: 700 1.2rem var(--pix); } .play-text span { color: var(--ink-soft); font-size: .9rem; }
.diorama-grid { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .diorama-grid { grid-template-columns: repeat(2, 1fr); } }
.diorama-thumb { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 2px solid var(--h2, var(--night-3)); }
.diorama-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.diorama-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font: 700 .9rem var(--pix); color: var(--ink); background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.play-invite { text-align: center; } .row.center { justify-content: center; }

/* puzzle */
.puzzle { display: grid; gap: 18px; align-items: start; }
@media (min-width: 760px) { .puzzle { grid-template-columns: 340px 1fr; } }
.puzzle-art { position: relative; aspect-ratio: 1; max-width: 340px; width: 100%; margin: 0 auto; border-radius: 18px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.22), rgba(255,255,255,.04) 70%), var(--night-2); border: 3px solid var(--night-3); overflow: hidden; }
.puzzle-art > * { width: 86%; grid-area: 1 / 1; }
.puzzle-art .silhouette { filter: brightness(0) invert(.88); opacity: 1; }
.puzzle-art .colour { visibility: hidden; }
.puzzle-art.half .colour { visibility: visible; clip-path: inset(0 0 50% 0); }
.puzzle-art.half .silhouette { clip-path: inset(50% 0 0 0); }
.guess label { font-weight: 600; display: block; margin-bottom: 6px; }
.guess-row { display: flex; gap: 8px; }
.guess-row input { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--night-3); background: var(--night-2); color: var(--ink); font-size: 1.05rem; }
.guesses, .clues { list-style: none; padding: 0; display: grid; gap: 6px; margin: 14px 0 0; }
.guesses li { padding: 6px 10px; border-radius: 8px; background: rgba(228,59,68,.15); border-left: 3px solid #e43b44; }
.clues li { padding: 8px 10px; border-radius: 8px; background: rgba(254,174,52,.12); border-left: 3px solid var(--glow); }
.puzzle-end h2 { margin-top: 0; } .puzzle-end.won h2 { color: var(--glow); }
.reward { font-weight: 700; font-size: 1.1rem; }

/* walks */
.walks { list-style: none; padding: 0; display: grid; gap: 10px; }
.walk { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; overflow: hidden;
  background: var(--night-2); border: 1px solid var(--night-3); }
.walk-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.walk > *:not(.walk-scene) { position: relative; }
.walk.back { border-color: var(--glow); }
.walk-team { display: flex; gap: 2px; } .mini-sprite { width: 44px; display: block; }
.walk-info b { display: block; font-family: var(--pix); } .walk-info span { font-size: .85rem; color: var(--ink-soft); }
.progress.small { height: 8px; margin-top: 6px; }
@media (max-width: 520px) { .walk { grid-template-columns: 1fr; } }
.claim-result { padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #3e2731, var(--night-2)); border: 2px solid var(--glow); margin: 12px 0; }
.claim-result h2 { margin-top: 0; }
.walk-form { display: grid; gap: 16px; }
.chips-field { border: 0; padding: 0; margin: 0; min-width: 0; } .chips-field legend { font-weight: 700; margin-bottom: 8px; }
.hab-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.hab-opt { position: relative; border-radius: 12px; overflow: hidden; border: 3px solid transparent; cursor: pointer; }
.hab-opt input, .chip-radio input { position: absolute; opacity: 0; }
.hab-opt img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.hab-opt span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 8px; font: 700 .85rem var(--pix); background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.hab-opt:has(input:checked) { border-color: var(--glow); box-shadow: 0 0 14px rgba(254,174,52,.5); }
.hab-opt:has(input:focus-visible), .chip-radio:has(input:focus-visible) { outline: 3px solid var(--glow); outline-offset: 2px; }
.chip-radio { position: relative; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--night-3); cursor: pointer; }
.chip-radio:has(input:checked) span { background: var(--glow); color: #2a1406; border-color: var(--glow); font-weight: 600; }
.bonus { color: var(--glow); font-weight: 600; min-height: 1.4em; margin: 0; }
.lore-pages { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lore-pages li { padding: 10px 12px; border-radius: 10px; background: var(--night-2); border: 1px solid var(--night-3); }
.lore-pages li.found { border-left: 4px solid var(--h2); }
.lore-pages li.missing { color: var(--muted); border-style: dashed; }
.lore-pages summary { cursor: pointer; font-weight: 600; } .lore-pages p { margin: 8px 0 0; color: var(--ink-soft); }

/* dioramas */
.diorama { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 3px solid var(--h2, var(--night-3)); background: var(--night-2); margin-bottom: 12px; }
.diorama-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.diorama-stage { position: absolute; inset: 0; }
.critter { position: absolute; width: 13%; min-width: 48px; transform: translate(-50%, -100%); background: none; border: 0; padding: 0; cursor: pointer; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.critter .sprite, .critter > .pix { width: 100%; }
.critter.flip .sprite, .critter.flip > .pix { transform: scaleX(-1); }
.bubble { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 8px;
  background: var(--ink); color: var(--night); font: 700 .8rem var(--pix); }
.diorama-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(24,20,37,.85); text-align: center; }
@media (max-width: 819px) { .tabs a { font-size: .66rem; } .tabs svg { width: 20px; height: 20px; } }

/* every picker card is exactly its grid cell: same width, same card shape, long names shortened */
.pick { width: 100%; display: block; }
.pick .mini, .mini { min-width: 0; }
.mini .card { aspect-ratio: 5 / 7; height: auto; overflow: hidden; }
.mini .art-window { min-height: 0; flex: 1 1 0; }
.mini .art-window > :not(.shiny-tag):not(.sparkles) { width: 92%; height: 92%; object-fit: contain; }
.mini .card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album .card, .album .art-window { min-height: 0; }
.album .art-window { flex: 1 1 0; }
.album .art-window > :not(.shiny-tag):not(.sparkles) { width: 92%; height: 92%; object-fit: contain; }
.album .card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Swap Board + friends ---------- */
.trade-tabs { margin-bottom: 8px; }
.chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 .72rem system-ui; }
.listings { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.listing { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; padding: 10px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--night-3); }
.listing.done { border-color: #63c74d; } .listing.stale, .listing.cancelled { opacity: .6; }
.listing .mini { width: 96px; }
.listing-info p { margin: 0 0 6px; }
.wants { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.want { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 8px; background: rgba(255,255,255,.06); }
.new-badge { display: inline-block; font: 700 .7rem system-ui; padding: 1px 7px; border-radius: 99px; background: #63c74d; color: #0d2a12; }
.new-badge.pin { position: absolute; top: -6px; right: -4px; z-index: 5; }
.pick { position: relative; }
.list-panel { margin: 14px 0; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, var(--night-3), var(--night-2)); border: 2px solid var(--glow); }
.list-panel h2 { margin-top: 0; }
.friend-code { text-align: center; padding: 14px; border-radius: 14px; background: var(--night-2); border: 2px dashed var(--glow); }
.friend-code p { margin: 0 0 6px; }
.friend-code .code { font: 700 clamp(1.5rem, 7vw, 2.2rem) ui-monospace, Consolas, monospace; letter-spacing: .08em; color: var(--glow); }
.friend-code .row { justify-content: center; }
.friends { list-style: none; padding: 0; display: grid; gap: 8px; }
.friends li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--night-2); }
.friends .row { margin: 0; }
@media (max-width: 420px) { .listing { grid-template-columns: 76px 1fr; } .listing .mini { width: 76px; } .listings { grid-template-columns: 1fr; } }

/* ---------- Lantern Buddy (Bongo-style) ---------- */
/* one art pixel = --u css pixels; the stage is the 64x64 art grid plus a drum below */
.buddy { --u: 1.5px; position: fixed; right: 14px; bottom: 18px; z-index: 15; width: calc(var(--u) * 64); height: calc(var(--u) * 82); pointer-events: none; }
.buddy[hidden] { display: none; }
.buddy-hit { position: absolute; inset: 0; z-index: 6; background: none; border: 0; padding: 0; cursor: pointer; pointer-events: auto; border-radius: 12px; }
.buddy-hit:focus-visible { outline: 3px solid var(--glow); }
.buddy-stage { position: absolute; inset: 0; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); }
.buddy-stage img { position: absolute; image-rendering: pixelated; }
.buddy-body { left: 0; top: 0; width: calc(var(--u) * 64); height: calc(var(--u) * 64); }
.buddy-hat { width: calc(var(--u) * var(--w, 30)); height: calc(var(--u) * var(--h, 30)); left: calc(var(--u) * (var(--hx) - var(--w, 30) / 2)); top: calc(var(--u) * (var(--hy) + 6 - var(--h, 30))); z-index: 2; }
.buddy-drum { left: calc(var(--u) * 14); bottom: calc(var(--u) * 4); width: calc(var(--u) * 36); height: calc(var(--u) * 36); z-index: 3; transform-origin: 50% 100%; }
.buddy-paw { width: calc(var(--u) * 14); height: calc(var(--u) * 10); top: calc(var(--u) * 38); z-index: 4; transition: transform .12s ease-out; }
.buddy-paw.left { left: calc(var(--u) * 14); } .buddy-paw.right { left: calc(var(--u) * 36); transform: scaleX(-1); }
.buddy-paw.left.down { animation: paw-l .16s ease-out; } .buddy-paw.right.down { animation: paw-r .16s ease-out; }
@keyframes paw-l { 40% { transform: translateY(calc(var(--u) * 6)) rotate(-8deg); } }
@keyframes paw-r { 40% { transform: scaleX(-1) translateY(calc(var(--u) * 6)) rotate(-8deg); } }
.buddy-drum.thump { animation: thump .16s ease-out; }
@keyframes thump { 40% { transform: scale(1.04, .94); } }
.buddy-count { position: absolute; left: 0; right: 0; bottom: calc(var(--u) * -2); z-index: 5; text-align: center; font: 700 11px system-ui; color: var(--ink);
  text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.buddy-spark { position: absolute; top: 18%; z-index: 7; font: 700 13px system-ui; color: #fee761; text-shadow: 0 0 6px #f77622; white-space: nowrap; animation: spark .75s ease-out forwards; pointer-events: none; }
@keyframes spark { from { opacity: 1; transform: translate(-50%, 0) scale(.7); } to { opacity: 0; transform: translate(-50%, -26px) scale(1.15); } }
.reduce .buddy-spark { display: none; }
.reduce .buddy-paw, .reduce .buddy-drum { animation: none !important; }
@media (max-width: 819px) {
  .buddy { --u: 1px; right: 6px; bottom: calc(var(--tabs-h) - 6px + env(safe-area-inset-bottom)); z-index: 21; }
  .buddy-count { font-size: 10px; }
}
.hat-grid { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); grid-auto-rows: 1fr; }
.hat-grid li { display: flex; } .hat-grid .hat-pick { width: 100%; height: 100%; }
.hat-pick { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--night-2); min-height: 110px; align-content: center; text-align: center; }
.hat-pick img { width: 64px; height: 64px; image-rendering: pixelated; }
.hat-pick span { font: 600 .85rem system-ui; color: var(--ink-soft); } .hat-pick .lock { color: var(--muted); }
.hat-pick:disabled { opacity: .55; cursor: not-allowed; } .hat-none { font: 700 1rem var(--pix); color: var(--ink-soft); }

/* single-column layouts on phones: size to the screen, not to their contents */
.puzzle, .detail, .pack-row, .walk-form, .auth-form { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .puzzle { grid-template-columns: 340px minmax(0, 1fr); } .detail { grid-template-columns: 340px minmax(0, 1fr); } }
@media (min-width: 700px) { .pack-row { grid-template-columns: 240px minmax(0, 1fr); } }

/* phones: the page leaves room for the buddy perched on the menu bar */
@media (max-width: 819px) { body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 70px); } }

/* ---------- pixel frames: chunky stepped corners, like the art ---------- */
.pixel-frame { --px: 6px; --pf: var(--h2, var(--night-3));
  clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px),
    100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px)));
  box-shadow: inset 0 0 0 3px var(--pf), inset 0 0 0 6px rgba(0,0,0,.25); border-radius: 0 !important; border: 0 !important; }
.hab-list li { clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
  border: 0; border-radius: 0; box-shadow: inset 0 0 0 3px var(--h2), inset 0 0 0 6px rgba(0,0,0,.25); padding: 12px 14px; }

/* story video */
.story { margin: 26px auto 0; padding: 16px; background: var(--night-2); text-align: center; }
.story h2 { margin-top: 0; }
.story-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; image-rendering: pixelated; }
.story .fine { margin-bottom: 0; }

/* how it works */
.how h2 { text-align: center; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .how-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.how-step { position: relative; padding: 16px 16px 18px; background: linear-gradient(170deg, var(--h1), var(--h3)); }
.how-step h3 { font: 700 1.25rem var(--pix); margin: 10px 0 6px; }
.how-step p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.step-no { position: absolute; top: 10px; left: 12px; display: grid; place-items: center; width: 30px; height: 30px; background: var(--glow); color: #2a1406; font: 800 1.1rem system-ui;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)); }
.how-art { height: 120px; display: flex; align-items: flex-end; justify-content: center; gap: 6px; padding-top: 18px; }
.how-art img { width: 72px; height: 72px; }
.mini-pack { display: grid; place-items: center; width: 74px; height: 100px; background: linear-gradient(160deg, #3a4466, #68386c); box-shadow: inset 0 0 0 3px #c0cbdc;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  animation: float 3s ease-in-out infinite; }
.mini-pack img { width: 60px; height: 60px; }
.mini-sleeve { display: grid; place-items: center; width: 58px; height: 80px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }
.mini-sleeve img { width: 50px; height: 50px; } .mini-sleeve.empty { box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.art-play { position: relative; }
.art-play .silhouette { filter: brightness(0) invert(.85); opacity: .9; }
.art-play .q { position: absolute; top: 6px; left: calc(50% - 48px); font: 800 1.6rem system-ui; color: var(--glow); }
.art-play .walker { width: 48px; height: 48px; animation: hop 1.2s ease-in-out infinite; }
.art-play .walker + .walker { animation-delay: .3s; }
@keyframes hop { 50% { transform: translateY(-6px); } }
.art-swap .arrows { font-size: 1.8rem; color: var(--glow); align-self: center; animation: pulse-swap 2s ease-in-out infinite; }
@keyframes pulse-swap { 50% { transform: scale(1.2); } }
.reduce .mini-pack, .reduce .art-play .walker, .reduce .art-swap .arrows { animation: none; }

/* walks in progress: the bar fills smoothly and the team bobs along */
.walk .progress span { transition: width 1s linear; }
.walk:not(.back) .mini-sprite { animation: walk-bob .5s ease-in-out infinite; }
.walk:not(.back) .mini-sprite:nth-child(2) { animation-delay: .17s; } .walk:not(.back) .mini-sprite:nth-child(3) { animation-delay: .34s; }
@keyframes walk-bob { 50% { transform: translateY(-3px); } }
.reduce .walk .mini-sprite { animation: none; } .reduce .walk .progress span { transition: none; }

/* drag the buddy */
.buddy-hit { touch-action: none; cursor: grab; }
.buddy.dragging .buddy-hit { cursor: grabbing; }
.buddy.dragging .buddy-stage { transform: scale(1.08); filter: drop-shadow(0 8px 8px rgba(0,0,0,.55)); }

.pick { position: relative; }
.spare-badge { display: inline-block; font: 700 .7rem system-ui; padding: 1px 7px; border-radius: 99px; background: #262b44; color: #f4ead2; border: 1px solid #5a6988; }
.spare-badge.pin { position: absolute; top: -6px; right: -4px; z-index: 5; }

/* gift code box */
.redeem-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.redeem-row input { flex: 1 1 220px; min-width: 0; font: 600 1.05rem ui-monospace, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 10px; padding: 10px 12px; }

/* ---------- quests ---------- */
.quests { background: var(--night-2); border-radius: 16px; padding: 4px 16px 10px; margin: 16px 0; }
.quests ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.quests li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.18); }
.quests .q-text { flex: 1; min-width: 0; }
.quests .q-mark { width: 1.4em; text-align: center; color: var(--muted); font-weight: 700; }
.quests li.ready .q-mark { color: #fee761; } .quests li.claimed .q-mark { color: #63c74d; } .quests li.claimed .q-text { color: var(--muted); }
.btn.small { padding: 5px 12px; font-size: .9rem; }

/* ---------- badges ---------- */
.set-grid { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.set-badge { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 10px; border-radius: 14px; background: var(--night-2); border: 2px solid var(--night-3); }
.set-badge img { width: 100%; max-width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; filter: grayscale(.7) brightness(.7); }
.set-badge.done { border-color: #feae34; box-shadow: 0 0 14px rgba(254,174,52,.35); } .set-badge.done img { filter: none; }
.set-badge .got { color: #63c74d; font-weight: 700; } .set-badge .progress { width: 100%; }
.mastery { list-style: none; padding: 0; display: grid; gap: 8px; }
.mastery li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--night-2); }
.mastery .progress, .mastery .fine { grid-column: 1 / -1; }
.lvl { font: 700 .75rem system-ui; padding: 1px 8px; border-radius: 99px; background: #3a4466; color: #c0cbdc; }
.lvl-explorer { background: #265c42; color: #d8f5c6; } .lvl-keeper { background: #feae34; color: #2a1406; }
.hab-opt small.lvl { justify-self: center; }
.ach-grid { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.ach { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 10px 12px; border-radius: 12px; background: var(--night-2); color: var(--muted); }
.ach .ach-icon { grid-row: span 2; font-size: 1.4rem; color: #5a6988; } .ach b { color: var(--ink-soft); } .ach span:not(.ach-icon) { font-size: .88rem; }
.ach.done { color: var(--ink-soft); border: 2px solid rgba(254,174,52,.5); } .ach.done .ach-icon { color: #feae34; } .ach.done b { color: var(--ink); }
.ach .ach-hat { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font-size: .82rem; color: #f6a5f0; }
.ach .ach-hat img { width: 22px; height: auto; image-rendering: pixelated; }

/* ---------- walks extras ---------- */
.encounter { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(254,174,52,.12); border: 2px solid rgba(254,174,52,.5); margin: 10px 0; }
.encounter .mini { width: 110px; flex: none; } .encounter p { margin: 0; }
.time-hint { border-color: #b55088; }

/* ---------- collection: gold covers for complete sets ---------- */
.sets-done { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.set-chip { font: 700 .8rem system-ui; padding: 3px 10px; border-radius: 99px; background: linear-gradient(90deg, #feae34, #fee761); color: #2a1406; text-decoration: none; }
.binder.gold-cover { box-shadow: 0 0 0 4px #feae34, 0 0 28px rgba(254,174,52,.45); border-radius: 18px; }

/* ---------- buddy figure (friend page, games) ---------- */
.bud-fig { --u: 2px; position: relative; display: inline-block; width: calc(var(--u) * 64); height: calc(var(--u) * 64); }
.bud-fig img { position: absolute; image-rendering: pixelated; }
.bud-fig .bud-body { inset: 0; width: 100%; height: 100%; }
.bud-fig .bud-hat { width: calc(var(--u) * var(--w, 30)); height: calc(var(--u) * var(--h, 30)); left: calc(var(--u) * (var(--hx) - var(--w, 30) / 2)); top: calc(var(--u) * (var(--hy) + 6 - var(--h, 30))); }
.friend-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.friend-buddy { text-align: center; padding: 10px; border-radius: 14px; background: var(--night-2); }
.friend-album { flex: 1 1 260px; min-width: 0; }
.album-dots { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
.album-dots img { width: 100%; height: auto; display: block; }

/* ---------- Drum Circle ---------- */
/* Drum Circle: one scene, buddy behind the drum (same rig as the corner buddy, scaled by --u) */
.drum-stage { position: relative; aspect-ratio: 2 / 1; touch-action: manipulation; cursor: pointer; border-radius: 18px; overflow: hidden; margin: 14px 0 12px; border: 3px solid #feae34; background: #1b2140; user-select: none; -webkit-user-select: none; }
.drum-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; filter: brightness(.5) saturate(.9); }
.drum-stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24,20,37,.15), rgba(24,20,37,.05) 50%, rgba(24,20,37,.45)); pointer-events: none; }
.drum-lane { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.drum-pad { position: absolute; left: 6%; bottom: 3%; z-index: 3; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; border-radius: 16px; }
.drum-pad:focus-visible { outline: 3px solid var(--glow); outline-offset: 4px; }
.drum-kit { --u: 3px; position: relative; display: block; width: calc(var(--u) * 64); height: calc(var(--u) * 82); filter: drop-shadow(0 6px 4px rgba(0,0,0,.55)); }
.drum-kit img { position: absolute; image-rendering: pixelated; }
.dk-body { left: 0; top: 0; width: calc(var(--u) * 64); height: calc(var(--u) * 64); transform-origin: 50% 100%; }
.dk-hat { width: calc(var(--u) * var(--w, 30)); height: calc(var(--u) * var(--h, 30)); left: calc(var(--u) * (var(--hx) - var(--w, 30) / 2)); top: calc(var(--u) * (var(--hy) + 6 - var(--h, 30))); z-index: 2; }
.dk-drum { left: calc(var(--u) * 14); bottom: calc(var(--u) * 4); width: calc(var(--u) * 36); height: calc(var(--u) * 36); z-index: 3; transform-origin: 50% 100%; }
.dk-paw { width: calc(var(--u) * 14); height: calc(var(--u) * 10); top: calc(var(--u) * 38); z-index: 4; }
.dk-paw.left { left: calc(var(--u) * 14); } .dk-paw.right { left: calc(var(--u) * 36); transform: scaleX(-1); }
.dk-paw.left.down { animation: paw-l .16s ease-out; } .dk-paw.right.down { animation: paw-r .16s ease-out; }
.drum-kit.thump .dk-drum { animation: thump .16s ease-out; }
.drum-kit.thump .dk-body { animation: bud-nod .2s ease-out; }
@keyframes bud-nod { 40% { transform: scale(1.02, .97); } }
.drum-hud { position: absolute; top: 4%; right: 3%; z-index: 4; display: grid; justify-items: end; gap: 4px; font: 700 clamp(.8rem, 1.6vw, 1.05rem) var(--pix); text-shadow: 0 2px 0 #181425; }
.drum-left { color: var(--ink); } .drum-combo { color: #feae34; font-size: 1.3em; } .drum-combo.hot { color: #fee761; }
.drum-judge { position: absolute; left: var(--jx, 20%); top: var(--jy, 30%); transform: translate(-50%, -100%); z-index: 5; margin: 0; white-space: nowrap; pointer-events: none;
  font: 700 clamp(1rem, 2.4vw, 1.6rem) var(--pix); text-shadow: 0 2px 0 #181425, 0 0 10px rgba(0,0,0,.6); }
.drum-judge.pop { animation: judge-pop .5s ease-out; }
@keyframes judge-pop { from { transform: translate(-50%, -80%) scale(.7); } 30% { transform: translate(-50%, -115%) scale(1.15); } to { transform: translate(-50%, -110%) scale(1); } }
.drum-judge.perfect { color: #fee761; } .drum-judge.good { color: #63c74d; } .drum-judge.miss { color: var(--ink-soft, #c0cbdc); font-size: clamp(.8rem, 1.6vw, 1.05rem); }
.drum-cover { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(24,20,37,.35); }
.drum-cover[hidden] { display: none; }
.drum-cover .btn { padding-left: 1.6em; padding-right: 1.6em; }
.drum-tools { align-items: center; }
.reduce .drum-kit.thump .dk-drum, .reduce .drum-kit.thump .dk-body, .reduce .dk-paw.down, .reduce .drum-judge.pop { animation: none; }
body.in-game .buddy { display: none; }
@media (max-width: 560px) { .drum-stage { aspect-ratio: 4 / 3; } .drum-pad { left: 3%; } }
.drum-result { background: var(--night-2); border-radius: 16px; padding: 4px 16px 12px; margin-top: 18px; }

/* ---------- Lantern Flight ---------- */
.flight-wrap { display: flex; justify-content: center; margin: 12px 0; }
.flight { width: min(100%, 360px); height: auto; max-height: 72vh; aspect-ratio: 2 / 3; image-rendering: pixelated; border-radius: 14px; touch-action: manipulation; cursor: pointer; background: #1b2140; }
.hiscores { list-style: none; counter-reset: hs; padding: 0; display: grid; gap: 4px; }
.hiscores li { counter-increment: hs; display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 10px; background: var(--night-2); }
.hiscores li span::before { content: counter(hs) '. '; color: var(--muted); }

/* ---------- corner buddy: reactions and level expressions ---------- */
.buddy-stage.cheer { animation: bud-cheer .6s ease-out 2; }
.buddy-stage.spin { animation: bud-spin 1.1s ease-in-out; }
@keyframes bud-cheer { 30% { transform: translateY(-14px) scale(1.05); } 60% { transform: translateY(0); } }
@keyframes bud-spin { 0% { transform: rotate(0); } 50% { transform: rotate(200deg) scale(1.1); } 100% { transform: rotate(360deg); } }
.buddy.lv3 .buddy-body { animation: bud-idle 2.4s ease-in-out infinite; }
@keyframes bud-idle { 50% { transform: translateY(-2px); } }
.buddy.lv7 .buddy-stage { filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)) drop-shadow(0 0 6px rgba(254,231,97,.55)); }
.buddy.lv9 .buddy-drum { animation: bud-shimmer 3s linear infinite; }
@keyframes bud-shimmer { 0%, 100% { filter: hue-rotate(0); } 50% { filter: hue-rotate(40deg) brightness(1.15); } }
.reduce .buddy-stage.cheer, .reduce .buddy-stage.spin, .reduce .buddy.lv3 .buddy-body, .reduce .buddy.lv9 .buddy-drum { animation: none; }
.buddy-level { background: var(--night-2); border-radius: 14px; padding: 4px 16px 10px; margin: 10px 0; }

/* breathing room after the stat tiles */
dl.stats + * { margin-top: 16px; }

/* ---------- limited events (Halloween) ---------- */
.event-banner { display: grid; gap: 14px; align-items: center; grid-template-columns: minmax(0, 1fr); margin: 0 0 22px; padding: 16px 18px; border-radius: 18px;
  background: radial-gradient(ellipse at 85% 20%, rgba(254,174,52,.28), transparent 60%), linear-gradient(135deg, #3b1d4a, #262b44 60%, #2a1a12);
  border: 2px solid #f77622; box-shadow: 0 0 24px rgba(247,118,34,.25); }
@media (min-width: 760px) { .event-banner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.event-banner h2 { margin: 2px 0 6px; } .event-banner p { margin: 0 0 10px; }
.ev-kicker { font: 700 .78rem system-ui; letter-spacing: .08em; text-transform: uppercase; color: #feae34; }
.ev-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ev-cards li { aspect-ratio: 1; border-radius: 12px; background: rgba(0,0,0,.28); display: grid; place-items: center; }
.ev-cards img { width: 86%; height: auto; image-rendering: pixelated; }
.ev-cards img:not(.silhouette) { animation: ev-bob 2.6s ease-in-out infinite; }
.ev-cards li:nth-child(2n) img { animation-delay: .6s; } .ev-cards li:nth-child(3n) img { animation-delay: 1.2s; }
@keyframes ev-bob { 50% { transform: translateY(-3px); } }
.reduce .ev-cards img { animation: none; }
.card.limited { box-shadow: 0 0 0 2px #f77622, 0 0 14px rgba(247,118,34,.45); }
.limited-tag { position: absolute; right: 6px; top: 26px; z-index: 3; font: 700 .6rem system-ui; padding: 1px 6px; border-radius: 99px; background: #f77622; color: #2a1406; white-space: nowrap; }
.mini .limited-tag { top: 22px; font-size: .5rem; }

/* ---------- header menu ---------- */
.topbar { gap: 12px; }
.top-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.top-nav .site-links { display: none; gap: 16px; margin-right: 6px; }
.top-nav .site-links a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.top-nav .site-links a:hover, .top-nav .site-links a:focus-visible { color: var(--ink); }
.top-nav .btn.small { white-space: nowrap; }
@media (min-width: 860px) { .top-nav .site-links { display: flex; } .top-nav .menu-mobile { display: none; } }
@media (max-width: 420px) { .top-nav > .btn.ghost.small { display: none; } } /* tiny phones: Play free + menu */
.light-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 99px; background: var(--night-2); border: 1px solid var(--night-3);
  color: #fee761; text-decoration: none; font: 600 .95rem system-ui; white-space: nowrap; }
.light-chip b { color: var(--ink); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--night-3); background: var(--night-2); color: var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }
.menu .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #feae34, #f77622); color: #2a1406; font: 700 .9rem var(--pix); }
.menu .who { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (max-width: 520px) { .menu .who { display: none; } .menu summary { padding: 4px; } }
.menu-mobile summary { padding: 9px 10px; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
.burger::before, .burger::after { content: ''; position: absolute; left: 0; } .burger::before { top: -6px; } .burger::after { top: 6px; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; display: grid; padding: 6px; border-radius: 14px;
  background: #1f2238; border: 1px solid var(--night-3); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.menu-panel a, .menu-panel button { display: block; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover, .menu-panel a:focus-visible, .menu-panel button:focus-visible { background: var(--night-3); outline: none; }
.menu-panel hr { border: 0; border-top: 1px solid var(--night-3); margin: 6px 4px; }
.menu-panel .fine { font-size: .8rem; }

/* ---------- homepage: games + grown-ups ---------- */
.game-tiles { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.game-tile { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 12px; border-radius: 16px;
  background: var(--h3, var(--night-2)); border: 2px solid rgba(255,255,255,.08); color: var(--ink); text-decoration: none; height: 100%; }
.game-tile img { grid-row: span 2; width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.game-tile b { font: 700 1.05rem var(--pix); } .game-tile span { color: var(--ink-soft); font-size: .9rem; }
.game-tile:hover, .game-tile:focus-visible { border-color: var(--glow); }
.grownups { margin: 26px 0; padding: 18px 22px 20px; } .grownups h2 { margin-top: 0; } .grownups .safe-list { padding-left: 1.4em; } .grownups .row { margin-bottom: 0; }
.safe-list { padding-left: 1.2em; display: grid; gap: 6px; }
.safe-list b { color: var(--ink); }

.ev-cards a { position: relative; display: grid; place-items: center; width: 100%; height: 100%; text-decoration: none; color: var(--ink); }
.ev-cards .ev-name { position: absolute; bottom: 4px; font: 700 .7rem system-ui; text-shadow: 0 1px 2px #000; }
.ev-cards .got { position: absolute; top: 4px; right: 6px; color: #63c74d; font-weight: 700; }
.ev-cards li.found { box-shadow: inset 0 0 0 2px #63c74d; }
.ev-cards img { width: 72%; }

/* slim event strip (links to the news article) */
.event-strip { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 10px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: linear-gradient(100deg, #3b1d4a, #262b44 70%); border: 2px solid #f77622; }
.event-strip:hover, .event-strip:focus-visible { box-shadow: 0 0 16px rgba(247,118,34,.4); }
.ev-minis { display: flex; flex: none; }
.ev-minis img { width: 34px; height: 34px; image-rendering: pixelated; margin-left: -8px; filter: drop-shadow(0 1px 1px #000); }
.ev-minis img:first-child { margin-left: 0; }
.ev-minis img.got { filter: drop-shadow(0 0 3px #63c74d); }
.ev-line { display: grid; gap: 2px; min-width: 0; } .ev-line b { font: 700 1rem var(--pix); } .ev-line span { color: var(--ink-soft); font-size: .9rem; }
.ev-line u { color: #feae34; }
@media (max-width: 560px) { .ev-minis img:nth-child(n+4) { display: none; } }

/* share panel */
.share-panel { margin: 14px 0; }
.share-box { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); padding: 14px; border-radius: 16px; background: var(--night-2); border: 1px solid var(--night-3); }
@media (min-width: 700px) { .share-box { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.share-preview { width: 100%; max-width: 320px; height: auto; border-radius: 12px; display: block; justify-self: center; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.share-side h3 { margin: 0 0 8px; }
.share-side .agree { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }

/* ---------- world map ---------- */
.world-counts { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--ink-soft); margin: 4px 0 10px; }
.world-counts b { color: #feae34; font-size: 1.1rem; }
.world-map { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.region { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; border: 2px solid rgba(255,255,255,.1); background: #1b2140; }
.region-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; filter: brightness(.8); }
.region header { position: absolute; left: 8px; top: 8px; z-index: 200; display: flex; gap: 8px; align-items: baseline; padding: 3px 10px; border-radius: 99px; background: rgba(24,20,37,.75); }
.region header b { font: 700 .95rem var(--pix); } .region header span { color: var(--ink-soft); font-size: .78rem; }
.region-stage { position: absolute; inset: 0; }
.roamer { position: absolute; transform: translate(-50%, -100%); background: none; border: 0; padding: 0; cursor: pointer; width: 15%; max-width: 64px; min-width: 40px; }
.roamer img { width: 100%; height: auto; image-rendering: pixelated; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.6)); }
.roamer.flip img:not(.roam-hat) { transform: scaleX(-1); }
.roamer.wild img { opacity: .9; }
.roamer .roam-hat { position: absolute; left: 50%; top: -18%; width: 46%; transform: translateX(-50%); }
.roamer:not(.wild) img:not(.roam-hat) { animation: roam-bob .9s ease-in-out infinite; }
@keyframes roam-bob { 50% { transform: translateY(-2px); } }
.roamer.flip:not(.wild) img:not(.roam-hat) { animation-name: roam-bob-flip; }
@keyframes roam-bob-flip { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(-2px); } }
.roamer .bubble { position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 .72rem system-ui; padding: 3px 8px; border-radius: 8px; background: #f4ead2; color: #181425; z-index: 300; }
.reduce .roamer img { animation: none !important; }
.world-feed { list-style: none; padding: 0; display: grid; gap: 6px; }
.world-feed li { padding: 8px 12px; border-radius: 10px; background: var(--night-2); } .world-feed small { color: var(--muted); }
.world-mini { margin: 18px 0; padding: 4px 16px 14px; border-radius: 16px; background: var(--night-2); }

/* ---------- Today ---------- */
.tour { padding: 4px 16px 12px; border-radius: 16px; border: 2px solid var(--glow); background: radial-gradient(ellipse at 90% 0, rgba(254,174,52,.16), transparent 60%), var(--night-2); margin-bottom: 14px; }
.tour-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: ts; }
.tour-steps li, .next-up li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.2); }
.tour-steps li > div, .next-up li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tour-steps li span:not(.tick), .next-up li > div span { color: var(--ink-soft); font-size: .9rem; }
.tour-steps .tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--night-3); display: grid; place-items: center; font-weight: 700; color: #0d2a12; }
.tour-steps li.done .tick { background: #63c74d; border-color: #63c74d; }
.tour-steps li.done b { color: var(--muted); text-decoration: line-through; }
.light-goal { padding: 12px 16px; border-radius: 16px; background: var(--night-2); margin: 0 0 14px; display: grid; gap: 8px; }
.lg-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; } .lg-row b { color: #fee761; } .lg-row span { color: var(--ink-soft); }
.light-goal .btn { justify-self: start; }
.next-up ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.next-up .ic { width: 28px; text-align: center; font-size: 1.2rem; flex: none; }
.all-done { padding: 6px 16px 12px; border-radius: 16px; background: linear-gradient(135deg, #265c42, #262b44); }
.later { margin-top: 8px; }
.goals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 16px 0; }
.goal { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--night-2); border: 2px solid transparent; color: var(--ink); text-decoration: none; }
.goal:hover, .goal:focus-visible { border-color: var(--glow); } .goal b { font-size: 1.3rem; color: #feae34; } .goal span { color: var(--ink-soft); font-size: .9rem; }

/* ---------- the story ---------- */
.story-card { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: linear-gradient(110deg, #2c2450, #262b44); border: 2px solid #b55088; }
.story-card.ready { border-color: var(--glow); box-shadow: 0 0 16px rgba(254,174,52,.35); }
.story-card .sc-art img { width: 120px; height: auto; border-radius: 10px; display: block; image-rendering: pixelated; }
.story-card > span:last-child { display: grid; gap: 2px; } .story-card b { font: 700 1rem var(--pix); } .story-card span span { color: var(--ink-soft); font-size: .9rem; }
.chapters { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.chapter > a, .chapter > div { display: grid; height: 100%; border-radius: 16px; overflow: hidden; background: var(--night-2); border: 2px solid var(--night-3); color: var(--ink); text-decoration: none; }
.chapter img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.chapter.locked img { filter: grayscale(1) brightness(.35); }
.chapter.ready > a { border-color: var(--glow); } .chapter.done > a { border-color: #63c74d; }
.ch-text { display: grid; gap: 2px; padding: 10px 12px 12px; } .ch-text small { color: var(--muted); } .ch-text b { font: 700 1.05rem var(--pix); } .ch-text span { color: var(--ink-soft); font-size: .9rem; }
.panels { display: grid; gap: 14px; margin: 12px 0; }
.panel { margin: 0; border-radius: 16px; overflow: hidden; background: var(--night-2); }
.panel img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.panel figcaption { padding: 12px 16px 16px; font-size: 1.1rem; line-height: 1.55; }
@media (min-width: 900px) { .panels { grid-template-columns: 1fr 1fr; } }
.narrate { margin: 4px 0 10px; }
.ch-goals { padding: 4px 16px 16px; border-radius: 16px; background: var(--night-2); }
.ch-goals ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.ch-goals li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.2); }
.ch-goals li > div { flex: 1; min-width: 0; display: grid; gap: 4px; } .ch-goals li > div span { color: var(--ink-soft); font-size: .85rem; }
.ch-goals .gt { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--night-3); display: grid; place-items: center; font-weight: 700; }
.ch-goals li.ok .gt { background: #63c74d; border-color: #63c74d; color: #0d2a12; } .ch-goals li.ok b { color: var(--muted); }
.reward-note { color: #fee761; }
.region.helped { border-color: #feae34; box-shadow: 0 0 18px rgba(254,174,52,.4); }
.region.helped .region-bg { filter: brightness(1) saturate(1.15); }

/* ---------- Lantern Circles ---------- */
.circle-title { display: flex; align-items: center; gap: 10px; color: var(--cc, var(--ink)); }
.circle-title img { width: 56px; height: 56px; image-rendering: pixelated; }
.camp { position: relative; aspect-ratio: 16 / 8; border-radius: 18px; overflow: hidden; margin: 10px 0 16px; border: 3px solid var(--cc, #feae34); background: #1b2140; }
.camp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; filter: brightness(.45) saturate(.9); }
.camp::after { content: ''; position: absolute; left: 50%; top: 78%; width: 60%; height: 60%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(254,174,52,.35), transparent 65%); pointer-events: none; }
.camp-fire { position: absolute; left: 50%; top: 84%; width: 13%; max-width: 112px; transform: translate(-50%, -100%); image-rendering: pixelated; z-index: 2; animation: fire-flick 1.2s ease-in-out infinite; }
@keyframes fire-flick { 50% { transform: translate(-50%, -100%) scale(1.04, .97); filter: brightness(1.15); } }
.camper { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; z-index: 3; width: 13%; max-width: 96px; }
.camper-fig { position: relative; display: block; width: 100%; }
.camper-fig img { width: 100%; height: auto; image-rendering: pixelated; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.camper-fig .camper-hat { position: absolute; left: 50%; top: -22%; width: 47%; transform: translateX(-50%); }
.camper-name { font: 600 .72rem system-ui; padding: 1px 7px; border-radius: 99px; background: rgba(24,20,37,.8); white-space: nowrap; }
.camper-name b { color: #fee761; }
.cheer-bubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 .72rem system-ui; padding: 4px 9px; border-radius: 10px; background: #f4ead2; color: #181425; z-index: 5; }
.cheer-bubble::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #f4ead2; }
.reduce .camp-fire { animation: none; }
.circle-lantern { padding: 4px 16px 14px; border-radius: 16px; background: var(--night-2); margin-bottom: 14px; }
.circle-lantern.lit { background: linear-gradient(135deg, #5a3b1a, #262b44); border: 2px solid #feae34; }
.cheers { display: flex; flex-wrap: wrap; gap: 6px; }
.cheer-log, .members, .invites { list-style: none; padding: 0; display: grid; gap: 6px; }
.cheer-log li { padding: 6px 12px; border-radius: 10px; background: var(--night-2); } .cheer-log small { color: var(--muted); }
.members li, .invites li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--night-2); }
.invites li img { width: 40px; height: 40px; image-rendering: pixelated; } .invites li > div { flex: 1; display: grid; } .invites li span { color: var(--ink-soft); font-size: .88rem; }
.members .tag { font: 700 .7rem system-ui; padding: 1px 7px; border-radius: 99px; background: #feae34; color: #2a1406; }
.circle-new { display: grid; gap: 14px; max-width: 640px; }
.circle-new fieldset { border: 0; padding: 0; margin: 0; } .circle-new legend { font-weight: 600; margin-bottom: 6px; }
.name-pick select { font: 600 1rem system-ui; color: var(--ink); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 10px; padding: 6px 8px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--sw); cursor: pointer; border: 3px solid transparent; }
.swatch:has(input:checked) { border-color: #f4ead2; box-shadow: 0 0 0 2px var(--sw); } .swatch input { position: absolute; opacity: 0; pointer-events: none; }
.emblem-pick { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.emblem-pick .pick { display: block; } .emblem-pick input { position: absolute; opacity: 0; pointer-events: none; }
.emblem-pick img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.emblem-pick .pick:has(input:checked) { border-color: var(--glow); box-shadow: 0 0 12px rgba(254,174,52,.5); }
.circle-sc img { width: 72px !important; }

/* the story video fills the box but never gets taller than the screen */
.story-video { max-height: 70vh; }

/* ---------- Growing up (Bright forms) ---------- */
.grow-panel { display: flex; gap: 16px; align-items: center; padding: 14px 16px; margin: 14px 0; border-radius: 16px; background: var(--night-2); border: 2px solid var(--night-3); }
.grow-panel.ready { border-color: #feae34; background: linear-gradient(135deg, #3b2a1a, var(--night-2)); box-shadow: 0 0 18px rgba(254,174,52,.25); }
.grow-panel h2 { margin: 0 0 4px; font-size: 1.15rem; } .grow-panel p { margin: 4px 0; } .grow-panel .row { margin: 8px 0 2px; }
.gp-art { position: relative; flex: 0 0 96px; } .gp-art img { width: 96px; height: 96px; image-rendering: pixelated; display: block; }
.gp-arrow { position: absolute; top: -6px; right: -6px; color: #fee761; font-size: 1.2rem; }
.grew-from { margin: 10px 0; font-weight: 600; }
.grow-list { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grow-row a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--night-2); color: inherit; text-decoration: none; border: 2px solid transparent; }
.grow-row a:hover, .grow-row a:focus-visible { border-color: var(--night-3); }
.grow-row.ready a { border-color: #feae34; background: linear-gradient(135deg, #3b2a1a, var(--night-2)); }
.grow-row img { width: 56px; height: 56px; image-rendering: pixelated; flex: none; }
.gr-arrow { color: #feae34; font-weight: 700; }
.gr-text { display: grid; gap: 3px; flex: 1; min-width: 0; } .gr-text > span { color: var(--ink-soft, #c0cbdc); font-size: .88rem; }
.grow-dialog { margin: auto; max-width: 440px; border: 3px solid #feae34; border-radius: 18px; background: var(--night-2); color: var(--ink); padding: 18px 20px; }
.grow-dialog::backdrop { background: rgba(10,8,20,.7); }
.grow-ceremony { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 16px; text-align: center;
  background: radial-gradient(circle at 50% 40%, #3b2a4a, #120f1f 70%); opacity: 0; transition: opacity .4s; }
.grow-ceremony.go { opacity: 1; }
.gc-stage { position: relative; width: min(60vw, 256px); aspect-ratio: 1; }
.gc-stage img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.gc-to { opacity: 0; transform: scale(.6); }
.gc-flash { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, #fff 0, #fee761 25%, rgba(254,174,52,0) 65%); opacity: 0; }
.gc-spark { position: absolute; left: 50%; top: 50%; color: #fee761; font-size: 1.4rem; opacity: 0; }
.grow-ceremony.go .gc-from { animation: gc-from 1.8s ease-in forwards; }
.grow-ceremony.go .gc-flash { animation: gc-flash 1s 1.4s ease-out forwards; }
.grow-ceremony.go .gc-to { animation: gc-to .7s 1.8s cubic-bezier(.2,1.6,.4,1) forwards; }
.grow-ceremony.go .gc-spark { animation: gc-spark 1.1s 1.8s ease-out forwards; }
.gc-spark.s0 { --a: 0deg; }
.gc-spark.s1 { --a: 30deg; }
.gc-spark.s2 { --a: 60deg; }
.gc-spark.s3 { --a: 90deg; }
.gc-spark.s4 { --a: 120deg; }
.gc-spark.s5 { --a: 150deg; }
.gc-spark.s6 { --a: 180deg; }
.gc-spark.s7 { --a: 210deg; }
.gc-spark.s8 { --a: 240deg; }
.gc-spark.s9 { --a: 270deg; }
.gc-spark.s10 { --a: 300deg; }
.gc-spark.s11 { --a: 330deg; }

@keyframes gc-from { 0% { filter: none; } 30% { transform: translateY(-4%); } 60% { filter: brightness(1.6) drop-shadow(0 0 12px #fee761); transform: scale(1.04); } 100% { filter: brightness(4) drop-shadow(0 0 30px #fff); transform: scale(1.1); opacity: 0; } }
@keyframes gc-flash { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes gc-to { to { opacity: 1; transform: scale(1); } }
@keyframes gc-spark { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-160px); } }
.gc-line1 { color: var(--ink-soft, #c0cbdc); margin: 8px 0 0; }
.gc-name, .gc-lore, .gc-btns { opacity: 0; } .grow-ceremony.go .gc-name, .grow-ceremony.go .gc-lore, .grow-ceremony.go .gc-btns { animation: gc-to .5s 2.3s ease-out forwards; }
.gc-name { margin: 0; font-size: 2rem; color: #fee761; } .gc-lore { max-width: 420px; margin: 0 0 8px; }
.grow-ceremony.still .gc-from, .grow-ceremony.still .gc-flash, .grow-ceremony.still .gc-spark { display: none; }
.grow-ceremony.still .gc-to, .grow-ceremony.still .gc-name, .grow-ceremony.still .gc-lore, .grow-ceremony.still .gc-btns { opacity: 1; transform: none; animation: none !important; }
@media (max-width: 520px) { .grow-panel { flex-direction: column; align-items: flex-start; } }

.grow-panel .silhouette, .grow-row .silhouette { filter: brightness(0) invert(.5); opacity: .75; }

/* ---------- Lantern Match ---------- */
.match-game { display: grid; grid-template-columns: minmax(0, 560px) minmax(220px, 1fr); gap: 20px; align-items: start; margin: 12px 0; }
.match-board { position: relative; aspect-ratio: 1; border-radius: 18px; border: 3px solid #feae34; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 50% 35%, #2b3768 0%, #1d2348 55%, #141832 100%); box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 0 24px rgba(254,174,52,.18); }
.mt { position: absolute; left: 0; top: 0; width: calc(100% / 7); height: calc(100% / 7); padding: 4%; border: 0; background: none; cursor: pointer;
  transform: translate(calc(var(--x, 0) * 100%), calc(var(--y, 0) * 100%)); transition: transform .18s ease-in; display: grid; place-items: center; }
.mt::before { content: ''; position: absolute; inset: 6%; border-radius: 22%; background: var(--mk, #262b44); opacity: .55; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.mt img { position: relative; width: 128%; height: 128%; margin: -14%; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 2px 1px rgba(0,0,0,.45)); }
.mt.nofx { transition: none; }
.mt.sel::before { opacity: 1; box-shadow: 0 0 0 3px #fee761, 0 0 14px #feae34; }
.mt:focus-visible { outline: none; } .mt:focus-visible::before { opacity: .9; box-shadow: 0 0 0 3px #f4ead2; }
.mt.pop { animation: mt-pop .26s ease-in forwards; }
@keyframes mt-pop { 40% { scale: 1.2; filter: brightness(1.8); } 100% { scale: 0; opacity: 0; } }
.mt.born { animation: mt-born .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes mt-born { from { scale: .2; } }
.mt.nope { animation: mt-nope .3s ease-in-out; }
@keyframes mt-nope { 25% { translate: -6% 0; } 75% { translate: 6% 0; } }
.mt.hint { animation: mt-hint 1.1s ease-in-out infinite; }
@keyframes mt-hint { 50% { scale: 1.08; filter: brightness(1.35); } }
.mt-badge { position: absolute !important; right: 2%; bottom: 2%; width: 40% !important; height: auto !important; margin: 0 !important; }
.mt.mt-lantern::before { box-shadow: 0 0 0 3px #feae34, 0 0 14px #feae34; opacity: .85; }
.mt-staricon { position: relative; font: 700 clamp(1.4rem, 5vw, 2.4rem) system-ui; color: #fee761; text-shadow: 0 0 10px #feae34, 0 0 2px #fff; animation: mt-twinkle 1.6s ease-in-out infinite; }
.mt.mt-star::before { background: radial-gradient(circle, #5a3b8a, #262b44); opacity: 1; box-shadow: 0 0 0 3px #fee761, 0 0 16px #fee761; }
@keyframes mt-twinkle { 50% { scale: 1.15; rotate: 20deg; } }
.mk-0 { --mk: #3e8948; } .mk-1 { --mk: #0099db; } .mk-2 { --mk: #be4a2f; } .mk-3 { --mk: #5a4a8a; } .mk-4 { --mk: #8bb8d8; } .mk-5 { --mk: #e4709a; }
.mt-points { position: absolute; left: 0; top: 0; width: calc(100% / 7); text-align: center; z-index: 5; pointer-events: none;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100% * 1)); font: 700 1.1rem var(--pix); color: #fee761; text-shadow: 0 2px 0 #181425; animation: mt-float .9s ease-out forwards; }
@keyframes mt-float { to { translate: 0 -60%; opacity: 0; } }
.match-side { display: grid; gap: 12px; }
.match-hud { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-hud div { background: var(--night-2); border-radius: 14px; padding: 10px 14px; display: grid; }
.match-hud span { color: var(--muted); font-size: .85rem; } .match-hud b { font: 700 1.8rem var(--pix); color: #fee761; }
.match-say { min-height: 1.4em; margin: 0; font: 700 1.05rem var(--pix); color: #feae34; }
.match-kinds { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.match-kinds li { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: color-mix(in srgb, var(--mk) 30%, var(--night-2)); font-size: .78rem; text-align: center; }
.match-kinds img { width: 44px; height: 44px; image-rendering: pixelated; }
.match-result { background: var(--night-2); border-radius: 16px; padding: 4px 16px 12px; border: 2px solid #feae34; }
.reduce .mt { transition: none; } .reduce .mt.hint, .reduce .mt-staricon { animation: none; }
@media (max-width: 760px) { .match-game { grid-template-columns: 1fr; } .match-kinds { grid-template-columns: repeat(6, 1fr); } .match-kinds span { display: none; } }

/* ---------- Lantern Pairs ---------- */
.pairs-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; margin: 8px 0 26px; }
.pairs-hud { display: flex; gap: 16px; margin: 0; } .pairs-hud b { font: 700 1.2rem var(--pix); color: #fee761; }
.pairs-grid { list-style: none; padding: 0; margin: 0 auto 20px; display: grid; gap: 10px; max-width: 580px; }
.pairs-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } .pairs-grid.cols-5 { grid-template-columns: repeat(5, 1fr); max-width: 720px; }
.pair .back { background: radial-gradient(circle at 50% 40%, #3b2a4a, #1b2140); border-color: #feae34; }
.pair .front .card { width: 100%; height: 100%; }
.pair.matched .front { filter: drop-shadow(0 0 10px rgba(254,231,97,.7)); }
.pair.matched { cursor: default; }
.pairs-result { margin: 16px 0; background: var(--night-2); border-radius: 16px; padding: 4px 16px 12px; border: 2px solid #feae34; }
.pairs-stars { font-size: 2rem; color: #fee761; margin: 0; letter-spacing: 4px; } .pairs-stars span { color: var(--night-3); }
@media (max-width: 560px) { .pairs-grid { gap: 6px; } .pairs-grid.cols-5 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- UX pass (2026-10-26) ---------- */
/* nothing may push the page sideways on a phone */
html { overflow-x: clip; }
.topbar { min-width: 0; } .brand { min-width: 0; flex-shrink: 1; }
@media (max-width: 420px) { .brand { font-size: 1.1rem; } .proto-pill { display: none; } }
/* bigger tap targets for small fingers */
a.back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px 0 0; margin-bottom: 4px; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: #feae34; vertical-align: middle; flex: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
/* Pixelify Sans draws "fi"/"fl" ligatures badly ("find" looked like "And"): plain letters everywhere */
html { font-variant-ligatures: no-common-ligatures; }
h1[tabindex="-1"]:focus { outline: none; } /* focus moves to the heading for screen readers on each page; no visible ring needed */

/* the other games, at the bottom of each game */
.more-games { margin: 28px 0 8px; }
.more-games h2 { font-size: 1.1rem; }
.more-games ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.more-games a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--night-2); border: 2px solid transparent; color: var(--ink); text-decoration: none; font: 700 .95rem var(--pix); min-height: 56px; }
.more-games a:hover, .more-games a:focus-visible { border-color: var(--glow); }
.more-games img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; image-rendering: pixelated; flex: none; }

.play-together { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 12px 0; border-radius: 14px; color: var(--ink); text-decoration: none;
  background: linear-gradient(135deg, #3b2a1a, var(--night-2)); border: 2px solid rgba(254,174,52,.5); }
.play-together:hover, .play-together:focus-visible { border-color: var(--glow); }
.play-together > span:first-child { font-size: 1.6rem; } .play-together > span:nth-child(2) { flex: 1; display: grid; } .play-together span span { color: var(--ink-soft); font-size: .9rem; }
.circle-card .play-art img { object-fit: contain; width: 70%; height: auto; }
/* circle name: room around each word picker for its focus ring */
.name-pick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: 6px; }
.name-pick select:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }
* + .event-strip { margin-top: 18px; } /* breathing room when the event banner comes after something (e.g. the gift code box) */

/* ---------- Album rewards ---------- */
.album-track { margin: 12px 0 16px; padding: 12px 16px; border-radius: 16px; background: var(--night-2); }
.album-track.has-ready { border: 2px solid #feae34; box-shadow: 0 0 16px rgba(254,174,52,.25); }
.at-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .at-head h2 { margin: 0; font-size: 1.15rem; }
.album-track > .fine { margin: 6px 0 10px; }
.at-track { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(9, minmax(58px, 1fr)); gap: 6px; overflow-x: auto; }
.at-track li { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: rgba(0,0,0,.25); opacity: .55; text-align: center; }
.at-track li.reached { opacity: 1; } .at-track li.ready { background: linear-gradient(160deg, #3b2a1a, rgba(0,0,0,.25)); }
.at-track b { font: 700 1rem var(--pix); color: #fee761; } .at-light { font-size: .8rem; color: var(--ink-soft); }
.at-icon { width: 40px; height: 40px; display: grid; place-items: center; } .at-icon img { width: 36px; height: auto; image-rendering: pixelated; }
.ar-cover { display: block; width: 30px; height: 38px; border-radius: 5px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.ar-frame { display: block; width: 28px; height: 38px; border-radius: 5px; background: var(--night-3); }
.at-style { margin-top: 12px; display: grid; gap: 10px; } .at-style fieldset { border: 0; padding: 0; margin: 0; } .at-style legend { font-weight: 700; margin-bottom: 6px; }
.at-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.at-opt { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px; border: 2px solid var(--night-3); background: var(--night); color: var(--ink); font: inherit; cursor: pointer; }
.at-opt[aria-pressed=true] { border-color: var(--glow); } .at-opt:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) { .at-track { grid-template-columns: repeat(9, 64px); } }
/* binder covers */
.cv-leather { background: linear-gradient(135deg, #3e2731, #2a1a24 60%, #3e2731); }
.cv-moss, body.cover-moss .binder { background: linear-gradient(135deg, #2f5a35, #1b3a24 60%, #2f5a35); }
.cv-ember, body.cover-ember .binder { background: linear-gradient(135deg, #7a2a22, #4a1716 60%, #7a2a22); }
.cv-aurora, body.cover-aurora .binder { background: linear-gradient(135deg, #2a3d7a, #3a2a6a 35%, #1f5a5a 70%, #2a3d7a); }
/* card frames: on your own binder and card pages */
.fr-none { background: var(--night-3); }
.fr-leaf { box-shadow: 0 0 0 3px #63c74d, 0 0 0 5px #265c42; background: #1b3a24; }
.fr-tide { box-shadow: 0 0 0 3px #2ce8f5, 0 0 0 5px #124e89; background: #12304a; }
.fr-star { box-shadow: 0 0 0 3px #fee761, 0 0 10px #fee761; background: #262b44; }
.fr-gold { box-shadow: 0 0 0 4px #feae34, 0 0 0 6px #a24a00, 0 0 14px #feae34; background: #3b2a1a; }
body.frame-leaf .binder .card:not(.missing), body.frame-leaf .detail-card .card { box-shadow: 0 0 0 3px #63c74d, 0 0 0 5px #265c42; }
body.frame-tide .binder .card:not(.missing), body.frame-tide .detail-card .card { box-shadow: 0 0 0 3px #2ce8f5, 0 0 0 5px #124e89; }
body.frame-star .binder .card:not(.missing), body.frame-star .detail-card .card { box-shadow: 0 0 0 3px #fee761, 0 0 12px rgba(254,231,97,.7); }
body.frame-gold .binder .card:not(.missing), body.frame-gold .detail-card .card { box-shadow: 0 0 0 4px #feae34, 0 0 0 6px #a24a00, 0 0 16px rgba(254,174,52,.6); }

/* ---------- Expeditions ---------- */
.ex-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.ex-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 14px; border-radius: 18px; background: var(--night-2); border: 2px solid transparent; }
.ex-card.ready { border-color: #feae34; box-shadow: 0 0 18px rgba(254,174,52,.25); }
.ex-art { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; }
.ex-art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.ex-level { position: absolute; left: 8px; top: 8px; padding: 2px 10px; border-radius: 99px; background: rgba(24,20,37,.85); font: 700 .8rem var(--pix); color: #fee761; }
.ex-body h2 { margin: 0; font-size: 1.2rem; } .ex-body > p { margin: 6px 0; }
.ex-need { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ex-chip { padding: 2px 10px; border-radius: 99px; background: var(--h3, var(--night-3)); font-size: .85rem; }
.ex-reward { color: #fee761; font-weight: 600; }
.ex-state { font-weight: 700; } .ex-state.ready { color: #feae34; } .ex-state.done { color: #63c74d; }
.ex-team { display: flex; gap: 4px; } .ex-team img { width: 44px; height: 44px; image-rendering: pixelated; }
.ex-builder { margin-top: 8px; display: grid; gap: 10px; }
.ex-place { border: 2px solid var(--night-3); border-radius: 12px; padding: 8px 10px; margin: 0; } .ex-place legend { font-weight: 700; padding: 0 4px; }
.ex-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-opt { display: grid; justify-items: center; width: 84px; padding: 4px; border-radius: 10px; border: 2px solid transparent; background: var(--night); color: var(--ink); font: .72rem system-ui; cursor: pointer; }
.ex-opt img { width: 56px; height: 56px; image-rendering: pixelated; }
.ex-opt[aria-pressed=true] { border-color: var(--glow); box-shadow: 0 0 10px rgba(254,174,52,.4); } .ex-opt:disabled { opacity: .35; }
.ex-missing { margin: 4px 0; color: var(--ink-soft); }
.ex-reveal { margin: 16px 0; } .ex-reveal-in { padding: 4px 18px 14px; border-radius: 18px; background: linear-gradient(160deg, #3b2a1a, var(--night-2)); border: 2px solid #feae34; text-align: center; }
.ex-found { width: 180px; margin: 0 auto; }
@media (max-width: 640px) { .ex-card { grid-template-columns: 1fr; } }
/* Pixelify Sans joins "fi"/"fl" through contextual alternates as well as ligatures: switch all of them off */
html, h1, h2, h3, .brand, .card-name, .btn, .pack, [class*="pix"], b, strong { font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0; font-variant-ligatures: none; }
.page-empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: min(80%, 360px); margin: 0; padding: 14px 18px; border-radius: 14px;
  background: rgba(24,20,37,.92); border: 2px solid var(--night-3); text-align: center; color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.play-sec { margin: 22px 0 10px; font-size: 1.2rem; }

/* Lantern Flight: who flies */
.flyer-row { align-items: center; }
.flyer-now { display: inline-flex; align-items: center; gap: 8px; } .flyer-now img { width: 36px; height: 36px; image-rendering: pixelated; }
.flyer-pick { margin: 8px 0 12px; }
.flyer-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.flyer-opt { display: block; width: 100%; padding: 4px; border-radius: 10px; border: 2px solid transparent; background: var(--night-2); cursor: pointer; }
.flyer-opt img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.flyer-opt[aria-pressed=true] { border-color: var(--glow); }

.mt-heart { position: absolute; left: 8%; top: 4%; font: 700 clamp(.6rem, 1.6vw, .85rem) system-ui; color: #ff8fb1; text-shadow: 0 1px 0 #181425; pointer-events: none; }
.match-kinds li.fav { box-shadow: inset 0 0 0 2px #ff8fb1; }
.match-fav { margin: 0; }

/* ---------- Discoveries (field guide) ---------- */
.disc-banner { display: block; margin: 10px 0; padding: 10px 16px; border-radius: 14px; background: linear-gradient(135deg, #1f4a5a, var(--night-2)); border: 2px solid #2ce8f5; color: var(--ink); text-decoration: none; }
.disc-banner:hover, .disc-banner:focus-visible { box-shadow: 0 0 14px rgba(44,232,245,.35); }
.disc-list { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-top: 16px; }
.disc-page { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--night-2); }
.disc-card { width: 120px; } .disc-text h3 { margin: 0; font: 700 1.1rem var(--pix); } .disc-text p { margin: 4px 0; }
.disc-page.added { animation: disc-in .5s ease-out both; animation-delay: var(--d, 0ms); box-shadow: inset 0 0 0 2px #63c74d; }
@keyframes disc-in { 40% { transform: scale(1.03); } }
.reduce .disc-page.added { animation: none; }
/* no letter-joining anywhere: some rules set the font shorthand, which turns ligatures back on */
*, *::before, *::after { font-feature-settings: "liga" 0, "clig" 0, "calt" 0, "dlig" 0 !important; font-variant-ligatures: none !important; }
/* card flags ("New!") sit on their own card */
.disc-card, .ex-found { position: relative; }

/* the one footer (same in the game and on the website) */
.site-footer { max-width: 1080px; margin: 24px auto 0; padding: 18px 16px 28px; border-top: 1px solid var(--night-3); text-align: center; font-size: .88rem; line-height: 1.6; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-bottom: 8px; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 4px 0; }

/* ---------- Lantern Relay ---------- */
.relay-lantern { padding: 12px 16px; border-radius: 16px; background: var(--night-2); margin: 12px 0; display: grid; gap: 8px; }
.relay-lantern.lit { background: linear-gradient(135deg, #5a3b1a, #262b44); border: 2px solid #feae34; }
.rl-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .rl-row span { color: var(--ink-soft); }
.relay-lantern .btn { justify-self: start; }
.relay-feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .9rem; } .relay-feed small { color: var(--muted); }
.relay-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 12px 0; border-radius: 14px; background: linear-gradient(135deg, #12304a, var(--night-2)); border: 2px solid #0099db; color: var(--ink); text-decoration: none; }
.relay-card img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; image-rendering: pixelated; } .relay-card > span:nth-child(2) { flex: 1; display: grid; } .relay-card span span { color: var(--ink-soft); font-size: .9rem; }
.relay-card:hover, .relay-card:focus-visible { border-color: var(--glow); }
.relay-pc .play-art img { object-fit: contain; width: 70%; height: auto; }

.circle-tabs { margin: 0 0 12px; } .circle-tabs .chip { display: inline-flex; align-items: center; gap: 6px; } .circle-tabs img { width: 22px; height: 22px; image-rendering: pixelated; }
.circle-tabs .chip[aria-current] { border-color: var(--cc, var(--glow)); }
.badge-inline { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 .7rem system-ui; }
.invite-note { display: block; text-decoration: none; color: var(--ink); }

/* Pairs for two */
.duo-sec { margin: 20px 0; }
.duo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.duo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--night-3); border-radius: 14px; background: var(--night-2); }
.duo-row .row { margin: 0; }
.duo-who { display: grid; gap: 2px; } .duo-who span { color: var(--ink-soft); font-size: .9rem; }
.duo-form { display: grid; gap: 14px; justify-items: start; }
.duo-form label select { margin-left: 8px; font: 600 1rem system-ui; color: var(--ink); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 10px; padding: 6px 8px; min-height: 40px; }
.duo-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.duo-form .chip { cursor: pointer; position: relative; }
.duo-form .chip input { position: absolute; opacity: 0; pointer-events: none; }
.duo-form .chip:has(input:checked) { background: var(--glow); color: #2a1406; border-color: var(--glow); font-weight: 600; }
.duo-form .chip:has(input:focus-visible) { outline: 2px solid var(--glow); outline-offset: 2px; }
.duo-status { font: 700 1.05rem var(--pix); margin: 4px 0 0; color: var(--ink-soft); }
.duo-status.my-turn { color: var(--glow); }
.duo-last { margin: 0; flex-basis: 100%; }
.pairs-grid.waiting .pair { cursor: default; }
.duo-foot { text-align: center; margin: 10px 0 0; }
.duo-sc img { width: 72px !important; }
.duo-card .play-art img { object-fit: contain; width: 60%; height: auto; }

/* Firefly Gathering */
.ff-wrap { position: relative; margin: 10px 0; border: 3px solid #feae34; border-radius: 18px; overflow: hidden; background: #1b2140; }
.ff-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 600; touch-action: none; cursor: pointer; image-rendering: pixelated; }
.ff-hud { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.ff-hud span { background: rgba(12,14,36,.75); padding: 4px 10px; border-radius: 99px; font: 700 1rem var(--pix); color: var(--ink); }
.ff-hud .ff-jar b { color: #e8ff8c; }
.ff-count { position: absolute; inset: 0; display: grid; place-items: center; font: 700 clamp(3rem, 12vw, 7rem) var(--pix); color: #fff2b0; text-shadow: 0 0 24px rgba(254,174,52,.8); pointer-events: none; }
.ff-count[hidden] { display: none; }
.ff-status { font: 700 1.05rem var(--pix); color: var(--ink-soft); margin: 4px 0 0; }
.ff-jarbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 6px 0 12px; }
.ff-jarbar .progress { flex: 1 1 220px; }
.ff-jarbar .ff-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b6ff6a, #fee761); border-radius: inherit; transition: width .3s; }
.ff-cheers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ff-controls { margin: 0 0 12px; }
.ff-who { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.ff-who li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--night-3); border-radius: 99px; background: var(--night-2); }
.ff-who img { width: 34px; height: 34px; image-rendering: pixelated; }
.ff-who small { color: var(--ink-soft); }
.ff-invite { margin: 0 0 10px; }
.ff-invite select { font: 600 1rem system-ui; color: var(--ink); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 10px; padding: 6px 8px; min-height: 40px; margin: 0 6px; }
.ff-sc img { width: 72px !important; }
.ff-drum { display: block; width: 100%; max-width: 420px; margin: 0 auto 12px; min-height: 64px; font-size: 1.3rem; touch-action: manipulation; }
.ff-drum[hidden] { display: none; }
.ff-controls .chips { margin: 0 0 10px; }
.dt-card .play-art img { object-fit: contain; width: 55%; height: auto; }

/* Field guide */
.guide-new { margin: 16px 0 24px; padding: 14px; border-radius: 16px; border: 2px solid #2ce8f5; background: linear-gradient(135deg, #1f4a5a, var(--night-2)); }
.guide-new h2 { margin-top: 0; }
.guide-chips { margin: 18px 0 4px; } .guide-chips small { opacity: .75; margin-left: 4px; }
.guide-hab { margin: 18px 0; } .guide-hab h2 { margin: 0 0 4px; }
.disc-card { display: block; text-decoration: none; border-radius: 10px; }
a.disc-card:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.disc-missing { opacity: .7; grid-template-columns: 56px minmax(0, 1fr); padding: 8px 12px; } .disc-missing .disc-card { width: 56px; aspect-ratio: 5 / 7; display: grid; place-items: center; border: 2px dashed var(--night-3); border-radius: 8px; }
.disc-missing .disc-card img { width: 80%; } .disc-missing h3 { font-size: .95rem; }

/* Lantern Trail */
.tcard { position: relative; width: 92px; aspect-ratio: 5 / 7; border-radius: 10px; padding: 6px; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center;
  background: linear-gradient(160deg, var(--h2, #5a6988), var(--h1, #3a4466)); border: 3px solid var(--h3, #262b44); color: #fff; font: inherit; box-shadow: 0 3px 0 rgba(0,0,0,.35); flex: 0 0 auto; }
.tcard img { width: 70%; height: auto; image-rendering: pixelated; }
.tcard .tc-n { position: absolute; top: 4px; left: 7px; font: 700 1.25rem var(--pix); text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.tcard .tc-n2 { top: 4px; left: auto; right: 7px; } /* the number in both top corners, clear of the habitat name */
.tcard .tc-h { grid-row: 3; font-size: .62rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; opacity: .9; }
.tcard img, .tcard .tc-icon { grid-row: 2; }
.tc-special .tc-name { grid-row: 1; font: 700 .85rem var(--pix); }
.tc-special .tc-icon { font-size: 2rem; font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; line-height: 1; }
.tc-wild { background: conic-gradient(from 30deg, #e43b44, #feae34, #63c74d, #2ce8f5, #b55088, #e43b44); border-color: #fee761; }
.tc-wild .tc-name, .tc-wild .tc-h { text-shadow: 0 1px 2px #000; }
.tc-back { background: linear-gradient(160deg, #3a2a52, #1f1830); border-color: #feae34; display: grid; place-items: center; cursor: pointer; }
.tc-back .back-mark { font-size: 2rem; color: #feae34; } .tc-back small { position: absolute; bottom: 6px; font-size: .7rem; color: var(--ink-soft); }
.tc-back:disabled { opacity: .5; cursor: default; }
button.tcard { cursor: pointer; transition: transform .15s; }
button.tcard[aria-disabled="true"] { filter: saturate(.55) brightness(.75); }
button.tcard.ok { transform: translateY(-6px); box-shadow: 0 0 0 3px #fee761, 0 8px 16px rgba(254,231,97,.3); }
button.tcard.ok:hover, button.tcard.ok:focus-visible { transform: translateY(-10px); }
.reduce button.tcard { transition: none; }
.trail-rules { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 10px 0 14px; }
.trail-rules li { display: flex; gap: 12px; align-items: center; } .trail-rules .tcard { width: 60px; padding: 3px; } .trail-rules .tc-h { display: none; }
.trail-rules .tc-special .tc-name { font-size: .6rem; } .trail-rules .tc-icon { font-size: 1.3rem; }
.trail-others { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.trail-others li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--night-2); border: 2px solid var(--night-3); }
.trail-others li.turn { border-color: var(--glow); box-shadow: 0 0 12px rgba(254,174,52,.35); }
.trail-others img { width: 40px; height: 40px; image-rendering: pixelated; } .trail-av { font-size: 1.6rem; }
.trail-others small { display: block; color: var(--ink-soft); }
.trail-table { display: flex; justify-content: center; align-items: flex-end; gap: 28px; padding: 16px; border-radius: 18px; background: radial-gradient(ellipse at center, #2b3a2e, #18201a); border: 3px solid #5a4a2a; margin: 0 0 10px; }
.trail-pile, .trail-deck { display: grid; justify-items: center; gap: 6px; }
.trail-top .tcard { width: 118px; }
.trail-hab { margin: 0; padding: 2px 10px; border-radius: 99px; background: var(--h1, #333); border: 1px solid var(--h2, #666); font-size: .85rem; font-weight: 700; }
.trail-say { min-height: 1.5em; font: 700 1.05rem var(--pix); color: var(--ink); text-align: center; }
.trail-tools { justify-content: center; }
.trail-hand { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 4px 6px; justify-content: center; }
.trail-pick { text-align: center; margin: 8px 0; padding: 12px; border-radius: 14px; background: var(--night-2); border: 2px solid var(--glow); }
.trail-pick .chip { background: var(--h1); border-color: var(--h2); color: #fff; }
.trail-card .play-art img, .trail-sc img { object-fit: contain; width: 45%; height: auto; }
@media (max-width: 560px) { .tcard { width: 70px; } .trail-top .tcard { width: 96px; } .tcard .tc-n { font-size: 1rem; } .trail-table { gap: 18px; padding: 12px; } }
