/* Honeydle — black hive, honey-yellow light, pixel art throughout. */

@font-face { font-family: "Press Start 2P"; src: url("/fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/libre-franklin-latin-800-normal.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --bg: #000000;
  --surface: #111111;
  --yellow: #ffd60a;
  --gold: #cf9a06;
  --soft: #f3d27a;
  --amber: #b45309;
  --ink: #ffffff;
  --muted: #a8a8a8;
  --line: #2e2e2e;
  --chip: #241d00;
  --f-pixel: "Press Start 2P", ui-monospace, monospace;
  --f-read: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --max: 560px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  /* faint dot lattice: texture on a second look, never a pattern */
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1.5px);
  background-size: 26px 26px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img.px, .px { image-rendering: pixelated; }
button { font: inherit; color: inherit; }
a { color: var(--soft); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
#app { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; animation: screen-in 260ms ease-out both; }
.screen.home { justify-content: center; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- header ---------- */
.masthead { position: relative; text-align: center; padding: 18px 0 10px; }
.masthead::before { /* gold glow pooled behind the wordmark */
  content: ""; position: absolute; left: 50%; top: 6px; width: 300px; height: 70px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,190,0,0.16), transparent); pointer-events: none;
}
.masthead::after { content: ""; display: block; width: 120px; height: 2px; margin: 10px auto 0; background: var(--gold); opacity: 0.8; }
.wordmark {
  position: relative; margin: 0; font-family: var(--f-pixel); font-weight: 400; font-size: 26px; line-height: 1.1;
  color: var(--yellow); letter-spacing: 0; white-space: nowrap;
  text-shadow: 0 3px 0 #7a5a00, 0 0 18px rgba(255,200,0,0.35);
}
.wordmark a { color: inherit; text-decoration: none; }
/* Press Start 2P gives Y and L extra left bearing and an off-centre full stop;
   pull them so every gap reads the same width. */
.wordmark .kY, .wordmark .kL { margin-left: -0.125em; }
.wordmark .dot { color: var(--gold); margin-left: -0.25em; }
.tagline { margin: 8px 0 0; color: var(--ink); font-size: 13px; font-weight: 500; opacity: 0.9; }
.dateline { margin: 4px 0 0; color: var(--muted); font-size: 12px; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.masthead.compact { padding: 10px 0 6px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.masthead.compact::after { display: none; }
.masthead.compact .wordmark { font-size: 16px; text-shadow: 0 2px 0 #7a5a00; }
.masthead.compact .tagline { display: none; }
.masthead.compact .dateline { display: none; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border: 6px solid; border-image: var(--px-ghost) / 6px;
  background: none; cursor: pointer; padding: 0; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; shape-rendering: crispEdges; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 6px solid; border-image: var(--px-chip) / 6px; padding: 0 4px; margin: -2px 0;
  color: var(--soft); font-size: 12px; font-weight: 600; line-height: 16px;
}
.chip .sw { width: 10px; height: 10px; flex: none; image-rendering: pixelated; }

/* ---------- cards ---------- */
.card { border: 6px solid; border-image: var(--px-card) / 6px; padding: 12px 12px; }
.card.gold { border-image: var(--px-cardgold) / 6px; }
.kicker { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kicker b { color: var(--soft); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { border: 6px solid; border-image: var(--px-cardgold) / 6px; padding: 6px 2px 4px; text-align: center; min-width: 0; }
.stat .v { display: block; font-family: var(--f-pixel); font-size: 15px; line-height: 1.4; color: var(--yellow); text-shadow: 0 0 10px rgba(255,214,10,0.35); }
.stat .l { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.daily-card { text-align: center; padding: 18px 14px 16px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.daily-card h2 { margin: 0; font-family: var(--f-read); font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.daily-card p { margin: 0; color: var(--muted); font-size: 14px; }
.daily-card .done { font-size: 15px; color: var(--ink); }
.daily-card .done b { font-family: var(--f-pixel); font-weight: 400; color: var(--yellow); font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; cursor: pointer;
  border: 6px solid; padding: 2px 12px 4px; font-family: var(--f-pixel); font-size: 13px; line-height: 1.3; letter-spacing: 0.02em;
  text-decoration: none; user-select: none; transition: transform 60ms ease-out;
}
.btn.primary { border-image: var(--px-primary) / 6px 6px 8px 6px; border-width: 6px 6px 8px; color: #111; background: none; }
.btn.primary:active:not(:disabled) { border-image: var(--px-primarydown) / 6px; border-width: 6px; transform: translateY(2px); margin-bottom: 2px; }
.btn.ghost { border-image: var(--px-ghost) / 6px 6px 8px 6px; border-width: 6px 6px 8px; color: var(--ink); background: none; }
.btn.ghost:active:not(:disabled) { border-image: var(--px-ghostdown) / 6px; border-width: 6px; transform: translateY(2px); margin-bottom: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.small { min-height: 40px; font-size: 11px; width: auto; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.linkbtn { background: none; border: 0; padding: 6px 4px; color: var(--soft); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(243,210,122,0.4); }
.linkbtn:hover { text-decoration-color: currentColor; }

/* ---------- footer ---------- */
.footer { display: flex; justify-content: center; gap: 18px; padding: 8px 0 18px; }

/* ---------- bee parade ---------- */
.parade { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; padding: 18px 2% 0; }
.parade::before { /* faint pool of honey light under the crew */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -6px; height: 46px;
  background: radial-gradient(closest-side, rgba(255,190,0,0.13), transparent); pointer-events: none;
}
.parade::after { /* the hive shelf */
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(207,154,6,0.55) 20%, rgba(207,154,6,0.55) 80%, transparent);
}
.bee-slot { position: relative; flex: 1 1 0; max-width: 52px; display: flex; flex-direction: column; align-items: center; }
/* worst → best: each bee rises a little higher on the ladder */
.bee-slot { --lift: calc(var(--i) * 2.5px); }
.bee-fly { position: relative; z-index: 1; width: 44px; height: 44px; margin-bottom: var(--lift);
  animation: hover 3.2s cubic-bezier(.45,.05,.55,.95) infinite; animation-delay: calc(var(--i) * -0.46s); will-change: transform; }
.bee-fly img { display: block; width: 100%; height: 100%; animation: sway 3.2s cubic-bezier(.45,.05,.55,.95) infinite; animation-delay: calc(var(--i) * -0.46s - 0.8s); transform-origin: 50% 40%; }
.bee-slot.diamond .bee-fly, .bee-slot.ruby .bee-fly { width: 48px; height: 48px; }
.bee-slot.ruby .bee-fly img { filter: drop-shadow(0 0 6px rgba(255,60,100,0.45)); }
.bee-slot.diamond .bee-fly img { filter: drop-shadow(0 0 6px rgba(150,220,255,0.45)); }
.bee-slot.golden .bee-fly img { filter: drop-shadow(0 0 6px rgba(255,200,0,0.4)); }
.bee-shadow { width: 24px; height: 4px; margin-top: 3px; border-radius: 50%; background: rgba(255,190,0,0.22); filter: blur(1.5px);
  animation: shadow 3.2s cubic-bezier(.45,.05,.55,.95) infinite; animation-delay: calc(var(--i) * -0.46s); transform: translateY(calc(var(--lift) * -1)); }
@keyframes hover { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -7px, 0); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes shadow { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: 0.55; scale: 0.72; } }
.parade::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 4px; height: 30px; background: radial-gradient(closest-side, rgba(255,190,0,0.14), transparent); }
.parade::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 10px; height: 1px; background: linear-gradient(90deg, transparent, rgba(207,154,6,0.6), transparent); }

/* ---------- round ---------- */
.progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.pips { display: flex; gap: 3px; }
.pip { width: 12px; height: 14px; image-rendering: pixelated; }
.question { margin: 0; font-family: var(--f-read); font-weight: 700; font-size: 21px; line-height: 1.28; letter-spacing: -0.012em; color: var(--ink); text-wrap: pretty; }
.round-head { display: flex; flex-direction: column; gap: 8px; }

.bignum { text-align: center; font-family: var(--f-pixel); font-size: 34px; line-height: 1; color: var(--yellow); text-shadow: 0 3px 0 #7a5a00, 0 0 22px rgba(255,214,10,0.35); margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.bignum small { font-size: 0.55em; margin-left: 2px; }

.comb { position: relative; width: 100%; height: 232px; display: grid; place-items: center; flex: none; }
.comb > canvas { grid-area: 1 / 1; image-rendering: pixelated; }
.comb > .comb-glow { image-rendering: auto; mix-blend-mode: screen; pointer-events: none; }
.comb-wrap { position: relative; }
.comb-wrap::before { /* faint pooled honey glow under the comb */
  content: ""; position: absolute; inset: 10% 6% -4%; background: radial-gradient(closest-side, rgba(255,190,0,0.10), transparent 75%); pointer-events: none;
}
.comb-scale { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); background: var(--bg); padding: 0 8px; font-size: 10px; color: var(--soft); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }

.controls { display: flex; flex-direction: column; gap: 10px; }
.slider-row { display: grid; grid-template-columns: auto 1fr 76px; gap: 10px; align-items: center; }
/* the subtle "<1" toggle: hundredths mode for answers under 1% */
.sub1-btn { font-family: var(--f-pixel); font-size: 10px; color: var(--muted); background: none; border: 2px solid #3a3a3a; padding: 0 7px; height: 32px; min-width: 38px; cursor: pointer; }
.sub1-btn[aria-pressed="true"] { color: #111; background: var(--yellow); border-color: var(--yellow); }
.sub1-btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* the slider: chunky pixel track and a honey-drop thumb */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; cursor: pointer; --v: 50%; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; background: linear-gradient(90deg, var(--yellow) 0 var(--v), #2e2e2e var(--v) 100%);
  box-shadow: 0 2px 0 #000 inset, 0 0 0 2px #000;
}
input[type="range"]::-moz-range-track { height: 10px; background: #2e2e2e; box-shadow: 0 0 0 2px #000; }
input[type="range"]::-moz-range-progress { height: 10px; background: var(--yellow); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: var(--yellow);
  border: 4px solid #1a1a1a; box-shadow: 0 0 0 2px var(--yellow), 0 0 14px rgba(255,214,10,0.55);
}
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: 4px solid #1a1a1a; box-shadow: 0 0 0 2px var(--yellow), 0 0 14px rgba(255,214,10,0.55); }

.field {
  width: 100%; border: 6px solid; border-image: var(--px-input) / 6px; background: none; color: var(--ink);
  font-family: var(--f-pixel); font-size: 14px; padding: 6px 4px; text-align: center; min-height: 44px; border-radius: 0;
  -moz-appearance: textfield;
}
.field::-webkit-outer-spin-button, .field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field:focus { outline: none; border-image: var(--px-inputfocus) / 6px; }
.field.text { font-family: var(--f-read); font-weight: 600; font-size: 19px; text-align: left; padding: 8px 10px; min-height: 54px; }
.field::placeholder { color: #5e5e5e; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.text-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.text-reveal { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }

/* ---------- reveal ---------- */
.reveal { display: flex; flex-direction: column; gap: 10px; }
.hero { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; position: relative; }
.hero::before { content: ""; position: absolute; left: -10px; top: 50%; width: 150px; height: 120px; transform: translateY(-50%); background: radial-gradient(closest-side, rgba(255,190,0,0.18), transparent); pointer-events: none; }
.hero img.bee { position: relative; width: 112px; height: 112px; image-rendering: pixelated; display: block; }
.hero .tier { margin: 0; overflow-wrap: anywhere; font-family: var(--f-pixel); font-size: 20px; line-height: 1.3; color: var(--yellow); text-shadow: 0 3px 0 #7a5a00, 0 0 16px rgba(255,214,10,0.3); }
.hero .pts { margin: 6px 0 0; font-family: var(--f-pixel); font-size: 14px; color: var(--ink); }
.hero .pts small { color: var(--muted); font-size: 10px; margin-left: 4px; }
.hero .chip { margin-top: 8px; }
.hero .ruby-chip { color: #ff8fa3; }
.hero.center { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.hero.center::before { left: 50%; transform: translate(-50%, -60%); }
.answer-line { margin: 0; font-size: 14.5px; color: var(--ink); }
.hero .answer-line { margin-top: 8px; font-size: 13px; line-height: 1.35; color: #dcdcdc; }
.answer-line b { color: var(--soft); font-weight: 700; }
.note { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.legend-plain { margin: 0; font-size: 12px; color: var(--muted); text-align: center; display: flex; gap: 6px; align-items: center; justify-content: center; }

/* tier entrances: the whole hero arrives together */
.enter-burst { animation: burst 520ms cubic-bezier(.2,1.6,.4,1) both; }
.enter-diamond { animation: burst-big 640ms cubic-bezier(.2,1.6,.4,1) both; }
.enter-splash { animation: splash 560ms ease-out both; }
.enter-pop { animation: pop 300ms cubic-bezier(.3,1.5,.5,1) both; }
.enter-pulse { animation: pulse 700ms ease-out both; }
.enter-gentle { animation: gentle 600ms ease-out both; }
@keyframes burst { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
@keyframes burst-big { 0% { transform: scale(.3); opacity: 0; } 55% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(1); } }
@keyframes splash { 0% { transform: translateY(-14px) scaleY(1.1); opacity: 0; } 55% { transform: translateY(2px) scale(1.08, .92); opacity: 1; } 100% { transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0% { opacity: 0; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes gentle { from { opacity: 0; transform: translateY(6px); } }
.hero img.sparkle, .sparkle { position: absolute; width: 10px; height: 10px; image-rendering: pixelated; pointer-events: none; animation: twinkle 1.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- results ---------- */
.results-hero { text-align: center; padding: 6px 0 0; position: relative; }
.results-hero .ruby-label { font-family: var(--f-pixel); font-size: 14px; color: #ff4d6d; text-shadow: 0 2px 0 #5c0a1a, 0 0 14px rgba(255,60,100,.5); margin: 0 0 4px; letter-spacing: .1em; }
.results-hero img { width: 120px; height: 120px; image-rendering: pixelated; }
.total { font-family: var(--f-pixel); font-size: 44px; color: var(--yellow); line-height: 1; margin: 8px 0 0; text-shadow: 0 4px 0 #7a5a00, 0 0 26px rgba(255,214,10,.4); }
.outof { margin: 8px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 20px 1fr 36px auto; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid #1f1f1f; }
.row:last-child { border-bottom: 0; }
.row .n { font-family: var(--f-pixel); font-size: 10px; color: var(--muted); }
.row .q { font-size: 13.5px; color: var(--ink); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .t { display: block; font-size: 11px; color: var(--soft); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.row-bee { width: 36px; height: 36px; display: block; }
.row .p { font-family: var(--f-pixel); font-size: 12px; color: var(--yellow); text-align: right; min-width: 40px; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.72); display: flex; align-items: flex-end; justify-content: center; animation: fade 160ms ease-out both; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; border: 6px solid; border-image: var(--px-sheet) / 6px;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: rise 220ms cubic-bezier(.2,.9,.3,1) both;
}
.sheet h2 { margin: 0 0 12px; font-family: var(--f-pixel); font-size: 15px; line-height: 1.5; font-weight: 400; color: var(--yellow); }
.sheet p { margin: 0 0 12px; color: #dcdcdc; font-size: 14.5px; }
.sheet p b { color: var(--ink); }
.sheet .btn { margin-top: 6px; }
.sheet .y-row { padding: 10px 0; border-bottom: 1px solid #1f1f1f; }
.sheet .y-row:last-of-type { border-bottom: 0; }
.sheet .y-row .k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sheet .y-row .qq { font-size: 14px; color: var(--ink); margin: 2px 0 4px; }
.sheet .y-row .a { font-family: var(--f-pixel); font-size: 12px; color: var(--yellow); }
.sheet .y-row .a small { font-family: var(--f-body); font-size: 12px; color: var(--muted); margin-left: 6px; }
.sheet .src { font-size: 11.5px; color: var(--muted); }
.sheet .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fine-value { text-align: center; font-family: var(--f-pixel); font-size: 30px; color: var(--yellow); margin: 4px 0 8px; text-shadow: 0 3px 0 #7a5a00; }
.sheet .comb { height: 250px; margin-bottom: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 600px) {
  .scrim { align-items: center; }
}

/* ---------- toast & loading ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  border: 6px solid; border-image: var(--px-toast) / 6px; color: #111; font-weight: 700; font-size: 13.5px; padding: 2px 8px; white-space: nowrap;
  animation: toast 2.4s ease both; pointer-events: none;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.loading { margin: auto 0; text-align: center; color: var(--muted); font-family: var(--f-pixel); font-size: 12px; }
.loading::after { content: ""; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* tall phones: pin answer controls to the bottom */
@media (min-height: 880px) {
  .screen.round .controls.pinnable { margin-top: auto; }
}
@media (max-width: 360px) {
  .wordmark { font-size: 22px; }
  .question { font-size: 19px; }
  .bee-fly, .bee-slot.diamond .bee-fly, .bee-slot.ruby .bee-fly { width: 36px; height: 36px; }
  .stat .v { font-size: 13px; }
  .comb { height: 206px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- the honey jar ---------- */
.jar { display: block; image-rendering: pixelated; }
.jar-slot { position: relative; width: 40px; height: 48px; display: grid; place-items: center; justify-self: end; }
.jar-plus {
  position: absolute; right: 2px; top: 4px; font-family: var(--f-pixel); font-size: 10px; color: var(--yellow);
  text-shadow: 0 2px 0 #7a5a00, 0 0 8px rgba(255,214,10,.5); pointer-events: none; animation: jar-plus 1.3s ease-out both;
}
@keyframes jar-plus { 0% { opacity: 0; transform: translateY(14px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
.total-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.total-row .total { margin: 0; }
.jar-big { filter: drop-shadow(0 0 14px rgba(255,190,0,.28)); }

/* ---------- the round timer ---------- */
.timer { display: flex; align-items: center; gap: 8px; }
.timer-track { flex: 1; height: 8px; background: #1e1e1e; box-shadow: 0 0 0 2px #000, inset 0 2px 0 #000; position: relative; overflow: hidden; }
.timer-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 6px, #e6bf00 6px 8px);
  transition: width 200ms linear;
}
.timer-num { font-family: var(--f-pixel); font-size: 10px; color: var(--muted); min-width: 34px; text-align: right; }
.timer.low .timer-fill { background: repeating-linear-gradient(90deg, #ff9f1a 0 6px, #d97f00 6px 8px); }
.timer.low .timer-num { color: #ffb347; }
.timer.critical .timer-fill { background: repeating-linear-gradient(90deg, #ff4d4d 0 6px, #c93030 6px 8px); }
.timer.critical .timer-num { color: #ff6b6b; animation: tick-pulse 1s steps(2) infinite; }
@keyframes tick-pulse { 50% { opacity: .45; } }

/* ---------- text answers: suggest / refuse ---------- */
.field.text.suggested { border-image: var(--px-inputfocus) / 6px; color: var(--yellow); }
.field.text.refused { animation: shake 320ms ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.hint.suggest { color: var(--soft); font-weight: 600; }
.hint.refuse { color: #ff8f8f; font-weight: 600; }

/* ---------- the top 3 after a text round ---------- */
.top3 { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top3 li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px;
  border: 6px solid; border-image: var(--px-card) / 6px; padding: 4px 6px; font-weight: 600; font-size: 15px; }
.top3 .rk { font-family: var(--f-pixel); font-size: 11px; color: var(--soft); }
.top3 li.you { border-image: var(--px-chip) / 6px; }
.top3 li.you .lb { color: var(--yellow); }
.top3 .tag { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }

/* ---------- next Daily countdown ---------- */
.countdown { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.countdown .cd-time { font-family: var(--f-pixel); font-weight: 400; font-size: 12px; color: var(--soft); margin-left: 4px; font-variant-numeric: tabular-nums; }
.results-hero .countdown { margin-top: 10px; }
.timer.stopped { opacity: .35; }
.timer.stopped .timer-num { animation: none; }

/* ---------- home: the crew + the hidden ruby ---------- */
.crew-row { display: flex; align-items: flex-end; gap: 10px; }
.crew-row .parade-wrap { flex: 1; min-width: 0; }
/* the ruby bee floats on its own, a single pixel "?" underneath */
.mystery { flex: none; width: 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 2px; }
.mystery-fly { --i: 6; --lift: 0px; width: 48px; height: 48px; } /* next in line after the diamond: same hover and sway timing as the crew */
/* a grey shadow bee that glitches now and then, as if it isn't quite there */
.mystery-bee { display: block; width: 100%; height: 100%; image-rendering: pixelated; opacity: .9; }
/* .bee-fly .mystery-bee outranks the crew's ".bee-fly img" so the flicker applies */
.bee-fly .mystery-bee { animation: sway 3.2s cubic-bezier(.45,.05,.55,.95) infinite, flicker 4s linear infinite;
  animation-delay: calc(var(--i) * -0.46s - 0.8s), 1.5s; transform-origin: 50% 40%; }
@keyframes flicker { 0%, 78% { opacity: .9; translate: 0; } 80% { opacity: .12; translate: 2px 0; } 82% { opacity: .85; translate: -1px 0; } 85% { opacity: .04; translate: 1px 0; } 88%, 100% { opacity: .9; translate: 0; } }
@media (prefers-reduced-motion: reduce) { .bee-fly .mystery-bee { animation: none; } }
.mystery-q { width: 10px; height: 16px; image-rendering: pixelated; opacity: .45; filter: grayscale(1); animation: mystery-q 3.2s ease-in-out infinite; }
@keyframes mystery-q { 50% { opacity: .25; } }
@media (max-width: 360px) { .mystery { width: 44px; } .mystery-fly { width: 38px; height: 38px; } }

/* ---------- text: "which one?" ---------- */
.hint.which { color: var(--soft); }
.hint.which .which-q { font-family: var(--f-pixel); font-weight: 400; font-size: 11px; color: var(--yellow); margin-right: 4px; }

/* ---------- past games ---------- */
.pg-title { margin: 6px 0 4px; font-family: var(--f-read); font-weight: 700; font-size: 21px; line-height: 1.25; }
.pg-list { display: flex; flex-direction: column; padding: 4px 8px; }
.pg-row {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 12px 2px; background: none; border: 0; border-bottom: 1px solid #1f1f1f; color: var(--ink); text-align: left; cursor: pointer;
}
.pg-row:last-child { border-bottom: 0; }
.pg-row:hover .pg-date { color: var(--yellow); }
.pg-num { font-family: var(--f-pixel); font-size: 12px; color: var(--soft); }
.pg-date { font-size: 15px; font-weight: 600; display: flex; flex-direction: column; }
.pg-date small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pg-score { font-family: var(--f-pixel); font-size: 13px; color: var(--yellow); }
.pg-score small { font-family: var(--f-body); font-size: 11px; color: var(--muted); }
.pg-row.new .chip { color: #111; border-image: var(--px-toast) / 6px; }

/* ---------- hive hunt ---------- */
.hunt-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px 14px 14px; }
.hunt-card .btn { width: 100%; margin-top: 4px; }
.hunt-card .done { margin: 0; font-size: 15px; }
.hunt-card .done b { font-family: var(--f-pixel); font-weight: 400; color: var(--yellow); font-size: 13px; }
.hunt-prompt { margin: 0; font-family: var(--f-read); font-weight: 700; font-size: 18px; line-height: 1.3; }
.hunt-count small { font-size: .45em; color: var(--muted); text-shadow: none; }
.hunt-comb-host, .screen.hunt > .hunt-comb { display: flex; justify-content: center; }
.hunt-comb { display: flex; flex-direction: column; align-items: center; padding: 4px 0 2px; }
.hc-row { display: flex; gap: 3px; height: 26px; }
.hc-row:nth-child(even) { transform: translateX(15px); } /* nest half a cell over, like a real comb */
.hc-cell { width: 27px; height: 31px; image-rendering: pixelated; margin-top: -3px; }
.hc-cell.found { filter: drop-shadow(0 0 4px rgba(255,200,0,.45)); }
.hc-cell.pop { animation: pop 300ms cubic-bezier(.3,1.5,.5,1) both; }
.hunt-feedback { min-height: 18px; text-align: left; font-weight: 600; }
.hunt-feedback.good { color: var(--yellow); }
.hunt-feedback.refuse { color: #ff8f8f; }
.hunt-feedback.which { color: var(--soft); }
.hunt-found { display: flex; flex-wrap: wrap; gap: 6px; }
.hunt-found.missed .chip { color: var(--muted); border-image: var(--px-card) / 6px; }
.hunt-giveup { align-self: center; }
.hunt-hero { display: flex; flex-direction: column; align-items: center; }
.hunt-hero .hunt-bee { width: 112px; height: 112px; image-rendering: pixelated; margin: 6px 0 2px; }
.hunt-hero .total .of { font-size: .45em; color: var(--muted); text-shadow: none; }
.hunt-hero .hunt-prompt { margin-top: 6px; text-align: center; color: #dcdcdc; font-size: 16px; }
.hunt-lists .src { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); }
.hunt-mystery { width: 42px; height: 66px; image-rendering: pixelated; margin: 18px auto; animation: mystery-q 2.4s steps(2) infinite; }
.hunt-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.hunt-entry .field.text { min-width: 0; }
.btn.hunt-enter { width: auto; min-height: 54px; padding: 2px 14px 4px; font-size: 12px; }
/* eight tiers worst→best, then the ruby: sized to fit a 320px phone */
.parade { gap: 2px; padding-left: 0; padding-right: 0; }
.bee-slot { max-width: 48px; min-width: 0; }
.bee-fly { width: 40px; height: 40px; }
.bee-slot.diamond .bee-fly { width: 44px; height: 44px; }
.crew-row { gap: 4px; }
.mystery { width: 46px; }
.mystery-fly { width: 44px; height: 44px; } /* the diamond's size */
/* the ruby is exactly the size of the other bees */
@media (max-width: 360px) { .bee-fly, .bee-slot.diamond .bee-fly, .mystery-fly { width: 28px; height: 28px; } .mystery { width: 34px; } }

/* Past games sits inside the Daily card, under the main button */
.daily-card .past-btn { width: 100%; margin-top: 10px; }

/* ---------- results: how you stack up ---------- */
.standings { display: flex; flex-direction: column; gap: 10px; }
.standings .beat { margin: 0; font-size: 17px; font-weight: 700; }
.standings .beat b { font-family: var(--f-pixel); font-weight: 400; color: var(--yellow); font-size: 16px; }
.curve { position: relative; height: 150px; margin: 30px 0 0; }
.curve-svg { position: absolute; left: 0; top: 0; width: 100%; height: 110px; overflow: visible; display: block; }
.curve-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #fff; box-shadow: 0 0 0 2px #000, 0 0 10px rgba(255,214,10,.7); }
.curve-bee { position: absolute; width: 30px; height: 30px; margin: -40px 0 0 -15px; image-rendering: pixelated; animation: hover 3.2s ease-in-out infinite; }
.curve-axis { position: absolute; left: 0; right: 0; top: 116px; height: 14px; border-top: 1px solid #333; }
.curve-axis span { position: absolute; transform: translateX(-50%); top: 4px; font-size: 10px; color: var(--muted); }
.curve-you { position: absolute; top: 136px; transform: translateX(-50%); font-family: var(--f-pixel); font-size: 9px; color: var(--yellow); white-space: nowrap; }

/* text rounds: the full ranked list */
.text-reveal .all-btn { align-self: center; }
.full-list { margin: 0 0 14px; }
