/* Hintle by Mintward. Keycap tiles on spruce felt. Brand tokens: spruce #072018, bone #f7f5ee, mint #77ebbe, verdigris #136a55. */
@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/SchibstedGrotesk-var.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/IBMPlexSans-var.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --spruce: #072018; --spruce-2: #0c2a20; --spruce-3: #12372b; --bone: #f7f5ee; --bone-edge: #b9b6a6;
  --mint: #77ebbe; --mint-edge: #2f9e74; --verdigris: #136a55; --fog: #9aa8a3; --line: rgba(247, 245, 238, 0.1);
  --amber: #f2b84b; --amber-edge: #b9822a; --coral: #e8614a; --coral-edge: #a83f2d; --slate: #44594f; --slate-edge: #2c3d36;
  --surface: linear-gradient(180deg, rgba(247, 245, 238, 0.055), rgba(247, 245, 238, 0.025));
  --display: "Schibsted Grotesk", ui-sans-serif, sans-serif;
  --body: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--spruce); }
body { margin: 0; color: var(--bone); font: 400 16px/1.5 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 8px; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 750; }
p { margin: 0 0 10px; }
a { color: var(--mint); }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--fog); }
.small { font-size: 0.86rem; }
.pad { padding: 10px 14px; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* felt: soft mint light from above, a faint tile grid */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 70% -8%, rgba(119, 235, 190, 0.15), transparent 62%), radial-gradient(700px 520px at -5% 105%, rgba(19, 106, 85, 0.42), transparent 64%), var(--spruce); }
.backdrop::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(247, 245, 238, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(247, 245, 238, 0.035) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 75%); }

#app { max-width: 520px; margin: 0 auto; padding: 10px 16px 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; }
.land { display: none; }

/* ---------- header */
.top { display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--bone); text-decoration: none; }
.logo svg { display: block; border-radius: 7px; }
.name { font: 800 1.36rem/1 var(--display); letter-spacing: -0.03em; }
.top .by { height: 13px; width: auto; color: var(--fog); margin-top: 4px; }
.spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: rgba(247, 245, 238, 0.05); cursor: pointer; transition: background 0.15s, transform 0.15s; }
.icon-btn:hover { background: rgba(247, 245, 238, 0.11); }
.icon-btn:active { transform: scale(0.94); }
.ic { display: inline-grid; place-items: center; }
.ic svg { display: block; }
.chip { display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  color: var(--amber); background: rgba(242, 184, 75, 0.12); border: 1px solid rgba(242, 184, 75, 0.3); }
.chip.bump { animation: bump 0.9s var(--pop) 0.9s both; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35) rotate(-6deg); box-shadow: 0 0 0 8px rgba(242, 184, 75, 0.16); } 100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; } }

