/* Feud! — game-show styling. No external fonts or images: everything is CSS. */

:root {
  --night: #040a2a;
  --deep: #071341;
  --stage: #0b1f6b;
  --tile-hi: #3d74ff;
  --tile: #1846c9;
  --tile-lo: #0a2580;
  --gold: #ffd23f;
  --gold-hi: #fff1a8;
  --gold-lo: #d98e04;
  --orange: #ff8c1a;
  --red: #ff3b5c;
  --red-lo: #b3122f;
  --blue: #2f9bff;
  --blue-lo: #0f4fb8;
  --ink: #fff;
  --muted: #b9c6ff;
  --panel: rgba(6, 14, 52, 0.92);
  --radius: 16px;
  --display: "Arial Black", "Arial Bold", Impact, "Franklin Gothic Heavy", "Helvetica Neue", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 50% at 15% -5%, rgba(120, 160, 255, 0.35), transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% -5%, rgba(255, 190, 90, 0.25), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(40, 90, 255, 0.35), transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 120%, rgba(255, 255, 255, 0.035) 0 6deg, transparent 6deg 12deg),
    linear-gradient(180deg, var(--deep), var(--night));
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 8px 0;
}

.error {
  color: #ffb3c0;
  font-weight: 700;
  min-height: 1.2em;
  margin: 6px 0;
}

.pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

/* ---------- buttons ---------- */

.btn {
  --b-top: #2b4bb8;
  --b-bot: #15287a;
  --b-edge: #0a154a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--b-top), var(--b-bot));
  box-shadow: 0 5px 0 var(--b-edge), 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--b-edge), 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-gold {
  --b-top: #ffe066;
  --b-bot: #ffb000;
  --b-edge: #a35f00;
  color: #3a1c00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-orange {
  --b-top: #ffa34d;
  --b-bot: #f56a00;
  --b-edge: #8f3800;
}

.btn-red,
.btn-team.red {
  --b-top: #ff5c78;
  --b-bot: #d81b3c;
  --b-edge: #7a0b1f;
}

.btn-team.blue {
  --b-top: #4fb0ff;
  --b-bot: #1268d9;
  --b-edge: #073a80;
}

.btn-ghost {
  --b-top: rgba(255, 255, 255, 0.1);
  --b-bot: rgba(255, 255, 255, 0.04);
  --b-edge: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-small {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn-xl {
  min-height: 64px;
  padding: 14px 28px;
  font-size: 1.3rem;
  width: 100%;
}

.icon-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---------- form fields ---------- */

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(160, 185, 255, 0.35);
  background: rgba(0, 8, 40, 0.6);
  color: #fff;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4);
}

.field::placeholder {
  color: #8796cf;
}

.field:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 210, 63, 0.35);
}

.field-big {
  font-size: 1.4rem;
  min-height: 60px;
  text-align: center;
  font-weight: 800;
}

.field-label {
  display: block;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin: 14px 0 8px;
}

select.field {
  width: auto;
  min-width: 90px;
}

/* ---------- marquee lights ---------- */

.marquee {
  position: relative;
}

.bulbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bulb {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 20%, #ffe680 45%, #ff9d00 100%);
  box-shadow: 0 0 6px 2px rgba(255, 200, 60, 0.85), 0 0 16px 4px rgba(255, 150, 0, 0.45);
  animation: chase 0.9s steps(1) infinite;
}

.bulb.odd {
  animation-delay: -0.45s;
}

@keyframes chase {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.28;
    box-shadow: none;
  }
}

