:root {
  --bg1: #3a1230; --bg2: #120614;
  --card: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.18);
  --text: #fff4ec; --muted: #d9a9c4;
  --accent: #ff9f1c; --accent-text: #2a1300;
  --bad: #ff6b6b;
  --radius: 14px;
  --night: 0;            /* 0 = market entrance, 1 = deepest; set by game.js */
  --c-plankton: #9c9c9c; --c-schooler: #4de3ff;
  --c-rare: #ff5252; --c-deepcut: #a685ff; --c-krillion: #ffd166; --c-none: #8c8c8c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg2); }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--text);
  background: transparent;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden;
}
.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 10px; }
.top h1 { margin: 0; font-size: 1.4rem; letter-spacing: .15em; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1rem; cursor: pointer; }
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 18px 24px; }
.screen { display: none; text-align: center; animation: fadeIn .35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.day { color: var(--accent); font-weight: 700; margin: 24px 0 4px; }
.tagline { font-size: 1.15rem; line-height: 1.6; margin: 0 0 28px; }
.muted { color: var(--muted); }
.big { font-size: 3rem; font-weight: 900; margin: 0; line-height: 1.1; }
.countdown { font-variant-numeric: tabular-nums; }
h3 { margin: 28px 0 10px; font-size: 1rem; }
h3 small { font-weight: 400; font-size: .8rem; }

button.primary { display: inline-block; min-width: 200px; padding: 14px 22px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 800; cursor: pointer; transition: transform .1s; }
button.primary.small { min-width: 0; padding: 0 18px; }
button.primary:active { transform: translateY(1px) scale(.98); }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; margin-top: 8px; }

/* ── HUD ── */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.hud-box { min-width: 76px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,6,20,.82); }
.hud-box small { display: block; font-size: .7rem; color: var(--muted); }
.hud-box b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.hud-box b.bump { animation: bump .4s ease; }
@keyframes bump { 50% { transform: scale(1.25); color: var(--accent); } }
.dots-wrap small { display: block; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); background: transparent; transition: background .4s, transform .4s; }
.dots span.current { border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.dots span.done { transform: scale(1.05); border-color: transparent; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,159,28,.25); } }

