@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* =========================================================
   Tokens — papel cálido + tinta del logo + un solo acento vivo
   (antes: fondo casi negro + acento lima neón)
   ========================================================= */
:root {
  --black: #1B1712;          /* tinta — antes era el fondo, ahora es el texto */
  --white: var(--black);     /* texto "fuerte" — antes blanco sobre negro, ahora tinta sobre claro */
  --lime: #FFFF00;           /* acento amarillo del logo */
  --gray: #8B8172;
  --gray-dark: #FFFFFF;      /* superficie de tarjetas — antes gris muy oscuro */
  --gray-deep: #F4ECDA;      /* superficie secundaria / inputs — antes casi negro */
  --red: #E2483D;
  --green: var(--lime);
  --answer-correct: #2E9B62;
  --blue: #3B63F5;
  --line: rgba(27, 23, 18, .12);
  --radius: 24px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #FAF3E4;
  color: var(--black);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
  background: #FAF3E4;
  background-image:
    radial-gradient(circle at 8% 0%, rgba(255, 201, 77, .16), transparent 28rem),
    radial-gradient(circle at 100% 45%, rgba(59, 99, 245, .07), transparent 24rem);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: linear-gradient(rgba(27,23,18,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(27,23,18,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

.app {
  flex: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 30px 24px 112px;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  animation: rise-in .55s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.03em;
}

/* logo real (imagen) en vez del span de texto "¿?" */
.brand .mark,
img.mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--black);
  flex-shrink: 0;
  display: block;
}

/* fallback por si algún template todavía usa <span class="mark">¿?</span> */
span.mark {
  border: 0;
  background: var(--black);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.player-chip {
  font-size: 13px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}

.player-chip strong { color: var(--black); }

/* ---------- Avatares ---------- */
.avatar-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--blue));
  color: var(--black);
  font-family: var(--font-display);
  font-weight: 700;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 28px; height: 28px; font-size: 12px; }
.avatar-ranking { width: 38px; height: 38px; font-size: 14px; border: 2px solid var(--line); }
.avatar-trigger:hover .avatar-small { box-shadow: 0 0 0 3px rgba(255, 201, 77, .35); }
.avatar-status { color: var(--gray); font-size: 10px; white-space: nowrap; }

.avatar-profile { width: 92px; height: 92px; font-size: 34px; border: 3px solid rgba(255,201,77,.6); }
.avatar-edit-label { font-size: 12px; color: var(--gray); }

/* ---------- Nickname gate ---------- */
.gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  text-align: center;
  min-height: 68vh;
  animation: rise-in .7s .08s ease both;
}

.gate-kicker {
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.gate h1 {
  max-width: 530px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(38px, 8vw, 58px);
  line-height: 1.1;
  letter-spacing: -.05em;
}

.gate p {
  max-width: 430px;
  margin: 0 auto;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- Formularios ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
  background: var(--gray-deep);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--black);
  padding: 16px 17px;
  font-size: 15px;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder { color: var(--gray); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(255, 201, 77, .22);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  transition: transform .2s ease, filter .2s ease, background .2s ease;
}

.btn:hover { filter: brightness(1.05); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn-primary { background: var(--lime); color: var(--black); }
.btn-secondary { background: var(--gray-deep); color: var(--black); border: 1px solid var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 10px 14px; font-size: 13px; width: auto; }

.error-msg { color: var(--red); font-size: 14px; min-height: 18px; }
.success-msg { color: var(--green); }

/* ---------- Auth card ---------- */
.auth-card {
  width: 100%;
  max-width: 410px;
  margin: 12px auto 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 20px 50px rgba(27,23,18,.08);
}

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.auth-tab {
  border: 0;
  border-radius: 12px;
  padding: 11px 8px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: color .2s ease, background .2s ease;
}
.auth-tab.active { background: rgba(255,201,77,.28); color: var(--black); }
.auth-card form { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.auth-contact-fields { display: none; gap: 10px; }
.auth-contact-fields:not([hidden]) { display: grid; }
.auth-hint { margin: -2px 2px 0; color: var(--gray); font-size: 11px; text-align: left; }

/* ---------- Perfil ---------- */
.profile-gate { display: flex; flex-direction: column; align-items: center; gap: 22px; animation: rise-in .6s ease both; }
.profile-heading h1 { margin: 8px 0 8px; font-family: var(--font-display); font-size: clamp(30px, 6vw, 44px); letter-spacing: -.04em; }
.profile-heading { text-align: center; }
.profile-heading p { max-width: 470px; margin: 0 auto; color: var(--gray); line-height: 1.6; }

.profile-card {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 470px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: 0 20px 50px rgba(27,23,18,.08);
}

.profile-avatar-button {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: max-content;
  margin: 0 auto 4px;
  border: 0;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
}

.profile-form { display: grid; gap: 8px; }
.profile-form label { color: var(--gray); font-size: 12px; font-weight: 600; }
.profile-form .btn { margin-top: 3px; }

.play-again-btn, .play-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 112px;
  margin: 18px auto 0;
  padding: 11px 16px;
  text-align: center;
}
.play-start-btn { margin: 0 auto; }
.play-again-btn span, .play-start-btn span { margin-right: 6px; font-size: .9em; }

.logout-link {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
}
.logout-link:hover { text-decoration: underline; }

/* ---------- Score strip / pregunta ---------- */
.score-strip {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--gray);
  letter-spacing: .01em;
  animation: rise-in .55s .1s ease both;
}

.score-strip strong {
  color: var(--black);
  font-family: var(--font-display);
  font-size: 15px;
  background: var(--lime);
  padding: 2px 8px;
  border-radius: 8px;
}

#gameShell {
  background: var(--gray-deep);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 16px;
  margin: -8px -4px 0;
  box-shadow: 0 24px 60px rgba(27,23,18,.06);
}

#gameShell .score-strip { color: var(--gray); margin: 0 4px 14px; }

.question-card {
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 22px 24px;
  flex: 1;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 20px 45px rgba(27,23,18,.07);
  animation: card-in .55s ease both;
}

.question-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--black);
  text-align: center;
  font-size: clamp(23px, 5vw, 34px);
  letter-spacing: -.03em;
  line-height: 1.22;
  margin: 4px 6px 22px;
}

.question-visual {
  width: min(100%, 270px);
  aspect-ratio: 16 / 9;
  margin: 0 auto 22px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--gray-deep);
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(27,23,18,.1);
}

.question-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }

.question-timer {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--lime);
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--black);
  font-family: var(--font-display);
  font-weight: 700;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}

.question-timer.urgent {
  border-color: var(--red);
  color: var(--red);
  transform: scale(1.08);
}

.question-card.question-card-play {
  padding-top: 82px;
}

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

.option-btn {
  background: #FFFFFF;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  text-align: center;
  color: var(--black);
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.option-btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.option-btn:active { transform: scale(.98); }
.option-btn.correct { border-color: var(--answer-correct); background: rgba(46,155,98,.16); }
.option-btn.wrong { border-color: var(--red); background: rgba(226,72,61,.1); }
.option-btn:disabled { cursor: default; opacity: .85; color: var(--black); }

.feedback { margin-top: 22px; text-align: center; }
.feedback .points { font-family: var(--font-display); font-size: 32px; font-weight: 700; }
.feedback .points.correct { color: var(--answer-correct); }
.feedback .points.wrong { color: var(--red); }

.done-card { text-align: center; padding: 40px 10px; color: var(--gray); }
.timeout-card strong { color: var(--red); font-family: var(--font-display); font-size: 24px; }

/* ---------- Campo de imagen (form de preguntas) ---------- */
.image-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.field-help { display: block; margin-top: 7px; color: var(--gray); font-size: 11px; }

.image-preview {
  position: relative;
  width: 100%;
  height: 160px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background-color: var(--gray-deep);
  background-position: center;
  background-size: cover;
  overflow: hidden;
}
.image-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(11,16,17,.55));
  pointer-events: none;
}
.image-preview:not([style*="background-image"]) {
  background-image: linear-gradient(135deg, rgba(255,255,0,.12), rgba(123,223,242,.08));
}

