/* ==========================================================================
   Uncinus — cloud-suite aesthetic: atmospheric themes + frosted glass.
   Shared by the host (index.html, body.host) and the phone pad (play.html, body.pad).
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root,
html.night {
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-faint: #94a3b8;
  --glass: rgba(10, 16, 32, 0.55);
  --glass-strong: rgba(10, 16, 32, 0.88);
  --glass-border: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --accent: #7dd3fc;
  --accent-ink: #04121c;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --line: rgba(255, 255, 255, 0.12);
  --input: rgba(2, 6, 23, 0.45);
  --btn: rgba(255, 255, 255, 0.08);
  --btn-hover: rgba(255, 255, 255, 0.14);
  --sky-top: #040814;
  --sky-mid: #0c1730;
  --sky-horizon: #22355c;
  --me: #7dd3fc;
  --radius: 14px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html.twilight {
  --ink: #fbf7ff;
  --ink-soft: #e2dcf0;
  --ink-faint: #b4abc9;
  --glass: rgba(34, 28, 62, 0.5);
  --glass-strong: rgba(34, 28, 62, 0.88);
  --glass-border: rgba(255, 255, 255, 0.18);
  --accent: #fbbf91;
  --accent-ink: #2a1408;
  --btn: rgba(255, 255, 255, 0.1);
  --btn-hover: rgba(255, 255, 255, 0.16);
  --input: rgba(20, 14, 40, 0.45);
  --sky-top: #251f52;
  --sky-mid: #8a4c8c;
  --sky-horizon: #ffb27a;
}

html.day {
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-faint: #64748b;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow: 0 18px 50px -24px rgba(15, 40, 80, 0.55);
  --accent: #0284c7;
  --accent-ink: #ffffff;
  --line: rgba(15, 23, 42, 0.12);
  --input: rgba(255, 255, 255, 0.75);
  --btn: rgba(15, 23, 42, 0.06);
  --btn-hover: rgba(15, 23, 42, 0.12);
  --sky-top: #3b82d6;
  --sky-mid: #7dbcef;
  --sky-horizon: #d8eefb;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--sky-top);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--ink-faint);
  font-size: 0.9rem;
  line-height: 1.45;
}

.center {
  text-align: center;
}

.error {
  color: var(--bad);
  font-size: 0.9rem;
  margin: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--btn);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  font: 600 0.95rem var(--font-ui);
  color: var(--ink);
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--btn-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.btn--primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
}

.btn--small {
  padding: 5px 10px;
  font-size: 0.85rem;
}

.btn--big {
  padding: 14px 18px;
  font-size: 1.1rem;
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: var(--glass-strong);
}

.icon-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.icon-btn.is-locked {
  animation: sound-nudge 1.6s ease-in-out infinite;
}

@keyframes sound-nudge {
  50% {
    background: var(--accent);
    color: var(--accent-ink);
  }
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__emblem {
  width: 46px;
  height: 30px;
  color: var(--ink);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.brand__name {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.brand__version {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
}

.brand--center {
  justify-content: center;
}

/* ---------- Status ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.status[data-state="open"] .status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

.status[data-state="error"] .status__dot,
.status[data-state="closed"] .status__dot,
.status[data-state="replaced"] .status__dot,
.status[data-state="no-host"] .status__dot,
.status[data-state="full"] .status__dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

.status--compact {
  padding: 10px;
}

/* ==========================================================================
   Host (Mac)
   ========================================================================== */
body.host {
  overflow: hidden;
}

.sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  z-index: 5;
}

.join-card {
  position: fixed;
  top: 50%;
  right: clamp(16px, 4vw, 56px);
  transform: translateY(-50%);
  width: min(340px, 34vw);
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 22px 22px 18px;
  text-align: center;
  z-index: 3;
}

.join-card__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: transparent;
  border-color: transparent;
}

.join-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.join-card__qr {
  display: block;
  width: min(100%, max(132px, 100vh - 390px));
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  line-height: 0;
}

.join-card__qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.join-card__code {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.join-card__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.room-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: 0.22em;
  margin-right: -0.22em;
}

.room-code--small {
  font-size: 1.25rem;
  letter-spacing: 0.16em;
}

.join-card__hint {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
  word-break: break-word;
}

.join-card__hint--soft {
  color: var(--ink-faint);
}

.join-mini {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  z-index: 3;
}

.join-mini__qr {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 8px;
  padding: 3px;
  line-height: 0;
}

.join-mini__qr svg {
  width: 100%;
  height: 100%;
}