/* ---------- logo ---------- */

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 46px 20px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.25), transparent 60%),
    linear-gradient(180deg, #1c3fbf, #0a1c6e);
  border: 5px solid var(--gold);
  box-shadow: 0 0 0 4px #8a4b00, 0 0 0 9px rgba(255, 210, 63, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.logo-word {
  display: flex;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.6rem, 13vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.logo-word span {
  display: inline-block;
  color: var(--gold);
  background: linear-gradient(180deg, #fffbe0 0%, #ffe066 38%, #ffb000 62%, #ff7a00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #8a3d00) drop-shadow(0 8px 0 #4a1e00) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6));
  animation: letter-in 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both, bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 90ms), calc(0.8s + var(--i) * 160ms);
  transform-origin: 50% 100%;
}

@keyframes letter-in {
  from {
    transform: translateY(-80px) scale(0.3) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(-2deg);
  }
}

.logo-tag {
  margin-top: 10px;
  padding: 6px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9d2e, #e65c00);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(0.7rem, 2.3vw, 1.05rem);
  box-shadow: 0 4px 0 #7a2e00, inset 0 2px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.logo-small {
  padding: 6px 16px 6px;
  border-width: 3px;
  border-radius: 14px;
  box-shadow: 0 0 0 2px #8a4b00, 0 6px 16px rgba(0, 0, 0, 0.5);
}

.logo-small .logo-word {
  font-size: 1.6rem;
}

.logo-small .logo-word span {
  filter: drop-shadow(0 2px 0 #8a3d00) drop-shadow(0 3px 0 #4a1e00);
  animation: none;
}

.logo-small .logo-tag {
  display: none;
}

.logo-small .bulb {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
}

/* ---------- landing ---------- */

.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 18px;
  text-align: center;
  overflow: hidden;
}

.spotlights span {
  position: fixed;
  top: -20vh;
  width: 46vw;
  height: 140vh;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 245, 200, 0.22), transparent 75%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  filter: blur(6px);
  transform-origin: 50% 0;
  animation: sweep 7s ease-in-out infinite alternate;
  z-index: -1;
}

.spotlights span:first-child {
  left: -6vw;
  --from: -24deg;
  --to: 14deg;
}

.spotlights span:last-child {
  right: -6vw;
  --from: 24deg;
  --to: -14deg;
  animation-delay: -3.5s;
}

@keyframes sweep {
  from {
    transform: rotate(var(--from));
  }
  to {
    transform: rotate(var(--to));
  }
}

.tagline {
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: #dbe3ff;
  margin: 6px 0 0;
}

.landing-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  width: min(760px, 100%);
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(40, 70, 190, 0.55), rgba(8, 20, 80, 0.75));
  border: 2px solid rgba(255, 210, 63, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  text-align: center;
}

.action-card h2,
.action-card h1 {
  margin: 0;
  font-family: var(--display);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 #6b3500;
}

.action-card p {
  margin: 0;
  color: #dbe3ff;
}

.code-input {
  margin-top: 8px;
  text-align: center;
  font-family: var(--display);
  font-size: 2.2rem;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  text-transform: uppercase;
  min-height: 70px;
}

.footnote {
  color: var(--muted);
  font-size: 0.9rem;
}

.not-found .action-card {
  max-width: 440px;
  align-items: center;
}

/* ---------- host layout ---------- */

.host {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.host-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(4, 10, 42, 0.9), rgba(4, 10, 42, 0.5));
  border-bottom: 1px solid rgba(255, 210, 63, 0.2);
  z-index: 5;
}

.top-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.code-chip,
.count-chip,
.me-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  background: rgba(255, 210, 63, 0.15);
  border: 1px solid rgba(255, 210, 63, 0.5);
  color: var(--gold-hi);
  white-space: nowrap;
}

.count-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.host-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 400px);
  min-height: 0;
}

.panel-closed .host-body {
  grid-template-columns: 1fr;
}

.panel-closed .panel {
  display: none;
}

.host-main {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: flex;
  padding: clamp(10px, 2vh, 24px) clamp(10px, 2vw, 32px);
}

.host-main > * {
  flex: 1;
  min-width: 0;
}

.panel {
  overflow-y: auto;
  padding: 14px 16px 40px;
  background: var(--panel);
  border-left: 2px solid rgba(255, 210, 63, 0.25);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
}

