/*
  Burkina Quiz — Dirección visual inspirada en El Impostor.
  Fondo azul noche (#070a24), losas azul marino (#10164a), acentos amarillo lacre (#ffe14d)
  para Equipo A y rojo tomate (#ff6a55) para Equipo B, con verde menta (#4ee6a0) para aciertos.
*/

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

:root {
  --bg: #070a24;
  --deep: #03051a;
  --panel: #10164a;
  --panel-2: #1a2266;
  --line: #2c38a6;
  --ink: #f5f7ff;
  --muted: #b4bbf5;
  --lemon: #ffe14d;
  --lemon-deep: #b89f00;
  --tomato: #ff6a55;
  --tomato-deep: #b73424;
  --green: #4ee6a0;
  --green-deep: #1b8c59;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text: "Schibsted Grotesk", system-ui, sans-serif;
  --r-slab: 28px 28px 28px 6px;
  --r-inner: 18px;
}

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

body {
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 225, 77, 0.08), transparent 36%),
    radial-gradient(circle at 12% 85%, rgba(255, 106, 85, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
  font-family: var(--text);
  line-height: 1.4;
  user-select: text;
}

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

button {
  cursor: pointer;
}

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

.icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

/* ───────── Estructura ───────── */
.shell {
  width: min(100% - 28px, 510px);
  min-height: 100dvh;
  margin: auto;
  padding: 18px 0 calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.shell.shell--wide {
  width: min(100% - 28px, 760px);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: auto 0;
}

.view--top {
  margin-top: 0;
}

/* ───────── Tipografía ───────── */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.4px;
}

h2 {
  font-size: 28px;
  line-height: 1.05;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin: 0;
}

.hint-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-2);
  font-weight: 600;
}

.hint-warning {
  background: var(--tomato);
  color: var(--deep);
  font-weight: 700;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0;
}

label,
.field-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* ───────── Marca (inicio) ───────── */
.home-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.home-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r-inner);
  background: var(--panel-2);
  border: 2px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s, transform 0.08s;
}

.game-link-card:hover {
  border-color: var(--lemon);
}

.game-link-card:active {
  transform: scale(0.99);
}

.game-link-card--current {
  border-color: var(--lemon);
  background: rgba(255, 225, 77, 0.1);
}

.game-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-link-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.game-link-cta {
  font-size: 13px;
  font-weight: 800;
  color: var(--lemon);
}

.game-link-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.hero {
  position: relative;
  margin: 1vh 0 12px;
  padding-right: 54px;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.h1-small {
  font-size: 24px;
  line-height: 1;
  padding: 5px 12px 3px;
  background: var(--lemon);
  color: var(--deep);
  border-radius: 8px 8px 8px 2px;
  transform: rotate(-3deg);
  transform-origin: left bottom;
  margin-left: 2px;
}

.h1-big {
  font-size: clamp(58px, 19vw, 88px);
  line-height: 0.96;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink);
  padding-top: 4px;
}

.logo {
  position: absolute;
  right: 0;
  top: 0;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: var(--deep);
  background: var(--tomato);
  border-radius: 50%;
  transform: rotate(8deg);
  box-shadow: 0 4px 0 var(--deep);
}

/* ───────── Losas y formularios ───────── */
.card {
  background: var(--panel);
  border-radius: var(--r-slab);
  padding: 20px;
  box-shadow: 0 6px 0 var(--deep);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  color: var(--ink);
  background: var(--deep);
  border: 2px solid var(--line);
  border-radius: 16px;
  outline: 0;
  padding: 12px 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--lemon);
}

input::placeholder,
textarea::placeholder {
  color: #8d97ee;
}

.name-wrapper {
  position: relative;
}

.name-input {
  padding: 15px 44px 15px 44px;
  font-size: 17px;
  font-weight: 600;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.name-wrapper:focus-within .field-icon {
  color: var(--lemon);
}

.btn-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--panel-2);
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 13px;
}

/* ───────── Código de sala (4 casillas) ───────── */
.join-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-inner);
  background: var(--panel-2);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
}

.code-field {
  position: relative;
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.code-slot {
  height: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--deep);
  font: 800 30px/1 var(--display);
  color: var(--ink);
  text-transform: uppercase;
}

.code-slot--filled {
  border-color: var(--lemon);
  background: var(--lemon);
  color: var(--deep);
}

.code-field:focus-within .code-slot {
  border-color: var(--lemon);
}

.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  padding: 0;
  border: 0;
}