.roster {
  position: fixed;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 34vw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.chip__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.chip.is-away {
  opacity: 0.6;
}

.chip em {
  font-weight: 500;
  color: var(--ink-faint);
}

/* ---------- Modal ---------- */
.modal {
  width: min(480px, calc(100vw - 32px));
  padding: 20px 22px;
  color: var(--ink);
  background: var(--glass-strong);
}

.modal::backdrop {
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(3px);
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal__section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.modal__section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.modal__section .muted {
  margin: 0 0 10px;
}

.modal__foot {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-chip {
  font: 600 0.9rem var(--font-ui);
  color: var(--ink);
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.theme-chip.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row input {
  flex: 1;
  min-width: 0;
}

input {
  font: 500 0.95rem var(--font-ui);
  color: var(--ink);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

/* ==========================================================================
   Phone pad
   ========================================================================== */
body.pad {
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.pad-sky {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 62%, var(--sky-horizon) 100%);
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.join-form input {
  -webkit-user-select: text;
  user-select: text;
  font-size: 1.05rem;
  padding: 12px 14px;
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.room-input {
  font-family: var(--font-mono) !important;
  font-weight: 700;
  font-size: 1.6rem !important;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}

.screen--play {
  justify-content: stretch;
  gap: 14px;
}

.pad-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.me {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}

.me__swatch {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.me__name {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me__sub {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.stick-area {
  position: relative;
  flex: 1;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: none;
  overflow: hidden;
}

.stick-base {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  border: 2px dashed var(--glass-border);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.2s;
}

.stick-area.is-dragging .stick-base {
  border-style: solid;
  border-color: var(--me);
}

.stick-knob {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--me) 140%);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.25);
  transition: transform 0.06s linear;
}

.stick-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  pointer-events: none;
  padding: 0 16px;
}

.stick-hint.is-flash {
  color: var(--ink);
  font-weight: 600;
}

.pad-bottom {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.tilt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 96px;
  border-radius: 18px;
  background: var(--glass);
  border-color: var(--glass-border);
}

.tilt-btn svg {
  width: 26px;
  height: 26px;
}

.tilt-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.35);
  z-index: 10;
}

.overlay__card {
  padding: 20px;
  text-align: center;
  max-width: 320px;
}

.overlay__card p {
  margin: 0 0 12px;
  font-weight: 600;
  line-height: 1.45;
}

.overlay__card p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Soccer
   ========================================================================== */
:root {
  --sky-team: #38bdf8;
  --ember-team: #fb923c;
}

.roster--left {
  left: 18px;
}

.roster--right {
  right: 18px;
  justify-content: flex-end;
}

.roster--left .chip__num {
  background: var(--sky-team);
}

.roster--right .chip__num {
  background: var(--ember-team);
}

.chip__num {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.scoreboard {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2;
}

/* Teams are known only by colour. */
.team-chip {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
  vertical-align: middle;
}

.team-chip--small {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.team-chip--left {
  background: var(--sky-team);
}

.team-chip--right {
  background: var(--ember-team);
}

.scoreboard__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2rem;
  min-width: 1.2ch;
  text-align: center;
}

.scoreboard__dash {
  color: var(--ink-faint);
  font-size: 1.4rem;
}

.goal-banner {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 4;
}

.goal-banner__word {
  font-weight: 900;
  font-size: clamp(4rem, 13vw, 11rem);
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: #fff;
  -webkit-text-stroke: 4px var(--team, #fff);
  text-shadow: 0 10px 0 var(--team, #000), 0 24px 40px rgba(0, 0, 0, 0.35);
}

.goal-banner__who {
  margin-top: 18px;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--team, #000);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.goal-banner.is-in .goal-banner__word {
  animation: goal-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes goal-pop {
  from {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
}

/* ---------- Phone ---------- */
.me__swatch--block {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.mini-score {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.mini-score b {
  font-family: var(--font-mono);
  color: var(--ink);
}

.kick-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 110px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--me);
  color: #0f172a;
  font: 900 1.6rem var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  touch-action: none;
  overflow: hidden;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.06s;
}

.kick-btn:active {
  transform: scale(0.96);
}

.kick-btn svg {
  width: 46px;
  height: 46px;
}

.kick-btn > * {
  position: relative;
  z-index: 1;
}

.kick-btn__charge {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  background: rgba(15, 23, 42, 0.35);
  transform-origin: left;
  transform: scaleX(0);
}

.kick-btn.is-charging .kick-btn__charge {
  animation: kick-charge 0.9s linear both;
}

@keyframes kick-charge {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.goal-flash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  z-index: 9;
  pointer-events: none;
  animation: flash-in 0.3s ease-out both;
}

.goal-flash.is-ours {
  background: var(--me);
  color: #0f172a;
}

.goal-flash span {
  font-weight: 900;
  font-size: clamp(2rem, 11vw, 3.2rem);
  padding: 0 16px;
  text-align: center;
  letter-spacing: -0.02em;
}

.goal-flash small {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.85;
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* ---------- Face photos ---------- */
/* Photos are cut to the face-guide oval wherever they're shown (FACE_OVAL in js/face.js). */
.chip__face,
.face-thumb img,
.cam__view img {
  clip-path: ellipse(36.9% 50%);
}

.chip__face {
  width: 26px;
  height: 26px;
  object-fit: cover;
  margin: -2px -4px;
}

button.me__swatch {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.me__swatch.has-face {
  background-size: cover;
  background-position: center;
  background-color: var(--me, #64748b);
  box-shadow: 0 0 0 3px var(--me, rgba(255, 255, 255, 0.35));
}

.me__swatch.has-face span {
  display: none;
}

.face-pick {
  display: flex;
  align-items: center;
  gap: 12px;
}

.face-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 12px;
  border: 2px dashed var(--ink-faint);
  background: var(--glass);
  color: var(--ink-faint);
  overflow: hidden;
  cursor: pointer;
}

.face-thumb svg {
  width: 36px;
  height: 36px;
}

.face-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-thumb:has(img:not([hidden])) {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
}

.face-pick__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.face-pick__text small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.cam {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: #020617;
  color: #f1f5f9;
}

.cam__title {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
}

.cam__view {
  position: relative;
  width: min(88vw, 58vh);
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: #0f172a;
}

.cam__view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* The shot is already cropped to the oval's square, which sits 8% in from each edge. */
.cam__view img {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: cover;
}

.cam__mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cam__mask > path:first-child {
  fill: rgba(2, 6, 23, 0.8);
}

.cam__oval {
  fill: none;
  stroke: #ffffff;
  stroke-width: 0.8;
  stroke-dasharray: 3 2;
}

.cam__guide {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 0.6;
  stroke-linecap: round;
}

.cam__error {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.85);
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
}

.cam__hint {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5e1;
  text-align: center;
}

.cam__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 72px;
}

.cam__actions .btn:not(.btn--primary) {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.cam__shutter {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 5px solid #ffffff;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 0 4px #020617, inset 0 0 0 30px #ffffff;
  cursor: pointer;
}

.cam__shutter:active {
  transform: scale(0.94);
}

/* ---------- Rules toggles ---------- */
.toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
}

.toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: var(--line);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.15s;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

.toggle input:checked {
  background: var(--accent);
}

.toggle input:checked::after {
  transform: translateX(18px);
}

.toggle__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle__text small {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ---------- Mayhem ---------- */
.star-toast {
  position: fixed;
  left: 50%;
  top: 128px;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fde047, #f59e0b);
  color: #422006;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.8);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

.star-toast.is-in {
  animation: star-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes star-pop {
  from {
    transform: translateX(-50%) scale(0.3);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

.goal-flash.is-star {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #422006;
  padding: 0 24px;
  text-align: center;
}

.goal-flash.is-star span,
.goal-flash.is-big span {
  font-size: clamp(2rem, 11vw, 3.4rem);
}

.goal-flash.is-big {
  background: radial-gradient(circle at 30% 30%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at 75% 70%, #ffffff 0 8%, transparent 9%), linear-gradient(135deg, #f87171, #dc2626);
  color: #fff;
  padding: 0 24px;
  text-align: center;
}

body.is-big .me {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px #ef4444, 0 0 24px #dc2626;
}

@keyframes star-hue {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}

body.is-star .me {
  border-color: #fde047;
  box-shadow: 0 0 0 3px #fde047, 0 0 24px #f59e0b;
}

body.is-star .kick-btn {
  animation: star-hue 1s linear infinite;
}

/* ---------- Team picker ---------- */
.team-pick__opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.team-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 10px;
  border-radius: 16px;
  border: 0;
  color: #fff;
  font: 600 0.8rem var(--font-ui);
  cursor: pointer;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}

.team-opt b {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.team-opt--left {
  background: var(--sky-team);
}

.team-opt--right {
  background: var(--ember-team);
}

.team-opt:active {
  transform: scale(0.96);
}

/* ---------- Flower power ---------- */
.goal-flash.is-flower {
  background: radial-gradient(circle at 50% 40%, #fde047 0 18%, #f97316 45%, #dc2626 100%);
  color: #fff;
  padding: 0 24px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(127, 29, 29, 0.5);
}

.goal-flash.is-flower span {
  font-size: clamp(2rem, 11vw, 3.4rem);
}

body.is-flower .me {
  border-color: #f97316;
  box-shadow: 0 0 0 3px #f97316, 0 0 24px #dc2626;
}

/* ---------- Magic brick ---------- */
.goal-flash.is-brick {
  background: repeating-linear-gradient(0deg, #fecaca 0 4px, transparent 4px 34px), linear-gradient(160deg, #dc2626, #7f1d1d);
  color: #fff;
  padding: 0 24px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(69, 10, 10, 0.7);
}

.goal-flash.is-brick span {
  font-size: clamp(2rem, 11vw, 3.4rem);
}

body.is-brick .me {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px #dc2626, 0 0 24px #7f1d1d;
}

/* ---------- Which way to attack ---------- */
.attack-bar {
  display: flex;
  align-items: stretch;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-weight: 800;
  font-size: 0.85rem;
}

.attack-bar__goal {
  flex: none;
  display: grid;
  place-items: center;
  width: 30%;
  color: #fff;
}

/* Each goal wears the colour of the team that defends it, like on the big screen. */
.attack-bar__goal--left {
  background: var(--sky-team);
}

.attack-bar__goal--right {
  background: var(--ember-team);
}

.attack-bar[data-defends="left"] .attack-bar__goal--left,
.attack-bar[data-defends="right"] .attack-bar__goal--right {
  opacity: 0.55;
  font-weight: 700;
}

.attack-bar[data-defends="left"] .attack-bar__goal--right,
.attack-bar[data-defends="right"] .attack-bar__goal--left {
  font-size: 1rem;
  box-shadow: inset 0 0 0 3px #fff;
  animation: score-pulse 1.4s ease-in-out infinite;
}

.attack-bar__arrow {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--me, var(--ink));
  letter-spacing: 0.04em;
}

@keyframes score-pulse {
  50% {
    filter: brightness(1.2);
  }
}

.attack-bar[data-can-pick] {
  cursor: pointer;
}

.attack-bar[data-can-pick] .attack-bar__arrow {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 1px;
}

.attack-bar[data-can-pick] .attack-bar__arrow::after {
  content: "tap to switch colour";
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0;
}

/* ---------- Game clock ---------- */
.match-clock {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  z-index: 3;
}

.match-clock.is-low {
  color: #fff;
  background: #dc2626;
  animation: score-pulse 1s ease-in-out infinite;
}

.period-banner {
  position: fixed;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 4;
}

.period-banner__word {
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6.5rem);
  white-space: nowrap;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: #fff;
  -webkit-text-stroke: 4px var(--accent-color, #fde047);
  paint-order: stroke fill;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.period-banner.is-in .period-banner__word {
  animation: goal-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.period-banner__sub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass-strong);
  font-weight: 800;
  font-size: 1.3rem;
}

.period-banner__count {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.me__clock {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--glass-strong);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
}

.period-screen {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #fff;
  pointer-events: none;
}

.period-screen.is-won {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #422006;
}

.period-screen.is-lost {
  background: linear-gradient(135deg, #475569, #1e293b);
}

.period-screen.is-draw {
  background: linear-gradient(135deg, #38bdf8, #fb923c);
}

.period-screen__title {
  font-weight: 900;
  font-size: clamp(2.2rem, 12vw, 3.6rem);
  line-height: 1;
}

.period-screen__sub {
  font-weight: 700;
  font-size: 1.2rem;
  max-width: 300px;
}

.period-screen__count {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  opacity: 0.85;
}

.goal-flash.is-swap {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #fff;
  padding: 0 24px;
  text-align: center;
}

.match-clock.is-golden {
  color: #422006;
  background: linear-gradient(90deg, #fde047, #f59e0b);
  font-family: var(--font-ui);
  font-weight: 800;
}

.goal-flash.is-golden {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #422006;
  padding: 0 24px;
  text-align: center;
}

/* ==========================================================================
   Championship — big screen
   (Large overlays skip backdrop-filter: blurring over a moving canvas is costly on TV browsers.)
   ========================================================================== */
.modal {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

body[data-cup="lobby"] .join-card,
body[data-cup="lobby"] .join-mini,
body[data-cup="lobby"] .scoreboard,
body[data-cup="lobby"] .match-clock,
body[data-cup="draw"] .scoreboard,
body[data-cup="draw"] .match-clock,
body[data-cup="next"] .scoreboard,
body[data-cup="next"] .match-clock,
body[data-cup="champion"] .join-card,
body[data-cup="champion"] .join-mini,
body[data-cup="champion"] .scoreboard,
body[data-cup="champion"] .match-clock,
body[data-cup="champion"] .roster {
  display: none !important;
}

.scoreboard__team {
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
}

.cup-lobby {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1240px, calc(100vw - 48px));
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 20px 26px;
  border-radius: 22px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  z-index: 3;
}

.cup-lobby__title {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.cup-lobby__sub {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.cup-lobby__body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.cup-lobby__join {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: clamp(170px, 19vw, 270px);
  text-align: center;
}

.cup-lobby__qr {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  line-height: 0;
}

.cup-lobby__qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.cup-lobby__url {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.cup-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cup-teams[data-size="8"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cup-team {
  min-height: 118px;
  border-radius: 16px;
  border: 2px solid var(--team);
  background: var(--btn);
  overflow: hidden;
}

.cup-team__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--team);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
}

.cup-team__emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.cup-teams[data-size="8"] .cup-team__head {
  gap: 6px;
  padding: 6px 9px;
  font-size: 1.05rem;
}

.cup-teams[data-size="8"] .cup-team__emoji {
  font-size: 1.25rem;
}

.cup-team__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cup-team__count {
  min-width: 2ch;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  text-align: center;
}

.cup-team__members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 10px;
  list-style: none;
}

.cup-team__members .chip,
.cup-champion__names .chip {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--glass-strong);
}

.cup-team__empty {
  padding: 4px 2px;
  color: var(--ink-faint);
  font-style: italic;
}

.cup-lobby__waiting {
  margin: 0;
  min-height: 1.4em;
  color: var(--ink-soft);
  font-weight: 600;
}

.cup-lobby__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.cup-go {
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 1.2rem;
}

.cup-go:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.cup-go:focus {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

/* Between ties: what's next, the countdown, and the bracket — high enough to leave the pitch in view. */
.cup-board {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 48px));
  padding: 14px 22px 16px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 3;
}

@media (min-width: 1700px) {
  .cup-board {
    top: 12px;
  }
}

.cup-board__label {
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cup-board__vs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-weight: 800;
}

.cup-vs__team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cup-vs__v {
  color: var(--ink-faint);
  font-size: 0.8em;
}

.cup-board__moves {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.cup-board__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
}

.cup-board__count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
}

.cup-bracket {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  text-align: left;
}

.cup-bracket:empty {
  display: none;
}

.cup-round {
  flex: 1;
  max-width: 250px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cup-round__ties {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 8px;
}

.cup-round__name {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.cup-tie {
  padding: 4px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--btn);
}

.cup-tie.is-now {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.cup-tie__team {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 10px;
  font-weight: 600;
  white-space: nowrap;
}

.cup-tie__team span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cup-tie__team.is-win {
  font-weight: 900;
}

.cup-tie__team.is-out {
  opacity: 0.45;
}

.cup-tie small {
  display: block;
  padding: 0 10px;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.cup-bracket--small {
  margin-top: 8px;
  font-size: 0.82rem;
}

.cup-bracket--small .cup-round__ties {
  gap: 4px;
}

.cup-bracket--small .cup-tie {
  padding: 1px 0;
}

.cup-champion {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px 28px;
  border-radius: 26px;
  background: var(--glass-strong);
  border: 3px solid var(--team, #fde047);
  box-shadow: 0 0 0 6px rgba(253, 224, 71, 0.35), var(--shadow);
  text-align: center;
  z-index: 6;
}

.cup-champion__trophy {
  font-size: clamp(3.4rem, 8vw, 5.6rem);
  line-height: 1;
  animation: trophy-bob 2.2s ease-in-out infinite;
}

.cup-champion__word {
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: #d97706;
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 55%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cup-champion__team {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
}

.cup-champion__names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.cup-champion__boot {
  margin: 14px 0 0;
  font-weight: 800;
  font-size: 1.2rem;
}

.cup-champion__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.cup-board.is-compact .cup-bracket {
  display: none;
}

/* Shorter TV screens (720p and below): tighten the overlays so their buttons stay on screen. */
@media (max-height: 820px) {
  .cup-lobby {
    top: 64px;
    gap: 10px;
    padding: 14px 20px;
  }

  .cup-lobby__title {
    font-size: 1.8rem;
  }

  .cup-lobby__sub {
    font-size: 0.95rem;
  }

  .cup-lobby__join {
    width: clamp(150px, 17vw, 210px);
  }

  .cup-lobby .room-code {
    font-size: 2rem;
  }

  .cup-team {
    min-height: 92px;
  }

  .cup-champion {
    padding: 14px 22px;
  }

  .cup-champion__trophy {
    font-size: 2.8rem;
  }

  .cup-champion__word {
    font-size: 2.6rem;
  }

  .cup-champion__team {
    margin-top: 2px;
    font-size: 1.8rem;
  }

  .cup-champion__names {
    margin-top: 8px;
  }

  .cup-champion__boot {
    margin-top: 8px;
  }

  .cup-champion .cup-bracket {
    display: none;
  }
}

@keyframes trophy-bob {
  50% {
    transform: translateY(-8px) rotate(-5deg);
  }
}

.cup-settings {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.cup-settings__row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
}

.cup-settings__row > span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.modal__section .cup-settings__locked {
  margin: 0;
}

.bot-skill {
  margin-top: 8px;
}

.flower-row {
  grid-template-columns: 86px 1fr;
  margin: 4px 0 0 54px;
}

.flower-row > span {
  white-space: nowrap;
}

.modal__section .bot-count {
  margin: 10px 0 0;
}

/* ==========================================================================
   Championship — phone
   ========================================================================== */
body.cup-watch .attack-bar,
body.cup-watch .stick-area,
body.cup-watch .pad-bottom {
  display: none !important;
}

.cup-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  font-weight: 700;
  font-size: 0.85rem;
}

.cup-bar__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cup-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.cup-card {
  padding: 16px;
  text-align: center;
}

.cup-card__label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.cup-card__vs {
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
}

.cup-card__sub {
  margin-top: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.cup-card__vs:empty,
.cup-card__sub:empty,
.cup-note:empty {
  display: none;
}

.cup-note {
  margin: 0;
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
}

.cup-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cup-pick {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "emoji name" "names names";
  align-items: center;
  gap: 2px 8px;
  padding: 12px;
  border-radius: 16px;
  border: 3px solid transparent;
  background: var(--team);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cup-pick__emoji {
  grid-area: emoji;
  font-size: 1.6rem;
  line-height: 1;
}

.cup-pick__name {
  grid-area: name;
  font-weight: 800;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cup-pick__names {
  grid-area: names;
  font-size: 0.75rem;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cup-pick.is-mine {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--team), inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cup-pick.is-mine::after {
  content: "✓";
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--team);
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cup-pick:disabled {
  opacity: 0.35;
  cursor: default;
}

.cup-pick:active:not(:disabled) {
  transform: scale(0.97);
}

.cup-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.cup-list b {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.cup-list .is-mine {
  font-weight: 800;
}

.cup-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.cup-actions .btn:disabled {
  opacity: 0.55;
}

.btn.cup-cheer,
.btn.cup-cheer:hover {
  border: 0;
  background: linear-gradient(135deg, #fde047, #f97316);
  color: #431407;
  font-size: 1.3rem;
  font-weight: 900;
}

.cup-cheer.is-cheering {
  animation: cheer-pop 0.35s ease-out;
}

@keyframes cheer-pop {
  40% {
    transform: scale(1.06) rotate(-2deg);
  }
}

/* ---------- Turkey & food coma ---------- */
.goal-flash.is-turkey {
  background: radial-gradient(circle at 50% 35%, #fde68a 0 16%, #d97706 48%, #78350f 100%);
  color: #fff;
  padding: 0 24px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(69, 26, 3, 0.6);
}

.goal-flash.is-coma {
  background: linear-gradient(160deg, #312e81, #1e1b4b);
  color: #e0e7ff;
  padding: 0 24px;
  text-align: center;
}

.goal-flash.is-turkey span,
.goal-flash.is-coma span {
  font-size: clamp(2rem, 11vw, 3.4rem);
}

body.is-coma .me {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px #818cf8, 0 0 24px #4338ca;
}

/* Too stuffed to kick. */
body.is-coma .kick-btn {
  filter: grayscale(0.9) brightness(0.8);
}

body.is-coma .kick-btn::after {
  content: "😴 stuffed";
  position: absolute;
  right: 14px;
  bottom: 8px;
  z-index: 2;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.power-picker {
  margin: 10px 0 0 54px;
}
