:root {
  --bg-deep: #071022;
  --bg-mid: #0f1c38;
  --panel: rgba(15, 28, 56, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #facc15;
  --gold-dark: #ca8a04;
  --blue: #0081c8;
  --green: #00a651;
  --red: #ee334e;
  --track: #c44031;
  --track-dark: #9e2d21;
  --track-line: rgba(255, 255, 255, 0.82);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top center, #162b56 0%, var(--bg-deep) 75%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.yt-hidden-host {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  opacity: 0.001;
  pointer-events: none;
}

/* Contenedor a pantalla completa */
.olympic-shell {
  width: 100%;
  min-height: 100vh;
  padding: 12px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Encabezado Olímpico */
.olympic-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(15, 28, 56, 0.95), rgba(22, 43, 86, 0.95));
  border: 1px solid rgba(250, 204, 21, 0.28);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-row h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #ffffff, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.header-right-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-anthem {
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.14);
  color: #fde047;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-anthem.muted {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* Aros Olímpicos */
.olympic-rings {
  position: relative;
  width: 82px;
  height: 40px;
  flex-shrink: 0;
}

.ring {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid;
}

.r-blue { border-color: #0081c8; left: 0; top: 0; }
.r-black { border-color: #cbd5e1; left: 28px; top: 0; }
.r-red { border-color: #ee334e; left: 56px; top: 0; }
.r-yellow { border-color: #fcb131; left: 14px; top: 13px; }
.r-green { border-color: #00a651; left: 42px; top: 13px; }

/* Stepper */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.step-pill span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}

.step-pill.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: var(--gold);
  color: var(--text);
}

.step-pill.active span {
  background: var(--gold);
  color: #0f172a;
}

.step-pill.done {
  border-color: rgba(0, 166, 81, 0.6);
  color: #bbf7d0;
}

.step-pill.done span {
  background: var(--green);
  color: #ffffff;
}

/* Paneles de etapas 1-4 */
.stage-panel {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
}

.panel-inner {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.step-head h2 {
  margin: 8px 0 6px;
  font-size: 1.6rem;
}

.step-head p {
  margin: 0;
  color: var(--muted);
}

.olympic-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #fde047);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Botones */
.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-lg {
  padding: 14px 26px;
  font-size: 1.05rem;
}

.btn-gold {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.25);
}

.btn-emerald {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.btn-danger {
  background: rgba(238, 51, 78, 0.2);
  color: #fecdd3;
  border: 1px solid rgba(238, 51, 78, 0.5);
}

/* =========================================================
   PASO 1: Patos grandes sin marco haciendo calentamiento + Saludo centrado
   ========================================================= */
.name-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  flex: 1;
}

@media (max-width: 900px) {
  .name-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .name-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.name-card {
  position: relative;
  padding: 6px 4px;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 1.15rem;
  font-weight: 800;
  min-width: 0;
  transition: transform 0.16s ease;
}

.name-card:hover {
  transform: translateY(-6px) scale(1.03);
}

.name-duck-img {
  width: 100%;
  max-width: 155px;
  height: 38vh;
  max-height: 360px;
  min-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5));
  transform-origin: bottom center;
}

.name-card.selected .name-duck-img {
  filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.85)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5));
}

.name-card .name-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.name-card.taken .name-badge {
  background: rgba(238, 51, 78, 0.25);
  color: #fda4af;
}

.name-card.selected .name-badge {
  background: var(--gold);
  color: #0f172a;
}

/* Spotlight centrado sin marco alrededor del pato ni nombre */
.step1-spotlight {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(16, 33, 72, 0.94), rgba(2, 6, 23, 0.96));
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.spotlight-card {
  width: 100%;
  max-width: 720px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.spotlight-duck-wrap {
  height: 44vh;
  max-height: 360px;
  min-height: 200px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
}

.spotlight-duck-wrap img {
  height: 44vh;
  max-height: 360px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(250, 204, 21, 0.45)) drop-shadow(0 20px 28px rgba(0, 0, 0, 0.65));
  transform-origin: bottom center;
}