/* Barra de acciones debajo de la preview — ambos botones iguales */
.image-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.image-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  background: #1b2324;
  color: var(--white) !important;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 44px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-font-smoothing: auto;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.image-action:hover {
  border-color: var(--lime);
  background: #202a2b;
  transform: translateY(-1px);
}

.image-action-upload,
label.image-action {
  color: var(--white) !important;
}

.image-action-ai {
  color: var(--lime) !important;
  border-color: rgba(255,255,0,.4);
  background: rgba(255,255,0,.08);
}
.image-action-ai:hover {
  background: rgba(255,255,0,.14);
}

.image-action:disabled { cursor: wait; opacity: .6; transform: none; }

.image-url-row { display: flex; gap: 8px; align-items: center; }

@media (max-width: 640px) {
  .image-actions { grid-template-columns: 1fr; }
}

/* ---------- Ranking ---------- */
.stats-season { color: var(--gray); font-size: 13px; margin: -12px 0 20px; }

.year-end-draw {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 26px 30px;
  margin-bottom: 24px;
  overflow: hidden;
  color: #F8F4D5;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 3px, transparent 3px 9px),
    radial-gradient(ellipse at 8% 100%, rgba(194, 165, 37, .12), transparent 52%),
    #101713;
  border: 1px solid rgba(204, 184, 47, .72);
  border-radius: 26px;
  box-shadow: 0 16px 36px rgba(27, 23, 18, .12);
}

.year-end-draw__icon {
  display: grid;
  place-items: center;
  flex: 0 0 148px;
  min-height: 144px;
  color: #E4BB27;
  border-right: 1px solid rgba(204, 184, 47, .52);
}
.year-end-draw__icon svg { width: 88px; height: 88px; filter: drop-shadow(0 8px 12px rgba(228, 187, 39, .18)); }
.year-end-draw__content { min-width: 0; }
.year-end-draw h2 {
  margin: 0 0 2px;
  color: #F3D824;
  font: 700 clamp(19px, 3vw, 28px)/1.15 var(--font-display);
  letter-spacing: -.035em;
  text-transform: uppercase;
}
.year-end-draw__date {
  margin: 0 0 12px;
  color: #FFFDF5;
  font: 700 clamp(22px, 4vw, 38px)/1.12 var(--font-display);
  letter-spacing: -.04em;
  text-transform: uppercase;
}
.year-end-draw__description {
  max-width: 560px;
  margin: 0;
  color: rgba(248, 244, 213, .76);
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1.55;
}

.player-rank-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 22px;
  margin-bottom: 14px;
  background: var(--black);
  color: #FFFFFF;
  border-radius: 18px;
  animation: rise-in .5s ease both;
}
.player-rank-card strong { font: 700 42px/1 var(--font-display); color: var(--lime); }
.player-rank-card span:last-child { color: rgba(255,255,255,.68); font-size: 13px; }
.stats-kicker { color: var(--lime); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.player-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.player-stat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 16px 12px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.player-stat-card strong { font: 700 28px/1 var(--font-display); }
.player-stat-card span { color: var(--gray); font-size: 11px; line-height: 1.2; }
.stat-correct strong { color: var(--answer-correct); }
.stat-wrong strong { color: var(--red); }
.stat-timeout strong { color: var(--blue); }
.stats-summary { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--gray); font-size: 12px; }

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

.ranking-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  animation: rise-in .5s ease both;
}

.ranking-row:nth-child(2) { animation-delay: .06s; }
.ranking-row:nth-child(3) { animation-delay: .12s; }
.ranking-row:nth-child(n+4) { animation-delay: .18s; }

.ranking-row .avatar { order: 0; }
.ranking-row .pos { font-family: var(--font-display); font-weight: 700; width: 28px; color: var(--gray); }
.ranking-row .nick { flex: 1; font-weight: 600; }
.ranking-row .pts {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lime), #eaff9e);
  box-shadow: 0 4px 14px rgba(255, 255, 0, .28), inset 0 1px 0 rgba(255,255,255,.4);
  font-family: var(--font-display);
}
.ranking-row .pts strong { font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: #111713; }
.ranking-row .pts small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: rgba(17,23,19,.62); }

