/* PokéKrillion — "illustrated dive log": flat sea, paper cards, ink outlines, hard shadows. */
:root {
  --sea: #59c9ea; --depth: 0; --scroll: 0px;
  --ink: #101a33; --paper: #fff6e0; --paper2: #f3e5bf; --cream: #ffeab8;
  --yellow: #ffcb05; --red: #e8262d; --blue: #3b4cca;
  --t0: #c9c1ab; --t1: #8fb8d8; --t2: #5bc79a; --t3: #8c7ae6; --t4: #ef5b8a; --t5: #ffcb05;
  --font-d: "Grandstander", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-b: "Gabarito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-m: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --line: 3px; --shadow: 6px 6px 0 var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font-family: var(--font-b); font-size: 16px; line-height: 1.45;
  background: var(--sea); overflow-x: hidden;
}
.hidden { display: none !important; }
.muted { opacity: .62; }
.center { text-align: center; }
a { color: inherit; }
button { font-family: inherit; color: inherit; }
.mono, .lbl { font-family: var(--font-m); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 500; }
kbd { font: 500 .7rem var(--font-m); padding: 1px 6px; border-radius: 5px; border: 2px solid currentColor; margin-left: 8px; opacity: .6; }

/* ---------- scene ---------- */
#scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--sea); }
#surface { position: absolute; left: 0; right: 0; top: 0; height: 262px; transform: translateY(calc(var(--scroll) * -1)); will-change: transform; }
#surface .sky { position: absolute; inset: 0 0 24px; background: var(--cream); }
#surface .sun { position: absolute; right: 9%; top: 84px; width: 76px; height: 76px; border-radius: 50%; background: var(--yellow); border: 4px solid var(--ink); box-shadow: 0 0 0 10px rgba(255, 203, 5, .35); }
#surface .cloud { position: absolute; width: 120px; height: 38px; background: #fff; border: 3px solid var(--ink); border-radius: 30px; animation: drift 60s linear infinite alternate; }
#surface .cloud::before, #surface .cloud::after { content: ""; position: absolute; background: #fff; border: 3px solid var(--ink); border-radius: 50%; border-bottom-color: transparent; }
#surface .cloud::before { width: 46px; height: 46px; left: 16px; top: -26px; } #surface .cloud::after { width: 34px; height: 34px; left: 58px; top: -18px; }
#surface .cloud.c1 { left: 6%; top: 104px; } #surface .cloud.c2 { left: 62%; top: 150px; transform: scale(.7); animation-duration: 80s; }
@keyframes drift { to { transform: translateX(60px); } }
.wave { position: absolute; left: 0; right: 0; height: 30px; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M0 15Q15 2 30 15T60 15T90 15T120 15V30H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 30px; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M0 15Q15 2 30 15T60 15T90 15T120 15V30H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 120px 30px; animation: waves 9s linear infinite; }
.wave.back { bottom: 8px; background: #9be6f6; animation-duration: 14s; animation-direction: reverse; }
.wave.front { bottom: -6px; background: var(--sea); }
@keyframes waves { to { -webkit-mask-position-x: 120px; mask-position-x: 120px; } }
#snow { position: absolute; inset: 0; width: 100%; height: 100%; }
#swimmers { position: absolute; inset: 0; }
.swimmer { position: absolute; left: 0; top: var(--y, 40%); width: var(--sz, 120px); opacity: var(--op, .16); filter: var(--flt, brightness(0)); animation: cross var(--dur, 32s) linear forwards; will-change: transform; }
.swimmer.flip img { transform: scaleX(-1); }
@keyframes cross { from { transform: translateX(-20vw); } to { transform: translateX(120vw); } }
.swimmer.rtl { animation-name: crossR; } @keyframes crossR { from { transform: translateX(120vw); } to { transform: translateX(-20vw); } }
.swimmer img { width: 100%; display: block; animation: bobS 4s ease-in-out infinite alternate; }
@keyframes bobS { from { transform: translateY(-8px); } to { transform: translateY(8px); } }

/* ---------- header ---------- */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 18px 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
.plate { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; text-decoration: none; font: 800 1.05rem var(--font-d); }
.brand b { font-weight: 800; color: var(--red); }
.top-right { display: flex; gap: 10px; align-items: center; margin-right: 46px; }
.depth-pill { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; padding: 4px 12px 5px; }
.depth-pill .lbl { grid-column: 1 / -1; font-size: .58rem; opacity: .55; line-height: 1.2; }
.depth-pill #depthNum { font: 800 1.45rem/1 var(--font-d); font-variant-numeric: tabular-nums; text-align: right; min-width: 3.4ch; }
.depth-pill small { font: 500 .8rem var(--font-m); opacity: .6; }
.depth-pill.diving { background: var(--yellow); }
.depth-pill { transition: background .25s; }
.zone-now { font: 500 .66rem var(--font-m); text-transform: uppercase; letter-spacing: .1em; color: var(--paper); background: var(--ink); padding: 5px 10px; border-radius: 99px; }
@media (max-width: 560px) { .zone-now { display: none; } .brand span { display: none; } .brand { padding: 6px; } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font: 800 1.1rem var(--font-d); background: var(--paper); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

/* ---------- depth gauge ---------- */
#gauge { position: fixed; z-index: 15; right: 14px; top: 84px; bottom: 56px; width: 24px; }
.g-track { position: absolute; left: 10px; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: rgba(255,255,255,.4); border: 0; overflow: hidden; }
.g-fill { width: 100%; height: 0%; background: var(--yellow); }
.g-ticks i { position: absolute; left: 3px; width: 18px; height: 3px; margin-top: -1px; background: #fff; border-radius: 2px; opacity: .8; }
.g-ticks i::after { content: attr(data-l); position: absolute; right: 26px; top: -9px; font: 500 .6rem var(--font-m); letter-spacing: .06em; text-transform: uppercase; color: var(--paper); background: var(--ink); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.g-marker { position: absolute; left: -1px; width: 26px; height: 26px; margin-top: -13px; top: 0; }
.g-marker i { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--red) 50%, #fff 50%); position: relative; box-shadow: 2px 2px 0 var(--ink); }
.g-marker i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }

/* ---------- layout ---------- */
main { position: relative; z-index: 10; max-width: 620px; margin: 0 auto; padding: 84px 18px 64px; padding-right: 50px; }
@media (max-width: 520px) { main { padding-left: 14px; padding-right: 44px; } .g-ticks i::after { display: none; } }
.screen { animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.card {
  position: relative; border: var(--line) solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 24px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
footer { position: relative; z-index: 10; text-align: center; font: 500 .66rem var(--font-m); text-transform: uppercase; letter-spacing: .08em; color: #fff; padding: 0 16px 26px; text-shadow: 0 1px 0 rgba(16,26,51,.5); }
footer a { text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  font: 700 1rem var(--font-b); letter-spacing: .005em; padding: 14px 20px; cursor: pointer; border: var(--line) solid var(--ink); border-radius: 14px;
  background: var(--paper); box-shadow: 4px 4px 0 var(--ink); display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible, input:focus-visible, .link:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn.primary { background: var(--yellow); }
.btn.ghost { background: #fff; }
.btn.big { flex-direction: column; gap: 3px; padding: 16px 18px; }
.btn-main { font: 800 1.2rem var(--font-d); }
.btn-sub { font: 500 .64rem var(--font-m); text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.btn.wide { width: 100%; margin-top: 18px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: 2px 2px 0 var(--ink); transform: none; }
.link { background: none; border: 0; font: 500 .72rem var(--font-m); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; display: block; margin: 18px auto 0; text-decoration: underline; text-underline-offset: 4px; opacity: .6; }
.row { display: flex; gap: 12px; margin-top: 16px; } .row .btn { flex: 1; } .row .btn.ghost { flex: .55; }

/* ---------- home ---------- */
.hero { text-align: center; position: relative; padding-top: 6px; }
.wordmark { margin: 0; line-height: .85; }
.w1 { display: block; font: 800 clamp(4.4rem, 20vw, 7rem)/.85 var(--font-d); color: var(--yellow); -webkit-text-stroke: 12px var(--blue); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); transform: rotate(-2deg); }
.w2 { display: inline-block; margin-top: 16px; padding: 5px 16px 5px 22px; font: 500 clamp(1rem, 5vw, 1.35rem) var(--font-m); letter-spacing: .38em; text-transform: uppercase; color: var(--paper); background: var(--ink); transform: rotate(-1.5deg); box-shadow: 4px 4px 0 rgba(16,26,51,.28); }
.tagline { margin: 20px auto 0; max-width: 24ch; font: 700 1.2rem/1.2 var(--font-d); color: var(--ink); }
.sub { width: 150px; height: auto; margin: 6px auto -30px; display: block; position: relative; z-index: 2; }
.sub-body { animation: bob 3.6s ease-in-out infinite; transform-origin: 110px 100px; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2.5deg); } 50% { transform: translateY(9px) rotate(2.5deg); } }
.home-card { padding-top: 48px; }
.home-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
@media (max-width: 460px) { .home-actions { grid-template-columns: 1fr; } }
.steps { list-style: none; display: flex; gap: 12px; padding: 18px 0 0; margin: 22px 0 0; border-top: 2px dashed rgba(16,26,51,.3); }
.steps li { flex: 1; display: flex; gap: 10px; align-items: center; font-size: .78rem; line-height: 1.2; }
.steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 500 .85rem var(--font-m); background: var(--yellow); border: 2.5px solid var(--ink); }
@media (max-width: 460px) { .steps { flex-direction: column; gap: 10px; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper2); }
.stat { text-align: center; padding: 10px 6px 9px; } .stat + .stat { border-left: 2.5px solid var(--ink); }
.stat b { display: block; font: 800 1.55rem/1.1 var(--font-d); } .stat span { font: 500 .58rem var(--font-m); text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.legend .tchip { display: inline-flex; align-items: center; gap: 8px; font: 700 .76rem var(--font-b); padding: 4px 10px 4px 5px; border: 2.5px solid var(--ink); border-radius: 99px; background: #fff; }
.legend .tchip i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--ink); }
.legend .tchip b { font: 500 .7rem var(--font-m); opacity: .55; }

/* ---------- game ---------- */
.progress { display: flex; gap: 6px; margin: 0 0 16px; }
.progress i { flex: 1; height: 14px; border-radius: 5px; border: 2.5px solid var(--ink); background: var(--paper); position: relative; overflow: hidden; box-shadow: 2px 2px 0 rgba(16,26,51,.55); }
.progress i.now { background: #fff; } .progress i.now::after { content: ""; position: absolute; inset: 0; background: var(--yellow); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.progress i.t0 { background: var(--t0); } .progress i.t1 { background: var(--t1); } .progress i.t2 { background: var(--t2); }
.progress i.t3 { background: var(--t3); } .progress i.t4 { background: var(--t4); } .progress i.t5 { background: var(--t5); }
.q-head { display: flex; justify-content: space-between; align-items: center; }
.chip { font: 500 .7rem var(--font-m); letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.timer { position: relative; width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.timer svg { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.tr-bg { stroke: transparent; } .tr-fg { stroke: var(--blue); stroke-linecap: butt; stroke-dasharray: 163.36; stroke-dashoffset: 0; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font: 500 1.2rem var(--font-m); font-variant-numeric: tabular-nums; }
.timer.low { background: #ffe0dc; } .timer.low .tr-fg { stroke: var(--red); } .timer.low b { color: var(--red); animation: tick 1s steps(2) infinite; }
@keyframes tick { 50% { transform: scale(1.12); } }
.q-text { font: 800 clamp(2rem, 8vw, 2.9rem)/1.02 var(--font-d); margin: 22px 0 24px; text-wrap: balance; }
.q-text.in { animation: qin .4s cubic-bezier(.2,.9,.2,1); } @keyframes qin { from { opacity: 0; transform: translateY(10px); } }
#ans { width: 100%; font: 600 1.3rem var(--font-b); padding: 16px 18px; color: var(--ink); background: #fff; border: var(--line) solid var(--ink); border-radius: 14px; box-shadow: inset 0 -4px 0 rgba(16,26,51,.08); transition: box-shadow .15s; caret-color: var(--red); }
#ans::placeholder { color: rgba(16,26,51,.38); font-weight: 500; }
#ans:focus { outline: none; box-shadow: 0 0 0 4px var(--yellow), 0 0 0 7px var(--ink); }
#ans.bad { background: #ffe9e6; }
#ans.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.hint { text-align: center; margin: 16px 0 0; font: 500 .64rem/1.5 var(--font-m); text-transform: uppercase; letter-spacing: .07em; opacity: .55; }
.fb { margin: 14px 0 0; padding: 10px 14px; border: 2.5px solid var(--ink); border-radius: 12px; font-size: .9rem; line-height: 1.35; animation: rise .25s; }
.fb.bad { background: #ffd9d4; box-shadow: inset 6px 0 0 var(--red); padding-left: 20px; } .fb.warn { background: #fff0b8; box-shadow: inset 6px 0 0 var(--yellow); padding-left: 20px; }
.tries { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .tries:empty { display: none; }
.try { font: 500 .72rem var(--font-m); padding: 3px 10px; border-radius: 99px; background: var(--paper2); border: 2px solid rgba(16,26,51,.4); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; opacity: .8; animation: pop2 .25s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop2 { from { transform: scale(.6); opacity: 0; } }

/* reveal */
#reveal { animation: rise .4s cubic-bezier(.2,.8,.2,1); }
.rv-top { display: flex; gap: 18px; align-items: center; }
.rv-art { width: 116px; height: 116px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--rv, var(--t1)); border: var(--line) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); position: relative; }
.rv-art img { width: 128%; height: 128%; max-width: none; object-fit: contain; margin: -14% 0 0; animation: pop .5s cubic-bezier(.2,1.4,.4,1); filter: drop-shadow(0 4px 0 rgba(16,26,51,.18)); }
.rv-art .mono-g { font: 800 3.2rem var(--font-d); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.3) rotate(-14deg); opacity: 0; } }
.rv-main { min-width: 0; }
.rv-typed { font: 500 .66rem var(--font-m); text-transform: uppercase; letter-spacing: .06em; opacity: .55; }
.rv-name { font: 800 clamp(1.7rem, 7vw, 2.2rem)/1 var(--font-d); margin: 2px 0 12px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 14px; border: 3px solid var(--ink); border-radius: 8px; font: 500 .78rem var(--font-m); letter-spacing: .1em; text-transform: uppercase; background: var(--t0); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); animation: stamp .35s cubic-bezier(.3,1.6,.5,1) .12s backwards; }
@keyframes stamp { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } }
.badge.t1 { background: var(--t1); } .badge.t2 { background: var(--t2); } .badge.t3 { background: var(--t3); color: #fff; } .badge.t4 { background: var(--t4); color: #fff; }
.badge.t5 { background: var(--t5); } .badge.t5::before { content: "★ "; } .badge.t5::after { content: " ★"; }
.rv-meters { margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; border-top: 2px dashed rgba(16,26,51,.3); padding-top: 16px; }
.rv-meters span { font: 800 3.4rem/1 var(--font-d); font-variant-numeric: normal; }
.rv-meters small { font: 500 .7rem var(--font-m); text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.rarity { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.rarity i { height: 16px; border: 2.5px solid var(--ink); border-radius: 5px; background: var(--paper); position: relative; }
.rarity i.on { background: var(--c); }
.rarity i.cur::after { content: ""; position: absolute; left: 50%; top: 20px; margin-left: -6px; border: 6px solid transparent; border-bottom: 8px solid var(--ink); border-top: 0; }
.rv-line { margin: 26px 0 10px; font-weight: 600; font-size: 1.02rem; }
.rv-line .muted { display: block; font: 500 .68rem var(--font-m); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.rv-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font: 500 .66rem var(--font-m); text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 6px; background: var(--paper2); border: 2px solid var(--ink); }
.tag[data-type="Fire"]{background:#ff9c54}.tag[data-type="Water"]{background:#6aa7f0}.tag[data-type="Grass"]{background:#78cf6a}.tag[data-type="Electric"]{background:#ffd93a}
.tag[data-type="Ice"]{background:#8fe3e8}.tag[data-type="Fighting"]{background:#d9564d;color:#fff}.tag[data-type="Poison"]{background:#b862c0;color:#fff}.tag[data-type="Ground"]{background:#dcb85d}
.tag[data-type="Flying"]{background:#a9b6ff}.tag[data-type="Psychic"]{background:#ff7aa6}.tag[data-type="Bug"]{background:#aac22b}.tag[data-type="Rock"]{background:#c4ad45}
.tag[data-type="Ghost"]{background:#8670b8;color:#fff}.tag[data-type="Dragon"]{background:#7a5cff;color:#fff}.tag[data-type="Dark"]{background:#6b5646;color:#fff}.tag[data-type="Steel"]{background:#b0b0c8}
.tag[data-type="Fairy"]{background:#f5b0c2}.tag[data-type="Normal"]{background:#c8c8a4}
.rv-dex { font: 500 .88rem/1.45 var(--font-b); font-style: italic; margin: 14px 0 0; padding: 10px 14px; background: var(--paper2); border-left: 5px solid var(--ink); border-radius: 0 10px 10px 0; }

/* ---------- results ---------- */
.res-hero { text-align: center; }
.res-label { display: inline-block; font: 500 .68rem var(--font-m); letter-spacing: .12em; text-transform: uppercase; padding: 5px 12px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.res-depth { font: 800 clamp(4.4rem, 22vw, 6.6rem)/1 var(--font-d); margin: 14px 0 0; font-variant-numeric: normal; }
.res-depth small { font: 500 1.3rem var(--font-m); letter-spacing: 0; margin-left: 6px; opacity: .55; }
.res-zone { display: inline-block; margin-top: 4px; font: 800 1.05rem var(--font-d); padding: 3px 14px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 8px; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); }
.res-creature { height: 132px; margin: 18px 0 8px; display: grid; place-items: center; }
.res-creature img { height: 150px; margin-top: -14px; filter: drop-shadow(0 5px 0 rgba(16,26,51,.2)); animation: pop .7s cubic-bezier(.2,1.4,.4,1), bobS 3s 1s ease-in-out infinite alternate; }
.res-grid { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.sq { width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 8px; background: var(--t0); box-shadow: 2px 2px 0 var(--ink); animation: pop2 .4s cubic-bezier(.2,1.5,.4,1) backwards; animation-delay: calc(var(--i) * 90ms + 300ms); }
.sq.t1 { background: var(--t1); } .sq.t2 { background: var(--t2); } .sq.t3 { background: var(--t3); } .sq.t4 { background: var(--t4); } .sq.t5 { background: var(--t5); }
.res-list { list-style: none; padding: 0; margin: 20px 0 6px; border-top: 3px solid var(--ink); }
.res-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 2px dashed rgba(16,26,51,.3); animation: rise .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i) * 70ms + 400ms); }
.res-list .th { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); background: var(--c, var(--t0)); display: grid; place-items: center; overflow: hidden; font: 800 1.2rem var(--font-d); }
.res-list .th img { width: 130%; height: 130%; max-width: none; object-fit: contain; image-rendering: pixelated; }
.res-list .q { font: 500 .6rem/1.3 var(--font-m); text-transform: uppercase; letter-spacing: .03em; opacity: .55; }
.res-list .a { font: 800 1.1rem/1.15 var(--font-d); overflow-wrap: anywhere; margin: 1px 0; }
.res-list .miss { font-size: .78rem; opacity: .6; } .res-list .miss::before { content: "Deep cuts: "; font: 500 .62rem var(--font-m); text-transform: uppercase; letter-spacing: .06em; }
.res-list .pts { text-align: right; font: 500 1.05rem var(--font-m); font-variant-numeric: tabular-nums; }
.res-list .pts span { display: block; max-width: 86px; margin-left: auto; line-height: 1.25; font: 500 .56rem var(--font-m); text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; margin-top: 3px; border-radius: 4px; background: var(--c, var(--t0)); border: 1.5px solid var(--ink); }
.tries-n { font: 500 .56rem var(--font-m); text-transform: uppercase; letter-spacing: .06em; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--paper2); border: 1.5px solid var(--ink); vertical-align: middle; }

/* ---------- toast & modal ---------- */
.toast { position: fixed; z-index: 40; left: 50%; bottom: 26px; transform: translateX(-50%) rotate(-1.2deg); display: flex; gap: 12px; align-items: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); padding: 8px 20px 8px 10px; max-width: calc(100vw - 32px); animation: toastIn .45s cubic-bezier(.2,1.3,.3,1); }
.toast > div { white-space: nowrap; } .toast img { width: 58px; height: 58px; object-fit: contain; } .toast small { display: block; font: 500 .6rem var(--font-m); text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.toast b { font: 800 1.2rem var(--font-d); }
@keyframes toastIn { from { transform: translate(-50%, 40px) rotate(3deg); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(16, 26, 51, .6); display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; max-width: 520px; max-height: 90vh; overflow: auto; padding: 28px; line-height: 1.5; font-size: .95rem; animation: rise .3s; background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); }
.modal-card h3 { font: 800 1.9rem var(--font-d); margin: 0 0 8px; } .modal-card h4 { font: 800 1.1rem var(--font-d); margin: 20px 0 4px; }
.modal-card .close { position: absolute; right: 14px; top: 14px; }
#fx { position: fixed; inset: 0; z-index: 35; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .swimmer { display: none; }
}

/* save / restore */
.save-row { margin-top: 10px; } .save-row .btn { flex: none; padding: 10px 16px; font-size: .9rem; }
.save-row:first-of-type .btn { flex: 1; }
#codeBox { flex: 1; min-width: 0; font: 500 .8rem var(--font-m); padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
#codeMsg { min-height: 1.3em; margin: 8px 0 0; font-size: .85rem; }
