/* ═══════════════════════════════════════════════════════════════════════════
   Heads Up — black and green, in the Game Room's house style.

   This game has no canvas: the word itself is the whole screen, so the layout
   is sized in viewport units and the two answer buttons are deliberately huge
   (they are the fallback for every device without a motion sensor).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-display: 'Bebas Neue', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg: #000000;
  --surface: #0b0b0b;
  --surface2: #131313;
  --surface3: #1c1c1c;
  --border: #232323;
  --border2: #2f2f2f;

  --text: #f5f5f5;
  --muted: #8a8a8a;

  --green: #1db954;
  --green-bright: #1ed760;
  --green-dim: #0f5c2a;
  --red: #e91429;
}

html[data-theme='light'] {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface2: #f0f3f0;
  --surface3: #e6eae6;
  --border: #d8ded8;
  --border2: #c6cec6;
  --text: #101410;
  --muted: #5c665c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.shell { max-width: 900px; margin: 0 auto; padding: 14px 16px 44px; }

/* ── Header ────────────────────────────────────────────────────────────── */

.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.home-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  color: var(--muted); text-decoration: none; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  transition: color .15s, border-color .15s;
}
.home-btn svg { width: 14px; height: 14px; }
.home-btn:hover { color: var(--green); border-color: var(--green-dim); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { font-size: 20px; line-height: 1; }
.brand-text { font-family: var(--font-display); font-size: 22px; letter-spacing: .12em; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-badge { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: color .15s, border-color .15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--green); border-color: var(--green-dim); }

.settings-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; min-width: 200px; z-index: 100;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8); overflow: hidden; display: none;
}
.settings-dropdown.open { display: block; }
.dropdown-item {
  display: block; padding: 11px 14px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--border); cursor: pointer;
  text-decoration: none; transition: color .2s, background .2s;
}
.dropdown-item:hover { color: var(--green); background: var(--surface3); }
.dropdown-item:last-child { border-bottom: none; }

/* ── Screens ───────────────────────────────────────────────────────────── */

.screen { display: none; padding-top: 18px; }
.screen.active { display: block; }

.screen-title {
  font-family: var(--font-display); font-size: 40px; letter-spacing: .04em;
  margin: 0 0 6px; color: var(--text);
}
.screen-sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 18px; max-width: 74ch; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.tilt-hint { display: block; font-size: 11px; margin-top: 16px; }

/* ── Buttons and fields ────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-display); font-size: 16px; letter-spacing: .08em;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border2); border-radius: 10px;
  padding: 9px 16px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green); border-color: var(--green); color: #04140a; font-weight: 700; }
.btn-primary:hover { background: var(--green-bright); color: #04140a; }
.btn-sm { font-size: 13px; padding: 6px 11px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.field label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.field input,
.field select {
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px;
  color: var(--text); padding: 8px 10px; font-size: 14px; font-family: var(--font-body);
}
.field input:focus,
.field select:focus { outline: none; border-color: var(--green); }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--green);
  border: 1px solid var(--green-dim); border-radius: 999px; padding: 5px 11px;
}

/* ── Menu ──────────────────────────────────────────────────────────────── */

.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.mode-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .18s, background .18s;
}
.mode-card:hover { border-color: var(--green-dim); background: var(--surface2); }
.mode-icon { font-size: 26px; line-height: 1; }
.mode-name { font-family: var(--font-display); font-size: 22px; letter-spacing: .04em; }
.mode-desc { color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.mode-form { display: flex; flex-direction: column; }

/* ── Game ──────────────────────────────────────────────────────────────── */

.game-layout { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hud-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.hud-stat { display: flex; flex-direction: column; gap: 2px; }
.hud-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.hud-value { font-family: var(--font-display); font-size: 22px; letter-spacing: .04em; }
.hud-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* The clock, as a bar. It goes red in the last ten seconds. */
.time-track {
  height: 6px; width: 100%; border-radius: 999px;
  background: var(--surface3); overflow: hidden;
}
.time-fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: var(--green); transition: width .12s linear, background .3s;
}
.time-fill.low { background: var(--red); }

/* The word card: the biggest thing on the page, because it is read from
   arm's length by someone who is deliberately not looking at it. */
.word-card {
  position: relative; overflow: hidden;
  min-height: 42vh; border-radius: 16px;
  border: 1px solid var(--border2); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 22px 16px; text-align: center;
}
.word-category {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .22em;
  color: var(--muted); text-transform: uppercase;
}
.word-text {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(46px, 13vw, 128px); line-height: 1.02;
  letter-spacing: .02em; word-break: break-word;
  color: var(--text); transition: color .12s;
}
.word-text.pulse { color: var(--green-bright); }

/* The tick or arrow that confirms an answer, without stealing the screen. */
.word-flash {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(70px, 22vw, 190px); opacity: 0;
}
.word-flash.show { animation: flash .5s ease-out; }
.word-flash.good { color: var(--green-bright); }
.word-flash.bad { color: var(--red); }
@keyframes flash {
  0%   { opacity: 0; transform: scale(.7); }
  25%  { opacity: .95; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* The two answer buttons — the tap fallback for every device. */
.answer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 16px 10px; min-height: 96px;
  border-radius: 14px; cursor: pointer; touch-action: manipulation;
  font-family: var(--font-display);
  border: 1px solid var(--border2); background: var(--surface2); color: var(--text);
  transition: background .15s, border-color .15s, transform .08s;
}
.answer-btn:active { transform: translateY(2px); }
.answer-btn .answer-icon { font-size: 26px; line-height: 1; }
.answer-btn .answer-label { font-size: 22px; letter-spacing: .1em; }
.answer-btn small { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.answer-correct { border-color: var(--green-dim); }
.answer-correct:hover { background: rgba(29, 185, 84, 0.14); border-color: var(--green); color: var(--green-bright); }
.answer-skip { border-color: var(--border2); }
.answer-skip:hover { background: rgba(233, 20, 41, 0.12); border-color: var(--red); color: #ff6b7d; }

.tilt-status { font-size: 11.5px; margin: 0; }

/* ── Results ───────────────────────────────────────────────────────────── */

.over-list {
  display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto;
}
.over-list .passed {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border2); border-radius: 999px; padding: 4px 10px;
}
.over-list .none { font-size: 13px; color: var(--muted); }

/* ── Small screens ─────────────────────────────────────────────────────── */

@media (max-width: 420px) {
  .screen-title { font-size: 32px; }
  .answer-btn { min-height: 84px; }
  .word-card { min-height: 38vh; }
}
