/* =============================================
   WAVELENGTH — Estilos principales
   Paleta tipo juego de mesa moderno
   ============================================= */

:root {
  color-scheme: light;
  --bg: #1a0a2e;
  --bg2: #16082a;
  --panel: rgba(30, 15, 55, 0.92);
  --panel-border: rgba(180, 120, 255, 0.18);
  --text: #f0e8ff;
  --muted: #9a85b8;
  --line: rgba(180, 120, 255, 0.18);

  /* Colores del dial */
  --zone-outer: #7c3aed;
  --zone-mid:   #a855f7;
  --zone-inner: #d946ef;
  --zone-bull:  #fbbf24;

  --accent:  #c084fc;
  --accent2: #f472b6;
  --gold:    #fbbf24;
  --cyan:    #22d3ee;
  --green:   #4ade80;
  --red:     #f87171;

  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --radius: 12px;
  --tap: 52px;
  --max: 1160px;

  /* Dial dimensions */
  --dial-cx: 200;
  --dial-cy: 200;
  --dial-r:  170;
}

[data-theme="dark"] {
  --bg: #0d0618;
  --bg2: #090412;
  --panel: rgba(15, 6, 30, 0.96);
  --panel-border: rgba(180, 120, 255, 0.18);
  --text: #f0e8ff;
  --muted: #9a85b8;
  --line: rgba(180, 120, 255, 0.18);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:  #fffbf5;
  --bg2: #fff7ef;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(200, 140, 60, 0.14);
  --text: #2c1800;
  --muted: #7a5520;
  --line: rgba(200, 140, 60, 0.14);

  /* Colores del dial: naranja, turquesa, coral, amarillo */
  --zone-outer: #FFA94D;
  --zone-mid:   #4ECDC4;
  --zone-inner: #FF7070;
  --zone-bull:  #FFD93D;

  --accent:  #E07836;
  --accent2: #1AABA8;
  --gold:    #E5AC00;
  --cyan:    #0891B2;
  --green:   #16a34a;
  --red:     #dc2626;

  --shadow: 0 14px 36px rgba(120, 70, 0, 0.1);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 20% 0%,  rgba(124,58,237,0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 5%,  rgba(244,114,182,0.28) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(34,211,238,0.18) 0%, transparent 50%),
    linear-gradient(175deg, var(--bg) 0%, var(--bg2) 100%);
  overflow-x: hidden;
}

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

.noscript {
  padding: 1rem;
  background: var(--red);
  color: #fff;
  text-align: center;
}

/* =============================================
   SHELL Y NAVEGACION
   ============================================= */

.app-shell {
  width: min(100%, var(--max));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.back-to-games {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  margin-bottom: 1rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 180ms, background 180ms, border-color 180ms;
}

.back-to-games:hover {
  color: var(--text);
  background: rgba(192,132,252,0.14);
  border-color: var(--accent);
}

.screen {
  display: none;
  animation: rise 200ms ease;
}

.screen.active { display: block; }

/* =============================================
   PANEL BASE
   ============================================= */

.panel {
  padding: 1.25rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

/* =============================================
   PANTALLA HOME / HERO
   ============================================= */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: clamp(1.5rem, 6vw, 3rem);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 20%, rgba(192,132,252,0.22), transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(34,211,238,0.18), transparent 40%),
    var(--panel);
  box-shadow: var(--shadow);
}

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; }
}