.panel-head {
  position: sticky;
  top: -14px;
  margin: -14px -16px 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #081450;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.phase-label {
  font-family: var(--display);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-section {
  padding: 12px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-section h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-section > .btn + .btn,
.panel-section > .btn + div {
  margin-top: 10px;
}

.keys {
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
}

.tab {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  color: var(--muted);
}

.tab.active {
  background: linear-gradient(180deg, #2b4bb8, #15287a);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.q-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.q-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.q-item:hover {
  background: rgba(255, 210, 63, 0.15);
  border-color: rgba(255, 210, 63, 0.5);
}

.q-meta {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.custom-form {
  display: grid;
  gap: 8px;
}

.answer-row {
  display: grid;
  grid-template-columns: 28px 1fr 80px;
  gap: 6px;
  align-items: center;
}

.answer-row .num,
.key-btn .num {
  font-family: var(--display);
  color: var(--gold);
  text-align: center;
}

.answer-key {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.key-btn {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(80, 130, 255, 0.5);
  background: linear-gradient(180deg, #1d48c4, #0e2a8a);
  font-weight: 700;
  cursor: pointer;
}

.key-btn:hover:not(:disabled) {
  filter: brightness(1.2);
}

.key-btn.done {
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.05);
  text-decoration: line-through;
  cursor: default;
}

.key-pts {
  font-family: var(--display);
  color: var(--gold);
}

.buzz-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.buzz-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 6px solid var(--team-c, #fff);
  font-weight: 700;
}

.buzz-list li.red {
  --team-c: var(--red);
}

.buzz-list li.blue {
  --team-c: var(--blue);
}

.buzz-list li.first {
  background: rgba(255, 210, 63, 0.18);
  font-size: 1.1rem;
}

.buzz-team,
.buzz-time {
  color: var(--muted);
  font-size: 0.85rem;
  align-self: center;
}

.play-pass p {
  font-weight: 800;
}

.score-adjust {
  padding: 8px 0;
}

.sa-name {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.score-adjust.red .sa-name {
  color: #ff9cad;
}

.score-adjust.blue .sa-name {
  color: #9fd1ff;
}

/* ---------- lobby (host) ---------- */

.lobby {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) 1.4fr;
  gap: clamp(16px, 3vw, 36px);
  align-items: center;
  overflow-y: auto;
}

.join-card {
  padding: 34px 28px;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.2), transparent 60%),
    linear-gradient(180deg, #1a3cb8, #0a1a66);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 4px #8a4b00, 0 24px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.join-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.85rem;
}

.join-url {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  color: #fff;
  word-break: break-all;
}

.room-code {
  display: flex;
  gap: 10px;
}

.code-letter {
  display: grid;
  place-items: center;
  width: clamp(56px, 7vw, 100px);
  height: clamp(70px, 9vw, 124px);
  border-radius: 14px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 5rem);
  color: #3a1c00;
  background: linear-gradient(180deg, #fff6c4, #ffd23f 45%, #ffa000);
  box-shadow: 0 6px 0 #8a4b00, 0 14px 24px rgba(0, 0, 0, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.7);
  animation: letter-in 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  animation-delay: calc(var(--i) * 110ms);
}

.lobby-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-self: stretch;
}

.lobby-team {
  --c: var(--red);
  --c-lo: var(--red-lo);
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 35%, transparent), rgba(5, 10, 40, 0.75));
  border: 3px solid var(--c);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c) 35%, transparent);
  min-height: 300px;
}

.lobby-team.blue {
  --c: var(--blue);
  --c-lo: var(--blue-lo);
}

.team-input {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 3px dashed rgba(255, 255, 255, 0.35);
  background: transparent;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  text-align: center;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.team-input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.member-count {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  margin: 10px 0;
}

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

.member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  animation: pop-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.member .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4dff88;
  box-shadow: 0 0 8px #4dff88;
}

