:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2430;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f8b8d;
  --accent-dark: #0b686a;
  --danger: #d64545;
  --ok: #1c8a4b;
  --warn: #bc7c00;
  --shadow: 0 10px 30px rgba(20, 32, 50, 0.10);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e8eef3;
  color: var(--ink);
}

button.secondary:hover {
  background: #d8e2ea;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  height: 36px;
  width: auto;
}

.room {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.stack {
  display: grid;
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 10px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted);
  background: white;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
}

.dot.connected {
  background: var(--ok);
}

.dot.locked {
  background: var(--danger);
}

.list {
  display: grid;
  gap: 8px;
  min-height: 48px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.item strong {
  overflow-wrap: anywhere;
}

.item.first {
  border-color: var(--accent);
  background: #e8f5f5;
}

.muted {
  color: var(--muted);
}

.big-buzzer {
  width: min(380px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: clamp(30px, 8vw, 54px);
  box-shadow: 0 18px 0 #085254, 0 28px 38px rgba(0, 0, 0, 0.22);
}

.big-buzzer:active {
  transform: translateY(8px);
  box-shadow: 0 10px 0 #085254, 0 18px 26px rgba(0, 0, 0, 0.18);
}

.player-stage {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.urlbox {
  display: grid;
  gap: 8px;
}

.urlbox a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
  min-height: 76px;
}

.tile.buzzed {
  border-color: var(--accent);
  background: #e8f5f5;
}

.visualizer {
  width: min(1280px, calc(100vw - 40px));
}

.visualizer .first-name {
  font-size: clamp(44px, 8vw, 96px);
  line-height: 1.05;
  font-weight: 900;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1120px);
    padding: 14px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .span-4,
  .span-6,
  .span-8,
  .span-12 {
    grid-column: span 12;
  }

  h1 {
    font-size: 26px;
  }
}