.hero-copy .eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(3.6rem, 14vw, 7rem);
  font-weight: 900;
  line-height: 0.9;
  background: linear-gradient(135deg, #f0e8ff 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy > p {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Dial decorativo en el hero */
.hero-dial {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-dial-svg {
  width: min(100%, 28rem);
  filter: drop-shadow(0 0 40px rgba(192,132,252,0.35));
  animation: dialFloat 4s ease-in-out infinite;
}

@keyframes dialFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* =============================================
   ENCABEZADOS DE PANTALLA
   ============================================= */

.screen-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.screen-header h2,
.panel h3,
.section-title h3 {
  margin: 0;
  font-size: 1.3rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* =============================================
   BOTONES
   ============================================= */

.btn, .icon-btn {
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.3rem;
  color: #0d0618;
  font-size: 0.97rem;
}

.btn:hover  { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0);    filter: brightness(0.95); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 4px 20px rgba(192,132,252,0.4);
  color: #fff;
}

.btn.primary:hover {
  box-shadow: 0 8px 28px rgba(192,132,252,0.55);
}

.btn.secondary {
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  box-shadow: 0 4px 16px rgba(251,191,36,0.35);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(192,132,252,0.12);
  border-color: var(--accent);
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.compact {
  min-height: 2.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.6rem;
}

.icon-btn:hover {
  background: rgba(192,132,252,0.12);
  border-color: var(--accent);
}

.icon-btn.small {
  width: 2.4rem;
  min-height: 2.4rem;
  font-size: 0.95rem;
}

/* =============================================
   FORMULARIOS
   ============================================= */

.stack   { display: grid; gap: 1rem; }
.form-grid, .team-grid, .result-grid, .admin-layout, .rules-grid {
  display: grid;
  gap: 0.8rem;
}

label, .wide-label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192,132,252,0.2);
}

select option { background: #1a0a2e; color: var(--text); }

textarea { min-height: 7rem; resize: vertical; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}

.toggle-row input {
  width: 1.2rem;
  min-height: 1.2rem;
  accent-color: var(--accent);
}

.number-stepper {
  display: grid;
  grid-template-columns: var(--tap) minmax(4rem, 1fr) var(--tap);
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
}

.number-stepper input {
  min-height: var(--tap);
  border: 0;
  border-right: 1px solid var(--line);
  border-left:  1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 900;
  -moz-appearance: textfield;
}

.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.number-stepper button {
  min-height: var(--tap);
  border: 0;
  background: linear-gradient(135deg, rgba(192,132,252,0.3), rgba(244,114,182,0.3));
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
}

.number-stepper button:hover { background: rgba(192,132,252,0.4); }

/* =============================================
   STICKY ACTIONS
   ============================================= */

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding-top: 0.8rem;
  background: linear-gradient(180deg, transparent, var(--bg) 40%);
}

.actions-row, .sticky-actions, .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

/* =============================================
   PLAY PANEL (pantallas guia/adivina)
   ============================================= */

.play-panel {
  display: grid;
  justify-items: center;
  gap: 1.2rem;
  text-align: center;
}

.pill {
  margin: 0;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(192,132,252,0.3);
  background: rgba(192,132,252,0.14);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

.spectrum-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 0.8rem;
}

.spectrum-labels .left  { text-align: right; }
.spectrum-labels .right { text-align: left; }

.spectrum-labels strong {
  font-size: clamp(1.1rem, 4vw, 1.7rem);
  color: var(--text);
}

.spectrum-labels .vs {
  color: var(--accent2);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(244,114,182,0.3);
  background: rgba(244,114,182,0.1);
}

/* =============================================
   DIAL SVG — El corazon visual del juego
   ============================================= */

.dial-container {
  position: relative;
  width: min(100%, 42rem);
  margin: 0 auto;
  user-select: none;
  touch-action: none;
}

/* Número secreto flotante sobre el dial */
.secret-number {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: clamp(2.4rem, 10vw, 4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  pointer-events: none;
  animation: popIn 300ms cubic-bezier(0.34,1.56,0.64,1);
}

/* Animación del dial al cambiar de pantalla */
.dial-anim {
  animation: dialEntrance 500ms ease;
}

@keyframes dialEntrance {
  from { opacity: 0.4; transform: scale(0.96); }
  to   { opacity: 1;   transform: scale(1); }
}

.dial-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

/* Arco base (fondo oscuro) */
.dial-track {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 36;
  stroke-linecap: butt;
}

/* Zonas de puntuación — se muestran al revelar */
.dial-zone {
  fill: none;
  stroke-linecap: butt;
  stroke-width: 36;
  transition: opacity 400ms ease;
}

.dial-zone.z-outer-l, .dial-zone.z-outer-r { stroke: #7c3aed; }   /* 1 pto */
.dial-zone.z-mid-l,   .dial-zone.z-mid-r   { stroke: #a855f7; }   /* 2 pts */
.dial-zone.z-inner-l, .dial-zone.z-inner-r { stroke: #d946ef; }   /* 3 pts */
.dial-zone.z-bull                           { stroke: #fbbf24; }   /* 4 pts */

/* Borde exterior decorativo del arco */
.dial-rim {
  fill: none;
  stroke: rgba(192,132,252,0.25);
  stroke-width: 2;
  stroke-linecap: butt;
}

/* Marcas de escala (ticks) */
.dial-tick {
  stroke: rgba(255,255,255,0.25);
  stroke-width: 1.5;
}

.dial-tick.major {
  stroke: rgba(255,255,255,0.55);
  stroke-width: 2.5;
}

/* Etiquetas izquierda/derecha en el arco */
.dial-label-left, .dial-label-right {
  font-size: 11px;
  font-weight: 800;
  fill: var(--muted);
  font-family: system-ui, sans-serif;
}

/* ---- AGUJA ---- */
/*
 * Usando CSS transform (no SVG attribute) para que transition funcione.
 * transform-box: view-box → transform-origin usa coordenadas del viewBox SVG.
 * Todos los dials usan viewBox="0 0 400 230", pivote en (200,200).
 */
.needle-group {
  transform-box: view-box;
  transform-origin: 200px 200px;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* La aguja está hecha de paths SVG reales, no de <line> */
.needle-body {
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

.needle-body.target-needle { fill: #e2e8f0; }
.needle-body.guess-needle  { fill: #c084fc; }

.needle-cap {
  fill: #fff;
  stroke: rgba(0,0,0,0.3);
  stroke-width: 1;
}

.needle-pivot {
  fill: #7c3aed;
  stroke: rgba(255,255,255,0.5);
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

/* Estado oculto */
.dial-zone.hidden-zone { opacity: 0; }
.needle-group.hidden   { opacity: 0; }

/* ---- Cursor de arrastre ---- */
.dial-drag-area {
  fill: transparent;
}

#guess-dial {
  cursor: grab;
}

#guess-dial:active {
  cursor: grabbing;
}

/* =============================================
   CONTROL SLIDER (bajo el dial)
   ============================================= */

.dial-controls {
  width: min(100%, 38rem);
  margin: 0 auto;
  display: grid;
  gap: 0.6rem;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.range {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  outline: none;
  border: none;
  min-height: unset;
  padding: 0;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 2px 8px rgba(192,132,252,0.5);
  cursor: grab;
}

.range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  cursor: grab;
}

.range-value {
  min-width: 3rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}

/* =============================================
   PISTA (clue box)
   ============================================= */

.clue-box {
  width: 100%;
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(251,191,36,0.3);
  background: rgba(251,191,36,0.1);
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}

.clue-box:empty { display: none; }

/* =============================================
   RESUMEN DE RONDA / SCOREBOARD
   ============================================= */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.7rem;
  width: 100%;
}

.summary-card {
  padding: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  text-align: center;
}

.summary-card .sc-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.summary-card .sc-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
}

.summary-card.pts .sc-value { color: var(--gold); }

.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.score-row.rank-0 { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.08); }
.score-row.rank-1 { border-color: rgba(192,132,252,0.3); }

.score-row strong { font-size: 1rem; }
.score-row .pts   { font-size: 1.1rem; font-weight: 900; color: var(--gold); }

.scoreboard { display: grid; gap: 0.5rem; width: 100%; }

/* =============================================
   RESULT GRID
   ============================================= */

.result-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .result-grid { grid-template-columns: 1.2fr 0.8fr; align-items: start; }
}

/* =============================================
   HISTORIAL
   ============================================= */

.history-list { display: grid; gap: 0.5rem; width: 100%; }

.history-row {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
  text-align: left;
}

.history-row span, .history-row small { color: var(--muted); font-size: 0.85rem; }

/* =============================================
   CATEGORIAS
   ============================================= */

.admin-layout { display: grid; gap: 0.8rem; }

@media (min-width: 960px) {
  .admin-layout { grid-template-columns: 22rem minmax(0,1fr); align-items: start; }
}

.category-list, .spectra-list { display: grid; gap: 0.4rem; width: 100%; }

.category-card {
  width: 100%;
  display: grid;
  gap: 0.1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-align: left;
  transition: background 150ms, border-color 150ms;
}

.category-card:hover { background: rgba(192,132,252,0.1); border-color: var(--accent); }
.category-card.active { border-color: var(--accent); background: rgba(192,132,252,0.14); }
.category-card span   { color: var(--muted); font-size: 0.82rem; }

.spectrum-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
}

.empty-state { color: var(--muted); text-align: center; padding: 2rem; }

.notice {
  margin: 0 0 0.8rem;
  padding: 0.85rem;
  border: 1px solid rgba(34,211,238,0.25);
  border-radius: var(--radius);
  background: rgba(34,211,238,0.1);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* =============================================
   REGLAS
   ============================================= */

.rules-grid { display: grid; gap: 0.8rem; }

@media (min-width: 720px) {
  .rules-grid { grid-template-columns: repeat(2, 1fr); }
}

.rules-grid article {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}

.rules-grid h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1rem;
}

.rules-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

/* =============================================
   TOAST
   ============================================= */

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  background: rgba(30,15,55,0.96);
  border: 1px solid var(--accent);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.8rem);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible { opacity: 1; transform: translateY(0); }

/* =============================================
   ANIMACIONES
   ============================================= */

@keyframes rise {
  from { opacity: 0; transform: translateY(0.4rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0%   { transform: scale(0.8); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(192,132,252,0.4)); }
  50%       { filter: drop-shadow(0 0 18px rgba(192,132,252,0.8)); }
}

.needle-group.animate-in {
  animation: needleEntry 600ms cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes needleEntry {
  0%   { transform: rotate(-20deg); opacity: 0.4; }
  100% { transform: rotate(var(--needle-angle, 0deg)); opacity: 1; }
}

.zone-reveal-anim .dial-zone {
  animation: zoneReveal 500ms ease forwards;
}

@keyframes zoneReveal {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.pts-pop {
  animation: popIn 400ms cubic-bezier(0.34,1.56,0.64,1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* =============================================
   UTILIDADES
   ============================================= */

.hidden { display: none !important; }
.muted  { color: var(--muted); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (min-width: 720px) {
  .app-shell { padding: 1.5rem; }

  .form-grid, .team-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (min-width: 960px) {
  .form-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 460px) {
  .app-shell { padding: 0.75rem; }

  .panel { padding: 1rem; }

  .spectrum-labels { grid-template-columns: 1fr; text-align: center; gap: 0.4rem; }
  .spectrum-labels .left, .spectrum-labels .right { text-align: center; }

  .spectrum-row { grid-template-columns: 1fr; }

  .hero-actions .btn,
  .sticky-actions .btn { width: 100%; }

  .actions-row .btn { flex: 1 1 100%; }

  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   LIGHT MODE — overrides específicos
   ============================================= */

[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 20% 0%,  rgba(255, 169, 77, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 5%,  rgba(78, 205, 196, 0.22) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 217, 61, 0.18) 0%, transparent 50%),
    linear-gradient(175deg, var(--bg) 0%, var(--bg2) 100%);
}

[data-theme="light"] .hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 169, 77, 0.16), transparent 40%),
    radial-gradient(circle at 15% 80%, rgba(78, 205, 196, 0.14), transparent 40%),
    var(--panel);
}

[data-theme="light"] .hero-copy h1 {
  background: linear-gradient(135deg, #2c1800 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-color: rgba(200, 140, 60, 0.2);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 120, 54, 0.16);
}

[data-theme="light"] select option {
  background: #fff;
  color: var(--text);
}

[data-theme="light"] .btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  box-shadow: 0 4px 18px rgba(224, 120, 54, 0.35);
  color: #fff;
}

[data-theme="light"] .btn.primary:hover {
  box-shadow: 0 8px 26px rgba(224, 120, 54, 0.5);
}

[data-theme="light"] .btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  color: var(--text);
}

[data-theme="light"] .btn.ghost:hover {
  background: rgba(255, 169, 77, 0.14);
  border-color: var(--accent);
}

[data-theme="light"] .icon-btn {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  color: var(--text);
}

[data-theme="light"] .icon-btn:hover {
  background: rgba(255, 169, 77, 0.16);
  border-color: var(--accent);
}

[data-theme="light"] .back-to-games {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border-color: var(--line);
}

[data-theme="light"] .back-to-games:hover {
  background: rgba(255, 169, 77, 0.14);
  color: var(--text);
  border-color: var(--accent);
}

[data-theme="light"] .number-stepper {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .number-stepper button {
  background: linear-gradient(135deg, rgba(255, 169, 77, 0.28), rgba(78, 205, 196, 0.22));
  color: var(--text);
}

[data-theme="light"] .number-stepper button:hover {
  background: rgba(255, 169, 77, 0.42);
}

[data-theme="light"] .category-card {
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="light"] .category-card:hover {
  background: rgba(255, 169, 77, 0.1);
  border-color: var(--accent);
}

[data-theme="light"] .category-card.active {
  border-color: var(--accent);
  background: rgba(255, 169, 77, 0.14);
}

[data-theme="light"] .score-row {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .score-row.rank-0 {
  background: rgba(251, 191, 36, 0.1);
}

[data-theme="light"] .summary-card {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .history-row {
  background: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .rules-grid article {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .notice {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .dial-track {
  stroke: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .dial-tick {
  stroke: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .dial-tick.major {
  stroke: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .dial-rim {
  stroke: rgba(120, 80, 200, 0.3);
}

[data-theme="light"] .dial-label-left,
[data-theme="light"] .dial-label-right {
  fill: var(--muted);
}

[data-theme="light"] .dial-zone.z-outer-l,
[data-theme="light"] .dial-zone.z-outer-r { stroke: var(--zone-outer); }
[data-theme="light"] .dial-zone.z-mid-l,
[data-theme="light"] .dial-zone.z-mid-r   { stroke: var(--zone-mid); }
[data-theme="light"] .dial-zone.z-inner-l,
[data-theme="light"] .dial-zone.z-inner-r { stroke: var(--zone-inner); }
[data-theme="light"] .dial-zone.z-bull    { stroke: var(--zone-bull); }

[data-theme="light"] .hero-dial-svg {
  filter: drop-shadow(0 0 40px rgba(255, 169, 77, 0.32));
}

[data-theme="light"] .needle-pivot { fill: var(--accent); }

[data-theme="light"] .dial-filter { filter: drop-shadow(0 8px 24px rgba(120, 70, 0, 0.2)); }

[data-theme="light"] .needle-pivot {
  fill: var(--accent);
}

[data-theme="light"] .turn-orb,
[data-theme="light"] .clue-box {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(120, 80, 200, 0.2);
}

[data-theme="light"] .sticky-actions {
  background: linear-gradient(180deg, transparent, rgba(255, 251, 245, 0.98) 40%);
}

[data-theme="light"] .toast {
  background: rgba(44, 26, 90, 0.96);
  color: #f5f0ff;
  border-color: var(--accent);
}
