:root {
  --ink: #202833;
  --paper: #f7f6f1;
  --blue: #19324d;
  --blue-deep: #0e1e31;
  --gold: #d5bb5b;
}

html, body { overflow-x: hidden; background: #000; }
body { min-width: 0; }

/* La entrada es exclusivamente el video: al terminar, se apaga a negro. */
.preloader {
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #000;
}
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
  opacity: 0;
  transition: opacity .28s ease;
}
.intro-playing .intro-video { opacity: 1; }
.intro-skip { position: fixed; right: clamp(20px, 4vw, 48px); bottom: clamp(20px, 4vw, 42px); z-index: 8; border: 1px solid rgba(247,246,241,.45); border-radius: 3px; padding: 10px 13px; background: rgba(0,0,0,.42); color: #f7f6f1; font: 700 10px/1 Manrope, Arial, sans-serif; letter-spacing: .1em; cursor: pointer; backdrop-filter: blur(4px); }
.intro-skip:hover { border-color: var(--gold); color: var(--gold); }
.intro-skip span { margin-left: 8px; }
.video-loader {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #f7f6f1;
  text-align: center;
}
.loader-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 25px;
  animation: pollera-loader 1.1s linear infinite;
}
.video-loader .micro { color: var(--gold); }
.video-loader b { font-size: 13px; letter-spacing: .13em; }
@keyframes pollera-loader { to { transform: rotate(360deg); } }
.video-gate {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px;
  text-align: center;
  background: #000;
  color: #f7f6f1;
}
.video-gate .micro { margin: 0 0 14px; color: var(--gold); }
.video-gate h1 { max-width: 800px; margin: 0 0 28px; color: #f7f6f1; font-size: clamp(38px, 6vw, 78px); font-weight: 800; line-height: .94; letter-spacing: -.07em; }
.video-gate h1 em { color: var(--gold); font-style: normal; }

/* Portada: negra, quieta y con foco en la marca. */
.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 310px);
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding: 24px max(5vw, 24px) 22px;
  background: #000;
  background-image: radial-gradient(circle at 77% 52%, rgba(213,187,91,.10), transparent 27%);
}
.landing .show-header { grid-column: 1 / -1; width: 100%; }
.landing-copy {
  grid-column: 1;
  grid-row: 2;
  width: min(610px, 100%);
  min-width: 0;
  align-self: center;
  margin: 0;
  padding: 64px 0 72px;
}
.landing-logo {
  position: static;
  grid-column: 2;
  grid-row: 2;
  width: min(265px, 20vw);
  height: auto;
  min-width: 0;
  align-self: center;
  justify-self: center;
  margin: 0;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.45));
}
.landing footer {
  position: static;
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  margin: 0;
  text-align: left;
}

