@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.ttf") format("truetype"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
/* Unbasic: mobile-first styles. Dark cave by default, light "daylight quarry" via theme. */
:root {
  --brand: #35197a;
  --bg: var(--brand); --bg2: var(--brand); --card: color-mix(in srgb, #fff 9%, var(--brand)); --card2: color-mix(in srgb, #fff 16%, var(--brand));
  --ink: #fbf8f1; --ink2: color-mix(in srgb, #fff 76%, var(--brand)); --ink3: color-mix(in srgb, #fff 62%, var(--brand));
  --line: rgba(255,255,255,.17); --accent: #ffd166; --accent2: #ff8fd0; --gold: #ffcf4a; --gold2: #ff9a1f;
  --good: #3ddc97; --bad: #ff7186; --warn: #ffb23e;
  --t0: #cdbfae; --t1: #3ddc97; --t2: #5cb0ff; --t3: #d49cff; --t4: #ffcf4a; --miss: #7c6fa8;
  --sheet: color-mix(in srgb, #fff 11%, var(--brand)); --overlay: rgba(8,3,24,.88); --toggle: var(--gold); --toggleknob: #35197a; --shadow: 0 10px 30px rgba(10,0,40,.4); --btn-ink: #2a1500; --glowA: rgba(255,209,102,.25);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6efe2; --bg2: #efe4d0; --card: #fffaf0; --card2: #fff3dc; --ink: #2b1f40; --ink2: #6a5b86; --ink3: #8f82a8;
  --line: rgba(43,31,64,.12); --accent: #6a47ff; --accent2: #e0489c; --gold: #f2b01e; --gold2: #e57f00;
  --t0: #9c8a74; --t1: #17b574; --t2: #2f86e8; --t3: #9a47e8; --t4: #e69a00; --miss: #b5aac8;
  --sheet: #fffaf0; --overlay: rgba(43,31,64,.5); --toggle: #2b1f40; --toggleknob: #fffaf0; --t0: #7d6b55; --t1: #0b7f55; --t2: #1f6fd0; --t3: #7d34c4; --t4: #b36b00; --shadow: 0 10px 26px rgba(80,50,10,.16); --glowA: rgba(106,71,255,.2); color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; color: var(--ink); font-family: var(--font); }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 10px; }

.bg { position: fixed; inset: 0; z-index: -2; background: var(--bg); }

#app { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.screen { flex: 1; display: flex; flex-direction: column; animation: screenIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- shared bits */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; }
.btn { border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 800; font-size: 17px; letter-spacing: .2px; transition: transform .12s, filter .12s; }
.btn:active { transform: translateY(2px) scale(.985); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: 0 3px 0 rgba(10,0,40,.35); }
.btn.primary:active { box-shadow: 0 4px 10px rgba(10,0,40,.3); }
.btn.ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: none; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.iconbtn { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.iconbtn svg { width: 20px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink2); }
.chip.fire { color: var(--gold); }
h1, h2, h3 { margin: 0; }

/* ---------- home */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { text-align: center; margin: 14px 0 6px; }
.brand .logo { filter: drop-shadow(0 10px 22px rgba(255,122,198,.35)); animation: floaty 4s ease-in-out infinite; display: inline-block; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(2deg); } }
.wordmark { font-size: 54px; line-height: 1; font-weight: 900; letter-spacing: -1.5px; margin-top: 4px;
  background: linear-gradient(95deg, var(--gold), var(--accent2) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin-top: 6px; color: var(--ink2); font-size: 17px; font-style: italic; }
.ladder { display: flex; justify-content: space-between; gap: 4px; margin: 18px 0 8px; padding: 12px 10px; }
.ladder .step { flex: 1; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink2); }
.ladder .step svg { display: block; margin: 0 auto 4px; width: 38px; height: 38px; }
.ladder .step b { display: block; font-size: 15px; }
.today { margin-top: 10px; text-align: center; }
.today .num { font-weight: 900; font-size: 20px; }
.today .date { color: var(--ink2); font-size: 14px; }
.pips { display: flex; gap: 6px; justify-content: center; margin: 12px 0 14px; }
.pip { width: 26px; height: 8px; border-radius: 6px; background: var(--line); transition: background .3s, transform .3s; }
.pip.on { background: var(--c, var(--miss)); box-shadow: 0 0 10px var(--c, transparent); }
.pip.now { background: var(--ink2); animation: pulsebar 1.2s infinite; }
@keyframes pulsebar { 50% { opacity: .4; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.grid2 .btn { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; padding: 13px 10px; }
.foot { margin-top: auto; padding-top: 18px; text-align: center; color: var(--ink3); font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--miss); margin-right: 6px; }
.dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.wait { background: var(--warn); animation: pulsebar 1s infinite; }

/* ---------- game */
.gtop { display: flex; align-items: center; gap: 10px; }
.gtop .mid { flex: 1; text-align: center; }
.gtop .count { font-weight: 800; font-size: 14px; color: var(--ink2); }
.score-badge { min-width: 62px; text-align: right; font-weight: 900; font-size: 20px; }
.score-badge small { display: block; font-size: 10px; letter-spacing: 1px; color: var(--ink3); text-transform: uppercase; font-weight: 800; }
.prompt-card { margin-top: 10px; padding: 18px 16px 22px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--card2), var(--card)); }
.prompt-card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 80%; background: radial-gradient(closest-side, var(--glowA), transparent); pointer-events: none; }
.lane { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--accent2); }
.prompt { font-size: clamp(25px, 7.4vw, 34px); line-height: 1.15; font-weight: 900; margin: 10px 4px 0; text-wrap: balance; position: relative; }
.timer-wrap { display: grid; place-items: center; margin: 14px 0 6px; }
.timer { position: relative; width: 108px; height: 108px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.timer .track { fill: none; stroke: var(--line); stroke-width: 9; }
.timer .prog { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke .3s; filter: drop-shadow(0 0 6px var(--accent)); }
.timer .tnum { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.warn .prog { stroke: var(--warn); filter: drop-shadow(0 0 6px var(--warn)); }
.timer.danger .prog { stroke: var(--bad); filter: drop-shadow(0 0 9px var(--bad)); }
.timer.danger { animation: timerpulse 1s infinite; }
.timer.danger .tnum { color: var(--bad); }
@keyframes timerpulse { 0%, 100% { transform: scale(1); } 8% { transform: scale(1.09); } 20% { transform: scale(1); } }
.timer.relaxed .prog { stroke: var(--good); }
.timer.paused .prog { stroke: var(--gold); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(255,40,70,.4)); transition: opacity .4s; }
.vignette.on { opacity: 1; animation: vig 1s infinite; }
@keyframes vig { 50% { opacity: .55; } }
.answer-form { display: flex; gap: 8px; margin-top: 8px; }
.answer-form input { flex: 1; min-width: 0; font: inherit; font-size: 20px; font-weight: 700; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.answer-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glowA); }
.answer-form input::placeholder { color: var(--ink3); font-weight: 600; }
.answer-form .btn { padding: 0 20px; }
.msg { min-height: 22px; margin-top: 8px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink2); }
.msg.err { color: var(--bad); }
.strikes { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.strike { width: 22px; height: 22px; opacity: .9; transition: transform .3s, opacity .3s, filter .3s; }
.strike.used { opacity: .25; filter: grayscale(1); transform: scale(.8) rotate(-20deg); }
.skip { background: none; border: 0; color: var(--ink3); font-weight: 700; font-size: 13px; text-decoration: underline; margin: 10px auto 0; padding: 8px; }
.shake { animation: shake .35s; } @keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.digging { display: none; align-items: center; justify-content: center; gap: 10px; padding: 14px; font-weight: 800; color: var(--gold); }
.digging.on { display: flex; }
.digging .pick { width: 30px; height: 30px; transform-origin: 80% 85%; animation: swing .42s ease-in-out infinite; }
@keyframes swing { 0% { transform: rotate(-35deg); } 55% { transform: rotate(25deg); } 100% { transform: rotate(-35deg); } }
.digging .dots::after { content: ""; animation: dots 1.2s steps(4) infinite; } @keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- reveal overlay */
.reveal { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 18px max(20px, env(safe-area-inset-bottom)); overflow-y: auto;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tc, var(--accent)) 28%, transparent), transparent 62%), color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(6px); animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.reveal-inner { width: 100%; max-width: 480px; text-align: center; }
.stage { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.stage .half, .stage .gemwrap, .stage .ring { position: absolute; inset: 0; }
.half { filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.half.l { clip-path: polygon(0 0, 52% 0, 46% 22%, 55% 40%, 45% 62%, 54% 80%, 49% 100%, 0 100%); }
.half.r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 49% 100%, 54% 80%, 45% 62%, 55% 40%, 46% 22%); }
.stage.dig .half { animation: rockshake .28s infinite; }
@keyframes rockshake { 25% { transform: translate(-3px, 2px) rotate(-2deg); } 50% { transform: translate(3px, -2px) rotate(2deg); } 75% { transform: translate(-2px, -1px) rotate(-1deg); } }
.stage.crack .half.l { animation: openL .75s cubic-bezier(.2,.9,.3,1.1) forwards; }
.stage.crack .half.r { animation: openR .75s cubic-bezier(.2,.9,.3,1.1) forwards; }
@keyframes openL { to { transform: translate(calc(var(--open, 95px) * -1), calc(var(--open, 95px) * .27)) rotate(-26deg); opacity: 0; } }
@keyframes openR { to { transform: translate(var(--open, 95px), calc(var(--open, 95px) * .27)) rotate(26deg); opacity: 0; } }
.gemwrap { display: grid; place-items: center; transform: scale(0) rotate(-25deg); opacity: 0; }
.stage.crack .gemwrap { animation: gempop .9s .12s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes gempop { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.25) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.gemwrap svg { width: 150px; height: 150px; filter: drop-shadow(0 0 22px var(--tc)); }
.stage.crack.t4 .gemwrap svg, .stage.crack.t3 .gemwrap svg { animation: gemglow 1.4s .9s ease-in-out infinite alternate; }
@keyframes gemglow { to { filter: drop-shadow(0 0 40px var(--tc)) brightness(1.2); } }
.stage.crack.t0 .gemwrap svg { filter: drop-shadow(0 6px 8px rgba(0,0,0,.4)); }
.flash { position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(circle, #fff, transparent 65%); opacity: 0; pointer-events: none; }
.stage.crack .flash { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.5); } }
.ring { border-radius: 50%; border: 3px solid var(--tc); opacity: 0; }
.stage.crack .ring { animation: shock .9s ease-out; }
@keyframes shock { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(2.2); } }
.stage.miss .half { filter: grayscale(.6) drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.stage.miss.crack .gemwrap svg { filter: none; opacity: .5; }
.rtier { font-family: var(--display); font-size: 36px; line-height: 1.1; letter-spacing: -.01em; margin-top: 8px; color: var(--tc); opacity: 0; transform: translateY(14px) scale(.9); white-space: nowrap; }
.rtier.tn0 { font-size: 26px; color: var(--ink2); } .rtier.tn1 { font-size: 32px; color: var(--ink); } .rtier.tn2 { font-size: 38px; } .rtier.tn3 { font-size: 42px; font-stretch: 90%; } .rtier.tn4 { font-size: 46px; font-stretch: 90%; }
.rtier.tn3, .rtier.tn4 { transform-origin: center; }
.rtier.tn4 { color: var(--hacc); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 7px; text-decoration-skip-ink: none; }
.rtier.tn4::after { content: none; }
.rtier.in { animation: rise .55s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.rtier.in.tn3 { animation-name: riseTilt; } @keyframes riseTilt { to { opacity: 1; transform: rotate(-2deg); } }
.rpts { font-size: 62px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 2px; opacity: 0; }
.rpts.in { opacity: 1; animation: ptsin .4s cubic-bezier(.2,1.5,.4,1); } @keyframes ptsin { from { transform: scale(.4); } }
.rpts small { font-size: 22px; color: var(--ink2); font-weight: 800; }
.rsay { margin-top: 8px; font-size: 18px; font-weight: 800; }
.rsay .sub { display: block; font-size: 13px; font-weight: 700; color: var(--ink2); margin-top: 2px; }
.rline { margin-top: 6px; font-size: 15px; color: var(--ink2); font-weight: 700; }
.teach { margin-top: 14px; padding: 12px; text-align: left; font-size: 14px; opacity: 0; transform: translateY(10px); }
.teach.in { animation: rise .5s forwards; }
.teach .lbl { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 800; color: var(--ink3); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip.c0 { color: var(--t0); } .chips .chip.legend { color: var(--t4); border-color: color-mix(in srgb, var(--t4) 50%, transparent); }
.teach .row + .row { margin-top: 10px; }
.reveal .btn { margin-top: 16px; opacity: 0; } .reveal .btn.in { animation: rise .4s forwards; }
.screen-shake { animation: screenshake .55s; } .screen-shake-big { animation: screenshakebig 1.05s; }
@keyframes screenshake { 10% { transform: translate(-9px, 5px); } 20% { transform: translate(8px, -6px); } 30% { transform: translate(-7px, -4px); } 40% { transform: translate(6px, 6px); } 50% { transform: translate(-5px, 2px); } 60% { transform: translate(4px, -3px); } 70% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -1px); } }

@keyframes screenshakebig { 6% { transform: translate(-18px, 10px) rotate(-.8deg); } 14% { transform: translate(16px, -12px) rotate(.7deg); } 22% { transform: translate(-14px, -8px) rotate(-.5deg); } 30% { transform: translate(12px, 12px) rotate(.5deg); } 40% { transform: translate(-10px, 4px); } 52% { transform: translate(8px, -6px); } 64% { transform: translate(-6px, 4px); } 78% { transform: translate(3px, -2px); } }
/* ---------- infinite-guess play: best gem panel, found row, shimmer */
.stage.mini { --open: 40px; width: 84px; height: 84px; margin: 0; flex: none; }
.stage.mini .gemwrap svg { width: 66px; height: 66px; }
.stage.mini.shown .half, .stage.shown .half { display: none; }
.stage.shown .gemwrap { transform: none; opacity: 1; animation: gemsettle .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes gemsettle { from { transform: scale(.6); } }
.stage.empty .half { filter: grayscale(.4) drop-shadow(0 6px 10px rgba(0,0,0,.4)); opacity: .55; }
.stage.empty .half { animation: none; }
.stage.upg .half { display: none; }
.stage.upg.crack .gemwrap { animation: gemupg .8s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes gemupg { 0% { transform: scale(.4) rotate(-40deg); opacity: .2; filter: brightness(2.4); } 55% { transform: scale(1.4) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.rays { position: absolute; inset: -70%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 70%, #fff) 0 5deg, transparent 5deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 62%); mask-image: radial-gradient(circle, #000 8%, transparent 62%); }
.stage.crack .rays { animation: raysin 1.1s ease-out; }
@keyframes raysin { 0% { opacity: .95; transform: scale(.3) rotate(0); } 100% { opacity: 0; transform: scale(1.1) rotate(55deg); } }
.stage.mini .rays { inset: -140%; }
.stage.mini .flash { inset: -50px; }
.stage.crack.t4 .gemwrap svg, .stage.shown.t4 .gemwrap svg { animation: gemglow 1.4s .9s ease-in-out infinite alternate; }
.msg.ok { color: var(--tc, var(--ink)); }
.msg.err.fadeout { animation: msgfade 2.4s forwards; } @keyframes msgfade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.msg.digging { font-weight: 900; background: linear-gradient(100deg, var(--ink3) 30%, var(--gold) 45%, #fff 50%, var(--gold) 55%, var(--ink3) 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimtext 1.1s linear infinite; }
.msg.digging::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes shimtext { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.answer-form.busy input { background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--gold) 28%, transparent) 50%, transparent 70%); background-size: 250% 100%; animation: shimtext 1s linear infinite; border-color: var(--gold); }
.input-wrong, .shake { }
.slowflash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle at 50% 50%, #fff 0, rgba(255,226,122,.85) 25%, rgba(255,207,74,.25) 55%, transparent 75%); animation: slowflash 1.4s cubic-bezier(.1,.7,.3,1) forwards; }
@keyframes slowflash { 0% { opacity: 0; transform: scale(.4); } 14% { opacity: 1; transform: scale(1); } 60% { opacity: .55; transform: scale(1.25); } 100% { opacity: 0; transform: scale(1.5); } }

/* ---------- results: chest + stamp */
.chest-stage { position: relative; height: 150px; margin: 0 auto; width: 100%; max-width: 360px; overflow: visible; }
.chest { position: absolute; left: 50%; bottom: 0; width: 150px; margin-left: -75px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.chest .chlid { transform-origin: 50% 100%; transform-box: fill-box; }
.flygem { position: absolute; top: 0; width: 44px; height: 44px; z-index: 4; pointer-events: none; filter: drop-shadow(0 0 8px rgba(255,255,255,.4)); }
.flygem svg { width: 44px; height: 44px; }
.rank.stamp { animation: stampin .55s cubic-bezier(.2,1.2,.3,1); color: var(--gold); text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 40%, transparent); }
@keyframes stampin { 0% { transform: scale(3.2) rotate(-14deg); opacity: 0; } 70% { transform: scale(.92) rotate(2deg); opacity: 1; } 100% { transform: scale(1) rotate(-2deg); opacity: 1; } }

/* ---------- results */
.res-top { text-align: center; margin-top: 8px; }
/* rarity bars: height = tier */
.rb { display: inline-block; width: 8px; height: 26px; position: relative; flex: none; }
.rb::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; background: var(--ink); opacity: .85; height: 100%; }
.rb.t0::before { height: 22%; opacity: .5; } .rb.t1::before { height: 42%; opacity: .62; } .rb.t2::before { height: 62%; opacity: .75; } .rb.t3::before { height: 82%; opacity: .9; }
.rb.t4::before { height: 100%; background: var(--gold); opacity: 1; }
.rb.miss::before { height: 2px; border-radius: 1px; opacity: .4; }
.rb.lg { width: 10px; height: 28px; }
.rbar { display: flex; gap: 7px; justify-content: center; align-items: flex-end; margin: 14px 0 4px; }
.rbar .rb { width: 12px; height: 38px; }
.res-score { font-size: 78px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.res-score small { font-size: 28px; -webkit-text-fill-color: var(--ink3); }
.rank { font-size: 22px; font-weight: 900; margin-top: 4px; }
.rows { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; opacity: 0; animation: rise .4s forwards; }
.prow .gi svg { width: 32px; height: 32px; }
.prow .pq { font-size: 12px; color: var(--ink3); font-weight: 700; line-height: 1.2; }
.prow .pa { font-weight: 800; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.prow .pp { font-weight: 900; font-size: 18px; text-align: right; }
.prow .pp small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.countdown { text-align: center; margin-top: 14px; }
.countdown b { display: block; font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.btnrow { display: flex; gap: 10px; margin-top: 14px; } .btnrow .btn { flex: 1; }

/* ---------- lists / stats / archive */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h2 { font-size: 24px; font-weight: 900; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; padding: 14px 6px; }
.stat b { display: block; font-size: 28px; font-weight: 900; } .stat span { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--ink3); }
.bars { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 14px 84px 1fr 34px; gap: 8px; align-items: center; font-weight: 800; font-size: 13px; }
.bar svg { width: 26px; height: 26px; } .bar .track { height: 12px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 8px; background: var(--c); width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.alist { display: flex; flex-direction: column; gap: 8px; }
.aitem { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; width: 100%; text-align: left; }
.aitem .t { font-weight: 800; } .aitem .d { font-size: 12px; color: var(--ink2); font-weight: 700; }
.aitem .st { text-align: right; font-weight: 900; }
.aitem .mini { display: flex; gap: 3px; align-items: flex-end; justify-content: flex-end; margin-top: 4px; } .aitem .mini .rb { width: 5px; height: 14px; }
.aitem.done { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.aitem .go { color: var(--gold); font-size: 14px; }
.settings .set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.settings .set:last-child { border-bottom: 0; }
.settings .set b { display: block; font-size: 16px; } .settings .set small { color: var(--ink2); font-size: 13px; }
.switch { width: 54px; height: 32px; border-radius: 20px; background: var(--line); border: 0; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.3); } .switch[aria-checked="true"]::after { background: var(--toggleknob); }
.switch[aria-checked="true"] { background: var(--toggle); } .switch[aria-checked="true"]::after { transform: translateX(22px); }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; padding: 7px 11px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.modal-back { position: fixed; inset: 0; z-index: 80; background: var(--overlay); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s; }
.modal { position: relative; box-shadow: 0 -10px 50px rgba(10,0,40,.35), 0 0 0 1px var(--line); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--sheet); border-radius: 26px 26px 0 0; padding: 20px 18px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); animation: sheet .3s cubic-bezier(.2,.9,.3,1); }
@keyframes sheet { from { transform: translateY(60px); opacity: 0; } }
.modal h2 { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.how li { margin: 8px 0; line-height: 1.4; } .how ul { padding-left: 20px; margin: 8px 0; }
.tier-table { display: grid; gap: 6px; margin: 10px 0; } .tier-table .tr { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 800; }
.tier-table svg { width: 30px; height: 30px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 800; opacity: 0; pointer-events: none; transition: .3s; z-index: 100; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.loading { margin: auto; text-align: center; color: var(--ink2); font-weight: 800; }

@media (min-width: 700px) {
  #app { padding-top: 26px; }
  .wordmark { font-size: 64px; } .stage { width: 220px; height: 220px; }
  .modal-back { align-items: center; } .modal { border-radius: 26px; }
}
@media (max-height: 780px) { .timer-wrap { margin: 8px 0 2px; } .timer { width: 84px; height: 84px; } .timer .tnum { font-size: 30px; } .prompt { font-size: clamp(22px, 6.4vw, 28px); } .prompt-card { padding: 12px 14px 16px; } }
@media (max-height: 700px) { .timer { width: 88px; height: 88px; } .timer .tnum { font-size: 31px; } .stage { width: 150px; height: 150px; } .gemwrap svg { width: 118px; height: 118px; } .rpts { font-size: 50px; } .rtier { font-size: 30px !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- home v3: plain, centred, top-weighted */
:root { --display: "Bricolage", ui-rounded, system-ui, sans-serif; --hacc: #f2b84b; }
:root[data-theme="light"] { --hacc: #c77a00; }
.screen.home { width: 100%; max-width: 440px; margin: 0 auto; align-items: center; text-align: center; padding: 0 0 32px; }
.home .topbar { width: 100%; display: flex; justify-content: flex-end; gap: 2px; min-height: 48px; align-items: center; }
.home .tb { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; background: none; border: 0; border-radius: 10px; color: var(--ink2); font: 500 14px/1 var(--display); }
.home .tb svg { width: 20px; height: 20px; } .home .tb:hover { color: var(--ink); background: var(--card); }
.home .tb.sp { margin-right: auto; }
.home .hero { margin: 0; padding-top: clamp(28px, 9vh, 88px); }
.home .wordmark { margin: 0; font: 800 clamp(72px, 24vw, 132px)/.86 var(--display); font-stretch: 85%; letter-spacing: -.045em; color: var(--ink); background: none; -webkit-text-fill-color: currentColor; text-align: center; white-space: nowrap; }
.home .wordmark .un { position: relative; font-weight: 200; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.home .wordmark .un::after { content: ''; position: absolute; left: -.02em; right: -.02em; top: 52%; height: .06em; background: var(--hacc); transform: rotate(-4deg); border-radius: 0; }
.home .issue { display: block; margin-top: 18px; font: 500 15px/1 var(--display); letter-spacing: .01em; text-transform: none; color: var(--ink2); }
.home .tagline b { font-weight: 300; font-style: italic; text-decoration: line-through; text-decoration-color: var(--hacc); text-decoration-thickness: 2px; }
.home .tagline { margin: 26px 0 0; font: 400 20px/1.35 var(--display); font-style: normal; color: var(--ink); }
.home .ladder-line { margin-top: 14px; display: flex; flex-wrap: nowrap; justify-content: center; align-items: baseline; gap: 0 7px; font-family: var(--display); white-space: nowrap; }
.ladder-line span { color: var(--ink2); } .ladder-line i { font-style: normal; color: var(--ink3); font-weight: 400; font-size: 11px; }
.tn0 { font-weight: 300; font-style: italic; } .tn1 { font-weight: 400; }
.tn2 { font-weight: 700; letter-spacing: .07em; } .tn3 { font-weight: 800; display: inline-block; transform: rotate(-2.5deg); letter-spacing: .01em; }
.tn4 { font-weight: 800; color: var(--hacc) !important; display: inline-block; letter-spacing: .02em; }
.tn4::after { content: "\2726"; font-size: .5em; margin-left: .2em; vertical-align: .55em; font-weight: 400; }
.ladder-line .tn0 { font-size: 13px; } .ladder-line .tn1 { font-size: 15px; } .ladder-line .tn2 { font-size: 16px; } .ladder-line .tn3 { font-size: 18px; color: var(--ink); } .ladder-line .tn4 { font-size: 21px; }
.home .cta { margin-top: 30px; width: min(100%, 320px); display: flex; flex-direction: column; align-items: stretch; }
.home .play { box-shadow: 0 3px 0 rgba(10,0,40,.35); display: block; width: 100%; border: 0; border-radius: 12px; padding: 16px 20px; background: var(--ink); color: var(--bg); font: 700 17px/1 var(--display); letter-spacing: 0; text-align: center; transition: transform .12s, background .15s, box-shadow .15s; }
.home .play::after { content: none; } .home .play:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(10,0,40,.35); } .home .play:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(10,0,40,.35); }
.home .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.home .sec { padding: 13px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 15px/1 var(--display); transition: background .15s, border-color .15s, transform .12s; }
.home .sec:hover { background: var(--card2); border-color: var(--ink3); transform: translateY(-1px); } .home .sec:active { transform: translateY(1px); }
.home .meta { margin-top: 18px; color: var(--ink2); font: 500 14px/1.3 var(--display); }
.home .today { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink2); font: 500 13px/1 var(--display); }
.home .today .pips { margin: 0; gap: 4px; } .home .pip { width: 18px; height: 4px; border-radius: 2px; background: var(--line); box-shadow: none; }
.home .pip.on { background: var(--hacc); box-shadow: none; }
@media (max-width: 420px) { .home .tagline { font-size: 18px; } .home .ladder-line { gap: 0 3px; } .ladder-line .tn0 { font-size: 10.5px; } .ladder-line .tn1 { font-size: 12px; } .ladder-line .tn2 { font-size: 12.5px; letter-spacing: .04em; } .ladder-line .tn3 { font-size: 14px; } .ladder-line .tn4 { font-size: 16px; } .ladder-line i { font-size: 9px; } .home .tb span { display: none; } .home .hero { padding-top: 24px; } }

.modal-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--line); color: var(--ink); font-size: 18px; font-weight: 900; cursor: pointer; z-index: 2; }

/* ---------- loader: five rarity bars as an equaliser */
.ldr { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink2); font-weight: 800; font-size: 14px; }
.eq { display: inline-flex; gap: 5px; align-items: flex-end; height: 26px; }
.eq i { width: 6px; height: 100%; border-radius: 3px; background: var(--ink); opacity: .85; transform-origin: bottom; transform: scaleY(.2); animation: eqbar .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .09s; } .eq i:nth-child(3) { animation-delay: .18s; } .eq i:nth-child(4) { animation-delay: .27s; }
.eq i:nth-child(5) { animation-delay: .36s; background: var(--gold); opacity: 1; }
@keyframes eqbar { 0%, 100% { transform: scaleY(.2); } 45% { transform: scaleY(1); } }
.msg.digging { background: none; -webkit-text-fill-color: initial; color: var(--ink2); }
.msg.digging::after { content: none; }
.ldr-t { animation: ldrfade 1.4s ease-in-out infinite; } @keyframes ldrfade { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; transform: scaleY(.6); } .eq i:nth-child(odd) { transform: scaleY(.35); } .ldr-t { animation: none; } }
/* reveal symbol */
.stage .scale { display: flex; gap: 10px; align-items: flex-end; justify-content: center; height: 120px; }
.stage .scale .rb { width: 22px; height: 100%; }
.stage .scale .rb:nth-child(1) { height: 30%; } .stage .scale .rb:nth-child(2) { height: 46%; } .stage .scale .rb:nth-child(3) { height: 62%; } .stage .scale .rb:nth-child(4) { height: 80%; } .stage .scale .rb:nth-child(5) { height: 100%; }
.stage .scale .rb::before { height: 100% !important; }
.stage .scale .rb.off::before { opacity: .14; } .stage .scale .rb.miss::before { opacity: .3; height: 100% !important; }
.stage .scale .rb.t0::before, .stage .scale .rb.t1::before, .stage .scale .rb.t2::before, .stage .scale .rb.t3::before { opacity: .9; }
.stage .gemwrap { display: grid; place-items: center; }
.reveal.ready { cursor: pointer; }

:root[data-theme="light"] .switch { border: 1px solid var(--line); } :root[data-theme="light"] .modal-back { backdrop-filter: blur(3px); }
.chip.fire, .aitem .go { color: var(--hacc); }

/* auto-correct morph: typed text blurs/dips and snaps into the canonical listed answer */
input.morph { animation: morphIn .55s cubic-bezier(.3,1.4,.5,1); }
@keyframes morphIn { 0% { filter: blur(0); transform: scale(1); } 30% { filter: blur(5px); transform: scale(.96); opacity: .5; } 60% { filter: blur(0); transform: scale(1.06); opacity: 1; color: var(--tc, inherit); } 100% { transform: scale(1); } }