.member.offline {
  opacity: 0.55;
}

.member.offline .dot {
  background: #889;
  box-shadow: none;
}

.kick {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-weight: 900;
  opacity: 0.6;
}

.kick:hover {
  opacity: 1;
  background: var(--red-lo);
}

@keyframes pop-in {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

/* ---------- board ---------- */

.board {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: clamp(8px, 1.6vh, 18px);
  min-height: 0;
}

.scorebar {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 0.8fr) 1fr;
  gap: clamp(8px, 1.5vw, 22px);
  align-items: stretch;
}

.team-box {
  --c: var(--red);
  --c-lo: var(--red-lo);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.2vh, 14px) 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 45%),
    linear-gradient(180deg, var(--c), var(--c-lo));
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.15), inset 0 -6px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.team-box.blue {
  --c: var(--blue);
  --c-lo: var(--blue-lo);
}

.team-name {
  font-family: var(--display);
  font-size: clamp(0.85rem, 1.7vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.team-score {
  font-family: var(--display);
  font-size: clamp(2rem, 5.2vw, 4.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 255, 255, 0.35);
}

.team-tag {
  min-height: 1.2em;
  font-size: clamp(0.7rem, 1.1vw, 0.95rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-hi);
}

.team-box.has-control,
.team-box.stealing,
.team-box.buzzed,
.team-box.leader {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 0 4px var(--gold), 0 0 40px rgba(255, 210, 63, 0.6);
}

.team-box.stealing {
  animation: glow 0.9s ease-in-out infinite alternate;
}

.team-box.mine::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 22px;
  border: 3px dashed rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.team-box.flash {
  animation: flash 0.9s ease-out;
}

@keyframes flash {
  0% {
    filter: brightness(2.2);
    transform: scale(1.12);
  }
}

@keyframes glow {
  to {
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 0 4px var(--orange), 0 0 60px rgba(255, 140, 26, 0.9);
  }
}

.bump {
  animation: bump 0.9s ease-out;
}

@keyframes bump {
  20% {
    transform: scale(1.18);
    color: var(--gold-hi);
  }
}

.bank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 50%),
    linear-gradient(180deg, #13277e, #071450);
  border: 3px solid var(--gold);
  box-shadow: 0 6px 0 #6b3500, inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.round-pill {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.65rem, 1vw, 0.9rem);
  color: var(--muted);
}

.bank-label {
  font-family: var(--display);
  font-size: clamp(0.7rem, 1vw, 0.95rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.bank-value {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4.2vw, 3.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-hi);
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.7), 0 3px 0 #6b3500;
}

.bank-mult {
  min-height: 1.1em;
  font-weight: 900;
  font-size: clamp(0.65rem, 1vw, 0.9rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bank-mult.hot {
  color: var(--orange);
  animation: pulse 1s ease-in-out infinite;
}

.question {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4em;
  padding: clamp(10px, 1.8vh, 20px) clamp(14px, 2vw, 28px);
  border-radius: 16px;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.2vw, 2.8rem);
  line-height: 1.15;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #5b8dff, #2156e0 50%, #1036a8);
  border: 3px solid #fff;
  box-shadow: 0 0 22px rgba(120, 170, 255, 0.55), inset 0 -4px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}

.question.enter {
  animation: q-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes q-in {
  from {
    transform: scale(0.7) translateY(-20px);
    opacity: 0;
  }
}

.board-frame {
  min-height: 0;
  padding: clamp(14px, 2.2vh, 26px);
  border-radius: 26px;
  background:
    linear-gradient(180deg, #ffe680, #ffb000 40%, #c46a00);
  box-shadow: 0 0 0 4px #6b3500, 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 3px 0 rgba(255, 255, 255, 0.6), inset 0 -6px 0 rgba(0, 0, 0, 0.25);
  display: flex;
}

.tiles {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, minmax(46px, 1fr));
  grid-template-columns: 1fr 1fr;
  gap: clamp(6px, 1vh, 12px) clamp(6px, 1vw, 14px);
  padding: clamp(8px, 1.2vh, 14px);
  border-radius: 14px;
  background: #050c33;
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, 0.9);
}

.tile {
  position: relative;
  perspective: 900px;
  border: 0;
  padding: 0;
  background: none;
  min-height: 46px;
  border-radius: 10px;
  font-family: var(--display);
  cursor: default;
}

button.tile:not(:disabled) {
  cursor: pointer;
}

button.tile:not(:disabled):hover .tile-front {
  filter: brightness(1.18);
}

.tile-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.tile.flipped .tile-inner {
  transform: rotateX(-180deg);
}

.tile.instant .tile-inner {
  transition: none;
}

.tile-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.tile-face::before {
  /* glossy bevel */
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.05));
  border-radius: 10px 10px 40% 40% / 10px 10px 18px 18px;
  pointer-events: none;
}