/* ───────── Botones ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 99px;
  min-height: 48px;
  padding: 11px 20px;
  color: var(--ink);
  background: var(--panel-2);
  box-shadow: 0 4px 0 var(--deep);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--deep);
}

.btn.primary {
  background: var(--lemon);
  color: var(--deep);
  box-shadow: 0 4px 0 var(--lemon-deep);
}

.btn.primary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--lemon-deep);
}

.btn.secondary {
  background: var(--tomato);
  color: var(--deep);
  box-shadow: 0 4px 0 var(--tomato-deep);
}

.btn.secondary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--tomato-deep);
}

.btn.success {
  background: var(--green);
  color: var(--deep);
  box-shadow: 0 4px 0 var(--green-deep);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px #ffffff44;
}

.btn.big {
  min-height: 56px;
  font-size: 18px;
}

.btn.small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

.btn.full-width {
  width: 100%;
}

.btn:disabled {
  background: var(--panel-2);
  color: var(--muted);
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.divider::before,
.divider::after {
  content: "";
  height: 2px;
  background: var(--line);
  flex: 1;
}

.admin-link {
  text-align: center;
  margin: 4px 0 0;
}

.admin-link a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ───────── Lobby: código, equipos y ajustes ───────── */
.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-inner);
  background: var(--deep);
}

.code-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-value {
  color: var(--lemon);
  font: 900 38px/1 var(--display);
  letter-spacing: 6px;
}

.code-actions {
  display: flex;
  gap: 8px;
}

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

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

.team-slab {
  background: var(--panel-2);
  border-radius: var(--r-inner);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid transparent;
}

.team-slab--A {
  border-color: rgba(255, 225, 77, 0.55);
}

.team-slab--B {
  border-color: rgba(255, 106, 85, 0.55);
}

.team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.team-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.team-slab--A .team-name {
  color: var(--lemon);
}

.team-slab--B .team-name {
  color: var(--tomato);
}

.team-count {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--deep);
  color: var(--ink);
}

.team-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 44px;
}

.player-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 600;
}

.player-chip.me {
  background: var(--ink);
  color: var(--deep);
}

.player-chip.off {
  opacity: 0.5;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.dot.off {
  background: var(--lemon);
}

.badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--lemon);
  color: var(--deep);
}

.mini-btn {
  border: 0;
  background: var(--deep);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.mini-btn.danger {
  color: var(--tomato);
}

.lobby-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.matchup-pill {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--deep);
  color: var(--lemon);
  letter-spacing: 1px;
}

/* ───────── Config de temas y opciones ───────── */
.lobby-section {
  background: var(--panel-2);
  border-radius: var(--r-inner);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 99px;
  border: 2px solid var(--line);
  background: var(--deep);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.12s;
}

.topic-chip.selected {
  background: var(--lemon);
  border-color: var(--lemon);
  color: var(--deep);
}

.topic-chip:disabled {
  cursor: default;
  opacity: 0.9;
}

.topic-count {
  font-size: 11px;
  opacity: 0.78;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.config-row select {
  width: auto;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 14px;
}

/* ───────── Marcador en partida ───────── */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border-radius: var(--r-inner);
  padding: 12px 14px;
  box-shadow: 0 5px 0 var(--deep);
}

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

.score-team--B {
  text-align: right;
  align-items: flex-end;
}

.score-team-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-team--A .score-pts {
  color: var(--lemon);
}

.score-team--B .score-pts {
  color: var(--tomato);
}

.score-pts {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.score-streak {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
}

.round-badge {
  background: var(--deep);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 6px 12px;
  text-align: center;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ───────── Pregunta y opciones ───────── */
.timer-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.timer-track {
  height: 10px;
  background: var(--deep);
  border-radius: 99px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--lemon);
  border-radius: 99px;
  transition: width 0.15s linear, background-color 0.2s;
}

.timer-fill.urgent {
  background: var(--tomato);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--lemon);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}

.diff-pill {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--deep);
  color: var(--muted);
}

.question-text {
  font-family: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 2px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--deep);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.08s, border-color 0.12s, background 0.12s;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--lemon);
}

.option-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.option-btn.selected {
  border-color: var(--lemon);
  background: rgba(255, 225, 77, 0.16);
}

.option-btn.correct {
  border-color: var(--green);
  background: rgba(78, 230, 160, 0.18);
}

.option-btn.wrong {
  border-color: var(--tomato);
  background: rgba(255, 106, 85, 0.16);
}

.option-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.option-letter {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--lemon);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  flex: none;
}

.option-btn.selected .option-letter {
  background: var(--lemon);
  color: var(--deep);
}

