/* ==========================================================================
   SIMULADOR — TEMA "OSCURO PULIDO" (estilo Apple TV)
   Capa que se carga después de styles.css. Negro profundo, materiales
   translúcidos grises, tipografía Inter apretada, botón primario blanco,
   tarjetas que "se elevan" al enfocarse. Sin brillos de color ni neón.
   La ficha coleccionable (#graduate-card) conserva su diseño propio.
   ========================================================================== */

:root {
  --font-title: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --bg-dark: #000000;
  --bg-surface: rgba(255, 255, 255, 0.06);
  --bg-card: #151517;
  --bg-card-hover: #1d1d20;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-bright: rgba(255, 255, 255, 0.22);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-card: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  --shadow-glow-school: none;

  --tv-glass: rgba(255, 255, 255, 0.12);
  --tv-glass-hover: rgba(255, 255, 255, 0.2);
  --tv-lift: 0 30px 60px -18px rgba(0, 0, 0, 0.95);
  --tv-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body {
  background: #000;
  color: var(--text-primary);
  font-family: var(--font-body);
  letter-spacing: -0.005em;
}
/* clip (en vez de hidden) evita el scroll lateral sin romper position: sticky */
html { overflow-x: visible; }
body { overflow-x: clip; }

/* Sin halos de color de fondo */
body::before { display: none; }

/* Tipografía única estilo Apple (excepto la ficha coleccionable) */
/* El Salón de la Fama usa la tipografía editorial de la portada (css/salon-fama.css) */
#app *:not(#graduate-card, #graduate-card *, #screen-rankings, #screen-rankings *) { font-family: var(--font-body); }

#app { max-width: 1240px; padding-inline: clamp(1rem, 3.5vw, 2.5rem); }

::selection { background: rgba(255, 255, 255, 0.9); color: #000; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  margin-inline: calc(clamp(1rem, 3.5vw, 2.5rem) * -1);
  padding: 0.85rem clamp(1rem, 3.5vw, 2.5rem);
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* El logo es un enlace a la portada */
.brand-badge { text-decoration: none; color: inherit; }
.brand-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}
.btn-hamburger {
  background: var(--tv-glass);
  border: 0;
  border-radius: 999px;
}
.btn-hamburger:hover { background: var(--tv-glass-hover); border: 0; }

/* Menú lateral: material translúcido */
.nav-dropdown-menu {
  background: rgba(28, 28, 30, 0.82) !important;
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px;
  box-shadow: var(--tv-lift) !important;
}
.dropdown-item { border-radius: 12px; }
.dropdown-item:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- Botones ---------- */
.btn-primary,
.tv-btn-play {
  background: #f5f5f7;
  color: #000;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: transform 0.25s var(--tv-ease), background-color 0.2s ease;
}
.btn-primary:hover:not(:disabled) { background: #fff; transform: scale(1.03); }
.btn-primary:disabled { background: rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.4); }

.btn-secondary,
.tv-btn-glass {
  background: var(--tv-glass);
  color: var(--text-primary);
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.25s var(--tv-ease), background-color 0.2s ease;
}
.btn-secondary:hover,
.tv-btn-glass:hover { background: var(--tv-glass-hover); transform: scale(1.03); }

/* ==========================================================================
   PANTALLA DE INICIO: billboard + estantes
   ========================================================================== */
.tv-intro {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  padding-bottom: 2rem;
}

.tv-billboard {
  position: relative;
  min-height: min(76vh, 720px);
  margin-inline: calc(clamp(1rem, 3.5vw, 2.5rem) * -1);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.tv-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.tv-art svg { width: 100%; height: 100%; display: block; }
/* Degradés para legibilidad (izquierda) y fundido al negro (abajo) */
.tv-billboard::before,
.tv-billboard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.tv-billboard::before { background: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.75) 32%, rgba(0, 0, 0, 0) 65%); }
.tv-billboard::after { background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.6) 18%, rgba(0, 0, 0, 0) 45%); }

.tv-billboard-content {
  width: 100%;
  max-width: 44rem;
  padding: 0 clamp(1rem, 3.5vw, 2.5rem) clamp(2rem, 5vw, 3.5rem);
  animation: tv-rise 0.9s var(--tv-ease) both;
}
@keyframes tv-rise { from { opacity: 0; transform: translateY(16px); } }

.tv-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.tv-title {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  color: #fff;
  text-wrap: balance;
}