.tile-front {
  justify-content: center;
  background: linear-gradient(180deg, var(--tile-hi), var(--tile) 50%, var(--tile-lo));
  box-shadow: inset 0 0 0 2px rgba(150, 190, 255, 0.6), inset 0 -5px 10px rgba(0, 0, 0, 0.4), 0 3px 0 #02092a;
}

.tile-num {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2.3em;
  height: 1.6em;
  padding: 0 0.6em;
  border-radius: 50%;
  font-size: clamp(1.1rem, 2.8vh, 2.2rem);
  color: #fff;
  background: radial-gradient(ellipse at 50% 30%, #2d63ff, #0a2272);
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px #6b3500, 0 4px 10px rgba(0, 0, 0, 0.5);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.tile-back {
  transform: rotateX(180deg);
  justify-content: space-between;
  background: linear-gradient(180deg, #5b8dff, #2156e0 50%, #1036a8);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 22px rgba(120, 170, 255, 0.55);
}

.tile-text {
  position: relative;
  flex: 1;
  padding: 0 0.7em;
  font-size: clamp(0.95rem, 2.5vh, 2rem);
  text-transform: uppercase;
  text-align: left;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-pts {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 2.6em;
  font-size: clamp(1rem, 2.7vh, 2.1rem);
  color: var(--gold-hi);
  background: linear-gradient(180deg, #0d2a8f, #061a5c);
  border-left: 3px solid rgba(255, 255, 255, 0.5);
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.7);
}

.tile-empty {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #0c1a5a, #08113d);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7);
}

.tile.deal {
  animation: deal 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  animation-delay: calc(var(--d) * 70ms);
}

@keyframes deal {
  from {
    transform: translateY(-30px) rotateX(70deg);
    opacity: 0;
  }
}

.status-row {
  min-height: 3.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.strikes {
  display: flex;
  gap: 8px;
}

.strike-mark {
  display: grid;
  place-items: center;
  width: clamp(36px, 4.4vh, 54px);
  height: clamp(36px, 4.4vh, 54px);
  border-radius: 10px;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.2vh, 2.3rem);
  color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s;
}

.strike-mark.on {
  color: #fff;
  background: linear-gradient(180deg, #ff5c78, #c3102f);
  border-color: #ffd0d8;
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.8);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.banner {
  flex: 1;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  font-family: var(--display);
  font-size: clamp(1rem, 2.2vw, 1.9rem);
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 210, 63, 0.4);
}

.banner.phase-steal,
.banner.phase-faceoff {
  color: var(--orange);
  animation: pulse 1.1s ease-in-out infinite;
}

/* the big red X */

.x-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
}

.x-overlay.show {
  animation: x-life 1.3s ease-out forwards;
}

@keyframes x-life {
  0% {
    opacity: 0;
    background: rgba(120, 0, 20, 0);
  }
  8% {
    opacity: 1;
    background: rgba(120, 0, 20, 0.35);
  }
  80% {
    opacity: 1;
    background: rgba(120, 0, 20, 0.25);
  }
  100% {
    opacity: 0;
    background: rgba(120, 0, 20, 0);
  }
}

.big-x {
  display: inline-block;
  font-family: var(--display);
  font-size: min(42vh, 30vw);
  line-height: 1;
  color: #ff1f3d;
  -webkit-text-stroke: 0.035em #fff;
  text-shadow: 0 0 0.12em rgba(255, 0, 40, 0.9), 0 0.05em 0 #5a0010, 0 0 0.4em rgba(255, 0, 40, 0.6);
  animation: x-slam 0.45s cubic-bezier(0.2, 1.8, 0.4, 1) both;
  animation-delay: calc(var(--i) * 70ms);
}

.big-x.static {
  font-size: 7rem;
  animation: none;
}

@keyframes x-slam {
  from {
    transform: scale(3) rotate(-20deg);
    opacity: 0;
  }
}

/* ---------- winner ---------- */

.winner-overlay {
  --c: var(--gold);
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 45%, rgba(20, 40, 140, 0.85), rgba(2, 5, 25, 0.96));
  animation: fade-in 0.5s ease-out;
}

.winner-overlay.red {
  --c: var(--red);
}

.winner-overlay.blue {
  --c: var(--blue);
}

.rays {
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c) 30%, transparent) 0 8deg, transparent 8deg 20deg);
  animation: spin 24s linear infinite;
  mask-image: radial-gradient(circle, #000 10%, transparent 60%);
  -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 60%);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.winner-card {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  animation: letter-in 0.8s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.winner-kicker {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-size: clamp(1rem, 2.4vw, 1.6rem);
}

.winner-name {
  font-family: var(--display);
  font-size: clamp(2.8rem, 10vw, 8rem);
  line-height: 1;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 6px 0 color-mix(in srgb, var(--c) 60%, #000), 0 12px 0 rgba(0, 0, 0, 0.35), 0 0 60px var(--c);
}

.winner-scores {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.winner-score {
  --c: var(--red);
  display: flex;
  flex-direction: column;
  padding: 12px 26px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 50%, #000));
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4);
}

.winner-score.blue {
  --c: var(--blue);
}

.ws-name {
  font-weight: 900;
  text-transform: uppercase;
}

.ws-pts {
  font-family: var(--display);
  font-size: 2.6rem;
}

canvas.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ---------- player ---------- */

.player {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(4, 10, 42, 0.7);
  border-bottom: 1px solid rgba(255, 210, 63, 0.2);
}

.player-top .icon-btn {
  margin-left: auto;
}

.me-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.me-chip:empty {
  display: none;
}

.me-chip.red {
  background: rgba(255, 59, 92, 0.25);
  border-color: var(--red);
  color: #fff;
}

.me-chip.blue {
  background: rgba(47, 155, 255, 0.25);
  border-color: var(--blue);
  color: #fff;
}

.player-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  width: min(720px, 100%);
  margin: 0 auto;
}

.screen-title {
  font-family: var(--display);
  text-align: center;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 3px 0 #6b3500;
  margin: 8px 0 4px;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
}

.join-screen,
.wait-screen {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wait-screen {
  text-align: center;
  gap: 10px;
}

.wait-hello {
  font-family: var(--display);
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  margin-top: 12px;
}

.wait-hello strong {
  color: var(--gold);
}

.wait-text {
  color: var(--muted);
  font-weight: 700;
  font-size: 1.1rem;
}

.team-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.team-card {
  --c: var(--red);
  --c-lo: var(--red-lo);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 190px;
  padding: 18px 10px 14px;
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 40%),
    linear-gradient(180deg, var(--c), var(--c-lo));
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.45), 0 14px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.team-card.blue {
  --c: var(--blue);
  --c-lo: var(--blue-lo);
}

.team-card:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.team-card.picked {
  border-color: var(--gold);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 210, 63, 0.5), 0 0 40px color-mix(in srgb, var(--c) 70%, transparent);
  transform: translateY(-3px);
}