/* ---------- keycap tiles */
.t { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 6px; position: relative; color: var(--spruce);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.26), 0 1px 0 rgba(0, 0, 0, 0.3); }
.t.correct { background: var(--mint); }
.t.close { background: var(--amber); }
.t.wrong { background: var(--coral); }
.t.skip { background: var(--slate); color: var(--bone); }
.t.empty { background: transparent; box-shadow: inset 0 0 0 2px rgba(247, 245, 238, 0.13); }
.meter { display: flex; gap: 5px; }
.meter.lg { gap: 8px; }
.meter.lg .t { width: 42px; height: 42px; border-radius: 10px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.24), 0 2px 0 rgba(0, 0, 0, 0.3); }
.meter.lg .t.empty { box-shadow: inset 0 0 0 2px rgba(247, 245, 238, 0.12); }
.t.flip { animation: flip 0.5s var(--ease) both; }
.meter.stagger .t { animation: drop 0.5s var(--pop) both; }
.meter.stagger .t:nth-child(2) { animation-delay: 0.07s; } .meter.stagger .t:nth-child(3) { animation-delay: 0.14s; }
.meter.stagger .t:nth-child(4) { animation-delay: 0.21s; } .meter.stagger .t:nth-child(5) { animation-delay: 0.28s; } .meter.stagger .t:nth-child(6) { animation-delay: 0.35s; }
@keyframes flip { 0% { transform: rotateX(90deg); filter: brightness(1.6); } 100% { transform: none; } }
@keyframes drop { 0% { transform: translateY(-14px) scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* feedback glyphs on guess tiles */
.guess .t::after, .legend .t::after { position: absolute; inset: 0; display: grid; place-items: center; font: 700 13px/1 var(--mono); padding-bottom: 2px; }
.guess .t.correct::after { content: "✓"; } .guess .t.close::after { content: "≈"; } .guess .t.wrong::after { content: "×"; font-size: 16px; } .guess .t.skip::after { content: "»"; }

/* ---------- puzzle head */
.puzzle-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.pz { margin: 0; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mint); }
.day { margin: 0; font: 800 1.4rem/1.1 var(--display); letter-spacing: -0.02em; }

/* ---------- hint trail */
.trail { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; perspective: 900px; }
.hint { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 13px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transform-origin: 50% 0; position: relative; overflow: hidden; }
.hint .hn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--bone); color: var(--spruce); font-size: 0.82rem; font-weight: 600; box-shadow: inset 0 -3px 0 var(--bone-edge); }
.hb p { margin: 0; font-size: 1.02rem; line-height: 1.45; }
.hint.latest { border-color: rgba(119, 235, 190, 0.55); background: linear-gradient(180deg, rgba(119, 235, 190, 0.1), rgba(119, 235, 190, 0.03)); box-shadow: 0 10px 34px -18px rgba(119, 235, 190, 0.6); }
.hint.latest .hn { background: var(--mint); box-shadow: inset 0 -3px 0 var(--mint-edge); }
.hb .kind { display: inline-block; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mint); background: rgba(119, 235, 190, 0.1); border: 1px solid rgba(119, 235, 190, 0.25); padding: 2px 8px; border-radius: 999px; margin-bottom: 6px !important; }
.hint.fresh { animation: reveal 0.62s var(--ease) 0.42s both; }
.hint.fresh::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(247, 245, 238, 0.16) 50%, transparent 70%); transform: translateX(-110%); animation: shine 0.9s var(--ease) 0.95s both; pointer-events: none; }
@keyframes reveal { 0% { transform: rotateX(-82deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes shine { to { transform: translateX(110%); } }
.trail.intro > li:not(:first-child) { animation: rise 0.45s var(--ease) both; }
.trail.intro > li:nth-child(2) { animation-delay: 0.04s; } .trail.intro > li:nth-child(3) { animation-delay: 0.08s; } .trail.intro > li:nth-child(4) { animation-delay: 0.12s; }
.trail.intro > li:nth-child(5) { animation-delay: 0.16s; } .trail.intro > li:nth-child(n + 6) { animation-delay: 0.2s; }
@keyframes rise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }

.guess { display: flex; align-items: center; gap: 10px; padding: 2px 6px 2px 14px; font-size: 0.95rem; min-height: 30px; }
.guess b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess .note { margin-left: auto; color: var(--fog); font-size: 0.8rem; text-align: right; }
.guess.close .note { color: var(--amber); }
.guess.fresh { animation: slide 0.36s var(--ease) both; }
.guess.fresh .t { animation: flip 0.5s var(--ease) 0.08s both; }
.guess.wrong.fresh { animation: slide 0.36s var(--ease) both, shake 0.42s ease 0.42s; }
.guess.close.fresh .t { animation: flip 0.5s var(--ease) 0.08s both, ring 0.9s ease-out 0.5s; }
@keyframes slide { 0% { transform: translateX(-12px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(242, 184, 75, 0.6); } 100% { box-shadow: 0 0 0 12px rgba(242, 184, 75, 0); } }

/* face-down cards still to come */
.hint.locked { padding: 9px 14px; background: transparent; border: 1px dashed rgba(247, 245, 238, 0.13); align-items: center; }
.hint.locked .hn { width: 28px; height: 28px; font-size: 0.74rem; background: rgba(247, 245, 238, 0.07); color: var(--fog); box-shadow: none; margin-left: 3px; }
.hint.locked p { margin: 0; }
.bars { display: grid; gap: 6px; }
.bars i { display: block; height: 7px; border-radius: 4px; width: 72%; background: repeating-linear-gradient(90deg, rgba(247, 245, 238, 0.08) 0 10px, rgba(247, 245, 238, 0.05) 10px 14px); }
.bars i + i { width: 44%; }
.hint.locked + .hint.locked + .hint.locked { opacity: 0.8; } .hint.locked + .hint.locked + .hint.locked + .hint.locked { opacity: 0.62; }

/* ---------- guess dock */
.play { flex: 1; display: flex; flex-direction: column; }
.dock { position: sticky; bottom: 0; z-index: 5; margin: auto -16px 0; padding: 18px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(7, 32, 24, 0), rgba(7, 32, 24, 0.9) 34%); }
.field { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 14px; border-radius: 16px; background: #0d2c22; border: 1.5px solid rgba(247, 245, 238, 0.16); transition: border-color 0.15s, box-shadow 0.15s; }
.field:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(119, 235, 190, 0.16); }
.field .ic { color: var(--fog); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--bone); font: 500 1.02rem var(--body); }
.field input::placeholder { color: rgba(154, 168, 163, 0.8); }
.suggest { position: absolute; left: 0; right: 0; bottom: calc(100% - 8px); display: none; max-height: 290px; overflow: auto; padding: 6px; border-radius: 16px;
  background: #0f3026; border: 1px solid rgba(247, 245, 238, 0.14); box-shadow: 0 -18px 40px -16px rgba(0, 0, 0, 0.7); animation: rise 0.18s var(--ease) both; }
.suggest.open { display: grid; gap: 2px; }
.opt { display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 11px 12px; border: 0; border-radius: 11px; background: none; cursor: pointer; }
.opt .muted { margin-left: auto; }
.opt:hover, .opt.on, .opt:focus-visible { background: rgba(119, 235, 190, 0.13); outline: 0; box-shadow: inset 3px 0 0 var(--mint); }
.row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1rem var(--body); border-radius: 15px; padding: 0 20px; height: 52px; border: 0; cursor: pointer; text-decoration: none; transition: transform 0.1s, box-shadow 0.1s, background 0.15s; }
.btn.primary { width: 100%; background: var(--mint); color: var(--spruce); box-shadow: inset 0 -4px 0 var(--mint-edge), 0 10px 30px -14px rgba(119, 235, 190, 0.8); }
.btn.primary:hover { background: #8ff2cb; }
.btn.primary:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--mint-edge); }
.btn.ghost { background: rgba(247, 245, 238, 0.04); color: var(--bone); box-shadow: inset 0 0 0 1.5px rgba(247, 245, 238, 0.25); }
.btn.ghost:hover { background: rgba(247, 245, 238, 0.1); }
.btn.skip { height: 36px; padding: 0 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 600; background: rgba(247, 245, 238, 0.06); box-shadow: inset 0 0 0 1px rgba(247, 245, 238, 0.18); }
.btn.skip:hover { background: rgba(247, 245, 238, 0.12); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, .icon-btn:focus-visible, .pill:focus-visible, summary:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- result */
.result { padding: 4px 0 6px; text-align: center; }
.kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--mint); margin: 2px 0 12px; }
.result.loss .kicker { color: var(--amber); }
.answer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 0 auto 14px; perspective: 700px; }
.word { display: flex; gap: 5px; }
.lt { width: var(--s, 40px); height: calc(var(--s, 40px) * 1.12); display: grid; place-items: center; border-radius: calc(var(--s, 40px) * 0.22);
  font: 800 calc(var(--s, 40px) * 0.56) / 1 var(--display); text-transform: uppercase; padding-bottom: calc(var(--s, 40px) * 0.06); }
