/* The shared chrome (top bar, buttons, dialogs, stats grid, week strip, toast) is in
   hub/game.css, linked before this file. This sets the tokens it uses and the dinner table. */
:root {
  color-scheme: light dark;
  --bg: #f7f0ea;
  --bg-2: #efe3d9;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --ink: #2c1a1e;
  --muted: #6e5559;
  --line: rgba(44, 26, 30, 0.13);
  --accent: #8a3a4a; /* white text on it is 7.4:1 */
  --accent-deep: #6d2a38;
  --accent-ink: #ffffff;
  --wood: #b98457;
  --wood-2: #9b6a42;
  --cloth: #fbf6ef;
  --card: #fffdf8;
  --good: #2f7d4f;
  --bad: #c2412f;
  --shadow: rgba(80, 30, 30, 0.18);
  --display: Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --text: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110f;
    --bg-2: #1e1613;
    --panel: rgba(48, 36, 34, 0.76);
    --panel-solid: #2b201e;
    --ink: #f5e9e4;
    --muted: #c1aaa4;
    --line: rgba(245, 233, 228, 0.13);
    --accent: #e48a9b;
    --accent-deep: #d66f83;
    --accent-ink: #2a0b12;
    --wood: #6b4a30;
    --wood-2: #573b25;
    --cloth: #2e2421;
    --card: #3a2d2a;
    --good: #6fd398;
    --bad: #ff8a78;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font: 600 16px/1.4 var(--text); -webkit-font-smoothing: antialiased; background: linear-gradient(180deg, var(--bg), var(--bg-2)) fixed; }
button { -webkit-tap-highlight-color: transparent; }
.app { width: 100%; max-width: 520px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.logo { margin: 0; font: 700 1.7rem/1 var(--display); white-space: nowrap; color: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .logo { color: var(--accent); } }
.day { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }

.play { display: flex; flex-direction: column; gap: 10px; }
.meta { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-size: 0.85rem; color: var(--muted); }
.clock { font: 600 1rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------------------------------------------------------------- the table */
.table-wrap { display: flex; justify-content: center; }
.table { position: relative; width: min(100%, 360px, 46vh); aspect-ratio: 1; }
.cloth {
  position: absolute; inset: 27%; border-radius: 50%;
  background: radial-gradient(circle, var(--cloth) 0 62%, var(--wood) 63% 100%);
  box-shadow: 0 0 0 6px var(--wood-2), 0 18px 40px -18px var(--shadow);
  display: grid; place-items: center;
}
.cw { font-size: 0.72rem; color: var(--muted); text-align: center; max-width: 70%; }
.seat {
  position: absolute; transform: translate(-50%, -50%);
  width: 23%; min-height: 44px; padding: 0;
  border: 2px dashed var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 60%, transparent);
  color: var(--muted);
  display: grid; place-items: center;
}
.seat .num { font: 600 1.1rem/1 var(--display); opacity: 0.6; }
.seat.full { border-style: solid; border-color: transparent; background: none; }
.seat .sn { position: absolute; top: -8px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--muted); color: var(--panel-solid); font: 700 0.68rem/18px var(--text); font-style: normal; }
.seat.head .sn { display: none; }
.seat.wrong .pc { box-shadow: 0 0 0 3px var(--bad); }
.seat.sel .pc { box-shadow: 0 0 0 3px var(--accent); transform: translateY(-3px); }
.seat:disabled { cursor: default; opacity: 1; }
.pc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 100%; min-height: 42px; padding: 3px 2px; border-radius: 10px;
  background: var(--card); color: var(--ink);
  box-shadow: 0 2px 0 var(--line), 0 6px 14px -8px var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.pc b { font: 600 clamp(0.78rem, 3.4vw, 0.98rem)/1.1 var(--display); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc small { font-size: 0.66rem; line-height: 1.1; }
.pc.host { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- the hand and the wishes */
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 46px; }
.hand.empty { min-height: 0; }
.hand-card { width: 72px; padding: 0; border: 0; background: none; }
.hand-card.sel .pc { box-shadow: 0 0 0 3px var(--accent); transform: translateY(-4px); }
.clues { list-style: none; margin: 0; padding: 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 6px; }
.clues li { display: flex; gap: 8px; align-items: baseline; font-size: 0.92rem; }
.tick { flex: none; width: 1.2em; text-align: center; font-weight: 800; color: var(--muted); }
.clues li.ok .tick { color: var(--good); }
.clues li.ok { color: color-mix(in srgb, var(--ink) 70%, var(--good)); }
.clues li.bad .tick, .clues li.bad { color: var(--bad); }
.acts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.how-line { margin: 0; min-height: 1.4em; text-align: center; font-size: 0.9rem; color: var(--muted); }
.foot { display: flex; justify-content: flex-end; }

.how { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; text-align: left; font-size: 0.92rem; }
.btn.wide { margin-top: 16px; }
.kicker { color: var(--muted); }
.res-line { margin: 0 0 12px; font-size: 1.05rem; }
.wd.today i { outline: 2px dashed var(--accent); outline-offset: -2px; }
.wd.great i { background: var(--good); color: #fff; font-size: 0.62rem; }
.wd.done i { background: var(--line); font-size: 0.62rem; }
.toast { z-index: 10; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hand-card { width: 64px; }
}
