/* Santa vs the Grinch: the Slow Bal palette (navy, cream, moon-gold) with Christmas red and pine green. Upright type. */
:root {
  --navy: #0d4265; --navy-deep: #053a5d; --cream: #fbe9cc; --paper: #fcefd8; --moon: #f9e3ac;
  --red: #b3261e; --pine: #1f5a3a; --ink: #0b3a5e; --muted: #5d7b8c;
  --font: "Lato", system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--navy-deep); }
body { background: radial-gradient(circle at 80% 0, #18577f, var(--navy-deep) 60%); background-attachment: fixed; color: var(--cream); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2 { margin: 0.4rem 0 0.8rem; line-height: 1.2; }
h1 small, h2 small, p small, label small { display: block; font-size: 0.6em; font-weight: 500; opacity: 0.75; margin-top: 0.15rem; }
p small, label small { font-size: 0.8em; }
button { font: inherit; cursor: pointer; border-radius: 999px; border: 0; }
button:disabled { opacity: 0.4; cursor: default; }
.pad { padding: 1rem 16px 2.5rem; max-width: 34rem; margin: 0 auto; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.bar { display: flex; justify-content: space-between; padding: 0.6rem 16px; font-weight: 700; font-size: 0.9rem; background: rgb(0 0 0 / 0.15); }
.big { display: block; width: 100%; max-width: 24rem; margin: 1.25rem auto 0; padding: 1rem 1.5rem; background: var(--moon); color: var(--navy-deep); font-size: 1.15rem; font-weight: 800; }
.ghost { background: transparent; color: var(--cream); border: 1.5px solid rgb(251 233 204 / 0.6); padding: 0.55rem 1.1rem; font-weight: 700; }
.ghost.small { font-size: 0.85rem; padding: 0.45rem 0.9rem; }
.ghost.on { background: var(--cream); color: var(--navy-deep); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; justify-content: center; }
label, .label { display: block; margin: 1.1rem 0 0.4rem; font-weight: 700; }
input { width: 100%; font: inherit; font-size: 1.15rem; padding: 0.75rem 0.9rem; border-radius: 12px; border: 0; background: var(--cream); color: var(--ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.seg button { padding: 0.85rem; background: rgb(251 233 204 / 0.12); color: var(--cream); border: 1.5px solid rgb(251 233 204 / 0.4); font-weight: 800; font-size: 1.05rem; }
.seg button.on { background: var(--moon); color: var(--navy-deep); border-color: var(--moon); }
.photo-row { display: flex; align-items: center; gap: 1rem; }
.err { color: #ffb4a8; font-weight: 700; }
.note { opacity: 0.85; }
.ok { color: #c9f2c7; font-weight: 800; font-size: 1.1rem; }
.knows { background: rgb(0 0 0 / 0.25); padding: 0.6rem 1rem; border-radius: 12px; font-size: 1.1rem; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--moon); color: var(--navy-deep); font-weight: 800; flex: none; box-shadow: 0 0 0 2px var(--cream); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Cards: poker proportions (63 × 88). */
.card { width: min(64vw, 15rem); aspect-ratio: 63 / 88; border-radius: 14px; background: var(--cream); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.75rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.35), inset 0 0 0 5px var(--cream), inset 0 0 0 7px var(--ink); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card img { width: 100%; flex: 1; min-height: 0; object-fit: contain; pointer-events: none; }
.card.team-santa { background: #fdecea; } .card.team-grinch { background: #e5f2e3; }
.card.back { background: var(--navy); box-shadow: 0 10px 30px rgb(0 0 0 / 0.35), inset 0 0 0 5px var(--navy), inset 0 0 0 7px var(--moon); }
.card-emoji { font-size: 5.5rem; flex: 1; display: grid; place-items: center; }
.card-name { margin: 0.3rem 0 0; font-weight: 900; font-size: 1.5rem; text-align: center; }
.card.art { padding: 0; background: none; box-shadow: 0 10px 30px rgb(0 0 0 / 0.35); }
.card.art img { width: 100%; height: 100%; border-radius: 14px; }
.card.small { width: 4.5rem; padding: 0.3rem; border-radius: 8px; } .card.small .card-emoji { font-size: 2rem; } .card.small .card-name { font-size: 0.7rem; }
.peek { margin: 0.5rem 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.peek .hint { margin-top: 0.6rem; font-weight: 700; }
.peek-card .knows { margin-top: 0.75rem; }
.timer { font-size: 4rem; font-weight: 900; margin: 0.25rem 0; font-variant-numeric: tabular-nums; }

/* Partner grid: photo circles with names. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.75rem 0.4rem; margin: 1rem 0; }
.person { background: transparent; color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.4rem 0.2rem; border-radius: 14px; font-weight: 700; font-size: 0.9rem; }
.person span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.on { background: var(--moon); color: var(--navy-deep); }

/* TV / host. */
.tv { padding: 2rem 3vw; min-height: 100vh; }
.tv.lobby { display: grid; grid-template-columns: minmax(20rem, 28rem) 1fr; gap: 3rem; align-items: start; }
.tv h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
.tv .huge { font-size: clamp(3rem, 9vw, 7rem); }
.tv .song { font-size: 1.5rem; font-weight: 800; opacity: 0.8; margin: 0; }
.tv .stat { font-size: 1.6rem; font-weight: 800; }
.tv-join { text-align: center; }
.qr { display: inline-block; padding: 16px; background: var(--cream); border-radius: 16px; }
.qr img, .qr canvas { display: block; }
.code { font-size: 1.4rem; } .code b { letter-spacing: 0.15em; color: var(--moon); }
.tv-roster { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; margin: 1rem 0 1.5rem; }
.tv-person { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 6rem; font-weight: 700; text-align: center; }
.tv-person small { opacity: 0.7; }
.tv-person.row { flex-direction: row; width: auto; gap: 0.6rem; margin: 0.35rem 0; }
.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; }
.controls .big { margin: 0.5rem 0 0; }
.stepper { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.stepper button { width: 2.25rem; height: 2.25rem; background: rgb(251 233 204 / 0.15); color: var(--cream); font-size: 1.2rem; }
.stepper b { min-width: 1.5rem; text-align: center; }
.timer.done { color: #ffb4a8; }
.teams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.team { background: rgb(0 0 0 / 0.2); border-radius: 16px; padding: 1rem 1.25rem; }
.team-santa h2 { color: #ffb4a8; } .team-grinch h2 { color: #b6e3b0; }
@media (max-width: 50rem) { .tv.lobby, .teams { grid-template-columns: 1fr; } }

/* Pick mismatch: fix it or confirm. */
.fix { background: rgb(179 38 30 / 0.25); border: 1.5px solid #ffb4a8; border-radius: 14px; padding: 0.75rem 1rem; }
.fix p { margin: 0.2rem 0 0.6rem; }
.warn { color: #ffb4a8; font-weight: 800; font-size: 1.1rem; }

/* Guest list, pending names, host panel. */
.tv-person.seed { opacity: 0.4; }
.pending { margin: 0.75rem 0; padding: 0.6rem 0.9rem; border-radius: 12px; background: rgb(0 0 0 / 0.2); font-weight: 700; }
.tv .pending { font-size: 1.3rem; max-width: 50rem; }
.host-panel { margin: 1rem 16px 2rem; padding: 0.75rem 1rem 1rem; border: 1.5px dashed var(--moon); border-radius: 16px; max-width: 34rem; }
@media (min-width: 36rem) { .host-panel { margin-inline: auto; } }
.host-title { margin: 0; font-weight: 800; color: var(--moon); }
.host-panel .big { margin-top: 0.6rem; }
.warn-btn { background: #ffcf9e; }
.hostbar { position: fixed; top: 0.75rem; right: 0.75rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.host-qr { padding: 10px; }