.answer.win .lt { background: var(--mint); color: var(--spruce); box-shadow: inset 0 -4px 0 var(--mint-edge), 0 2px 0 rgba(0, 0, 0, 0.3); }
.answer.loss .lt { background: var(--bone); color: var(--spruce); box-shadow: inset 0 -4px 0 var(--bone-edge), 0 2px 0 rgba(0, 0, 0, 0.3); }
.answer.fresh .lt { animation: letter 0.55s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes letter { 0% { transform: rotateX(90deg); background: var(--spruce-3); color: transparent; } 55% { transform: rotateX(-12deg); } 100% { transform: none; } }
.answer.win.fresh .word { animation: hop 0.5s var(--pop) both; animation-delay: calc(var(--n, 8) * 70ms + 0.3s); }
@keyframes hop { 50% { transform: translateY(-6px); } }
.fact { color: var(--fog); font-size: 0.95rem; max-width: 34em; margin: 0 auto 16px; }
.scorecard { margin: 0 0 12px; padding: 16px; border-radius: 20px; text-align: left; background: linear-gradient(160deg, #10392c, #0a271e 70%); border: 1px solid rgba(119, 235, 190, 0.2); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8); }
.sc-top { display: flex; justify-content: space-between; align-items: center; }
.flame { display: inline-flex; align-items: center; gap: 3px; color: var(--amber); font-weight: 600; }
.score { margin: 2px 0 10px; font: 800 4.2rem/1 var(--display); letter-spacing: -0.04em; }
.score small { font-size: 1.6rem; color: var(--fog); letter-spacing: 0; margin-left: 4px; }
.result.fresh .score { animation: pop 0.6s var(--pop) 0.5s both; }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
.scorecard .small { margin: 12px 0 0; }
.btn.share { margin-bottom: 14px; }
.next { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 6px; text-align: left; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: rgba(247, 245, 238, 0.1); }
.ring .arc { stroke: var(--mint); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.nl { display: grid; line-height: 1.2; }
.digits { font-size: 1.35rem; font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

/* tile confetti */
.burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 3px; opacity: 0; animation: fly 1.5s cubic-bezier(0.15, 0.7, 0.3, 1) var(--d) forwards; }
.burst i.mint { background: var(--mint); } .burst i.bone { background: var(--bone); } .burst i.amber { background: var(--amber); } .burst i.verd { background: #2bb48a; }
@keyframes fly {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  55% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1.15), calc(var(--dy) + 170px)) rotate(calc(var(--rot) * 1.6)) scale(0.8); opacity: 0; }
}

/* ---------- cards */
.card { border-radius: 18px; padding: 16px; margin-top: 12px; background: var(--surface); border: 1px solid var(--line); }
.card h3 { margin-bottom: 6px; }
.card.quiet { background: rgba(119, 235, 190, 0.07); border-color: rgba(119, 235, 190, 0.18); }
.card.keep { border-color: rgba(119, 235, 190, 0.3); }
.card .btn.primary { margin-top: 6px; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 8px 0 14px; }
.stat { display: grid; text-align: center; padding: 8px 2px; border-radius: 12px; background: rgba(247, 245, 238, 0.04); }
.stat b { font: 800 1.5rem/1.1 var(--display); }
.dist { display: grid; gap: 5px; }
.drow { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; }
.lane { display: block; }
.bar { display: block; height: 22px; line-height: 22px; background: rgba(247, 245, 238, 0.1); font: 600 0.75rem/22px var(--mono); text-align: right; padding: 0 8px; border-radius: 6px; min-width: 26px; transition: width 0.8s var(--ease); }
.bar.mine { background: var(--mint); color: var(--spruce); box-shadow: inset 0 -3px 0 var(--mint-edge); }
.recap { margin: 12px 0 18px; border-radius: 16px; border: 1px solid var(--line); }
.recap summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 0.92rem; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.recap summary::-webkit-details-marker { display: none; }
.recap summary::after { content: "+"; font: 600 1.1rem/1 var(--mono); color: var(--mint); }
.recap[open] summary::after { content: "−"; }
.recap .trail { padding: 0 10px 10px; }

/* ---------- sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(3, 13, 10, 0.68); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 0.2s ease both; }
.sheet { width: min(520px, 100%); max-height: 90dvh; overflow: auto; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #0b281f; border: 1px solid rgba(247, 245, 238, 0.12); border-bottom: 0; animation: up 0.34s var(--ease) both; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-top h2 { margin: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.help .lead { font-size: 1.02rem; }
.how { list-style: none; counter-reset: s; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.how li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.how li::before { content: counter(s); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--bone); color: var(--spruce); font: 600 0.82rem var(--mono); box-shadow: inset 0 -3px 0 var(--bone-edge); }
.how li b { font-weight: 650; }
.eg { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mint); margin: 4px 0 6px; }
.legend { list-style: none; padding: 10px 0; margin: 0 0 14px; display: grid; gap: 6px; border-radius: 14px; background: rgba(247, 245, 238, 0.04); }
.legend .guess { animation: slide 0.4s var(--ease) both; }
.legend .guess:nth-child(2) { animation-delay: 0.12s; } .legend .guess:nth-child(3) { animation-delay: 0.24s; } .legend .guess:nth-child(4) { animation-delay: 0.36s; }
.help .btn.primary { margin-top: 4px; }
.pills { display: flex; gap: 6px; margin-bottom: 12px; }
.pill { font: 600 0.88rem var(--body); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fog); cursor: pointer; }
.pill.on { background: var(--bone); color: var(--spruce); border-color: var(--bone); }
.rank { list-style: none; padding: 0; margin: 0 0 12px; }
.rank li { display: grid; grid-template-columns: 28px 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.rank li.me { background: rgba(119, 235, 190, 0.08); border-radius: 10px; }
.rank .pos { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-size: 0.8rem; color: var(--fog); }
.rank li.top .pos { color: var(--spruce); font-weight: 600; }
.rank li.p1 .pos { background: var(--mint); box-shadow: inset 0 -3px 0 var(--mint-edge); }
.rank li.p2 .pos { background: var(--bone); box-shadow: inset 0 -3px 0 var(--bone-edge); }
.rank li.p3 .pos { background: var(--amber); box-shadow: inset 0 -3px 0 var(--amber-edge); }
.rank .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfp { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--spruce-3); display: grid; place-items: center; font: 600 0.85rem var(--body); color: var(--fog); }
.empty-board { display: grid; justify-items: center; gap: 10px; padding: 22px 0 10px; text-align: center; }

.notice { padding: 10px 12px; border-radius: 12px; background: rgba(247, 245, 238, 0.05); font-size: 0.9rem; }
.notice.error { box-shadow: inset 3px 0 0 var(--coral); }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--bone); color: var(--spruce); font-weight: 600; padding: 11px 18px; border-radius: 12px; font-size: 0.92rem; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7); animation: toast 0.3s var(--pop) both; }
@keyframes toast { from { transform: translate(-50%, 14px); opacity: 0; } }

.foot { max-width: 520px; margin: 0 auto; padding: 14px 16px 22px; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; font-size: 0.78rem; color: var(--fog); }
.home .foot { display: none; }

/* ---------- share page */
.share-app { min-height: 0; }
.share-hero { display: grid; justify-items: center; text-align: center; padding: 18px 0 10px; }
.big-score { margin: 6px 0 12px; font: 800 6.5rem/0.9 var(--display); letter-spacing: -0.05em; color: var(--mint); }
.share-hero .meter { margin-bottom: 22px; }
.share-hero h1 { font-size: 1.45rem; }
.share-hero .lede { color: var(--fog); max-width: 30em; }
.share-hero .btn { margin: 10px 0 26px; }

/* ---------- desktop: landing beside the game (never inside the mini app) */
@media (min-width: 980px) {
  html:not(.mini) .stage { max-width: 1240px; margin: 0 auto; min-height: 100vh; padding: 40px 48px; display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 72px; align-items: center; }
  html:not(.mini) .land { display: block; }
  html:not(.mini) .device { position: relative; height: min(880px, calc(100vh - 80px)); overflow: auto; border-radius: 38px; background: var(--spruce); border: 1px solid rgba(247, 245, 238, 0.14);
    box-shadow: 0 0 0 10px rgba(247, 245, 238, 0.035), 0 50px 120px -40px rgba(0, 0, 0, 0.85), 0 0 120px -40px rgba(119, 235, 190, 0.35); scrollbar-width: thin; scrollbar-color: rgba(247, 245, 238, 0.15) transparent; }
  html:not(.mini) .device #app { min-height: 100%; padding: 18px 20px 0; }
  html:not(.mini) .home .foot { display: flex; max-width: 1240px; padding: 0 48px 28px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 24px; border-bottom: 1px solid rgba(247, 245, 238, 0.12); }
}
.land h1 { font-size: clamp(3.4rem, 5.6vw, 5.6rem); font-weight: 800; line-height: 0.94; letter-spacing: -0.045em; margin: 0 0 22px; }
.land .hl { color: var(--mint); }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mint); margin: 0 0 16px; }
.land .lede { font-size: 1.15rem; color: #c9d1cd; max-width: 31em; margin-bottom: 28px; }
.wordtiles { display: flex; gap: 8px; margin-bottom: 30px; perspective: 800px; }
.wt { width: 56px; height: 62px; display: grid; place-items: center; border-radius: 13px; font: 800 2rem/1 var(--display); color: var(--spruce); padding-bottom: 4px;
  background: var(--bone); box-shadow: inset 0 -5px 0 var(--bone-edge), 0 3px 0 rgba(0, 0, 0, 0.35); animation: letter 0.6s var(--ease) both; }
.wt.w0 { animation-delay: 0.1s; background: var(--coral); box-shadow: inset 0 -5px 0 var(--coral-edge), 0 3px 0 rgba(0, 0, 0, 0.35); }
.wt.w1 { animation-delay: 0.2s; background: var(--amber); box-shadow: inset 0 -5px 0 var(--amber-edge), 0 3px 0 rgba(0, 0, 0, 0.35); }
.wt.w2 { animation-delay: 0.3s; background: var(--slate); color: var(--bone); box-shadow: inset 0 -5px 0 var(--slate-edge), 0 3px 0 rgba(0, 0, 0, 0.35); }
.wt.w3 { animation-delay: 0.4s; background: var(--amber); box-shadow: inset 0 -5px 0 var(--amber-edge), 0 3px 0 rgba(0, 0, 0, 0.35); }
.wt.w4, .wt.w5 { background: var(--mint); box-shadow: inset 0 -5px 0 var(--mint-edge), 0 3px 0 rgba(0, 0, 0, 0.35); }
.wt.w4 { animation-delay: 0.5s; } .wt.w5 { animation: letter 0.6s var(--ease) 0.6s both, hop 0.6s var(--pop) 1.4s both; }
.steps { list-style: none; padding: 0; margin: 0 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 640px; }
.steps li { display: grid; gap: 4px; align-content: start; font-size: 0.92rem; color: var(--fog); }
.steps b { color: var(--bone); font: 750 1.02rem var(--display); margin-top: 8px; }
.steps .t { width: 30px; height: 30px; border-radius: 8px; }
.steps .s1 { background: var(--bone); } .steps .s2 { background: var(--amber); } .steps .s3 { background: var(--mint); }
.cta { display: flex; gap: 12px; margin-bottom: 34px; }
.cta .btn.primary { width: auto; padding: 0 26px; }
.casts { display: flex; gap: 14px; margin-bottom: 26px; }
.cast { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #0d2c23; border: 1px solid var(--line); font-size: 0.82rem; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8); animation: float 6s ease-in-out infinite; }
.cast b { font: 600 0.8rem var(--mono); }
.cast.c1 { transform: rotate(-3deg); } .cast.c2 { animation-delay: -2s; transform: rotate(2deg); } .cast.c3 { animation-delay: -4s; transform: rotate(-1deg); }
@keyframes float { 50% { translate: 0 -8px; } }
.cast .gr { display: flex; gap: 4px; }
.cast .gr i { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.cast .gr .w { background: var(--coral); } .cast .gr .c { background: var(--amber); } .cast .gr .s { background: var(--slate); } .cast .gr .g { background: var(--mint); }
.fine { font-size: 0.85rem; color: var(--fog); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .burst, .hint.fresh::after { display: none; }
}
