/* Shared look for player, host and admin pages */
:root {
  --ink: #14122b;
  --ink-2: #221f45;
  --ink-3: #35316a;
  --paper: #fbf8f1;
  --paper-2: #f1ece0;
  --line: #ddd5c4;
  --muted: #6f6a86;
  --sun: #ffcf3f;
  --good: #1fae6b;
  --bad: #e5484d;
  --a0: #f2553d;
  --a1: #0e9f9f;
  --a2: #e09a00;
  --a3: #6d4cf5;
  --radius: 14px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.brand { font-weight: 800; letter-spacing: -0.02em; }
.brand b { color: var(--sun); }

/* ---------- buttons & inputs */
.btn {
  border: 0; border-radius: 12px; padding: 0.8em 1.4em; font-weight: 700;
  background: var(--sun); color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .06s, box-shadow .06s, opacity .2s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 0.45em 0.9em; font-size: 0.9rem; box-shadow: 0 2px 0 rgba(0,0,0,.2); }

.field {
  width: 100%; border: 2px solid transparent; border-radius: 12px; padding: 0.8em 1em;
  background: #fff; color: var(--ink); outline: none;
}
.field:focus { border-color: var(--sun); }

/* ---------- answer colours */
.c0 { --c: var(--a0); } .c1 { --c: var(--a1); } .c2 { --c: var(--a2); } .c3 { --c: var(--a3); }
.letter {
  display: inline-grid; place-items: center; flex: none;
  width: 1.9em; height: 1.9em; border-radius: 50%;
  background: rgba(255,255,255,.22); font-weight: 800;
}

/* ---------- timer bar */
.timebar { height: 8px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.timebar > i { display: block; height: 100%; width: 100%; background: var(--sun); transform-origin: left; }

/* ---------- toasts */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #fff; color: var(--ink); padding: 0.7em 1.2em; border-radius: 12px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); z-index: 100; max-width: calc(100% - 32px); text-align: center;
}
.toast.err { background: var(--bad); color: #fff; }

.conn {
  position: fixed; top: 10px; right: 10px; font-size: 0.8rem; padding: 0.3em 0.7em;
  background: var(--bad); color: #fff; border-radius: 99px; z-index: 50;
}

@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { animation: pop .28s cubic-bezier(.2,1.4,.4,1) both; }
.rise { animation: rise .35s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  .pop, .rise { animation: none; }
}
