/* Multiplayer screens layered over the seeker map. Hiders are red, seekers are blue. */
[hidden] { display: none !important; }
html, body { margin: 0; }
:root { --hide: #e0412f; --hide-soft: #fde3df; --seek: #2563c9; --seek-soft: #dde8fb; --ok: #1d8f4e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hide-soft: #3a1915; --seek-soft: #142542; } }

.screen { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.screen .wrap { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.screen .narrow { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.title { margin: 0; font-family: var(--font-hand); font-weight: 400; font-size: clamp(2.4rem, 8vw, 3.4rem); line-height: 1; color: var(--marker); transform: rotate(-2deg); transform-origin: left; }
.lede { margin: 0; color: var(--muted); }
.btn.big { padding: 13px 18px; font-size: 1.02rem; border-radius: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.field input, .field select, .field textarea { font-size: 1rem; padding: 11px 12px; border-radius: 10px; width: 100%; }
.codeinput { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--font-mono); font-weight: 700; }
.warn { margin: 0; font-size: 0.9rem; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.invite .code { font-family: var(--font-mono); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.2em; }

/* Choose a team */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .teams { grid-template-columns: 1fr; } }
.team { border-radius: 18px; padding: 16px; min-height: 220px; display: flex; flex-direction: column; gap: 12px; border: 3px solid transparent; cursor: pointer; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
.team.hiders { background: var(--hide-soft); color: var(--ink); }
.team.seekers { background: var(--seek-soft); color: var(--ink); }
.team.mine.hiders { border-color: var(--hide); box-shadow: 0 8px 24px rgba(224,65,47,.25); }
.team.mine.seekers { border-color: var(--seek); box-shadow: 0 8px 24px rgba(37,99,201,.25); }
@media (hover: hover) { .team:hover { transform: translateY(-2px); } }
.team h2 { font-size: 1.6rem; letter-spacing: 0.04em; color: inherit; font-weight: 900; }
.team.hiders h2 { color: var(--hide); }
.team.seekers h2 { color: var(--seek); }
.team .tagline { margin: 0; font-size: 0.88rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.92rem; }
.chip.me { outline: 2px solid var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip .dot.on { background: var(--ok); }
.chip .rdy { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--ok); color: #fff; }
.chip button { border: 0; background: none; padding: 0 2px; color: var(--muted); font-size: 0.9rem; }
.bench { display: flex; flex-direction: column; gap: 8px; }
.readybar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; background: var(--bg); }
.readybar .btn { min-width: 220px; font-size: 1.15rem; font-weight: 900; letter-spacing: .06em; }
.readybar .btn.isready { background: var(--ok); border-color: var(--ok); color: #fff; }
.hostbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.countdown { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(21,34,42,.82); color: #fff; font-family: var(--font-hand); font-size: 30vmin; pointer-events: none; }

/* In-round panel */
.role { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 999px; color: #fff; }
.role.hiders { background: var(--hide); }
.role.seekers { background: var(--seek); }
.clock { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--panel); }
.clock .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; opacity: .75; font-weight: 800; }
.clock .t { font-family: var(--font-mono); font-weight: 700; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.clock.paused { background: #7a5a00; }
.qcard { border: 2px solid var(--ink); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); }
.qcard.incoming { border-color: var(--hide); box-shadow: 0 0 0 4px var(--hide-soft); }
.qcard .ask { font-family: var(--font-hand); font-size: 1.2rem; color: var(--marker); margin: 0; }
.qcard .timer { font-family: var(--font-mono); font-weight: 700; }
.qcard .timer.late { color: var(--marker); }
.suggest { border: 1.5px dashed var(--ok); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.cursebar { display: flex; flex-direction: column; gap: 8px; }
.cursecard { border-radius: 12px; padding: 12px; background: #2b0f3a; color: #f5ecff; display: flex; flex-direction: column; gap: 6px; }
.cursecard .n { font-family: var(--font-hand); font-size: 1.15rem; color: #ffd84d; }
.cursecard .meta { font-family: var(--font-mono); font-size: 0.72rem; opacity: .85; }
.cursecard .btn { align-self: flex-start; }
.movebox { border-radius: 12px; padding: 12px; background: #fff3c4; color: #3d2c00; font-weight: 700; display: flex; flex-direction: column; gap: 8px; }

/* Cards */
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gcard { position: relative; border-radius: 12px; padding: 10px; min-height: 108px; display: flex; flex-direction: column; gap: 4px; text-align: left; border: 2px solid transparent; color: #fff; font-size: 0.82rem; line-height: 1.3; }
.gcard .k { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.gcard .n { font-weight: 900; font-size: 0.98rem; }
.gcard .big { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.gcard.time { background: #c0392b; }
.gcard.power { background: #2563c9; }
.gcard.curse { background: #4b1d66; }
.gcard.blank { background: #f7f7f2; color: #15222a; border-color: #c9cfc6; border-style: dashed; }
.gcard.sel { border-color: #ffd84d; box-shadow: 0 0 0 3px #ffd84d; }
.gcard.target { outline: 3px dashed #ffd84d; outline-offset: 2px; }
.cardactions { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); }
.over { color: var(--marker); font-weight: 800; }

.overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(10,14,18,.78); padding: 20px; }
.overlay .big-curse { max-width: 420px; width: 100%; border-radius: 22px; padding: 26px 22px; background: #2b0f3a; color: #f5ecff; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: rise 280ms var(--ease-out); }
.overlay .big-curse .n { font-family: var(--font-hand); font-size: 2rem; line-height: 1.05; color: #ffd84d; }
.overlay .big-curse .e { font-size: 1.05rem; white-space: pre-wrap; }
.overlay .notice { max-width: 420px; width: 100%; border-radius: 22px; padding: 24px; background: var(--panel); color: var(--ink); display: flex; flex-direction: column; gap: 12px; animation: rise 240ms var(--ease-out); }



.results table { width: 100%; border-collapse: collapse; }
.results td, .results th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.results .t { font-family: var(--font-mono); font-weight: 700; }
.photo { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.decklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.decklist li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty-space { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.connbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--marker); color: #fff; padding: 4px 12px; border-radius: 0 0 10px 10px; font-size: .8rem; font-weight: 700; }

/* Motion, after Emil Kowalski: short ease-out transitions, subtle press feedback, no bounce,
   enter from near-full size (never from 0), hover only on real pointers, nothing moves under reduced motion. */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); }
.btn, .team, .gcard, .types button, .seg button, .answers button, .mapctl button, .banner button, .chip button {
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, box-shadow 200ms var(--ease-out), opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:not(:disabled):active, .types button:not(:disabled):active, .seg button:not(:disabled):active, .answers button:not(:disabled):active, .mapctl button:active, .banner button:active { transform: scale(0.97); }
.team:active, .gcard:active { transform: scale(0.98); }
.team { transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .team:hover { transform: translateY(-2px); } .gcard:hover { transform: translateY(-2px); } }
@media not all and (hover: hover) { .team:hover { transform: none; } }
.gcard.sel { transform: translateY(-4px); }
.overlay:not([hidden]) { animation: fade 200ms ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.toast:not([hidden]) { animation: toastIn 300ms var(--ease-out); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } }
.countdown span { display: inline-block; animation: tickIn 420ms var(--ease-out); }
@keyframes tickIn { from { opacity: 0; transform: scale(1.25); } }
.big-curse .btn, .cursecard .btn { background: #ffd84d; border-color: #ffd84d; color: #2b0f3a; }
.overlay .notice h2 { font-size: 1.5rem; color: var(--ink); letter-spacing: 0; text-transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .btn:active, .team:active, .gcard:active, .gcard.sel, .team:hover, .gcard:hover { transform: none !important; }
}