.tc-name {
  font-family: var(--display);
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  text-align: center;
  overflow-wrap: anywhere;
}

.tc-cta {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.team-card.picked .tc-cta {
  background: var(--gold);
  color: #3a1c00;
}

.tc-members {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.tc-member,
.tc-empty {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  font-weight: 700;
}

.tc-member.me {
  background: #fff;
  color: #071341;
}

.tc-empty {
  background: transparent;
  font-style: italic;
  opacity: 0.85;
}

.game-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.watch-join {
  align-self: center;
}

.mode-player .scorebar {
  grid-template-columns: 1fr 0.8fr 1fr;
  gap: 8px;
}

.mode-player .tiles {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  grid-auto-rows: minmax(46px, auto);
}

.mode-player .tile-empty {
  display: none;
}

.mode-player .tile {
  min-height: 48px;
}

.mode-player .tile-num {
  font-size: 1.2rem;
}

.mode-player .tile-text {
  font-size: 0.95rem;
}

.mode-player .tile-pts {
  font-size: 1.1rem;
}

.mode-player .question {
  font-size: clamp(1.25rem, 5.4vw, 1.8rem);
}

.mode-player .board-frame {
  padding: 10px;
}

.mode-player .x-overlay .big-x {
  font-size: 40vw;
}

.buzz-zone[hidden] {
  display: none;
}

.buzz-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.buzz-btn {
  position: relative;
  width: min(68vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #ff8095, #ff1f3d 45%, #9c0019 100%);
  box-shadow:
    0 0 0 10px #2a2f45,
    0 0 0 14px #11142a,
    0 14px 0 14px #070818,
    0 30px 50px rgba(0, 0, 0, 0.6),
    inset 0 -14px 30px rgba(80, 0, 10, 0.6),
    inset 0 10px 20px rgba(255, 255, 255, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  margin-bottom: 18px;
}

.buzz-cap {
  font-family: var(--display);
  font-size: clamp(2.4rem, 13vw, 4rem);
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 4px 0 rgba(90, 0, 15, 0.7);
}

.buzz-btn.live {
  animation: buzz-glow 0.8s ease-in-out infinite alternate;
}

@keyframes buzz-glow {
  to {
    box-shadow:
      0 0 0 10px #2a2f45,
      0 0 0 14px var(--gold),
      0 14px 0 14px #070818,
      0 0 70px 30px rgba(255, 40, 70, 0.75),
      inset 0 -14px 30px rgba(80, 0, 10, 0.6),
      inset 0 10px 20px rgba(255, 255, 255, 0.35);
  }
}

.buzz-btn:active:not(:disabled),
.buzz-btn.pressed {
  transform: translateY(10px);
  box-shadow:
    0 0 0 10px #2a2f45,
    0 0 0 14px #11142a,
    0 4px 0 14px #070818,
    0 10px 20px rgba(0, 0, 0, 0.6),
    inset 0 -6px 20px rgba(80, 0, 10, 0.7),
    inset 0 10px 20px rgba(255, 255, 255, 0.25);
}

.buzz-btn:disabled:not(.pressed) {
  cursor: default;
  filter: grayscale(0.75) brightness(0.6);
}

.buzz-msg {
  margin: 0;
  min-height: 1.4em;
  font-family: var(--display);
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  text-align: center;
  color: var(--muted);
}

.buzz-msg.win {
  color: var(--gold);
  font-size: clamp(1.5rem, 7vw, 2.2rem);
  text-shadow: 0 0 20px rgba(255, 210, 63, 0.6);
  animation: letter-in 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* ---------- misc ---------- */

.conn-banner {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 0 0 14px 14px;
  background: var(--orange);
  color: #2a1000;
  font-weight: 900;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -110%);
  transition: transform 0.3s;
}

.conn-banner.show {
  transform: translate(-50%, 0);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.25);
  border-top-color: #2a1000;
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  background: #fff;
  color: #071341;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 160%);
  transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.toast.show {
  transform: translate(-50%, 0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 25, 0.8);
}

.modal {
  width: min(480px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1a3cb8, #0a1a66);
  border: 3px solid var(--gold);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.modal h2 {
  margin-top: 0;
  font-family: var(--display);
  color: var(--gold);
}

.noscript {
  padding: 40px;
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .lobby {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .host {
    height: auto;
    min-height: 100vh;
  }

  .host-body {
    grid-template-columns: 1fr;
  }

  .panel {
    border-left: 0;
    border-top: 2px solid rgba(255, 210, 63, 0.25);
    overflow: visible;
  }

  .panel-head {
    position: static;
  }

  .host-top {
    flex-wrap: wrap;
  }

  .host-main .board {
    min-height: 80vh;
  }
}

@media (max-width: 640px) {
  .tiles {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: minmax(46px, auto);
  }

  .tile-empty {
    display: none;
  }

  .tiles.few {
    grid-auto-rows: minmax(52px, auto);
  }

  .lobby-teams,
  .team-cards {
    gap: 10px;
  }

  .lobby-teams {
    grid-template-columns: 1fr;
  }

  .scorebar {
    grid-template-columns: 1fr 0.85fr 1fr;
  }

  .team-box {
    border-radius: 14px;
  }

  .status-row {
    flex-direction: column;
    align-items: center;
  }

  .banner {
    text-align: center;
    justify-content: center;
  }

  .logo {
    padding: 22px 26px 16px;
  }

  .top-actions .icon-btn {
    font-size: 0.8rem;
  }
}

@media (min-width: 641px) and (max-height: 560px) {
  .logo-word {
    font-size: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bulb {
    opacity: 1;
  }

  .spotlights {
    display: none;
  }

  .x-overlay.show {
    animation: none;
    opacity: 1;
    background: rgba(120, 0, 20, 0.3);
  }
}

/* ---------- whose turn, controls window, board-only view ---------- */

.turn-banner {
  --tc: var(--red);
  --tc-lo: var(--red-lo);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.6vw, 2.2rem);
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, var(--tc), var(--tc-lo));
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 22px var(--tc);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.turn-banner {
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-banner.idle {
  /* keep the row's height so the board never jumps */
  visibility: hidden;
}

.turn-banner.yours {
  --tc: var(--gold);
  --tc-lo: #d89400;
  color: #1b1300;
  text-shadow: none;
  border-color: #fff;
  animation: pulse 1.1s ease-in-out infinite;
}

.turn-banner.blue {
  --tc: var(--blue);
  --tc-lo: var(--blue-lo);
}

.turn-now {
  font-weight: 800;
  margin: 0 0 8px;
}

.turn-team h4 {
  margin: 10px 0 4px;
}

.turn-team.red h4 {
  color: var(--red);
}

.turn-team.blue h4 {
  color: var(--blue);
}

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

.turn-player {
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.turn-player.current {
  background: var(--gold);
  border-color: #fff;
  color: #1b1300;
}

.turn-player:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.url-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 8px;
}

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

.conn-chip {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  background: rgba(60, 220, 120, 0.18);
  border: 1px solid rgba(60, 220, 120, 0.6);
}

.conn-chip.bad {
  background: rgba(255, 59, 92, 0.25);
  border-color: var(--red);
}

.ctl-offline {
  padding: 12px 16px;
  background: var(--red-lo);
  border-bottom: 2px solid #fff;
}

.controls-window .host-body {
  grid-template-columns: 1fr;
}

.controls-window .panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-left: 0;
}

.board-only .host-main {
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  .turn-banner.yours {
    animation: none;
  }
}