.spotlight-card h2 {
  margin: 0;
  font-size: 2.3rem;
  color: var(--gold);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.salute-bubble {
  margin: 0;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.05rem;
  font-weight: 700;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

/* =========================================================
   PASO 2: Previsualización GRANDE a pantalla completa
   ========================================================= */
.outfit-showcase-lg {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 860px) {
  .outfit-showcase-lg {
    grid-template-columns: 1fr;
  }
}

.showcase-pedestal-lg {
  height: 100%;
  min-height: 520px;
  max-height: 68vh;
  background: radial-gradient(ellipse at 50% 85%, rgba(250, 204, 21, 0.22), transparent 68%);
  border: none;
  display: grid;
  place-items: center;
  padding: 8px;
}

.showcase-duck-lg {
  height: 62vh;
  max-height: 580px;
  min-height: 340px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.6));
  transform-origin: bottom center;
}

.outfit-grid-lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.accessory-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 700;
}

.accessory-btn.selected {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.18);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.22);
}

.acc-thumb {
  height: 112px;
  width: auto;
  object-fit: contain;
}

/* =========================================================
   PASO 3: Marco de cámara con colores de los Aros Olímpicos
   ========================================================= */
.camera-setup-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: center;
}

@media (max-width: 820px) {
  .camera-setup-layout {
    grid-template-columns: 1fr;
  }
}

.olympic-cam-frame {
  padding: 8px;
  border-radius: 22px;
  background: conic-gradient(
    from 0deg,
    #0081c8 0deg 72deg,
    #fcb131 72deg 144deg,
    #e2e8f0 144deg 216deg,
    #00a651 216deg 288deg,
    #ee334e 288deg 360deg
  );
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}

.video-wrapper-lg {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #020617;
  border-radius: 15px;
  overflow: hidden;
}

#webcam-setup {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.78);
}

.camera-controls-box {
  display: grid;
  gap: 14px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.motion-meter-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.meter-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #facc15);
  transition: width 0.08s linear;
}

/* =========================================================
   PASO 4: Zona de Calentamiento + Reglas
   ========================================================= */
.warmup-parade {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 16px 14px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(0, 129, 200, 0.16), rgba(20, 83, 45, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.15);
  align-items: end;
}

@media (max-width: 780px) {
  .warmup-parade {
    grid-template-columns: repeat(3, 1fr);
  }
}

.warmup-athlete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.warmup-duck-img {
  height: 145px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
  transform-origin: bottom center;
}

.warmup-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.rule-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
}

.rule-icon {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.rule-card h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  color: var(--gold);
}

.rule-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.4;
}

.trials-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trials-legend.centered {
  justify-content: center;
}

.legend-chip {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* =========================================================
   PASO 5: Solo Barra de Avance + Cámara Miniatura + Pista
   ========================================================= */
.track-fullscreen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.progress-hud-box {
  flex: 1;
  display: grid;
  gap: 6px;
}

.progress-hud-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-hud-labels strong {
  color: var(--gold);
}

.player-progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.player-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0081c8, #00a651, #facc15);
  transition: width 0.2s ease-out;
}

.pip-cam-frame {
  padding: 4px;
  border-radius: 14px;
  background: conic-gradient(
    #0081c8 0deg 72deg,
    #fcb131 72deg 144deg,
    #e2e8f0 144deg 216deg,
    #00a651 216deg 288deg,
    #ee334e 288deg 360deg
  );
}

.pip-cam {
  width: 128px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #020617;
}

#webcam-pip {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.pip-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.6);
}

.pip-fill {
  height: 100%;
  width: 0%;
  background: #22c55e;
  transition: width 0.08s linear;
}

