:root {
  --void: #05070F;
  --panel: #0C1230;
  --gold: #D69F4C;
  --ink: #EAEEFF;
  --dim: #8892B8;
  --team: #37406B;
  --team-ink: #FFFFFF;
  --display: "Arial Narrow", "Helvetica Neue Condensed", "Liberation Sans Narrow", Impact, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior: none;
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.screen.is-live { display: flex; }

/* ------------------------------------------------------------ join */

.wordmark {
  font-family: var(--display);
  font-size: 40px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1;
  text-align: center;
  margin-top: 8px;
}

.wordmark span { display: block; font-size: 30px; color: var(--ink); letter-spacing: 0.3em; }

.lede { color: var(--dim); font-size: 15px; line-height: 1.45; text-align: center; }

.field { display: block; }

.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}

#nameinput {
  width: 100%;
  padding: 16px;
  font-size: 17px; /* 16px+ stops iOS zoom-on-focus */
  font-family: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid #1D2650;
  border-radius: 10px;
}

#nameinput:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

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

.teamchip {
  padding: 18px 12px;
  border-radius: 10px;
  border: 3px solid transparent;
  background: var(--chip, #222);
  color: var(--chip-ink, #fff);
  font-family: var(--display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.1;
  opacity: 0.45;
  transition: opacity 120ms ease, transform 120ms ease;
  cursor: pointer;
}

.teamchip.is-picked { opacity: 1; border-color: #fff; transform: translateY(-2px); }

.primary {
  margin-top: auto;
  padding: 20px;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #16110A;
  background: var(--gold);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.primary:disabled { opacity: 0.35; cursor: default; }

.hint { text-align: center; font-size: 13px; color: var(--dim); min-height: 18px; }

/* ---------------------------------------------------------- buzzer */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--dim);
  flex: 0 0 auto;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--team);
  color: var(--team-ink);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ghost {
  padding: 7px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid #263061;
  color: var(--dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.status { letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; }
.status.is-offline { color: #FF8B8B; }

.buzz {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 6px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #171C36;
  color: #6B76A6;
  font-family: var(--display);
  font-size: 58px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 90ms ease, background 140ms ease, color 140ms ease;
}

.buzz span:last-child {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.8;
  min-height: 18px;
  padding: 0 20px;
  text-align: center;
}

/* armed: the button becomes the team colour and grows a halo */
.buzz.is-armed {
  background: var(--team);
  color: var(--team-ink);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 0 var(--team);
  animation: breathe 1.9s ease-in-out infinite;
}

.buzz.is-armed:active { transform: scale(0.97); }

.buzz.is-mine {
  background: #F5F7FF;
  color: #0B0F22;
  border-color: var(--team);
  animation: none;
}

.buzz.is-locked { background: #12162C; color: #5C6795; animation: none; }

.buzz.is-out { background: #1A1020; color: #7A5C6E; animation: none; }

.buzz.is-early { animation: nope 260ms ease; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.18); }
  50%      { box-shadow: 0 0 44px 6px var(--team); }
}

@keyframes nope {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .buzz, .buzz.is-armed, .teamchip { animation: none; transition: none; }
}

.field[hidden] { display: none; }
.hint[hidden] { display: none; }

.tag {
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  padding: 4px 8px;
  border: 1px solid #263061;
  border-radius: 6px;
}

/* benched by the host for mashing the buzzer */
.buzz.is-benched {
  background: #2A1410;
  color: #E08A6E;
  border-color: #6B3A2A;
  animation: none;
}