.tv-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  margin: 1.1rem 0 0.9rem;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.tv-meta li + li::before { content: "·"; margin: 0 0.55rem; color: var(--text-muted); }
.tv-meta .tv-meta-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}
.tv-meta .tv-meta-badge::before { content: none; }
.tv-meta .tv-meta-badge { margin-left: 0.65rem; }

.tv-desc {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.5;
  color: #d2d2d7;
  max-width: 32rem;
}

.tv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}
.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  padding: 0 1.6rem;
  font-size: 1rem;
  cursor: pointer;
}
.tv-btn-play svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Estantes ---------- */
.tv-shelf-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tv-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.tv-row--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tv-row--episodes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tv-row--legends { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Tarjeta con "elevación" al enfocar (efecto foco de Apple TV) */
.tv-card,
.tv-episode,
.tv-legend {
  border-radius: 16px;
  transition: transform 0.4s var(--tv-ease), box-shadow 0.4s var(--tv-ease);
}

.tv-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 8;
  padding: 1.5rem;
  border: 0;
  overflow: hidden;
  text-align: left;
  color: #fff;
  cursor: pointer;
  isolation: isolate;
}
.tv-card:hover,
.tv-card:focus-visible { transform: scale(1.03); box-shadow: var(--tv-lift); }
.tv-card:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.tv-card--banda { background: linear-gradient(135deg, #ff9f43 0%, #e0561b 45%, #6b1d0e 100%); }
.tv-card--baile { background: linear-gradient(135deg, #c86dd7 0%, #7b2ff7 50%, #25115c 100%); }
.tv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 60%);
}

.tv-card-art {
  position: absolute;
  right: -2%;
  top: 50%;
  width: 46%;
  transform: translateY(-50%);
  z-index: -1;
  opacity: 0.9;
}
.tv-card-art svg {
  width: 100%;
  height: auto;
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tv-card-body { display: flex; flex-direction: column; gap: 0.2rem; max-width: 60%; }
.tv-card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.tv-card-title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.tv-card-desc { font-size: 0.9rem; color: rgba(255, 255, 255, 0.85); }

.tv-episode {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.35rem;
  background: var(--bg-card);
  min-height: 190px;
}
.tv-episode:hover { transform: scale(1.03); box-shadow: var(--tv-lift); background: var(--bg-card-hover); }
.tv-episode-num {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.22);
  margin-bottom: 1.6rem;
}
.tv-episode-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.015em; }
.tv-episode-desc { font-size: 0.86rem; line-height: 1.45; color: var(--text-secondary); }

.tv-legend {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.35rem;
  background: linear-gradient(160deg, #26262a 0%, #121214 70%);
}
.tv-legend:hover { transform: scale(1.03); box-shadow: var(--tv-lift); }
.tv-legend-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.4rem;
}
.tv-legend-pos { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.tv-legend-ovr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
}
.tv-legend-ovr small { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-secondary); margin-top: 0.3rem; }
.tv-legend-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.tv-legend-alias { font-size: 0.88rem; color: #d2d2d7; font-style: italic; }
.tv-legend-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ---------- Términos (plegable al pie del inicio) ---------- */
.tv-terms .terms-desplegable-container { margin-top: 0; max-width: none; width: 100%; }
.btn-terms-desplegable-trigger {
  background: var(--bg-card) !important;
  border: 0 !important;
  border-radius: 14px !important;
}
.terms-trigger-arrow {
  background: var(--tv-glass) !important;
  color: var(--text-primary) !important;
  border: 0 !important;
  border-radius: 8px !important;
}

/* Botón "Ingresar" y píldora de usuario del header */
.btn-global-nav-login,
.global-nav-user-pill {
  background: var(--tv-glass) !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  border-radius: 999px !important;
}
.btn-global-nav-login:hover,
.global-nav-user-pill:hover { background: var(--tv-glass-hover) !important; }

/* ==========================================================================
   PANTALLAS DEL JUEGO
   ========================================================================== */
.screen:not(#screen-intro) { padding-top: 1.5rem; }

/* La columna principal no debe empujar a la barra lateral fuera de pantalla */
@media (min-width: 901px) {
  .career-dashboard { grid-template-columns: minmax(0, 1fr) 300px; }
  .career-sidebar { top: 5rem; }
}
.sidebar-card {
  background: var(--bg-card) !important;
  border: 0 !important;
  box-shadow: var(--shadow-card) !important;
}

/* Paneles: superficie gris sólida, sin bordes de color ni halos */
.form-card,
.decision-card,
.career-table-card,
.outcome-feedback-card,
.status-banner,
.player-counters-row {
  background: var(--bg-card) !important;
  border: 0 !important;
  box-shadow: var(--shadow-card) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.decision-card::after { display: none; }
.decision-card { border-radius: 22px; }

.form-title,
.decision-title,
.outcome-title { font-weight: 800; letter-spacing: -0.035em; }
.form-title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.decision-title { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.08; }
.form-subtitle,
.decision-narrative { color: var(--text-secondary); }

.decision-category-tag {
  background: var(--tv-glass) !important;
  color: var(--text-primary) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 8px !important;
}

/* Pasos */
.step-dot {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: var(--text-secondary);
  box-shadow: none;
}
.step-dot.active,
.step-dot.completed { background: #f5f5f7; color: #000; box-shadow: none; }
.step-line { background: rgba(255, 255, 255, 0.1); }

/* Selector segmentado de rubro */
.rubros-tabs {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 0 !important;
  border-radius: 12px !important;
  padding: 4px !important;
}
.rubro-tab { border-radius: 9px; }
.rubro-tab.active { background: #f5f5f7; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }

/* Tarjetas seleccionables: elevación y anillo blanco al elegir */
.rol-card,
.colegio-card,
.option-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 16px;
  transition: transform 0.35s var(--tv-ease), box-shadow 0.35s var(--tv-ease), background-color 0.2s ease;
}
.rol-card::before,
.option-btn::before { display: none; }
.rol-card:hover,
.colegio-card:hover,
.option-btn:hover,
.option-btn:focus-visible {
  background: rgba(255, 255, 255, 0.09) !important;
  transform: scale(1.02);
  box-shadow: var(--tv-lift) !important;
}
.rol-card.selected,
.colegio-card.selected {
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 0 0 2px #f5f5f7, var(--tv-lift) !important;
}
.option-btn:active { transform: scale(0.99); }

/* Filtros tipo píldora */
.colegio-filter-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 0 !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}
.colegio-filter-pill.active { background: #f5f5f7 !important; color: #000 !important; }

/* Campos */
.search-input,
.text-input {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  color: var(--text-primary);
}
.search-input:focus,
.text-input:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55) !important; outline: none; }

/* Tablero: OVR y contadores sin neón */
.player-ovr-badge { box-shadow: none !important; }
.player-counter-label { color: var(--text-muted); }
.hero-pill {
  background: var(--tv-glass);
  color: var(--text-primary);
  border: 0;
  box-shadow: none;
  border-radius: 8px;
}

/* Modales: material translúcido */
.modal-overlay,
[class*="modal-overlay"] {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}


/* ==========================================================================
   BARRAS DE SCROLL
   ========================================================================== */
/* Oscuras en todo el simulador (antes la tabla del Salón mostraba una barra blanca nativa) */
#app, #app * { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; scrollbar-width: thin; }
#app ::-webkit-scrollbar { width: 8px; height: 8px; }
#app ::-webkit-scrollbar-track { background: transparent; }
#app ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 8px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .tv-row--episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .tv-billboard { min-height: 620px; }
  .tv-billboard::before { background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.85) 45%, rgba(0, 0, 0, 0.1) 80%); }
  .tv-actions .tv-btn { flex: 1 1 100%; }

  /* Estantes con scroll horizontal, como en la app */
  .tv-row--wide,
  .tv-row--episodes,
  .tv-row--legends {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(clamp(1rem, 3.5vw, 2.5rem) * -1);
    padding: 0.5rem clamp(1rem, 3.5vw, 2.5rem) 1.5rem;
    scrollbar-width: none;
  }
  .tv-row::-webkit-scrollbar { display: none; }
  .tv-row > * { flex: 0 0 78%; scroll-snap-align: start; }
  .tv-row--episodes > * { flex-basis: 64%; }
  .tv-card { aspect-ratio: 4 / 3; }
  .tv-card-body { max-width: 75%; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-billboard-content { animation: none; }
  .tv-card, .tv-episode, .tv-legend, .rol-card, .colegio-card, .option-btn { transition: none; }
}

/* ---------- Anuncio del premio al N°1 (portada) ---------- */
.tv-prize {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.06));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.45);
  color: #f5f5f7;
  font: 500 0.9rem/1.35 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}
.tv-prize strong { color: #fbbf24; font-weight: 700; }
.tv-prize:hover { transform: scale(1.02); background-color: rgba(251, 191, 36, 0.12); }
.tv-prize:focus-visible { outline: 2px solid #fbbf24; outline-offset: 3px; }
.tv-prize-icon { font-size: 1.15rem; line-height: 1; }
@media (max-width: 640px) { .tv-prize { border-radius: 16px; } }