/* Estadio y Pista */
.stadium-frame.full-height {
  flex: 1;
  padding: 12px;
  border-radius: 20px;
  background: repeating-linear-gradient(
    90deg,
    #14532d 0px,
    #14532d 44px,
    #166534 44px,
    #166534 88px
  );
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.45);
  display: flex;
}

.athletics-track {
  position: relative;
  width: 100%;
  background: repeating-linear-gradient(
    180deg,
    var(--track) 0px,
    var(--track) 88px,
    var(--track-dark) 88px,
    var(--track-dark) 176px
  );
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  padding: 60px 46px 14px 62px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-start-band {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 62px;
  background: rgba(15, 23, 42, 0.38);
  border-right: 4px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8px;
  z-index: 1;
}

.track-start-band span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.9);
}

.track-finish-band {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 46px;
  background: repeating-conic-gradient(#0f172a 0% 25%, #f8fafc 0% 50%) 50% / 14px 14px;
  border-left: 4px solid var(--gold);
  display: grid;
  place-items: center;
  z-index: 1;
}

.track-finish-band span {
  writing-mode: vertical-rl;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  background: var(--gold);
  color: #0f172a;
  padding: 8px 4px;
  border-radius: 4px;
}

.checkpoint-ruler {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 62px;
  right: 46px;
  pointer-events: none;
  z-index: 1;
}

.checkpoint-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  border-left: 2px dashed rgba(255, 255, 255, 0.58);
  transform: translateX(-50%);
}

.checkpoint-mark.completed {
  border-left-color: rgba(74, 222, 128, 0.92);
}

.checkpoint-pill {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.checkpoint-ruler.dense .checkpoint-mark.stagger-low .checkpoint-pill {
  top: 31px;
}

.checkpoint-mark.completed .checkpoint-pill {
  background: #16a34a;
  border-color: #86efac;
}

.lanes-container {
  position: relative;
  display: grid;
  gap: 0;
  z-index: 2;
}

.lane {
  position: relative;
  height: 84px;
  display: flex;
  align-items: center;
  border-top: 2px solid var(--track-line);
}

.lane:last-child {
  border-bottom: 2px solid var(--track-line);
}

.lane-number {
  position: absolute;
  left: -30px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
}

/* Figura 3D del pato en pista: SIN nombre ni círculo */
.duck-runner {
  --pct: 0;
  position: absolute;
  left: calc(var(--pct) * 1%);
  transform: translateX(calc(-1 * var(--pct) * 1%));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.duck-runner.is-player {
  z-index: 4;
}

.duck-figure-3d {
  height: 76px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  transform-origin: bottom center;
}

.duck-runner.is-player .duck-figure-3d {
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.9)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.duck-shadow {
  width: 38px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  margin-top: -6px;
}

.player-marker {
  position: absolute;
  top: -12px;
  font-size: 0.9rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.runner-fx {
  position: absolute;
  top: -8px;
  right: -14px;
  font-size: 1rem;
}

/* Overlays de Dado y Cuenta Regresiva en Pista */
.dice-overlay,
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.dice-overlay-card {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  border-radius: 24px;
  background: linear-gradient(145deg, #162b56, #0b1630);
  border: 2px solid rgba(250, 204, 21, 0.65);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.player-dice-cube {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  color: #0f172a;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), inset 0 -6px 0 #cbd5e1;
}

.dice-overlay-card h2 {
  margin: 0;
  color: var(--gold);
  font-size: 1.4rem;
}

.dice-overlay-card p {
  margin: 0;
  color: #cbd5e1;
}

.dice-wait-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.dice-wait-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #facc15);
}

.countdown-number {
  font-size: 7rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 10px 35px rgba(250, 204, 21, 0.65);
}

/* Confeti y Podio Olímpico */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 58;
}

.podium-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 55;
}

.podium-card {
  width: 100%;
  max-width: 660px;
  padding: 26px 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15, 28, 56, 0.98), rgba(22, 43, 86, 0.98));
  border: 2px solid rgba(250, 204, 21, 0.72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.podium-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  color: var(--gold);
}

.podium-champion-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.55);
  font-size: 1.08rem;
  font-weight: 800;
  color: #fef08a;
}