.option-btn.correct .option-letter {
  background: var(--green);
  color: var(--deep);
}

.option-votes {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--lemon);
  flex: none;
}

/* ───────── Reveal & Resultados ───────── */
.explanation-box {
  background: var(--deep);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--muted);
}

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

.reveal-team-card {
  background: var(--panel-2);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reveal-delta {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.reveal-delta.ok {
  color: var(--green);
}

.reveal-delta.miss {
  color: var(--tomato);
}

.podium-banner {
  text-align: center;
  padding: 18px;
  border-radius: var(--r-inner);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.podium-title {
  font-family: var(--display);
  font-size: 46px;
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--lemon);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--deep);
  font-size: 14px;
  font-weight: 600;
}

/* ───────── Admin Panel ───────── */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--panel);
  padding: 6px;
  border-radius: 99px;
}

.tab-btn {
  border: 0;
  border-radius: 99px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.tab-btn.active {
  background: var(--lemon);
  color: var(--deep);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item {
  background: var(--panel-2);
  border-radius: var(--r-inner);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-item-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-item-title {
  font-weight: 800;
  font-size: 16px;
}

.admin-item-sub {
  font-size: 13px;
  color: var(--muted);
}

.admin-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.q-editor-card {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 520px) {
  .q-options-grid {
    grid-template-columns: 1fr;
  }
}

.mode-toggle {
  display: inline-flex;
  background: var(--deep);
  padding: 4px;
  border-radius: 99px;
  gap: 4px;
}

.mode-btn {
  border: 0;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
}

.mode-btn.active {
  background: var(--lemon);
  color: var(--deep);
}

.json-textarea {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.error-msg {
  color: var(--tomato);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 106, 85, 0.14);
  border: 1px solid rgba(255, 106, 85, 0.5);
  border-radius: 12px;
}

/* ───────── Native <dialog> modals ───────── */
.bq-dialog {
  border: 0;
  padding: 20px;
  width: min(calc(100% - 28px), 470px);
  max-height: min(720px, 88dvh);
  overflow: auto;
  color: var(--ink);
  background: var(--panel);
  border-radius: var(--r-slab);
  box-shadow: 0 8px 0 var(--deep);
}

.bq-dialog:not([open]) {
  display: none;
}

.bq-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-actions {
  display: flex;
  gap: 4px;
}

.badge--B {
  background: var(--tomato);
  color: var(--deep);
}

.reveal-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.hint--left {
  text-align: left;
}

.ranking-score {
  color: var(--lemon);
  font-weight: 800;
}

.toggle-checkbox {
  width: auto;
  transform: scale(1.3);
  accent-color: var(--lemon);
}

/* ───────── Mejoras: comodines, renombrar equipo, historial y audio ───────── */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team-rename-form {
  display: flex;
  gap: 6px;
  width: 100%;
}

.team-rename-input {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 10px;
}

.lifelines-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lifeline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--deep);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.08s, border-color 0.12s, background 0.12s;
}

.lifeline-btn:hover:not(:disabled) {
  border-color: var(--lemon);
}

.lifeline-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.lifeline-btn.active {
  border-color: var(--lemon);
  background: var(--lemon);
  color: var(--deep);
}

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

.lifeline-banner {
  background: rgba(255, 225, 77, 0.14);
  border: 1px solid rgba(255, 225, 77, 0.55);
  color: var(--lemon);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.option-btn.eliminated {
  opacity: 0.3;
  text-decoration: line-through;
  cursor: not-allowed;
  border-style: dashed;
}

.teammate-votes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.teammate-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--muted);
}

.reveal-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.member-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--deep);
}

.member-tag.ok {
  color: var(--green);
}

.member-tag.miss {
  color: var(--tomato);
}

.double-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--lemon);
  color: var(--deep);
  margin-left: 6px;
  vertical-align: middle;
}

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

.team-stat-box {
  background: var(--deep);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-details {
  background: var(--deep);
  border-radius: 14px;
  padding: 10px 14px;
}

.history-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--lemon);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.history-item {
  border-top: 1px solid var(--panel-2);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(3, 5, 26, 0.84);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialog-title {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--panel-2);
  font-size: 16px;
  font-weight: 800;
}

.help-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-section h3 {
  font-size: 20px;
  color: var(--lemon);
  margin-bottom: 4px;
}

.help-section p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.help-section strong {
  color: var(--ink);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ───────── Toasts ───────── */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(calc(100% - 28px), 440px);
}

.toast {
  background: var(--ink);
  color: var(--deep);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.toast.error {
  background: var(--tomato);
  color: var(--deep);
}