/* La votación trabaja sobre papel claro: menos ruido y más lectura. */
.ballot {
  min-height: 100svh;
  background: var(--paper);
  background-image: linear-gradient(rgba(25,50,77,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(25,50,77,.05) 1px, transparent 1px);
  color: var(--ink);
}
.ballot .show-header { border-bottom-color: rgba(25,50,77,.22); color: #566373; }
.ballot .show-header b, .ballot .player { color: var(--ink); }
.ballot .show-header > span:first-child, .ballot .show-header > span:last-child,
.ballot .player small, .ballot .micro { color: #497ca7; }
.ballot-topline h2 { color: var(--ink); }
.ballot-topline h2 em { color: #386b98; }
.qualifier { color: #647386; }
.counter { background: #fff; color: var(--ink); border-color: #497ca7; }
.counter b { color: #386b98; }
.player { border-color: rgba(25,50,77,.2); }
.logout-link { display: block; margin-top: 5px; padding: 0; color: #386b98; font-size: 8px; }
.player-tile, .player-tile:nth-child(4n+2), .player-tile:nth-child(4n+3), .player-tile:nth-child(4n+4) {
  background: #fff;
  border-color: rgba(25,50,77,.20);
  color: var(--ink);
}
.player-tile:hover:not(.unavailable) { border-color: #497ca7; background: #f3f7fa; }
.player-tile.chosen { background: #eaf2f7; border-color: #386b98; }
.player-tile .tile-no { color: #497ca7; }
.player-tile b { color: #fff; background: #386b98; }
.ready-panel { background: var(--blue-deep); border-color: var(--gold); }

/* Evita títulos cortados en teléfonos, incluso con nombres muy largos. */
.self-check, .login { overflow-x: hidden; }
.question-zone, .console, .ballot-topline, .arena { min-width: 0; }
.question-zone h2 { max-width: 100%; overflow-wrap: anywhere; }

.success-logo { display: block; width: 108px; height: auto; margin: -8px 0 17px; }
.after-vote, .curiosity {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
  background: #000;
  background-image: none;
}
.speech-bubble {
  position: relative;
  width: min(650px, 100%);
  padding: clamp(28px, 6vw, 58px);
  color: var(--ink);
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 10px 10px 0 var(--gold);
}
.speech-bubble::after { content: ""; position: absolute; left: 58px; bottom: -28px; border-width: 29px 26px 0 0; border-style: solid; border-color: var(--paper) transparent transparent transparent; }
.speech-bubble .micro, .curiosity .micro { color: #497ca7; }
.speech-bubble h2, .curiosity h2 { margin: 16px 0; font-size: clamp(34px, 5vw, 62px); line-height: .95; letter-spacing: -.07em; }
.speech-bubble p:not(.micro) { max-width: 390px; margin: 0 0 25px; color: #586574; line-height: 1.5; }
.curiosity { grid-template-columns: minmax(0, .85fr) minmax(240px, .7fr); gap: clamp(15px, 5vw, 75px); overflow: hidden; }
.curiosity-copy { position: relative; z-index: 1; color: #f7f6f1; }
.curiosity h2 em { color: var(--gold); font-style: normal; }
.curiosity-copy > p:not(.micro) { margin: 0 0 26px; color: #d5bb5b; font-size: clamp(16px, 2vw, 23px); font-weight: 800; }
.curiosity > img { align-self: end; width: min(370px, 35vw); max-height: 82vh; object-fit: contain; filter: grayscale(1) contrast(1.12); }
.spectator { display: grid; place-items: center; min-height: 100svh; padding: 24px; background: #101b29; background-image: radial-gradient(circle at 50% 45%, rgba(213,187,91,.15), transparent 32%); }
.spectator-copy { width: min(640px, 100%); color: var(--cream); text-align: center; }
.spectator-copy .micro { color: var(--gold); }
.spectator-copy h2 { margin: 16px 0; font-size: clamp(38px, 6vw, 70px); line-height: .94; letter-spacing: -.075em; }
.spectator-copy h2 em { color: var(--gold); font-style: normal; }
.spectator-copy p:not(.micro) { max-width: 360px; margin: 0 auto 26px; color: var(--muted); }
.jorge-modal { max-width: 560px; }
.jorge-note { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.jorge-note-after { margin: 18px 0 0; font-size: 10px; line-height: 1.4; opacity: .88; }
.stacked-actions { display: grid; gap: 16px; align-items: stretch; }
.stacked-actions .big-button { width: 100%; }

@media (max-width: 750px) {
  .video-gate { padding: 20px; }
  .video-gate h1 { font-size: clamp(37px, 12vw, 54px); }
  .intro-skip { right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  .landing {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
    background-image: radial-gradient(circle at 50% 24%, rgba(213,187,91,.11), transparent 34%);
  }
  .landing .show-header { flex: 0 0 auto; }
  .landing-logo {
    position: static;
    order: 1;
    width: min(136px, 38vw);
    margin: 24px auto 14px;
  }
  .landing-copy {
    order: 2;
    width: 100%;
    align-self: auto;
    margin: 0;
    padding: 0 0 26px;
    text-align: center;
  }
  .landing .micro { margin: 0 0 12px; }
  .landing h1 { font-size: clamp(42px, 13vw, 60px); letter-spacing: -.075em; }
  .landing-text { margin: 18px auto 22px; font-size: 14px; line-height: 1.58; }
  .landing .big-button { width: 100%; max-width: 350px; }
  .landing footer {
    order: 3;
    margin-top: auto;
    padding-top: 10px;
    text-align: center;
    font-size: 8px;
    line-height: 1.5;
  }

  .show-header { width: 100%; min-width: 0; gap: 7px; font-size: 7px; }
  .show-header b { min-width: 0; font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
  .self-check { padding: 18px 20px 28px; }
  .question-zone { width: 100%; margin: 0; padding: 58px 0 0; }
  .question-zone .micro { max-width: 100%; font-size: 8px; line-height: 1.5; }
  .question-zone h2 { margin: 16px 0 18px; font-size: clamp(38px, 12.6vw, 54px); line-height: .94; letter-spacing: -.075em; }
  .question-zone > p:not(.micro) { max-width: 100%; font-size: 15px; line-height: 1.42; }
  .choice-buttons { grid-template-columns: 1fr; }
  .choice { min-height: 78px; font-size: 12px; }

  .ballot { padding: 18px 16px 130px; }
  .ballot .show-header { margin-bottom: 20px; }
  .ballot .player { max-width: 110px; padding: 6px; overflow: hidden; }
  .ballot .player strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ballot-topline { display: block; margin: 0 0 20px; }
  .ballot-topline h2 { font-size: clamp(37px, 11.7vw, 50px); }
  .counter { width: fit-content; margin-top: 17px; }
  .arena { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .player-tile, .player-tile:nth-child(4n+2), .player-tile:nth-child(4n+3), .player-tile:nth-child(4n+4) { min-width: 0; min-height: 92px; padding: 12px 10px; }
  .player-tile strong { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; }
  .ready-panel { width: calc(100% - 24px); bottom: 12px; padding: 12px; }
  .ready-panel > div { min-width: 0; }
  #selectedNames { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .success-logo { width: 82px; margin-bottom: 12px; }
  .after-vote { padding: 24px 20px 55px; }
  .speech-bubble { padding: 31px 24px 36px; }
  .speech-bubble::after { left: 38px; }
  .speech-bubble h2 { font-size: clamp(31px, 10.3vw, 43px); }
  .curiosity { grid-template-columns: 1fr; align-content: center; padding: 45px 25px 0; gap: 10px; text-align: center; }
  .curiosity-copy { order: 1; }
  .curiosity > img { order: 2; width: min(275px, 76vw); max-height: 45vh; }
  .spectator-copy h2 { font-size: clamp(37px, 11vw, 50px); }
}