.podium-country-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.flag-svg {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.podium-steps {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.podium-slot {
  width: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.podium-medal-badge {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.podium-slot img {
  height: 120px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
}

.podium-block {
  width: 100%;
  border-radius: 12px 12px 0 0;
  padding: 10px 8px;
  font-weight: 800;
  color: #0f172a;
}

.podium-slot.place-1 .podium-block {
  height: 112px;
  background: linear-gradient(180deg, #fde047, #eab308);
}

.podium-slot.place-2 .podium-block {
  height: 92px;
  background: linear-gradient(180deg, #e2e8f0, #94a3b8);
}

.podium-slot.place-3 .podium-block {
  height: 78px;
  background: linear-gradient(180deg, #fdba74, #c2410c);
  color: #ffffff;
}

.podium-rest {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.podium-rest-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Modal de Pruebas */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: #142342;
  border: 2px solid rgba(250, 204, 21, 0.45);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal-subtitle {
  margin: 0 0 16px;
  color: #cbd5e1;
  font-size: 0.98rem;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.trivia-option {
  width: 100%;
  text-align: left;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
}

.trivia-option:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(250, 204, 21, 0.12);
}

.roulette-wrapper {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.roulette-pointer {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: -14px;
  z-index: 3;
  color: var(--gold);
}

.roulette-svg {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 5px solid #f8fafc;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.chaos-card-btn {
  min-height: 126px;
  border-radius: 14px;
  border: 2px solid rgba(250, 204, 21, 0.5);
  background: linear-gradient(145deg, #1e293b, #0f172a);
  color: #f8fafc;
  cursor: pointer;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
}

.chaos-card-btn.revealed {
  background: rgba(0, 129, 200, 0.22);
  border-color: #38bdf8;
}

.traffic-light {
  width: 110px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 18px;
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.tl-bulb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  opacity: 0.22;
}

.tl-bulb.red { background: #ef4444; }
.tl-bulb.yellow { background: #eab308; }
.tl-bulb.green { background: #22c55e; }
.tl-bulb.on { opacity: 1; box-shadow: 0 0 22px currentColor; }

.sprint-meter {
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.sprint-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #facc15);
  transition: width 0.08s linear;
}

.statue-status-pill {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.statue-status-pill.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
}

.modal-feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

/* =========================================================
   PANEL DEL MODERADOR
   ========================================================= */
.mod-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.moderator-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

@media (max-width: 960px) {
  .moderator-layout {
    grid-template-columns: 1fr;
  }
}

.mod-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mod-section-head h2 {
  margin: 6px 0 0;
}

.assigned-counter {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.45);
  font-weight: 800;
  color: var(--gold);
}

.mod-ducks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.mod-duck-card {
  position: relative;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 10px;
}

.mod-duck-card.is-assigned {
  border-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.08);
}

.mod-duck-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.lane-tag {
  font-weight: 800;
  color: var(--muted);
}

.status-dot {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-dot.on {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.status-dot.off {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.mod-duck-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mod-duck-img {
  height: 82px;
  width: 56px;
  object-fit: contain;
}

.mod-duck-info h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.mod-meta {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.mod-progress-wrap {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

.mod-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.mod-progress-bar div {
  height: 100%;
  background: var(--gold);
}

.btn-mini-release {
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.76rem;
  cursor: pointer;
}

.mod-dice-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dice-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dice-rule-chip {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dice-stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.olympic-dice {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  color: #0f172a;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 -6px 0 #cbd5e1;
}

.dice-result-box {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}

.mod-controls-stack {
  display: grid;
  gap: 10px;
}

.mod-race-status {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 129, 200, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 700;
  font-size: 0.9rem;
}