/* Podio — versión sobria, sin brillos en loop */
.ranking-row:nth-child(1) {
  background: linear-gradient(105deg, rgba(255, 201, 77, .25), #FFFFFF 60%);
  border-color: rgba(255, 201, 77, .6);
}
.ranking-row:nth-child(2) {
  background: linear-gradient(105deg, rgba(190, 202, 214, .3), #FFFFFF 60%);
  border-color: rgba(190, 202, 214, .7);
}
.ranking-row:nth-child(3) {
  background: linear-gradient(105deg, rgba(205, 137, 91, .22), #FFFFFF 60%);
  border-color: rgba(205, 137, 91, .5);
}
.ranking-row:nth-child(1) .pos { color: #B9852A; }
.ranking-row:nth-child(2) .pos { color: #8791A0; }
.ranking-row:nth-child(3) .pos { color: #B06A3E; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 35px rgba(27,23,18,.05);
  display: flex;
  justify-content: center;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}

.bottom-nav-inner { width: 100%; max-width: 480px; display: flex; justify-content: space-around; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  padding: 6px 18px;
  border-radius: 12px;
  transition: color .2s ease, background .2s ease;
}

.nav-item:hover { background: rgba(255,201,77,.15); color: var(--black); }
.nav-item.active { color: var(--black); background: rgba(255,201,77,.15); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.nav-item.active .dot { background: var(--lime); }

/* ---------- Ad slot ---------- */
.ad-slot {
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  color: var(--black);
  font-size: 12px;
  width: min(100%, 420px);
  margin: 20px auto 4px;
}

/* ---------- Admin ---------- */
.admin-body { max-width: 1000px; margin: 0 auto; padding: 32px 24px 60px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -.03em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--gray);
  font-weight: 600;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.admin-nav a:hover { transform: translateY(-2px); color: var(--black); }
.admin-nav a.active { background: var(--lime); color: var(--black); font-weight: 700; border-color: var(--lime); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  transition: transform .2s ease, border-color .2s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(255,201,77,.6); }
.stat-card .num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--black); }
.stat-card .label { font-size: 12px; color: var(--gray); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--gray); font-weight: 600; font-size: 12px; letter-spacing: 0.02em; background: var(--gray-deep); }
tr:last-child td { border-bottom: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 640px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 34px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(27,23,18,.08);
  animation: card-in .6s ease both;
  text-align: center;
}
.login-card .login-logo { width: 56px; height: 56px; margin: 0 auto 14px; display: block; border-radius: 50%; border: 2px solid var(--black); }
.login-card h1 { font-family: var(--font-display); font-size: 22px; margin-bottom: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; background: var(--gray-deep); color: var(--gray); border: 1px solid var(--line); }
.tag.on { background: rgba(255,255,0,.14); color: var(--green); border-color: rgba(255,255,0,.3); }

/* ---------- Animaciones (mismas del original, sin loops infinitos) ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .app { padding: 22px 16px 104px; }
  .topbar { margin-bottom: 28px; }
  .gate { min-height: 68vh; }
  .gate h1 { font-size: clamp(34px, 11vw, 46px); }
  .question-card { min-height: 430px; }
  .admin-body { padding: 22px 16px 50px; }
  .admin-header { align-items: flex-start; }
  .admin-nav { flex-wrap: nowrap; overflow-x: auto; width: calc(100vw - 32px); padding-bottom: 5px; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a, .admin-nav form { flex-shrink: 0; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .login-card { padding: 26px 20px; }
  .image-url-row { align-items: stretch; flex-direction: column; }
  .image-url-row .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}

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

/* ---------- Rediseño: noche de juego ---------- */
:root {
  --black: #f4f6f2;
  --white: #f4f6f2;
  --lime: #FFFF00;
  --gray: #909a9a;
  --gray-dark: #151b1c;
  --gray-deep: #101516;
  --red: #ff6b6b;
  --green: var(--lime);
  --blue: #7bdff2;
  --line: rgba(244, 246, 242, .1);
  --radius: 18px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

html, body {
  background: #0b1011;
  color: var(--black);
}

body {
  background-image:
    radial-gradient(circle at 8% -8%, rgba(255, 255, 0, .13), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(123, 223, 242, .1), transparent 25rem),
    linear-gradient(135deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.025) 50%, rgba(255,255,255,.025) 75%, transparent 75%);
  background-size: auto, auto, 5px 5px;
}

body::before { opacity: .18; background-size: 42px 42px; }

.app {
  max-width: 680px;
  padding: 28px 22px 118px;
}

.topbar { margin-bottom: 40px; }

.brand {
  gap: 10px;
  color: var(--white);
  font-size: 16px;
  letter-spacing: -.035em;
}

.brand .mark, img.mark {
  width: 38px;
  height: 38px;
  border: 0;
  box-shadow: 0 0 0 5px rgba(255, 255, 0, .1);
}

span.mark { background: var(--lime); color: #121713; font-family: var(--font-display); font-weight: 700; }

.player-chip {
  padding: 7px 10px;
  color: var(--gray);
  background: rgba(21, 27, 28, .72);
  border-color: var(--line);
  backdrop-filter: blur(14px);
}

.player-chip strong { color: var(--white); }
.avatar { background: linear-gradient(135deg, var(--lime), var(--blue)); color: #101516; }
.avatar-profile { border-color: rgba(255, 255, 0, .65); }
.avatar-trigger:hover .avatar-small { box-shadow: 0 0 0 3px rgba(255, 255, 0, .28); }

.gate { min-height: 70vh; gap: 22px; }
.gate-kicker { color: var(--lime); letter-spacing: .16em; }
.gate h1, .profile-heading h1 { color: var(--white); text-wrap: balance; }
.gate p, .profile-heading p { color: var(--gray); }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  background: #111819;
  border-color: var(--line);
  color: var(--white);
}
input:focus, textarea:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(255, 255, 0, .13); }
input::placeholder { color: #687373; }

.btn { border-radius: 13px; }
.btn-primary { background: var(--lime); color: #111713; box-shadow: 0 8px 22px rgba(255, 255, 0, .12); }
.btn-secondary { background: #1b2324; color: var(--white); border-color: var(--line); }
.btn:hover { filter: brightness(1.08); }

.auth-card, .profile-card, .login-card {
  border-color: var(--line);
  background: rgba(21, 27, 28, .86);
  box-shadow: 0 26px 70px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}
.auth-tab { color: var(--gray); }
.auth-tab.active { background: rgba(255, 255, 0, .16); color: var(--lime); }
.auth-hint { color: var(--gray); }
.profile-card { padding: 26px; }
.profile-form label, .avatar-edit-label { color: var(--gray); }

#gameShell {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 14px;
  background: rgba(16, 21, 22, .82);
  border-color: var(--line);
  box-shadow: 0 28px 70px rgba(0,0,0,.25);
}
#gameArea { width: 100%; max-width: 560px; margin: 0 auto; }
.ad-slot { background: rgba(16, 21, 22, .6); }
.score-strip { color: var(--gray); }
.score-strip strong { color: #111713; background: var(--lime); }
.question-card {
  min-height: 410px;
  background: #171e20;
  border-color: rgba(244,246,242,.11);
  box-shadow: 0 18px 45px rgba(0,0,0,.26);
}
.question-text { color: var(--white); }
.question-visual { background: #101516; border-color: var(--line); }
.question-timer { background: #171e20; color: var(--lime); border-color: var(--lime); }
.option-btn { background: #111819; border-color: rgba(244,246,242,.12); color: var(--white); }
.option-btn:hover { border-color: var(--blue); background: #1a2526; }
.option-btn:disabled { color: var(--white); }
.option-btn.correct { border-color: var(--answer-correct); background: rgba(46,155,98,.16); }
.option-btn.wrong { border-color: var(--red); background: rgba(255,107,107,.1); }
.feedback .points.correct { color: var(--answer-correct); }
.ad-slot { border-color: rgba(244,246,242,.14); color: #687373; }

.ranking-row, .stat-card, table {
  background: #151b1c;
  border-color: var(--line);
}
.player-stat-card { background: #151b1c; border-color: var(--line); }
.player-stat-card span { color: var(--gray); }
.player-rank-card { background: #151b1c; border: 1px solid var(--line); }
.ranking-row:nth-child(1) { background: linear-gradient(105deg, rgba(255,255,0,.16), #151b1c 68%); border-color: rgba(255,255,0,.4); }
.ranking-row:nth-child(2) { background: linear-gradient(105deg, rgba(190,202,214,.11), #151b1c 68%); border-color: rgba(190,202,214,.28); }
.ranking-row:nth-child(3) { background: linear-gradient(105deg, rgba(205,137,91,.12), #151b1c 68%); border-color: rgba(205,137,91,.25); }
.ranking-row:nth-child(1) .pos { color: var(--lime); }
.ranking-row:nth-child(2) .pos { color: #b5c0c8; }
.ranking-row:nth-child(3) .pos { color: #d49b75; }

.previous-winner {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 0, .3);
  border-radius: 18px;
  background: linear-gradient(105deg, rgba(255,255,0,.12), #151b1c 72%);
}
.previous-winner-player { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.previous-winner-player strong { color: var(--white); }
.previous-winner-points { margin-left: auto; color: #111713; background: var(--lime); padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.previous-winner-season { display: block; margin-top: 8px; color: var(--gray); font-size: 12px; }

.bottom-nav {
  background: rgba(12, 17, 18, .9);
  border-top-color: var(--line);
  box-shadow: 0 -18px 45px rgba(0,0,0,.26);
  backdrop-filter: blur(18px);
}
.bottom-nav-inner { max-width: 420px; }
.nav-item { min-width: 92px; padding: 8px 18px; color: var(--gray); }
.nav-item:hover, .nav-item.active { color: var(--white); background: rgba(255,255,0,.1); }
.nav-item .dot { width: 20px; height: 18px; }
.nav-item .dot::before { font-size: 15px; line-height: 18px; }
.nav-item:first-child .dot::before { content: '✦'; color: currentColor; }
.nav-item:nth-child(2) .dot::before { content: '↗'; color: currentColor; font-weight: 700; }
.nav-item:nth-child(3) .dot::before { content: '▥'; color: currentColor; font-weight: 700; }
.nav-item.active .dot { background: transparent; color: var(--lime); }

.admin-body { max-width: 1120px; padding: 30px 28px 70px; }
.admin-header { margin-bottom: 30px; }
.admin-header h1 { color: var(--white); }
.admin-nav a { background: #151b1c; border-color: var(--line); color: var(--gray); }
.admin-nav a:hover { color: var(--white); }
.admin-nav a.active { background: var(--lime); border-color: var(--lime); color: #111713; }
.stat-card .num { color: var(--white); }
.stat-card:hover { border-color: rgba(255,255,0,.45); }
th { background: #101516; color: var(--gray); }
th, td { border-color: var(--line); }
.login-card .login-logo { border-color: var(--lime); }
.login-card h1 { color: var(--white); }
.tag { background: #101516; border-color: var(--line); color: var(--gray); }

@media (max-width: 640px) {
  .app { padding: 20px 16px 110px; }
  .topbar { margin-bottom: 30px; }
  .brand { font-size: 15px; }
  .player-chip { max-width: 48%; }
  .player-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #gameShell { margin-inline: auto; padding: 10px; border-radius: 24px; }
  .question-card { min-height: 440px; padding-inline: 16px; border-radius: 20px; }
  .question-card.question-card-play { padding-top: 78px; }
  .question-timer { top: 14px; right: 14px; }
  .option-btn { padding: 15px 12px; }
  .profile-card { padding: 20px; }
  .ranking-row { gap: 10px; padding: 13px 12px; }
  .ranking-row .nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ranking-row .pts { font-size: 12px; padding-inline: 7px; }
  .player-stat-card { padding: 14px 10px; }
  .player-stat-card strong { font-size: 25px; }
  .stats-summary { flex-direction: column; gap: 5px; }
  .admin-body { padding: 20px 16px 54px; }
  .admin-header h1 { font-size: 22px; }
}

/* Logo original de la marca: se tiñe con el acento sin sustituir la imagen. */
.brand img.mark {
  border: 0;
  border-radius: 50%;
  padding: 4px;
  background: rgba(255, 255, 0, .12);
  box-shadow: 0 0 0 1px rgba(255, 255, 0, .32), 0 0 24px rgba(255, 255, 0, .14);
  filter: none;
}

.login-card .login-logo {
  padding: 5px;
  border: 0;
  background: rgba(255, 255, 0, .12);
  box-shadow: 0 0 0 1px rgba(255, 255, 0, .35), 0 0 28px rgba(255, 255, 0, .16);
  filter: none;
}

/* Panel admin: navegación y tablas pensadas para trabajo frecuente. */
.admin-body { width: min(1180px, 100%); padding-top: 26px; }
.admin-header { align-items: center; margin-bottom: 20px; gap: 18px; }
.admin-brand { display: inline-flex; align-items: center; gap: 11px; }
.admin-brand-mark { width: 40px; height: 40px; border-radius: 50%; padding: 4px; object-fit: contain; background: rgba(255, 255, 0, .12); box-shadow: 0 0 0 1px rgba(255, 255, 0, .32), 0 0 24px rgba(255, 255, 0, .14); }
.admin-brand strong { display: block; font: 700 18px/1 var(--font-display); color: var(--white); }
.admin-brand small { display: block; margin-top: 4px; color: var(--gray); font-size: 11px; }
.admin-user { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 12px; }
.admin-user strong { color: var(--white); }
.admin-user form { margin: 0; }
.admin-logout { border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--gray); padding: 8px 11px; cursor: pointer; font: 600 12px var(--font-body); }
.admin-logout:hover { color: var(--white); border-color: var(--lime); }
.admin-nav { gap: 6px; padding: 6px; margin-bottom: 36px; border: 1px solid var(--line); border-radius: 14px; background: rgba(21, 27, 28, .7); box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.admin-nav a { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 10px 12px; border-radius: 9px; }
.admin-nav a span { color: var(--lime); font-size: 14px; }
.admin-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-page-heading h2 { margin: 4px 0 6px; color: var(--white); font: 700 clamp(28px, 4vw, 38px)/1.05 var(--font-display); letter-spacing: -.04em; }
.admin-page-heading p { margin: 0; color: var(--gray); font-size: 14px; }
.admin-eyebrow { color: var(--lime); font: 700 11px var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.admin-heading-action { white-space: nowrap; }
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.admin-toolbar div { display: flex; align-items: baseline; gap: 8px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(21,27,28,.55); }
.admin-toolbar strong { color: var(--white); font: 700 20px var(--font-display); }
.admin-toolbar span { color: var(--gray); font-size: 12px; }
.question-bulk-actions { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(21,27,28,.48); }
.question-bulk-actions > span { margin-right: auto; color: var(--gray); font-size: 12px; font-weight: 600; }
.question-bulk-actions form { margin: 0; }
.bulk-action { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: transparent; color: var(--gray); font: 600 11px var(--font-body); cursor: pointer; }
.bulk-action:hover { transform: translateY(-1px); }
.bulk-action-on { color: var(--green); border-color: rgba(255,255,0,.35); }
.bulk-action-on:hover { background: rgba(255,255,0,.1); }
.bulk-action-off { color: var(--red); border-color: rgba(255,107,107,.35); }
.bulk-action-off:hover { background: rgba(255,107,107,.1); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.16); }
.questions-table { min-width: 760px; border: 0; border-radius: 0; }
.questions-table td, .questions-table th { padding: 14px 16px; vertical-align: middle; }
.question-cell { max-width: 430px; }
.question-cell strong { display: block; overflow: hidden; color: var(--white); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.question-cell small { display: block; margin-top: 5px; color: var(--gray); font-size: 11px; }
.difficulty { display: inline-block; padding: 4px 8px; border-radius: 6px; background: rgba(123,223,242,.1); color: var(--blue); font-size: 11px; text-transform: capitalize; }
.difficulty-dificil { background: rgba(255,107,107,.1); color: var(--red); }
.difficulty-media { background: rgba(255,215,92,.12); color: var(--lime); }
.actions-column { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }
.table-action { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: transparent; color: var(--gray); font: 600 11px var(--font-body); cursor: pointer; }
.table-action:hover { color: var(--white); border-color: var(--lime); }
.table-action-danger:hover { color: var(--red); border-color: var(--red); }
.empty-state { padding: 34px; text-align: center; color: var(--gray); }
.stats-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.stats-heading h2 { margin: 5px 0 8px; color: var(--white); font: 700 clamp(28px, 4vw, 40px)/1.05 var(--font-display); letter-spacing: -.04em; }
.stats-heading p { margin: 0; color: var(--gray); font-size: 14px; }
.stats-heading p strong { color: var(--white); }
.stats-season-pill { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--gray); font-size: 12px; text-transform: capitalize; }
.stats-season-pill .status-pulse { display: block; }
.player-stats-section, .top-questions-section { margin-top: 30px; }
.player-stats-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.14); }
.player-stats-table { min-width: 850px; border: 0; border-radius: 0; }
.player-stats-table th, .player-stats-table td { padding: 14px 13px; vertical-align: middle; }
.player-position { width: 58px; color: var(--lime); font: 700 18px var(--font-display); text-align: center; }
.player-name { min-width: 155px; }
.player-name strong, .player-name small { display: block; }
.player-name strong { color: var(--white); font-weight: 600; }
.player-name small { margin-top: 4px; color: var(--gray); font-size: 10px; }
.metric-correct { color: var(--answer-correct); }
.metric-wrong { color: var(--red); }
.metric-timeout { color: var(--lime); }
.chart-cell { width: 250px; }
.player-chart { display: flex; width: 100%; height: 12px; overflow: hidden; border-radius: 99px; background: #252d2e; }
.player-chart span { min-width: 0; transition: width .3s ease; }
.chart-correct { background: var(--answer-correct); }
.chart-wrong { background: var(--red); }
.chart-timeout { background: var(--lime); }
.player-points { color: var(--white); font: 700 15px var(--font-display); text-align: right; }
.top-questions-section { padding-top: 4px; }

/* Dashboard: lectura rápida y acciones frecuentes. */
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; padding: 28px 30px; border: 1px solid rgba(255,255,0,.2); border-radius: 20px; background: linear-gradient(120deg, rgba(255,255,0,.12), rgba(21,27,28,.8) 55%, rgba(123,223,242,.08)); box-shadow: 0 20px 45px rgba(0,0,0,.16); }
.dashboard-hero h2 { max-width: 600px; margin: 6px 0 10px; color: var(--white); font: 700 clamp(28px, 5vw, 44px)/1.03 var(--font-display); letter-spacing: -.05em; }
.dashboard-hero p { max-width: 560px; margin: 0; color: var(--gray); font-size: 14px; line-height: 1.6; }
.season-status { display: flex; align-items: flex-start; gap: 10px; min-width: 210px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(10,15,16,.45); }
.status-pulse { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(255,255,0,.12); }
.season-status small, .season-status strong, .season-status em { display: block; }
.season-status small { color: var(--gray); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.season-status strong { margin-top: 4px; color: var(--white); font: 600 14px var(--font-display); }
.season-status em { margin-top: 2px; color: var(--lime); font-size: 11px; font-style: normal; text-transform: capitalize; }
.dashboard-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 34px; }
.dashboard-stats .stat-card { position: relative; min-height: 132px; padding: 20px; }
.stat-icon { position: absolute; top: 16px; right: 18px; color: var(--lime); font: 700 22px var(--font-display); opacity: .9; }
.dashboard-stats .num { margin-top: 19px; font-size: 34px; }
.dashboard-stats .label { max-width: 150px; line-height: 1.35; }
.stat-card-alert { border-color: rgba(255,215,92,.42); background: linear-gradient(135deg, rgba(255,215,92,.12), #151b1c 70%); }
.stat-card-alert .stat-icon { color: var(--lime); display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--lime); border-radius: 50%; font-size: 13px; }
.dashboard-actions { padding-top: 4px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-heading h3 { margin: 5px 0 0; color: var(--white); font: 600 22px var(--font-display); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action { display: flex; min-height: 138px; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(21,27,28,.72); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.quick-action:hover { transform: translateY(-3px); border-color: rgba(255,255,0,.55); background: #192122; }
.quick-action span { color: var(--lime); font: 700 24px var(--font-display); }
.quick-action strong { margin-top: auto; color: var(--white); font: 600 14px var(--font-display); }
.quick-action small { margin-top: 5px; color: var(--gray); font-size: 11px; line-height: 1.35; }
.quick-action-primary { border-color: rgba(255,255,0,.5); background: linear-gradient(145deg, rgba(255,255,0,.18), rgba(21,27,28,.76)); }

@media (max-width: 860px) {
  .dashboard-stats, .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .image-actions { grid-template-columns: 1fr; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 22px 20px; }
  .season-status { width: 100%; }
  .dashboard-stats, .quick-actions { grid-template-columns: 1fr 1fr; gap: 9px; }
  .dashboard-stats .stat-card { padding: 15px; }
  .dashboard-stats .num { font-size: 28px; }
  .quick-action { min-height: 128px; padding: 14px; }
}

@media (max-width: 640px) {
  .admin-header { align-items: flex-start; }
  .admin-user > span { display: none; }
  .admin-nav { margin-bottom: 28px; }
  .admin-page-heading { align-items: flex-start; flex-direction: column; }
  .admin-heading-action { width: auto; }
  .admin-toolbar { overflow-x: auto; }
  .admin-toolbar div { flex: 0 0 auto; }
  .question-bulk-actions { align-items: stretch; flex-wrap: wrap; }
  .question-bulk-actions > span { flex-basis: 100%; margin-right: 0; }
  .question-bulk-actions form { flex: 1; }
  .bulk-action { width: 100%; }
}

/* Podio metálico: oro, plata y bronce. */
.ranking-row:nth-child(-n+3) {
  position: relative;
  overflow: hidden;
}

.ranking-row:nth-child(1) {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 224, 130, .38), transparent 60%),
    linear-gradient(105deg, rgba(255, 215, 92, .32), #171e20 68%);
  border-color: rgba(255, 215, 92, .95);
  border-width: 1.5px;
  box-shadow:
    0 0 0 1px rgba(255, 215, 92, .3),
    0 0 24px rgba(255, 197, 61, .35),
    0 14px 34px rgba(255, 190, 50, .22);
  animation: rise-in .5s ease both, podium-gold 2.6s ease-in-out .55s infinite;
}

.ranking-row:nth-child(2) {
  background: linear-gradient(105deg, rgba(218, 226, 232, .2), #171e20 72%);
  border-color: rgba(218, 226, 232, .62);
  box-shadow: 0 0 0 1px rgba(218, 226, 232, .06), 0 10px 26px rgba(180, 200, 215, .1);
  animation: rise-in .5s .06s ease both, podium-silver 4.6s ease-in-out 1s infinite;
}

.ranking-row:nth-child(3) {
  background: linear-gradient(105deg, rgba(205, 137, 91, .2), #171e20 72%);
  border-color: rgba(205, 137, 91, .58);
  box-shadow: 0 0 0 1px rgba(205, 137, 91, .05), 0 8px 22px rgba(170, 94, 52, .08);
}

.ranking-row:nth-child(1) .pos {
  color: #ffe082;
  text-shadow: 0 0 10px rgba(255, 210, 90, .85), 0 0 22px rgba(255, 190, 50, .5);
  font-size: 20px;
}
.ranking-row:nth-child(2) .pos { color: #dce4ea; }
.ranking-row:nth-child(3) .pos { color: #d08a5b; }

.ranking-row:nth-child(1) .avatar {
  box-shadow: 0 0 0 2px rgba(255, 215, 92, .9), 0 0 16px rgba(255, 197, 61, .55);
}

.ranking-row:nth-child(1) .pts {
  box-shadow: 0 4px 14px rgba(255, 255, 0, .28), inset 0 1px 0 rgba(255,255,255,.4), 0 0 14px rgba(255, 197, 61, .35);
}

.ranking-row:nth-child(1)::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(closest-side, rgba(255, 224, 130, .22), transparent 70%);
  animation: podium-aura 2.6s ease-in-out .55s infinite;
  pointer-events: none;
}

.ranking-row:nth-child(1)::after,
.ranking-row:nth-child(2)::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: podium-shine 4.8s ease-in-out 1.2s infinite;
}

.ranking-row:nth-child(1)::after {
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 200, .55), transparent);
  animation: podium-shine 3s ease-in-out .8s infinite;
}

@keyframes podium-gold {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 215, 92, .3),
      0 0 24px rgba(255, 197, 61, .35),
      0 14px 34px rgba(255, 190, 50, .22);
  }
  50% {
    box-shadow:
      0 0 0 1.5px rgba(255, 224, 130, .55),
      0 0 42px rgba(255, 205, 80, .6),
      0 18px 44px rgba(255, 190, 50, .38);
  }
}

@keyframes podium-aura {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

@keyframes podium-silver {
  0%, 100% { box-shadow: 0 0 0 1px rgba(218, 226, 232, .06), 0 10px 26px rgba(180, 200, 215, .1); }
  50% { box-shadow: 0 0 0 1px rgba(218, 226, 232, .16), 0 12px 32px rgba(180, 200, 215, .2); }
}

@keyframes podium-shine {
  0%, 35% { left: -45%; }
  70%, 100% { left: 125%; }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-row:nth-child(1), .ranking-row:nth-child(2),
  .ranking-row:nth-child(1)::before,
  .ranking-row:nth-child(1)::after, .ranking-row:nth-child(2)::after {
    animation: none;
  }
}

@media (min-width: 900px) and (max-height: 850px) {
  .app { padding-top: 18px; padding-bottom: 96px; }
  .topbar { margin-bottom: 20px; }
  .gate { min-height: 0; gap: 14px; }
  .gate h1 { font-size: clamp(36px, 4vw, 50px); }
  .gate p { font-size: 14px; }
  .auth-card { margin-top: 2px; }
  .auth-tab { padding-block: 9px; }
  .auth-card form { gap: 8px; }
  .auth-card input { padding-block: 13px; }
}

/* =========================================================
   Altcha — ancho completo, alineado con inputs y botón.
   ========================================================= */
altcha-widget {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 6px 0 4px !important;
}

altcha-widget .altcha,
altcha-widget .altcha-main {
  width: 100% !important;
}

/* =========================================================
   Admin — menú hamburguesa + tablas responsive
   ========================================================= */

/* Botón hamburguesa: oculto en desktop */
.admin-menu-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #151b1c;
  color: var(--white);
  font: 600 13px var(--font-body);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.admin-menu-toggle:hover { border-color: var(--lime); }
.admin-menu-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
}
.admin-menu-icon span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.admin-menu-toggle[aria-expanded="true"] .admin-menu-icon span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.admin-menu-toggle[aria-expanded="true"] .admin-menu-icon span:nth-child(2) { opacity: 0; }
.admin-menu-toggle[aria-expanded="true"] .admin-menu-icon span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Overlay para cerrar el menú en mobile */
.admin-nav-backdrop { display: none; }

@media (max-width: 860px) {
  .admin-header { flex-wrap: wrap; gap: 14px; }
  .admin-user span { display: none; }
  .admin-menu-toggle { display: inline-flex; }

  /* El menú se convierte en panel lateral */
  .admin-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: min(290px, 84vw);
    height: 100vh;
    margin: 0;
    padding: 84px 16px 24px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: #101516;
    box-shadow: -20px 0 50px rgba(0,0,0,.45);
    transform: translateX(102%);
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
    overflow-y: auto;
  }
  .admin-nav.open { transform: translateX(0); }

  .admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 14px;
  }
  .admin-nav a span { font-size: 16px; }
  .admin-nav a:hover { background: rgba(255,255,0,.08); border-color: var(--line); }
  .admin-nav a.active {
    background: rgba(255,255,0,.14);
    border-color: rgba(255,255,0,.4);
    color: var(--lime);
  }

  /* Bloquea el scroll del body cuando el menú está abierto */
  body.admin-menu-open { overflow: hidden; }
}

/* ---------------------------------------------
   Tabla de preguntas → tarjetas en mobile
   --------------------------------------------- */
@media (max-width: 860px) {
  .admin-table-wrap { overflow: visible; border: 0; box-shadow: none; }
  .questions-table { min-width: 0; border-collapse: separate; }
  .questions-table thead { display: none; }
  .questions-table,
  .questions-table tbody,
  .questions-table tr,
  .questions-table td { display: block; width: 100%; }

  .questions-table tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #151b1c;
  }
  .questions-table tr:last-child { margin-bottom: 0; }

  .questions-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }
  .questions-table td:last-child { border-bottom: 0; padding-bottom: 0; }
  .questions-table td::before {
    content: attr(data-label);
    flex: 0 0 88px;
    color: var(--gray);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .questions-table .question-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 0;
    max-width: 100%;
  }
  .questions-table .question-cell::before { flex-basis: auto; }
  .questions-table .question-cell strong {
    white-space: normal;
    font-size: 15px;
    line-height: 1.35;
  }
  .questions-table .actions-column { justify-content: flex-start; }
  .questions-table .actions-column::before { flex-basis: auto; }
  .questions-table .row-actions { flex-wrap: wrap; }
}

/* =========================================================
   Admin — gráfico de torta (donut) + leyenda
   ========================================================= */
.stats-chart-section { margin-top: 30px; }

.stats-chart-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 32px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(21, 27, 28, .55);
  box-shadow: 0 20px 45px rgba(0,0,0,.16);
}

/* Donut con conic-gradient. Los colores se calculan con las variables
   --correct y --wrong (porcentajes acumulados). */
.donut {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(
    var(--answer-correct) 0% calc(var(--correct) * 1%),
    var(--red) calc(var(--correct) * 1%) calc(var(--wrong) * 1%),
    var(--lime) calc(var(--wrong) * 1%) 100%
  );
  display: grid;
  place-items: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}

.donut::before {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #151b1c;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}
.donut-center strong {
  display: block;
  color: var(--white);
  font: 700 34px var(--font-display);
  letter-spacing: -.03em;
}
.donut-center span {
  display: block;
  margin-top: 4px;
  color: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Leyenda */
.stats-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.stats-legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 21, 22, .55);
}
.legend-dot {
  grid-row: 1 / 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-self: center;
}
.legend-correct { background: var(--answer-correct); box-shadow: 0 0 0 3px rgba(46,155,98,.2); }
.legend-wrong   { background: var(--red);   box-shadow: 0 0 0 3px rgba(255,107,107,.16); }
.legend-timeout { background: var(--lime);  box-shadow: 0 0 0 3px rgba(255,255,0,.18); }

.legend-label {
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
}
.stats-legend strong {
  color: var(--white);
  font: 700 20px var(--font-display);
  text-align: right;
}
.stats-legend small {
  grid-column: 2 / 4;
  color: var(--gray);
  font-size: 11px;
}

/* Mobile: el gráfico va arriba y la leyenda abajo, centrados */
@media (max-width: 860px) {
  .stats-chart-card {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 20px;
    text-align: center;
  }
  .donut {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }
  .donut::before { inset: 18px; }
  .donut-center strong { font-size: 28px; }
  .stats-legend li {
    text-align: left;
  }
}

/* =========================================================
   Grilla de dos donuts (admin y jugador)
   ========================================================= */
.stats-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 18px;
  margin-top: 6px;
}

.stats-chart-head { margin-bottom: 14px; }
.stats-chart-head h3,
.stats-chart-head h4 {
  margin: 4px 0 4px;
  color: var(--white);
  font: 700 18px var(--font-display);
  letter-spacing: -.02em;
}
.stats-chart-head small {
  display: block;
  color: var(--gray);
  font-size: 11px;
}

@media (max-width: 860px) {
  .stats-charts-grid { grid-template-columns: 1fr; }
}

/* La tarjeta de donut en modo "grid de 2" se reacomoda para que el
   header, el donut y la leyenda no se aplasten. */
.stats-chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.stats-chart-card .stats-chart-head { align-self: stretch; text-align: left; }
.stats-chart-card .stats-legend { align-self: stretch; width: 100%; }
.stats-chart-card .donut { margin: 0 auto; }

/* =========================================================
   Tarjeta de posición en el ranking (stats del jugador)
   ========================================================= */
.rank-position-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 26px;
  padding: 22px 24px;
  border: 1px solid rgba(255,255,0,.35);
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255,255,0,.16), rgba(21,27,28,.86) 60%, rgba(123,223,242,.08));
  box-shadow: 0 22px 50px rgba(0,0,0,.22);
}

.rank-medal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 21, 22, .8);
  border: 1px solid var(--line);
  font: 700 26px var(--font-display);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(255,255,0,.25), 0 10px 26px rgba(0,0,0,.28);
}
.rank-medal[data-rank="1"] { background: linear-gradient(135deg, #ffd75c, #b9852a); color: #1b1712; border-color: transparent; }
.rank-medal[data-rank="2"] { background: linear-gradient(135deg, #e2e8ee, #8791a0); color: #1b1712; border-color: transparent; }
.rank-medal[data-rank="3"] { background: linear-gradient(135deg, #d79a6a, #8a4f2b); color: #1b1712; border-color: transparent; }

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.rank-kicker {
  color: var(--lime);
  font: 700 11px var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rank-number {
  color: var(--white);
  font: 700 34px/1 var(--font-display);
  letter-spacing: -.04em;
}
.rank-season {
  color: var(--gray);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-points {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(16, 21, 22, .7);
  border: 1px solid var(--line);
}
.rank-points strong {
  color: var(--lime);
  font: 700 24px var(--font-display);
  letter-spacing: -.03em;
}
.rank-points span {
  color: var(--gray);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

@media (max-width: 640px) {
  .rank-position-card {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
  }
  .rank-medal { width: 54px; height: 54px; font-size: 22px; }
  .rank-number { font-size: 28px; }
  .rank-points { align-self: stretch; align-items: center; flex-direction: row; justify-content: space-between; }
  .rank-points strong { font-size: 20px; }
}

/* =========================================================
   Tarjetas de ranking del jugador (actual + mejor histórico)
   ========================================================= */
.rank-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 8px 0 26px;
}

.rank-cards-grid .rank-position-card {
  margin: 0;
  height: 100%;
}

.rank-position-card.rank-best {
  border-color: rgba(255, 215, 92, .4);
  background: linear-gradient(120deg, rgba(255, 215, 92, .14), rgba(21, 27, 28, .86) 60%, rgba(255, 255, 0, .06));
}

@media (max-width: 720px) {
  .rank-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rank-cards-grid .rank-position-card {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .rank-medal { width: 50px; height: 50px; font-size: 20px; }
  .rank-number { font-size: 26px; }
  .rank-points { align-self: stretch; align-items: center; flex-direction: row; justify-content: space-between; }
}

/* =========================================================
   Pantalla de juego en PC / notebook — antes quedaba angosta
   y perdida en pantallas grandes; acá se aprovecha el ancho.
   ========================================================= */
@media (min-width: 900px) {
  .game-page .app {
    max-width: 760px;
    padding-top: 22px;
  }

  .game-page .topbar { margin-bottom: 20px; }

  .game-page #gameShell {
    max-width: 100%;
    padding: 18px;
    border-radius: 28px;
  }

  .game-page #gameShell .score-strip {
    font-size: 14px;
    margin: 0 6px 12px;
  }
  .game-page .score-strip strong { font-size: 15px; padding: 3px 10px; }

  .game-page #gameArea { max-width: 560px; margin: 0 auto; }

  /* Tarjeta compacta: que entre en pantalla sin tener que hacer scroll */
  .game-page .question-card {
    min-height: 0;
    padding: 26px 34px 22px;
    border-radius: 24px;
  }
  .game-page .question-card.question-card-play { padding-top: 60px; }

  .game-page .question-text {
    font-size: clamp(19px, 1.9vw, 25px);
    margin-bottom: 16px;
  }

  .game-page .question-visual { width: min(100%, 260px); margin-bottom: 14px; }

  .game-page .question-timer {
    width: 38px;
    height: 38px;
    top: 14px;
    right: 16px;
    font-size: 14px;
  }

  /* Opciones en una sola columna, compactas */
  .game-page .options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .game-page .option-btn {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 12px;
  }

  .game-page .feedback { margin-top: 10px; }
  .game-page .feedback .points { font-size: 26px; }

  .game-page .ad-slot { margin-top: 12px; padding: 10px; font-size: 11px; }
}

@media (min-width: 1280px) {
  .game-page .app { max-width: 820px; }
  .game-page #gameArea { max-width: 620px; }
}


/* =========================================================
   Corrección: stats.ejs usa <h1> dentro de .stats-heading,
   pero acá sólo estaba estilado el <h2> (quedaba con la
   tipografía por defecto del navegador). Se iguala a la h2.
   ========================================================= */
.stats-heading h1 {
  margin: 5px 0 8px;
  color: var(--white);
  font: 700 clamp(28px, 4vw, 40px)/1.05 var(--font-display);
  letter-spacing: -.04em;
}

/* =========================================================
   Pantalla de inicio / login / perfil en PC y notebook
   ========================================================= */
@media (min-width: 900px) {
  .home-page .app { max-width: 760px; padding-top: 56px; }
  .home-page .topbar { margin-bottom: 56px; }

  .home-page .gate { min-height: 54vh; gap: 26px; }
  .home-page .gate h1 { font-size: clamp(44px, 4vw, 60px); }
  .home-page .gate p { font-size: 16px; }

  .home-page .auth-card { max-width: 460px; padding: 12px; }
  .home-page .auth-card form { padding: 14px; gap: 14px; }
  .home-page .auth-tab { padding: 13px 10px; font-size: 15px; }

  .home-page .profile-card { max-width: 520px; padding: 32px; }
  .home-page .profile-heading h1 { font-size: clamp(34px, 3.4vw, 46px); }
  .home-page .avatar-profile { width: 108px; height: 108px; font-size: 40px; }
}

/* =========================================================
   Pantalla de ranking en PC y notebook
   ========================================================= */
@media (min-width: 900px) {
  .ranking-page .app { max-width: 820px; padding-top: 46px; }
  .ranking-page .topbar { margin-bottom: 40px; }

  .ranking-page .year-end-draw { gap: 34px; padding: 30px 38px; }
  .ranking-page .year-end-draw__icon { flex-basis: 170px; min-height: 170px; }
  .ranking-page .year-end-draw__icon svg { width: 100px; height: 100px; }

  .ranking-page .previous-winner { padding: 20px 22px; }
  .ranking-page .avatar-ranking { width: 46px; height: 46px; font-size: 16px; }

  .ranking-page .ranking-list { gap: 12px; }
  .ranking-page .ranking-row {
    padding: 18px 22px;
    gap: 18px;
    border-radius: 18px;
  }
  .ranking-page .ranking-row .pos { width: 34px; font-size: 16px; }
  .ranking-page .ranking-row .nick { font-size: 16px; }
  .ranking-page .ranking-row .pts { padding: 7px 15px; }
  .ranking-page .ranking-row .pts strong { font-size: 17px; }
}

@media (max-width: 480px) {
  .ranking-page .year-end-draw {
    gap: 16px;
    padding: 20px 16px;
    border-radius: 20px;
  }
  .ranking-page .year-end-draw__icon { flex-basis: 64px; min-height: 112px; }
  .ranking-page .year-end-draw__icon svg { width: 52px; height: 52px; }
  .ranking-page .year-end-draw h2 { font-size: clamp(15px, 4.5vw, 19px); }
  .ranking-page .year-end-draw__date { margin-bottom: 8px; font-size: clamp(20px, 6vw, 26px); }
  .ranking-page .year-end-draw__description { font-size: 13px; line-height: 1.45; }
}

@media (min-width: 1280px) {
  .ranking-page .app { max-width: 900px; }
}

/* =========================================================
   Pantalla de estadísticas en PC y notebook
   ========================================================= */
@media (min-width: 900px) {
  .stats-page .app { max-width: 980px; padding-top: 46px; }
  .stats-page .topbar { margin-bottom: 40px; }
  .stats-page .stats-heading h1 { font-size: clamp(34px, 3vw, 46px); }
  .stats-page .stats-heading p { font-size: 15px; }

  .stats-page .rank-cards-grid { gap: 22px; }
  .stats-page .rank-position-card { padding: 26px 28px; }
  .stats-page .rank-medal { width: 72px; height: 72px; font-size: 30px; }
  .stats-page .rank-number { font-size: 38px; }

  .stats-page .stats-charts-grid { gap: 26px; }
  .stats-page .stats-chart-card { padding: 32px; }
  .stats-page .donut { width: 240px; height: 240px; }
  .stats-page .donut::before { inset: 24px; }
  .stats-page .donut-center strong { font-size: 36px; }
}

@media (min-width: 1280px) {
  .stats-page .app { max-width: 1100px; }
}

/* ---------- Banner de inicio ---------- */
.hero-banner {
  margin: 0 0 22px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(27, 23, 18, .18);
  animation: rise-in .55s ease both;
}
.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
}
@media (min-width: 900px) {
  .home-page .hero-banner { margin-bottom: 32px; border-radius: 24px; }
}

/* ---------- Logo horizontal (sin círculo) ----------
   El logo es un wordmark ancho ("PREGUNTAS FÁCILES ¿?"): en un círculo
   con object-fit: cover se cortaba. Se muestra completo, con su proporción. */
.brand img.mark,
img.mark {
  width: auto;
  height: 40px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}

.login-card img.login-logo,
.login-card .login-logo {
  width: auto;
  height: 52px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}

.admin-brand-mark {
  width: auto;
  height: 34px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}

@media (max-width: 600px) {
  .brand img.mark,
  img.mark { height: 34px; }
}

/* =========================================================
   Inicio (invitados) — landing con héroe, Tomi y bloque de marcas
   Solo afecta a body.home-guest; la vista del jugador logueado no cambia.
   ========================================================= */
.home-guest { --ink-soft: rgba(244, 246, 242, .72); --brand-gray: .62; }

.landing { flex: 1; display: flex; flex-direction: column; width: 100%; }
.landing-inner { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.landing-header { padding: 18px 0 6px; }
.landing-header-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.landing .brand img.mark { height: 38px; }
.landing-nav { display: flex; align-items: center; gap: 22px; }
.nav-link { position: relative; padding: 6px 0; font: 500 16px/1 var(--font-body); color: var(--ink-soft); transition: color .2s ease; }
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--lime); }
.nav-link.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--lime); border-radius: 2px; }
.nav-cta {
  padding: 11px 18px; border: 1.5px solid var(--lime); border-radius: 999px;
  color: var(--lime); font: 600 14px/1 var(--font-body); white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.nav-cta:hover { background: var(--lime); color: #111713; }
.nav-home { display: none; }

/* ---------- Héroe ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 26px; padding-bottom: 0; }
.hero-left { display: contents; }
.hero-copy { order: 1; }
.hero-auth { order: 2; }
.hero-prize { order: 3; }
.prize-note { order: 4; }
.hero-photo { order: 5; }

.home-guest .gate-kicker { font-size: 12px; letter-spacing: .2em; }
.hero-copy h1 {
  margin: 14px 0 0; max-width: 11em;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 11vw, 48px); line-height: 1.02; letter-spacing: -.045em;
  color: #fff; text-wrap: balance;
}
.hero-sub { margin: 14px 0 0; color: var(--ink-soft); font-size: 17px; line-height: 1.5; }

.hero-auth .auth-card { max-width: none; margin: 0; padding: 10px; border-radius: 22px; }
.hero-auth .auth-tab { padding: 14px 8px; font-size: 15px; }
.hero-auth .auth-card form { gap: 12px; padding: 12px; }
.hero-auth .auth-hint { text-align: center; margin: 2px 0 2px; font-size: 12px; }
.hero-auth .btn-primary { padding: 17px 20px; font-size: 17px; font-weight: 600; font-family: var(--font-body); }

/* Cartel del sorteo */
.hero-prize {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 22px; border: 1px solid rgba(255, 255, 0, .38); border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 0, .07), rgba(255, 255, 0, .015));
}
.trophy { flex: none; width: 84px; height: 84px; filter: drop-shadow(0 6px 14px rgba(244, 180, 0, .35)); }
.prize-text { display: flex; flex-direction: column; padding-left: 20px; border-left: 1px solid rgba(255, 255, 0, .3); }
.prize-text strong { font: 800 26px/1.05 'Barlow Condensed', var(--font-display); text-transform: uppercase; color: var(--lime); letter-spacing: .01em; }
.prize-text .prize-date { color: #fff; font-size: 31px; }
.prize-text span { margin-top: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.prize-note { margin: -8px 0 0; color: var(--gray); font-size: 13px; }

/* Foto de Tomi: apoyada sobre la línea amarilla */
.hero-photo { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 330px; overflow: hidden; margin-top: 8px; }
.hero-photo::before {
  content: ''; position: absolute; inset: 10% -10% 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 255, 0, .2), transparent 62%);
}
.hero-photo img {
  position: relative; display: block; flex: none; max-width: none;
  height: 470px; width: auto; align-self: flex-start;
  filter: drop-shadow(0 0 22px rgba(255, 255, 0, .22));
}

/* ---------- Bloque de marcas ---------- */
.brand-band { border-top: 2px solid var(--lime); background: rgba(8, 12, 13, .72); }
.brand-band-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; padding-top: 38px; padding-bottom: 54px; }
.band-pitch h2 { margin: 0; font: 700 clamp(30px, 8vw, 40px)/1.04 var(--font-display); letter-spacing: -.04em; color: #fff; }
.band-pitch h2 span { color: var(--lime); }
.band-pitch p { margin: 14px 0 22px; max-width: 24em; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.band-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 15px 28px;
  border-radius: 14px; background: var(--lime); color: #111713;
  font: 700 18px/1 var(--font-body); box-shadow: 0 10px 28px rgba(255, 255, 0, .16);
  transition: transform .2s ease, filter .2s ease;
}
.band-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.band-pitch small { display: block; margin-top: 12px; color: var(--gray); font-size: 14px; }

.band-brands p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }
.brand-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brand-wall li { display: flex; align-items: center; justify-content: center; height: 80px; padding: 0 14px; }
.brand-wall li:nth-child(even) { border-left: 1px solid rgba(244, 246, 242, .12); }
/* Todos los logos entran en la misma caja (ancho y alto máximos iguales) y quedan centrados en su celda.
   Son PNG blancos con transparencia: la opacidad define el mismo gris para todos. */
.brand-wall img {
  display: block; width: auto; height: auto;
  max-width: min(100%, 132px); max-height: 50px; object-fit: contain;
  opacity: var(--brand-gray); transition: opacity .2s ease;
}
.brand-wall li:hover img { opacity: .95; }
/* El único logo extra-ancho (6:1) tiene una caja un poco más ancha para no verse diminuto */
.brand-wall img[data-b="sommier"] { max-width: min(100%, 150px); }

@media (max-width: 479px) {
  .landing-nav { gap: 14px; }
  .nav-cta { padding: 10px 14px; font-size: 13px; }
  .hide-sm { display: none; }
  .hero-prize { padding: 14px 16px; gap: 14px; }
  .trophy { width: 64px; height: 64px; }
  .prize-text { padding-left: 14px; }
  .prize-text strong { font-size: 22px; }
  .prize-text .prize-date { font-size: 26px; }
  .landing .brand img.mark { height: 32px; }
}

@media (min-width: 640px) {
}

@media (min-width: 640px) {
  .nav-home { display: inline-block; }
  .brand-wall { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .brand-wall li:nth-child(even) { border-left: 0; }
  .brand-wall li:not(:nth-child(5n+1)) { border-left: 1px solid rgba(244, 246, 242, .12); }
}

@media (min-width: 980px) {
  .landing-inner { padding: 0 36px; }
  .landing-header { padding: 26px 0 8px; }
  .landing .brand img.mark { height: 54px; }
  .landing-nav { gap: 34px; }
  .nav-link { font-size: 17px; }
  .nav-cta { padding: 14px 24px; font-size: 16px; }

  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .82fr) minmax(0, .94fr);
    column-gap: 18px; row-gap: 0; align-items: center;
    min-height: 600px; padding-top: 18px;
  }
  .hero-left { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding-bottom: 36px; position: relative; z-index: 2; }
  .hero-copy, .hero-prize, .prize-note, .hero-auth, .hero-photo { order: 0; }
  .hero-copy h1 { font-size: clamp(54px, 5.4vw, 74px); max-width: 8.5em; margin-top: 18px; }
  .hero-sub { font-size: 19px; margin-top: 18px; }
  .hero-prize { max-width: 450px; }
  .prize-note { margin: -14px 0 0; }

  .hero-photo { align-self: end; height: min(600px, 100%); margin: 0 -10px 0 -50px; overflow: visible; }
  .hero-photo img { height: 590px; align-self: flex-end; }
  .hero-photo::before { inset: 4% -20% 0; }

  .hero-auth { align-self: center; padding-bottom: 36px; position: relative; z-index: 2; }
  .hero-auth .auth-card { padding: 12px; }

  .brand-band-row { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); gap: 0; padding-top: 44px; padding-bottom: 60px; align-items: center; }
  .band-brands { padding-left: 34px; border-left: 1px solid rgba(244, 246, 242, .14); }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .hero-photo { margin: 0 -56px; }
  .hero-photo img { height: 540px; }
}

/* En landscape bajo o pantallas bajas el héroe no debe ser más alto que la ventana */
@media (min-width: 980px) and (max-height: 760px) {
  .hero { min-height: 520px; }
  .hero-photo img { height: 520px; }
}