/* Clapback — shared styles. Brand: pink #ff2e88, cyan #43e6ff, ink #0b0016.
   Display: Bricolage Grotesque. Body: Inter. */
:root {
  --ink: #0b0016;
  --ink-2: #150a2b;
  --ink-3: #1f1140;
  --line: #34255a;
  --text: #f6f1ff;
  --muted: #b3a4d3;
  --pink: #ff2e88;
  --pink-deep: #b81558;
  --cyan: #43e6ff;
  --cyan-deep: #0e93aa;
  --gold: #ffd166;
  --ok: #4ade80;
  --danger: #ff6b6b;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  --r-lg: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --p0:#ff2e88; --p1:#43e6ff; --p2:#ffd166; --p3:#4ade80; --p4:#ff8a3d; --p5:#c084fc;
  --p6:#f472b6; --p7:#7dd3fc; --p8:#facc15; --p9:#a3e635; --p10:#fb7185; --p11:#2dd4bf;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh; min-height: 100dvh;
  background-image:
    radial-gradient(60% 45% at 8% 0%, rgba(255, 46, 136, .16), transparent 70%),
    radial-gradient(55% 40% at 100% 100%, rgba(67, 230, 255, .12), transparent 70%);
  background-attachment: fixed;
}
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.02; }
a { color: var(--cyan); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.sr { position: absolute; left: -9999px; }
.wrap { width: min(1100px, 100% - 40px); margin: 0 auto; }

/* Safe area. Pages ship viewport-fit=cover with a translucent status bar, so the
   installed PWA draws edge to edge and has to reserve the Dynamic Island / notch
   and home-indicator space itself. These insets sit above the header's own padding,
   so the bar keeps its normal breathing room below the island. env() resolves to 0
   in a browser tab, on desktop, and on hardware without insets, so nothing else moves.
   The phone (.top) and TV layouts handle their own insets and don't use .wrap. */
.wrap {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Word mark: a filled chat bubble with the name. */
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.mark svg { width: 28px; height: 28px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 17px; transition: transform .08s ease, background .15s ease, opacity .15s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 10px 30px rgba(255, 46, 136, .35); }
.btn-pink:hover { background: #ff4d9a; }
.btn-cyan { background: var(--cyan); color: var(--ink); box-shadow: 0 10px 30px rgba(67, 230, 255, .25); }
.btn-cyan:hover { background: #6cecff; }
.btn-ghost { background: rgba(255, 255, 255, .06); border: 1.5px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-lg { min-height: 62px; font-size: 20px; padding: 0 30px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* Inputs */
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 600; }
.input { width: 100%; min-height: 56px; padding: 0 18px; border-radius: 14px; background: var(--ink-2); border: 1.5px solid var(--line); color: var(--text); font-size: 18px; }
.input:focus { border-color: var(--cyan); outline: none; }
.input.code { text-transform: uppercase; letter-spacing: .35em; font-family: var(--display); font-weight: 700; font-size: 30px; text-align: center; }
textarea.input { padding: 14px 18px; min-height: 120px; resize: none; line-height: 1.35; }
.hint { font-size: 14px; color: var(--muted); }
.error { color: var(--danger); font-size: 15px; font-weight: 600; min-height: 1.2em; }

/* Player chips */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.chip .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--ink); }
.chip.off { opacity: .45; }
.chip .tick { margin-left: 2px; color: var(--ok); font-weight: 800; }

/* Toggle */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--ink-2); border: 1.5px solid var(--line); }
.seg button { padding: 10px 18px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--pink); color: #fff; }
.seg button.on.cyan { background: var(--cyan); color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--ink-3); border: 1.5px solid var(--line); position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch input:checked { background: var(--cyan-deep); border-color: var(--cyan); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }

/* Speech bubble — the one memorable element. */
.bubble { position: relative; background: var(--ink-2); border: 2px solid var(--line); border-radius: 26px; padding: 22px 26px; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3.2vw, 40px); line-height: 1.15; letter-spacing: -.01em; }
.bubble::after { content: ""; position: absolute; bottom: -18px; left: 34px; width: 28px; height: 28px; background: inherit; border: 2px solid var(--line); border-top: 0; border-left: 0; transform: skewX(20deg) rotate(45deg); border-radius: 0 0 6px 0; }
.bubble.right::after { left: auto; right: 34px; transform: skewX(-20deg) rotate(45deg); }
.bubble.pink { background: #2a0f2e; border-color: var(--pink); }
.bubble.pink::after { border-color: var(--pink); }
.bubble.cyan { background: #0e2035; border-color: var(--cyan); }
.bubble.cyan::after { border-color: var(--cyan); }
.bubble.win { box-shadow: 0 0 0 4px rgba(255, 209, 102, .25), 0 24px 60px rgba(0, 0, 0, .4); }
.bubble.dim { opacity: .55; }

/* Prompt card */
.prompt { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }

/* Countdown chip */
.timer { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--ink-2); border: 1.5px solid var(--line); font-family: var(--display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.timer .bar { width: 90px; height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: var(--cyan); width: 100%; transition: width .25s linear; }
.timer.low { border-color: var(--pink); }
.timer.low .bar i { background: var(--pink); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink-3); border: 1.5px solid var(--line); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: min(92vw, 520px); text-align: center; box-shadow: var(--shadow); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
