:root {
  --bg: #12121f;
  --card: #1c1c30;
  --accent: #ffb703;
  --text: #f4f4f9;
  --muted: #9a9ab0;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 100px;
  min-height: 100vh;
}

h1 {
  font-size: 28px;
  text-align: center;
  margin: 12px 0 4px;
}
.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  text-align: center;
  text-decoration: none;
  color: #12121f;
  background: var(--accent);
  transition: transform .1s ease;
}
.btn:active { transform: scale(0.97); }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid #33334d;
}
.btn.danger { background: #ef476f; color: white; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

input[type=text], input[type=number], select {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid #33334d;
  background: var(--card);
  color: var(--text);
  font-size: 17px;
  margin-bottom: 12px;
}
input::placeholder { color: var(--muted); }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.code-badge {
  display: block;
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--accent);
  margin: 8px 0 4px;
}
.code-hint { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 8px; }

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.team-name { font-weight: 700; font-size: 17px; }
.team-score { font-size: 22px; font-weight: 800; }
.team-actions { display: flex; gap: 8px; }
.icon-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.icon-btn.add { background: rgba(255,255,255,0.15); color: white; }
.icon-btn.mute { background: #ef476f; color: white; }
.icon-btn.remove { background: rgba(255,255,255,0.1); color: var(--muted); }

.word-display {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
}
.word-value {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}
.word-value-en {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  margin-top: -6px;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
/* De browser verbergt [hidden] normaal via de standaard UA-stylesheet, maar
   die regel heeft dezelfde specificiteit als .center-screen hierboven en
   auteur-CSS wint altijd van de UA-stylesheet - dus zonder deze regel
   bleven ALLE schermen (join/waiting/word/between/finished) permanent
   zichtbaar (display:flex) ongeacht hun hidden-attribuut. Dit was de echte
   oorzaak achter "tikken op sessie blijft hangen": de join-status klopte
   intern prima, maar het join-scherm verdween nooit echt van beeld. */
.center-screen[hidden] {
  display: none;
}

.mic-emoji { font-size: 64px; margin-bottom: 8px; }

.transcript-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0; /* wordt in JS bijgewerkt naar de actuele hoogte van #scoreboard,
                zodat de balk er altijd nét boven blijft staan, ongeacht het
                aantal teams (en dus de hoogte van het scorebord). */
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
  line-height: 1.35;
  z-index: 5;
}
.transcript-bar[hidden] { display: none; }
.transcript-current {
  color: var(--text);
  font-size: min(4.5vw, 24px);
  font-weight: 700;
  min-height: 1.35em; /* voorkomt "springen" als deze regel leeg is */
}
.transcript-previous {
  color: var(--muted);
  font-size: min(3.5vw, 18px);
}

.song-match-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 24px;
  background: var(--accent);
  color: #12121f;
  font-size: min(4.5vw, 24px);
  font-weight: 800;
  text-align: center;
  z-index: 5;
}
.song-match-banner[hidden] { display: none; }

.display-word {
  font-size: min(18vw, 110px);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.05;
  word-break: break-word;
}
.display-word-en {
  font-size: min(9vw, 54px);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.display-scoreboard {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 4px;
  padding: 12px;
  background: rgba(0,0,0,0.35);
  flex-wrap: wrap;
  justify-content: center;
}
.display-team-chip {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #12121f;
}

.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 24px;
}

.version-tag {
  position: fixed;
  bottom: 4px;
  right: 8px;
  font-size: 15px;
  color: var(--muted);
  opacity: 0.55;
  z-index: 999;
  pointer-events: none;
}
