/* Base */
:root { color-scheme: light; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Phone web app: instant taps (no double-tap zoom), visible press feedback, no text selection on buttons. */
button, .choice { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (prefers-reduced-motion: no-preference) {
  button { transition: transform 0.08s ease, opacity 0.08s ease; }
  button:active { transform: scale(0.97); opacity: 0.9; }
}
.options li:active { background: var(--miss); }
body { margin: 0; }
img { max-width: 100%; }

/* Layout: one centered column. Masthead with title and mode switch, a short legend, the guess box, then a stack of guess rows (six labeled tiles each, newest on top) and a result panel. */
:root {
  --bg: #F1F4F8;
  --surface: #FFFFFF;
  --ink: #15202B;
  --muted: #586677;
  --line: #D3DAE3;
  --accent: #2A5C91;
  --accent-ink: #FFFFFF;
  --hit: #25774A;
  --hit-ink: #FFFFFF;
  --near: #E3B63D;
  --near-ink: #2A2000;
  --miss: #DCE2E9;
  --miss-ink: #15202B;
  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F151C;
    --surface: #17202A;
    --ink: #E6EBF1;
    --muted: #97A4B3;
    --line: #2A3441;
    --accent: #86B6E8;
    --accent-ink: #0C1520;
    --hit: #2C8355;
    --hit-ink: #FFFFFF;
    --near: #C99A22;
    --near-ink: #1A1400;
    --miss: #2B3542;
    --miss-ink: #E6EBF1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F151C;
  --surface: #17202A;
  --ink: #E6EBF1;
  --muted: #97A4B3;
  --line: #2A3441;
  --accent: #86B6E8;
  --accent-ink: #0C1520;
  --hit: #2C8355;
  --hit-ink: #FFFFFF;
  --near: #C99A22;
  --near-ink: #1A1400;
  --miss: #2B3542;
  --miss-ink: #E6EBF1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
h1 { font-family: var(--font-display); font-weight: 800; font-size: 2.3rem; line-height: 1; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.sub { margin: 6px 0 0; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: flex-start; gap: 7px; min-width: 0; }
.swatch { flex: none; width: 14px; height: 14px; border-radius: 4px; margin-top: 2px; }
.swatch.hit { background: var(--hit); }
.swatch.near { background: var(--near); }

.status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--muted); }
#count { font-weight: 700; color: var(--ink); }

.guessbox { position: relative; display: flex; gap: 8px; }
.guessbox input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.guessbox input::placeholder { color: var(--muted); }
.primary { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 0 20px; border-radius: 8px; }
.secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 500; padding: 10px 16px; border-radius: 8px; }
.options {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; margin: 0; padding: 4px; list-style: none;
  max-height: min(260px, 38dvh); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.options li { padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.options li[aria-selected="true"] { background: var(--miss); }
.options li.none { color: var(--muted); cursor: default; }
.options li.opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.options .he { flex: none; color: var(--muted); font-size: 16px; }
.msg { margin: -8px 0 0; min-height: 1.3em; font-size: 13px; color: var(--muted); }

.rows { display: flex; flex-direction: column; gap: 16px; }
.empty { margin: 0; padding: 18px 0; color: var(--muted); max-width: 52ch; }
.guess { display: flex; flex-direction: column; gap: 6px; }
.cap { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile {
  min-width: 0; min-height: 78px; padding: 8px 8px 9px; border-radius: 8px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  background: var(--miss); color: var(--miss-ink);
}
.tile.hit { background: var(--hit); color: var(--hit-ink); }
.tile.near { background: var(--near); color: var(--near-ink); }
.tile .head { display: flex; justify-content: space-between; gap: 4px; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; opacity: 0.9; }
.tile .mark { font-weight: 700; }
.tile .v { font-weight: 700; font-size: 16px; line-height: 1.15; overflow-wrap: anywhere; }
.tile.addr .v { font-size: 12.5px; font-weight: 600; }
.tile .arrow { font-size: 12px; }
.tile .sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; opacity: 0.92; }
@media (prefers-reduced-motion: no-preference) {
  .tile.fresh { animation: flip 0.55s ease both; animation-delay: calc(var(--i) * 110ms); }
  @keyframes flip { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: rotateX(0); opacity: 1; } }
}

.result { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.result h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.015em; text-wrap: balance; }
.result p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }

/* Home screen */
.home { max-width: 520px; margin: 0 auto; padding-top: clamp(16px, 9vh, 96px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.8rem, 13vw, 4.6rem); line-height: 0.95; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.home .sub { margin: 14px 0 0; }
.choices { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.choice {
  width: 100%; min-height: 124px; padding: 22px 20px; border-radius: 16px; border: 2px solid var(--accent);
  background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.choice.main { background: var(--accent); color: var(--accent-ink); }
.ct { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.02em; }
.cs { font-size: 14px; opacity: 0.88; max-width: 32ch; }
.nextbday { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
.nb-day { flex: none; width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--near); color: var(--near-ink); font-size: 22px; font-weight: 700; }
.nb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nb-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nb-names { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.nb-date { font-size: 13px; color: var(--muted); }
.nb-count { flex: none; min-width: 52px; display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.nb-unit { margin-top: 3px; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.nextbday.bday { border: 2px solid var(--near); padding: 13px 15px; }
.nextbday.bday .nb-label { color: var(--accent); }
.nextbday.bday .nb-names { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.15; letter-spacing: -0.01em; }
.dnext { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.14); font-size: 13px; font-weight: 500; }
.dnext b { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
/* "Login as admin" joke button (menu only) and its 3-second overlay */
/* The menu fills the screen so the button lands in the bottom-right corner, or just below the last card on short screens. */
#hub { min-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.admin-btn {
  margin-top: auto; align-self: flex-end;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.whomp {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(8, 12, 18, 0.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: whompIn 0.25s ease both;
}
.whomp.out { animation: whompOut 0.3s ease both; }
.whomp p {
  margin: 0; max-width: 14ch; text-align: center; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 11vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance;
}
@keyframes whompIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes whompOut { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .whomp p { animation: whompPop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
  @keyframes whompPop { from { transform: scale(0.6); } to { transform: scale(1); } }
}
.soon { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.soon-label { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: left; }
.choice.locked { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 12px; min-height: 0; padding: 18px 16px 18px 20px; border: 2px dashed var(--line); color: var(--muted); cursor: not-allowed; user-select: none; }
.locked .lk-main { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; opacity: 0.75; }
.locked .ct { font-size: 1.6rem; }
.locked .cs { opacity: 1; }
.clock { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.clock[hidden] { display: none; }
.clock span { padding: 7px 4px 6px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.clock b { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.clock i { font-style: normal; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }
.lk-side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.backrow { width: 100%; display: flex; justify-content: flex-start; margin-bottom: -8px; }

/* Birthday calendar */
.wrap.wide { max-width: 980px; }
.csearch { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.csearch::placeholder { color: var(--muted); }
.cnote { margin: -4px 0 0; min-height: 1.3em; font-size: 13px; color: var(--muted); }
.cmonths { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.cmonth { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cmonth.now { border: 2px solid var(--accent); padding: 13px; }
.chead { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.che { font-weight: 500; font-size: 1.05rem; color: var(--muted); }
.cbadge { margin-left: auto; font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 3px 8px; border-radius: 999px; }
.clist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.clist li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cday { flex: none; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--miss); color: var(--miss-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cday:lang(he) { font-size: 16px; }
.cday.unk { color: var(--muted); font-weight: 500; }
.cwho { min-width: 0; display: flex; flex-direction: column; }
.cname { font-weight: 700; overflow-wrap: anywhere; }
.csub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cnone { margin: 0; font-size: 13px; color: var(--muted); }
.rules { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.rules h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.rules p { margin: 0; }
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rules li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.rules li > span:last-child { min-width: 0; }
.rules .swatch { margin-top: 4px; }
.swatch.miss { background: var(--miss); border: 1px solid var(--line); }
.samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sample { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.sample .tile { min-height: 70px; }

/* Intro: walking up to the house. Percent values are the door's place inside the picture. */
.intro { position: fixed; inset: 0; z-index: 100; background: #0b1020; overflow: hidden; }
.intro-bg { position: absolute; inset: -60px; background-image: var(--house); background-size: cover; background-position: center; filter: blur(22px) brightness(0.7); }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-image: var(--house); background-size: 100% 100%; background-repeat: no-repeat; visibility: hidden; }
.stage.on { visibility: visible; animation: introfade 0.7s ease both; }
.stage.px, .stage.px .door-slab, .stage.px .door-fg { image-rendering: pixelated; }
@keyframes introfade { from { opacity: 0; } to { opacity: 1; } }
.door-light {
  position: absolute; left: 49.1046%; top: 48.5155%; width: 9.8021%; height: 15.9244%; overflow: hidden; visibility: hidden;
  background: linear-gradient(#ffe7b0 0 52%, #8c5a30 52% 100%);
}
.door-light::before { content: ""; position: absolute; left: 26%; right: 26%; top: 18%; height: 42%; background: #fff8dc; box-shadow: 0 0 5px 2px rgba(255, 240, 190, 0.9); }
.door-light::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(70, 35, 12, 0.6), rgba(70, 35, 12, 0) 30%, rgba(70, 35, 12, 0) 70%, rgba(70, 35, 12, 0.6)),
    linear-gradient(rgba(70, 35, 12, 0.45), rgba(70, 35, 12, 0) 25%, rgba(70, 35, 12, 0) 60%, rgba(70, 35, 12, 0.4));
}
.door-slab { image-rendering: pixelated; }
@keyframes introfade { from { opacity: 0; } to { opacity: 1; } }
.door-light {
  position: absolute; left: 49.1046%; top: 48.5155%; width: 9.8021%; height: 15.9244%;
  background: radial-gradient(ellipse 75% 85% at 50% 75%, #fff2cf 0%, #f7c57f 42%, #a05c26 100%);
  box-shadow: inset 0 0 0.6em rgba(70, 32, 0, 0.55);
}
.door-slab {
  position: absolute; left: 49.1046%; top: 48.5155%; width: 9.8021%; height: 15.9244%;
  background-image: var(--house); background-repeat: no-repeat; background-size: 1020.1923% auto; background-position: 54.4410% 57.7047%;
  transform-origin: left center; backface-visibility: hidden;
}
.door-fg {
  position: absolute; left: 46.9369%; top: 55.7355%; width: 7.5401%; height: 8.7045%;
  background-image: var(--house); background-repeat: no-repeat; background-size: 1326.2500% auto; background-position: 50.7645% 61.0495%;
  clip-path: polygon(0% 0%, 57.5% 0%, 57.5% 48.1%, 60% 48.1%, 100% 100%, 0% 100%);
}
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.5) 100%); }
.loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  color: #fff; font-family: 'Press Start 2P', ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: 0.08em; transition: opacity 0.4s ease;
}
.loading.gone { opacity: 0; pointer-events: none; }
.track { display: block; width: min(240px, 60vw); height: 18px; border: 3px solid #fff; padding: 2px; }
.fill { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #4ade80 0 10px, transparent 10px 14px); }
.skip {
  position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  font-family: 'Press Start 2P', ui-monospace, Menlo, monospace; font-size: 10px; color: #fff;
  background: rgba(0, 0, 0, 0.55); border: 2px solid #fff; padding: 9px 11px; border-radius: 0;
}

/* Mystery Maccabee: card unlocked state on the menu */
.choice.locked.open { border: 2px solid var(--accent); color: var(--ink); cursor: pointer; }
.choice.locked.open .lk-main { opacity: 1; }
.choice.locked.open .lk-side { color: var(--accent); }
.choice.locked { cursor: pointer; }

/* Mystery Maccabee tracker page */
.mm-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.mm-card h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.015em; }
.mm-card p { margin: 0; color: var(--muted); }
.mm-locked { align-items: center; text-align: center; padding: 32px 18px; color: var(--muted); }
.mm-locked h2 { color: var(--ink); }
.mm-track { display: flex; flex-direction: column; gap: 14px; }
.mm-progress { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.mm-progress b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mm-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.mm-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hit); }
.mm-live.off::before { background: var(--muted); }
.mm-bar { height: 8px; border-radius: 999px; background: var(--miss); overflow: hidden; }
.mm-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.4s ease; }
.mm-field { display: flex; flex-direction: column; gap: 6px; }
.mm-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mm-hint { margin: 0; font-size: 13px; color: var(--muted); }
.mm-input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.mm-input::placeholder { color: var(--muted); }
.mm-save { min-height: 48px; font-size: 16px; }
.mm-save:disabled { opacity: 0.5; cursor: default; }
.mm-msg { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); }
.mm-msg.err { color: #D9534F; }

/* person picker */
.pick { position: relative; }
.pick-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 10px; background: var(--miss); }
.pick-name { font-weight: 700; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.pick-name small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.pick-change { flex: none; padding: 7px 12px; font-size: 13px; }
.pick-list { margin: 6px 0 0; padding: 4px; list-style: none; max-height: min(280px, 40dvh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pick-list li { padding: 11px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.pick-list li:active, .pick-list li:hover { background: var(--miss); }
.pick-list li .he { color: var(--muted); }
.pick-list li.none { color: var(--muted); cursor: default; }

/* the chain */
.mm-listtitle { margin: 8px 0 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mm-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mm-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.mm-num { grid-row: span 2; align-self: start; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--near); color: var(--near-ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.mm-who { font-weight: 700; overflow-wrap: anywhere; }
.mm-who .arrow { color: var(--muted); font-weight: 500; margin: 0 4px; }
.mm-gift { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mm-gift .none { font-style: italic; }
.mm-edit { flex: none; padding: 4px 10px; font-size: 12px; }
.mm-editrow { display: flex; gap: 6px; }
.mm-editrow .mm-input { padding: 8px 10px; }
.mm-editrow button { flex: none; padding: 0 12px; }
.mm-empty { margin: 0; color: var(--muted); }
.mm-done { border: 2px solid var(--hit); text-align: center; }

/* host sign-in */
.mm-host { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.mm-hostbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.mm-hostbtns { display: flex; gap: 8px; }
.mm-hostbtns button { padding: 8px 12px; font-size: 13px; }
.mm-login summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; }
.mm-loginform { display: flex; gap: 8px; margin-top: 8px; }
.mm-loginform .mm-input { flex: 1; min-width: 0; }
.mm-loginform button { padding: 0 18px; }
.mm-editrow { flex: 1; min-width: 0; }

/* Merge game (preview, reached at #merge) */
.mg { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; margin-top: -8px; }
.mg-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mg-back { justify-self: start; padding: 8px 14px; }
.mg-scorebox { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.mg-score { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.mg-best { margin-top: 4px; font-size: 12px; color: var(--muted); }
.mg-best b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mg-next { justify-self: end; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mg-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#mgNext { width: 56px; height: 56px; display: block; }
.mg-boxwrap { position: relative; display: flex; justify-content: center; }
.mg-canvas { display: block; touch-action: none; -webkit-user-select: none; user-select: none; border-radius: 14px; }
.mg-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; background: rgba(8, 12, 18, 0.72); color: #fff; border-radius: 14px; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.mg-over h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; letter-spacing: -0.02em; }
.mg-final { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; }
.mg-newbest { margin: 0; color: var(--near); font-weight: 700; }
.mg-over .primary { padding: 12px 26px; font-size: 16px; }
.mg-chain { width: 100%; height: 44px; display: block; }
.mg-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.mg-foot button { padding: 6px 12px; font-size: 13px; }
.choice.locked[aria-disabled="true"] { cursor: default; }
button[aria-disabled="true"]:active { transform: none; opacity: 1; }

/* Chanukah Merge host sign-in (before it opens) */
.gate { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 12, 18, 0.7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.gate-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 22px 20px 16px; text-align: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.gate-card svg { align-self: center; color: var(--muted); }
.gate-card h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.015em; }
.gate-card p { margin: 0; color: var(--muted); font-size: 14px; }
.gate-card .mm-input { text-align: center; letter-spacing: 0.3em; }
.gate-card .primary { min-height: 46px; font-size: 16px; }
.gate-card .secondary { min-height: 40px; }
.mg-footbtns { display: flex; gap: 8px; }

/* Chanukah Merge: oil timer next to the Next box */
.mg-top { grid-template-columns: auto 1fr auto; }
.mg-right { justify-self: end; display: flex; align-items: stretch; gap: 6px; }
.mg-timer { min-width: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mg-timer b { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1; font-variant-numeric: tabular-nums; color: #D9A21E; }
.mg-timer.idle b { color: var(--muted); }
.mg-timer.soon { border-color: #E5484D; }
.mg-timer.soon b { color: #E5484D; }
.mg-timer.pouring { border-color: #D9A21E; background: rgba(240, 186, 40, 0.14); }
.mg-next { padding: 4px 4px 4px 10px; gap: 4px; }
.mg-reason { margin: -4px 0 0; font-size: 14px; color: rgba(255, 255, 255, 0.85); }
@media (prefers-reduced-motion: no-preference) {
  .mg-timer.soon b { animation: mgPulse 0.8s ease-in-out infinite; }
  @keyframes mgPulse { 50% { opacity: 0.45; } }
}

/* Chanukah Merge header: Menu | score | Oil | Greeks | Next (label above the picture) */
.mg-top { gap: 6px; }
.mg-back { padding: 8px 11px; }
.mg-score { font-size: 1.9rem; }
.mg-right { gap: 5px; }
.mg-timer { min-width: 50px; padding: 4px 6px; border-radius: 12px; }
.mg-timer .mg-label { font-size: 9.5px; letter-spacing: 0.06em; }
.mg-timer b { font-size: 1.1rem; }
.mg-timer.greeks b { color: #4F8FD8; }
.mg-timer.greeks.idle b { color: var(--muted); }
.mg-timer.greeks.soon b { color: #E5484D; }
.mg-timer.greeks.here { border-color: #4F8FD8; background: rgba(79, 143, 216, 0.14); }
.mg-next { flex-direction: column; gap: 0; padding: 3px 6px 2px; border-radius: 12px; }
.mg-next .mg-label { font-size: 9.5px; letter-spacing: 0.06em; }
#mgNext { width: 40px; height: 40px; }
@media (max-width: 359px) {
  .mg-back { padding: 7px 8px; font-size: 13px; }
  .mg-score { font-size: 1.5rem; }
  .mg-timer { min-width: 44px; padding: 3px 4px; }
  .mg-timer b { font-size: 0.98rem; }
}

/* ----- Reaction test: full-screen colored pad ----- */
.rx { position: fixed; inset: 0; z-index: 40; }
.rx-pad {
  --rx-bg: #2547A8;
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; color: #FFFFFF; background: var(--rx-bg);
  padding: calc(env(safe-area-inset-top) + 72px) calc(env(safe-area-inset-right) + 24px) calc(env(safe-area-inset-bottom) + 40px) calc(env(safe-area-inset-left) + 24px);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; outline: none;
}
.rx-pad.rx-start { --rx-bg: #2547A8; }  /* royal blue */
.swatch.zm-red { background: #A3202E; }
.swatch.zm-green { background: #18804A; }
.rx-pad.rx-wait  { --rx-bg: #A3202E; }  /* royal red */
.rx-pad.rx-go    { --rx-bg: #18804A; }  /* royal green */
.rx-pad p { margin: 0; }
.rx-back {
  position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: calc(env(safe-area-inset-left) + 16px);
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.12); color: #FFFFFF; font: 600 1rem var(--font-body); cursor: pointer;
}
.rx-title { position: absolute; top: calc(env(safe-area-inset-top) + 14px); line-height: 44px; left: 0; right: 0; pointer-events: none;
  font: 700 0.85rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.rx-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 13vw, 4.2rem); line-height: 1.05; letter-spacing: -0.02em; }
.rx-big.rx-clock { font-variant-numeric: tabular-nums; font-size: clamp(3.4rem, 20vw, 6rem); }
.rx-msg { font: 600 1.15rem/1.4 var(--font-body); max-width: 22em; opacity: 0.95; }
.rx-sub { font: 500 1rem var(--font-body); opacity: 0.8; }
.rx-best { font: 700 1.05rem var(--font-body); font-variant-numeric: tabular-nums; margin-top: 18px !important; opacity: 0.9; }
.rx-round { font: 700 1rem/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; white-space: pre-line; }
.rx-extra { font: 700 1.2rem/1.45 var(--font-body); font-variant-numeric: tabular-nums; white-space: pre-line; }
.rx-best:empty, .rx-sub:empty, .rx-msg:empty, .rx-round:empty, .rx-extra:empty { display: none; }
.rx-choices { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 300px; margin-top: 18px; }
.rx-choices[hidden] { display: none; }
.rx-btn {
  min-height: 54px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.7); background: transparent;
  color: #FFFFFF; font: 700 1.15rem var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rx-btn-main { background: #FFFFFF; color: #2547A8; border-color: #FFFFFF; }
.rx-btn:active { transform: scale(0.98); }
.rx-pad.rx-still { touch-action: none; }   /* swipes and grid taps never scroll or zoom */
.rx-big.rx-arrow { font-family: var(--font-body); font-size: clamp(7rem, 42vw, 11rem); line-height: 0.9; }
.rx-big.rx-arrow.rx-bad { color: #C4202F; text-shadow: 0 0 0 #fff, 0 0 18px rgba(255,255,255,0.5); }
.rx-pick { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 320px; margin-top: 10px; }
.rx-pick[hidden] { display: none; }
.rx-pick .rx-btn { min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }
.rx-pick small { font: 500 0.95rem var(--font-body); opacity: 0.8; }
.rx-gridon { gap: 10px; }
.rx-gridon .rx-big.rx-clock { font-size: clamp(2.4rem, 12vw, 3.4rem); }
.rx-grid {
  --cell: min(22vw, 10.5svh, 92px);
  display: grid; grid-template-columns: repeat(3, var(--cell)); gap: min(4vw, 2svh, 18px);
  margin-top: 4px;
}
.rx-grid[hidden] { display: none; }
.rx-num {
  width: var(--cell); height: var(--cell); border-radius: 50%; border: 0; padding: 0;
  background: #FFFFFF; color: #18804A; font-family: var(--font-display); font-weight: 800; font-size: calc(var(--cell) * 0.42);
  font-variant-numeric: tabular-nums; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 0 rgba(0,0,0,0.18); transition: background 0.12s, color 0.12s, transform 0.08s;
}
.rx-num:active { transform: scale(0.95); }
.rx-num.done { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.45); box-shadow: none; }
.rx-num.wrong { animation: rx-wrong 0.35s; }
@keyframes rx-wrong { 0%, 60% { background: #A3202E; color: #FFFFFF; transform: translateX(-3px); } 30% { transform: translateX(3px); } 100% { background: #FFFFFF; color: #18804A; transform: none; } }
@media (max-width: 340px) { .rx-title { left: 90px; right: 16px; text-align: right; } }
@media (max-height: 640px) {
  .rx-pad { gap: 8px; }
  .rx-best { margin-top: 6px !important; }
  .rx-choices { margin-top: 8px; gap: 8px; }
  .rx-btn { min-height: 46px; }
  .rx-extra { font-size: 1.05rem; line-height: 1.35; }
}