/* ── Stage ── */
.stage { position: relative; min-height: 420px; }
.q-card { padding: 22px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16,6,20,.86); }
.q-card.enter { animation: dropIn .5s cubic-bezier(.2,.9,.3,1.2); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
#play-question { font-size: 1.6rem; line-height: 1.4; margin: 0; }
@keyframes tickPop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

.answer-area { margin-top: 22px; animation: fadeIn .25s ease; }
.not-answer { min-height: 1.4em; margin: 0 0 8px; color: var(--bad); font-weight: 700; }
.not-answer.show { animation: fadeIn .2s ease; }
#answer-form { display: flex; gap: 10px; align-items: stretch; }
#answer-input { flex: 1; min-width: 0; padding: 14px; font: inherit; font-size: 1.15rem; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
#answer-input:focus { outline: 2px solid var(--accent); }
#answer-input.wrong { border-color: var(--bad); animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }

.ring { position: relative; width: 52px; flex: 0 0 52px; }
.ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke .3s; }
.ring.low .ring-fg { stroke: var(--bad); }
.ring.low #ring-num { color: var(--bad); animation: bump .5s ease infinite; }
#ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── Pixel night market + walking animation ── */
.scene { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: -1; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.hud { position: relative; z-index: 6; }
.walk { position: fixed; inset: 0; z-index: 5; pointer-events: none; animation: fadeIn .2s ease; }
.walk-track { position: absolute; left: 0; right: 0; bottom: var(--feet, 28px); height: 230px; }
.walker { position: absolute; bottom: 0; left: 3%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; z-index: 4; }
.walker canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.walker.landed canvas { animation: hop .45s ease 2; }
@keyframes hop { 50% { transform: translateY(-10px); } }
.sink-pill { margin-bottom: 10px; padding: 7px 16px 6px; font-size: 1.35rem; font-weight: 900; letter-spacing: .06em; white-space: nowrap; background: rgba(16,8,24,.95); color: var(--tc); text-shadow: 0 0 10px var(--tc); box-shadow: 0 0 0 3px var(--tc), 0 0 26px var(--tc); transition: color .25s, box-shadow .25s, text-shadow .25s; }
.sink-pill::after { content: "▶"; margin-left: 8px; font-size: .8em; opacity: .8; }
.sink-pill.land { animation: land .45s ease; }
@keyframes land { 40% { transform: scale(1.25, .8); } 70% { transform: scale(.95, 1.08); } }
.bubble { position: absolute; width: 4px; height: 4px; background: rgba(255,240,220,.7); animation: puff .9s ease-out forwards; }
@keyframes puff { to { transform: translate(-10px, -14px) scale(2); opacity: 0; } }

/* ── Reveal card ── */
.reveal { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; border-radius: var(--radius); background: rgba(10,3,12,.85); animation: pop .35s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.reveal-icon { font-size: 3.4rem; line-height: 1; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(4deg); } }
.reveal-tier { font-size: 2rem; font-weight: 900; margin: 10px 0 2px; letter-spacing: .08em; }
.reveal-answer { font-size: 1.2rem; margin: 0; }
.reveal-gain { color: var(--accent); font-weight: 800; margin: 10px 0 2px; }
.reveal-desc { color: var(--muted); margin: 0 0 20px; font-size: .9rem; }
.reveal.krillion .reveal-tier { animation: shimmer 1.2s linear infinite; background: linear-gradient(90deg, #ffd166, #fff6cf, #e9a93a, #ffd166); background-size: 200%; -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes shimmer { to { background-position: 200% 0; } }

.t-plankton { color: var(--c-plankton); } .t-schooler { color: var(--c-schooler); }
.t-rare { color: var(--c-rare); } .t-deepcut { color: var(--c-deepcut); } .t-krillion { color: var(--c-krillion); } .t-none { color: var(--c-none); }
.bg-plankton { background: var(--c-plankton) !important; } .bg-schooler { background: var(--c-schooler) !important; }
.bg-rare { background: var(--c-rare) !important; } .bg-deepcut { background: var(--c-deepcut) !important; } .bg-krillion { background: var(--c-krillion) !important; } .bg-none { background: var(--c-none) !important; }

/* confetti for the top tier */
.confetti { position: fixed; top: -10px; width: 8px; height: 12px; z-index: 10; pointer-events: none; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ── Result ── */
.log-chart svg { width: 100%; height: auto; display: block; }
.log-chart .dot { animation: dotDrop .6s ease backwards; }
@keyframes dotDrop { from { transform: translateY(-40px); opacity: 0; } }
.bearing { list-style: none; padding: 0; margin: 0; text-align: left; }
.bearing li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 8px 12px; margin-bottom: 4px; border-radius: 10px; color: var(--muted); font-size: .9rem; }
.bearing li.me { background: var(--card); color: var(--text); outline: 1px solid var(--accent); }
.bearing li b { color: var(--text); }
.catch { text-align: left; margin-bottom: 22px; border-top: 1px solid var(--line); }
.catch-row { border-bottom: 1px solid var(--line); }
.catch-head { width: 100%; display: grid; grid-template-columns: 22px 28px 1fr auto 18px; gap: 8px; align-items: center; padding: 12px 4px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.catch-head:hover .c-ans { color: var(--accent); }
.c-num { color: var(--muted); font-size: .8rem; text-align: right; }
.c-icon { font-size: 1.2rem; text-align: center; }
.c-mid { min-width: 0; }
.c-q { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-ans { display: block; font-size: 1.1rem; font-weight: 800; transition: color .15s; }
.c-pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.c-tog { color: var(--muted); text-align: center; }
.catch-row.open .c-tog { color: var(--accent); }
.catch-body { padding: 0 0 14px; animation: fadeIn .25s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: rgba(0,0,0,.2); font: inherit; font-size: .78rem; color: var(--muted); cursor: pointer; }
.chip.on { border-color: currentColor; background: var(--card); }
.chip.on { color: var(--text); }
.chip.t-plankton { color: var(--c-plankton); } .chip.t-schooler { color: var(--c-schooler); }
.chip.t-rare { color: var(--c-rare); } .chip.t-deepcut { color: var(--c-deepcut); } .chip.t-krillion { color: var(--c-krillion); }
.a-search { width: 100%; padding: 9px 12px; margin-bottom: 6px; font: inherit; font-size: .9rem; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 8px; }
.a-search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.a-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.2); overscroll-behavior: contain; }
.a-list::-webkit-scrollbar { width: 8px; }
.a-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.a-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.a-row:last-child { border-bottom: 0; }
.a-row.mine { background: rgba(255,159,28,.15); box-shadow: inset 3px 0 0 var(--accent); }
.a-icon { text-align: center; }
.a-name { font-weight: 700; font-size: .92rem; }
.a-name small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.a-name em { margin-left: 8px; font-style: normal; font-size: .7rem; color: var(--accent-text); background: var(--accent); padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.a-pts { font-size: .8rem; font-weight: 800; }
.a-empty { text-align: center; color: var(--muted); }
.logbook { margin-top: 18px; font-size: .9rem; }

/* dialogs */
dialog { max-width: 460px; width: calc(100% - 32px); border: 0; border-radius: var(--radius); background: #2a0d24; color: var(--text); padding: 22px; }
dialog[open] { animation: pop .25s ease; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog ol { padding-left: 1.2em; line-height: 1.7; }
.tier-list { list-style: none; padding: 0; margin: 0 0 18px; }
.tier-list li { margin-bottom: 8px; line-height: 1.4; }
.tier-list b { margin-right: 6px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: center; margin: 0 0 18px; }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 1.6rem; font-weight: 800; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 14px; }
.untranslated { outline: 1px dashed var(--bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* test mode banner (index.html?test) */
.test-banner { position: sticky; top: 0; z-index: 20; padding: 6px 12px; text-align: center; font-size: .8rem; font-weight: 700; background: #ffd166; color: #2a1300; }

/* readable panels over the pixel background */
.log-chart, .bearing, .catch { background: rgba(16,6,20,.82); border-radius: 12px; }
.log-chart { padding: 8px; }
.bearing { padding: 6px; }
.catch { padding: 0 10px; border-top: 0; }
.answer-area { background: rgba(16,6,20,.82); padding: 12px; border-radius: var(--radius); }

/* home screen content sits on a panel so it stays readable over the gate */
#screen-home { background: rgba(16,6,20,.72); border-radius: 16px; padding: 6px 18px 18px; margin-top: 8px; }

/* footprint trail behind the walker */
.trail { position: absolute; bottom: -6px; height: 5px; border-radius: 3px; background: repeating-linear-gradient(90deg, currentColor 0 8px, transparent 8px 14px); opacity: .9; box-shadow: 0 0 8px currentColor; }
.trail.t-none { display: none; }

/* ── per-tier effects ── */
.fx-flash { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; }
.fx-dark { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; image-rendering: pixelated; pointer-events: none; }
.trail { z-index: 3; }
.fx-shake { animation: fxShake .5s linear; }
@keyframes fxShake {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  12% { translate: -10px 5px; rotate: -.6deg; } 26% { translate: 9px -6px; rotate: .5deg; }
  42% { translate: -7px 4px; rotate: -.35deg; } 58% { translate: 5px -3px; rotate: .2deg; } 76% { translate: -3px 2px; rotate: 0deg; }
}
/* the answer word glows in its tier colour; the top tier pulses gold */
.sink-pill.tier-plankton { box-shadow: 0 0 0 3px var(--tc), 0 0 8px var(--tc); }
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 3px #ffd166, 0 0 26px rgba(255,209,102,.5); }
  50% { box-shadow: 0 0 0 3px #ffe9a8, 0 0 60px rgba(255,209,102,.9); }
}
.sink-pill.land { animation: land .45s ease; }
.sink-pill.tier-krillion.land { animation: land .45s ease, goldPulse 1s ease-in-out .45s infinite; }
/* walker poses on landing */
.pose-sad { transform: rotate(14deg) translateY(3px); transition: transform .4s ease; }
.pose-hop { animation: hop .45s ease 2; }
.pose-celebrate { animation: flip .9s cubic-bezier(.3,.1,.3,1); }
@keyframes flip { 30% { transform: translateY(-40px) rotate(-140deg) scale(1.15); } 60% { transform: translateY(-18px) rotate(-280deg) scale(1.2); } 100% { transform: translateY(0) rotate(-360deg); } }
.walker.gold canvas { filter: drop-shadow(0 0 10px rgba(255,209,102,.9)) drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.walker.landed canvas { animation: none; }
/* score slams in gold for the top tier; steps click up */
#points-num.slam { display: inline-block; animation: slam .7s ease; }
@keyframes slam { 35% { color: #ffd166; text-shadow: 0 0 26px rgba(255,209,102,.9); transform: scale(1.4) rotate(-2deg); } }
#depth-num.crank { display: inline-block; animation: crankJolt .11s ease; }
@keyframes crankJolt { 45% { transform: translateY(3px) scale(1.06); } }
/* result card: tier name glows in its colour, pops in with an overshoot */
.reveal { animation: bannerIn .7s cubic-bezier(.2,1.7,.4,1); }
@keyframes bannerIn { from { opacity: 0; transform: scale(.5); } }
.reveal-tier { text-shadow: 0 0 22px currentColor, 0 3px 0 rgba(0,0,0,.6); }
.reveal-icon { filter: drop-shadow(0 0 16px var(--tc, transparent)); }
.reveal-gain b { color: var(--tc, var(--accent)); }

/* ── background tier lines (full height), like the original's depth lines ── */
.beams { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.beam { position: absolute; top: 0; bottom: 0; left: 0; width: 0; color: rgba(200,190,215,.55); animation: signIn .5s ease-out backwards; will-change: transform; }
.beam::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; border-left: 2px dashed rgba(200,190,215,.32); transition: border-color .2s, box-shadow .3s; }
.beam-label { position: absolute; top: 34%; left: 10px; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font-weight: 900; letter-spacing: .12em; font-size: 1.05rem; transition: color .2s, text-shadow .2s, transform .3s; }
.beam-label b { font-size: 1.2rem; filter: grayscale(.7) brightness(.8); transition: filter .2s; }
.beam-label em { font-style: normal; font-size: .85rem; opacity: .85; }
.beam.t-plankton { --bc: var(--c-plankton); } .beam.t-schooler { --bc: var(--c-schooler); } .beam.t-rare { --bc: var(--c-rare); }
.beam.t-deepcut { --bc: var(--c-deepcut); } .beam.t-krillion { --bc: var(--c-krillion); }
.beam.passed { color: var(--bc); animation: beamFlash .6s ease-out; }
.beam.passed::before { border-left-color: var(--bc); box-shadow: 0 0 18px var(--bc), 0 0 4px var(--bc); }
.beam.passed .beam-label { text-shadow: 0 0 12px var(--bc); }
.beam.passed .beam-label b { filter: none; }
.beam.landed::before { border-left-style: solid; border-left-width: 3px; }
.beam.landed .beam-label { transform: scale(1.35); transform-origin: left center; }
@keyframes beamFlash { 0% { filter: brightness(3); } }
/* passing captions */
.amb { position: absolute; left: 0; white-space: nowrap; font-size: .88rem; letter-spacing: .06em; color: rgba(215,200,230,.7); text-shadow: 0 2px 0 rgba(0,0,0,.6); opacity: 0; transition: opacity .6s ease-out; will-change: transform; }
.amb.lo { top: 52%; } .amb.hi { top: 24%; }
.amb.show { opacity: 1; }
/* a glow of the passed line's colour washes across the screen */
.fx-wash { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 38% 90% at var(--wx, 50%) 50%, var(--wc, #fff), transparent 70%); mix-blend-mode: screen; }
.fx-wash.on { animation: wash .9s ease-out; }
@keyframes wash { 0% { opacity: var(--wa, .25); } 100% { opacity: 0; } }
/* the word pops each time it changes colour */
.sink-pill.recolor { animation: recolor .35s ease; }
@keyframes recolor { 40% { transform: scale(1.18); filter: brightness(1.6); } }
.sink-pill.land.tier-krillion { animation: land .45s ease, goldPulse 1s ease-in-out .45s infinite; }
@keyframes signIn { from { opacity: 0; translate: 0 -12px; } }
@keyframes flash { 0% { filter: brightness(2.2); transform: scale(1.15); } }

/* the question card floats away while the walker goes (and returns with the next question) */
.q-card.gone { animation: cardGone .7s cubic-bezier(.5,0,.75,0) forwards; }
@keyframes cardGone { to { opacity: 0; transform: translateY(-140px); } }
.amb.hi { top: 26%; } .amb.lo { top: 56%; }
.beam-label { top: 40%; }
@media (max-width: 600px) {
  .beam-label { font-size: .85rem; letter-spacing: .06em; }
  .beam.landed .beam-label { transform: scale(1.1); }
  .amb { font-size: .75rem; }
}

/* 招牌菜: the crowd that said the same thing */
.echoes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.echo { position: absolute; left: 0; display: flex; flex-direction: column; align-items: center; translate: -50% 0; }
.echo canvas { image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)) brightness(.9); }
.echo-sign { margin-bottom: 4px; padding: 3px 9px; font-size: .85rem; font-weight: 800; white-space: nowrap; color: var(--c-plankton); background: rgba(16,8,24,.92); box-shadow: 0 0 0 2px var(--c-plankton); animation: lazySway 2.2s ease-in-out infinite; }
@keyframes lazySway { 0%, 100% { transform: translateX(-6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(6deg); } }
.echo.idle canvas { animation: shrugBob 1.6s ease-in-out infinite; }
@keyframes shrugBob { 50% { transform: translateY(-3px); } }
.heckle { position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 0; padding: 6px 12px; white-space: nowrap; font-size: .95rem; font-weight: 800; color: #1a0f1e; background: #f4f0f6; border-radius: 10px; box-shadow: 3px 3px 0 rgba(0,0,0,.45); text-shadow: none; animation: bubbleIn .4s cubic-bezier(.2,1.7,.4,1) backwards; }
.heckle::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #f4f0f6; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(.4) translateY(10px); } }
@media (max-width: 600px) { .echo-sign { font-size: .72rem; } .heckle { font-size: .8rem; } }

/* the answer box flying from the input down to the walker */
.drop-chip { position: fixed; left: 0; top: 0; z-index: 40; margin: 0; pointer-events: none; }

/* 在地人氣: scooter */
.walker canvas { filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.pose-skid { animation: skid .7s cubic-bezier(.3,1.6,.5,1); transform-origin: 30% 100%; }
@keyframes skid { 0% { transform: rotate(0); } 25% { transform: translateX(10px) rotate(-10deg); } 55% { transform: translateX(4px) rotate(4deg); } 100% { transform: none; } }

/* 古早味: old neon shop signs */
.neon { position: absolute; left: 0; writing-mode: vertical-rl; text-orientation: upright; padding: 8px 5px; font-size: 1.25rem; font-weight: 900; letter-spacing: 2px;
  color: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.08); border-radius: 6px; background: rgba(10,4,14,.55); text-shadow: none; will-change: transform; transition: color .1s; }
.neon.lit { color: #fff; border-color: var(--nc); text-shadow: 0 0 4px #fff, 0 0 12px var(--nc), 0 0 26px var(--nc); box-shadow: 0 0 14px var(--nc), inset 0 0 10px var(--nc); animation: neonOn .7s steps(1) both; }
@keyframes neonOn { 0% { opacity: .15; } 10% { opacity: 1; } 18% { opacity: .2; } 30% { opacity: 1; } 36% { opacity: .35; } 46%, 100% { opacity: 1; } }
.neon.lit.pulse { animation: neonOn .6s steps(1) both, neonPulse 1s ease-in-out .6s infinite; }
@keyframes neonPulse { 50% { filter: brightness(1.5); } }

/* 老饕私房: paper lantern carried in the dark */
.lantern { display: none; position: absolute; right: -14px; bottom: 30%; width: 16px; height: 20px; transform-origin: 50% -10px; animation: lanternSwing 1.2s ease-in-out infinite; }
.lantern::before { content: ""; position: absolute; left: 7px; top: -12px; width: 2px; height: 12px; background: #3a2a2a; }
.lantern i { position: absolute; inset: 0; background: #e63946; border-top: 3px solid #ffd166; border-bottom: 3px solid #ffd166; box-shadow: 0 0 14px 4px rgba(255,150,60,.75), 0 0 40px 10px rgba(255,120,40,.35); }
.lantern i::after { content: ""; position: absolute; left: 3px; right: 3px; top: 3px; bottom: 3px; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(120,0,0,.45) 3px 4px); }
.walker.has-lantern .lantern { display: block; }
.walker.lantern-up .lantern { animation: lanternUp .5s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes lanternSwing { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes lanternUp { to { transform: translateY(-46px) scale(1.25); } }


/* 老饕私房: lantern hangs from the scooter handlebar */
.walker.mode-scooter .lantern { right: 4px; bottom: 58%; width: 13px; height: 16px; }

/* 老闆的私房菜單: 神轎 is set down */
.pose-lower { animation: lower .6s cubic-bezier(.3,1.6,.5,1); transform-origin: 50% 100%; }
@keyframes lower { 35% { transform: scale(1.04, .9) translateY(4px); } 70% { transform: scale(.98, 1.04); } }

/* shoppers along the route reacting as you pass */
.bystander { position: absolute; left: 0; display: flex; flex-direction: column; align-items: center; translate: -50% 0; z-index: 2; will-change: transform; }
.bystander canvas { image-rendering: pixelated; filter: brightness(.8) drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.bystander .mark { font-size: 1rem; opacity: 0; transform: translateY(6px) scale(.5); transition: opacity .15s, transform .25s cubic-bezier(.2,1.8,.4,1); text-shadow: none; }
.bystander.wave .mark, .bystander.look .mark, .bystander.jump .mark, .bystander.cheer .mark { opacity: 1; transform: none; }
.bystander.wave canvas { animation: byWave .5s ease 2; }
@keyframes byWave { 50% { transform: translateY(-4px) rotate(-6deg); } }
.bystander.look canvas { animation: byLook .35s ease; }
@keyframes byLook { 40% { transform: translateY(-10px); } }
.bystander.jump canvas { animation: byJump .55s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes byJump { 40% { transform: translate(-14px, -22px) rotate(-14deg); } 100% { transform: translate(-18px, 0) rotate(0); } }
.bystander.cheer canvas { animation: byCheer .32s ease-in-out infinite; }
@keyframes byCheer { 50% { transform: translateY(-12px); } }

/* vendors shouting from their stalls */
.shout { position: absolute; left: 0; padding: 5px 11px; white-space: nowrap; font-size: .95rem; font-weight: 900; color: #1a0f1e; background: #ffe9a8; border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.45); text-shadow: none; opacity: 0; scale: .4; transition: opacity .15s, scale .3s cubic-bezier(.2,1.8,.4,1); will-change: transform; }
.shout::after { content: ""; position: absolute; top: 100%; left: 16px; border: 6px solid transparent; border-top-color: #ffe9a8; }
.shout.show { opacity: 1; scale: 1; }
.shout.fade { opacity: 0; transition: opacity .5s; }
@media (max-width: 600px) { .shout { font-size: .78rem; } }

/* pixel-art tier icons (icons.js); rarer tiers glow and the top tier shines */
.px-icon { image-rendering: pixelated; image-rendering: crisp-edges; width: 1.35em; height: 1.35em; vertical-align: -0.28em; display: inline-block; }
.px-icon.big { width: 76px; height: 76px; }
.px-rare { filter: drop-shadow(0 0 3px rgba(255,82,82,.55)); }
.px-deepcut { filter: drop-shadow(0 0 4px rgba(166,133,255,.7)); }
.px-krillion { filter: drop-shadow(0 0 5px rgba(255,209,102,.85)); animation: pxShine 2.2s ease-in-out infinite; }
@keyframes pxShine { 0%, 100% { filter: drop-shadow(0 0 4px rgba(255,209,102,.7)) brightness(1); } 50% { filter: drop-shadow(0 0 10px rgba(255,209,102,1)) brightness(1.25); } }
.reveal-icon { line-height: 0; }
.beam-label b { filter: none; }
.beam:not(.passed) .beam-label .px-icon { filter: grayscale(.8) brightness(.75); animation: none; }

/* CRT-style flicker when an answer is entered */
.fx-zap { position: fixed; inset: 0; z-index: 35; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, transparent 1px 3px), rgba(255,240,220,.1); mix-blend-mode: screen; }
.fx-zap.on { animation: zap .28s steps(1) forwards; }
@keyframes zap { 0% { opacity: .9; transform: translateY(0); } 33% { opacity: .2; transform: translateY(2px); } 66% { opacity: .7; transform: translateY(-1px); } 100% { opacity: 0; } }

/* ── along-the-way set pieces ── */
/* 招牌菜: one sad bulb */
.bulb { position: absolute; top: 0; left: 0; width: 0; height: 46%; z-index: 2; }
.bulb::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 14px; width: 2px; background: #2a1b20; }
.bulb i { position: absolute; left: -13px; bottom: 0; width: 26px; height: 30px; border-radius: 50% 50% 45% 45%; background: #fff2b0;
  box-shadow: 0 0 26px 12px rgba(255,230,150,.6), 0 0 70px 30px rgba(255,220,140,.18); border-top: 7px solid #555; }
.bulb.flicker i { animation: bulbFlicker .9s steps(1) infinite; }
@keyframes bulbFlicker { 0% { opacity: 1; } 12% { opacity: .2; } 20% { opacity: 1; } 47% { opacity: .1; } 52% { opacity: .9; } 70% { opacity: .3; } 80% { opacity: 1; } }
.bulb.dead i { animation: none; background: #4a4450; box-shadow: none; opacity: 1; }

/* 在地人氣: square-dance aunties */
.dance-group { position: absolute; left: 0; display: flex; gap: 4px; translate: -50% 0; z-index: 2; }
.dance-group canvas { image-rendering: pixelated; filter: brightness(.85) drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.dance-group.dancing canvas { animation: auntieBob .52s ease-in-out infinite; }
.dance-group.dancing canvas:nth-child(2) { animation-delay: -.17s; }
.dance-group.dancing canvas:nth-child(3) { animation-delay: -.34s; }
@keyframes auntieBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

/* 老饕私房: 天燈 that lift off */
.skylantern { position: absolute; left: 0; width: 40px; height: 50px; translate: -50% 0; z-index: 2;
  clip-path: polygon(8% 0, 92% 0, 78% 100%, 22% 100%); background: linear-gradient(180deg, #ffe7a8, #ff9f43 70%, #e8743b);
  box-shadow: 0 0 0 0 transparent; display: grid; place-items: center; filter: drop-shadow(0 0 6px rgba(255,170,80,.5)); }
.skylantern span { font-size: 15px; font-weight: 900; color: #a8321e; writing-mode: vertical-rl; letter-spacing: -1px; text-shadow: none; }
.skylantern::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 10px 4px #ffb35c; }
.skylantern.rise { animation: skyRise var(--rise, 4s) cubic-bezier(.3,.1,.5,1) forwards; }
@keyframes skyRise {
  0% { translate: -50% 0; filter: drop-shadow(0 0 6px rgba(255,170,80,.5)); }
  15% { filter: drop-shadow(0 0 16px rgba(255,170,80,1)) brightness(1.3); }
  85% { opacity: 1; }
  100% { translate: calc(-50% + var(--sway, 0px)) -72vh; opacity: 0; scale: .6; filter: drop-shadow(0 0 22px rgba(255,170,80,1)) brightness(1.4); }
}

/* 老闆的私房菜單: hanging 鞭炮 strings */
.bianpao { position: absolute; left: 0; display: flex; flex-direction: column; align-items: center; translate: -50% 0; z-index: 2; }
.bianpao::before { content: ""; width: 2px; height: 18px; background: #2a1b20; }
.bianpao i { display: block; width: 9px; height: 13px; margin-top: 1px; background: #c1121f; border-top: 2px solid #ffd166; box-shadow: 0 0 4px rgba(255,60,60,.4); }
.bianpao i.r { translate: 3px 0; rotate: 12deg; }
.bianpao i:not(.r) { translate: -3px 0; rotate: -12deg; }
.bianpao i.pop { visibility: hidden; }
.bianpao.spent::before { opacity: .4; }
@media (max-width: 600px) { .skylantern { width: 30px; height: 38px; } .skylantern span { font-size: 12px; } }

/* one-sentence note for 老闆的私房菜單 answers */
.reveal-note { max-width: 420px; margin: -10px auto 18px; padding: 8px 14px; font-size: .92rem; line-height: 1.6; color: #fff3d0;
  background: rgba(255,209,102,.1); border: 1px solid rgba(255,209,102,.45); border-radius: 10px; animation: fadeIn .5s ease .25s backwards; }
.a-note { margin: 4px 0 2px; font-weight: 400; font-size: .8rem; line-height: 1.5; color: #f3e4c0; white-space: normal; }
