/*
 * D-UI-SELECCION — pantalla de selección de héroe: estandartes (estilo B de la maqueta
 * claude/maquetas/seleccion_creacion.html) con el fondo y la paleta cálida compartidos con la creación.
 * Mesa claude/_CLAUDE_D_UI_SELECCION_MESA.md. Pantalla fija: nada se desplaza a 1920×1080 ni a 1366×768.
 *
 * Trampas: v2-theme fuerza la tipografía con `* { … !important }` (P-UI-13), así que las fuentes van con
 * !important; y style_v0.8.9.css anima en escalera los hijos de #heroChoice (se anula abajo).
 */

#heroChoice.sel-pantalla {
  position: fixed; inset: 0; z-index: 20; overflow: hidden; margin: 0; padding: 0; max-width: none; width: auto;
  background: #070503; color: var(--ui-tinta-1); border: 0; border-radius: 0; box-shadow: none;
}
#heroChoice.sel-pantalla.hidden { display: none; }
#heroChoice.sel-pantalla > * { animation: none !important; opacity: 1 !important; transform: none; }

/* ── Fondo cálido compartido (A) y rayos de oro ── */
#heroChoice .sel-fondo { position: absolute; inset: -24px; background: url('../assets/backgrounds/fondo.png') center 30% / cover;
  filter: blur(4px) brightness(.4) sepia(.45) saturate(1.25); }
#heroChoice .sel-velo { position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(90,58,14,.25), rgba(4,3,2,.88) 70%),
              linear-gradient(180deg, rgba(4,3,2,.5) 0%, transparent 30%, rgba(4,3,2,.9) 82%, #040302 100%); }
#heroChoice .sel-rayos { position: absolute; left: 50%; top: -220px; width: 1700px; height: 1300px; transform: translateX(-50%); opacity: .55; pointer-events: none;
  background: repeating-conic-gradient(from 180deg at 50% 0%, rgba(255,214,140,.12) 0deg 3deg, transparent 3deg 11deg);
  -webkit-mask: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 68%); mask: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 68%);
  animation: sel-girar 70s linear infinite; }
@keyframes sel-girar { to { transform: translateX(-50%) rotate(6deg); } }
#heroChoice .sel-polvo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── Cabecera ── */
#heroChoice .sel-cabecera { position: absolute; top: 3.2vh; left: 4vw; right: 4vw; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; z-index: 2; }
#heroChoice .sel-titulo { margin: 0; font-family: 'Cinzel', serif !important; font-weight: 700; font-size: clamp(28px, 2.4vw, 46px); letter-spacing: .1em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff3c4, #e0b252 55%, #9a6a1c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(233,196,106,.35)) drop-shadow(0 2px 0 #000); }
#heroChoice .sel-avisos { text-align: right; }
#heroChoice .sel-aviso { margin: 2px 0; font-size: 13px; color: #c9b48c; letter-spacing: .06em; }

/* ── Fila de estandartes ── */
#heroChoice .sel-fila { position: absolute; left: 4vw; right: 4vw; top: 14vh; height: 60vh; display: flex; gap: 1.4vw; justify-content: center; align-items: flex-end; z-index: 2; }
#heroChoice .sel-estandartes { display: flex; gap: 1.4vw; align-items: flex-end; height: 100%; }
#heroChoice .sel-estandarte { position: relative; width: clamp(200px, 15.5vw, 300px); height: 88%; cursor: pointer; transition: transform .35s, filter .35s; filter: brightness(.6) saturate(.7); outline: none; }
#heroChoice .sel-estandarte:hover { filter: brightness(.85) saturate(.9); }
#heroChoice .sel-estandarte--elegido { transform: translateY(-5%) scale(1.06); filter: none; z-index: 2; }
#heroChoice .sel-estandarte--elegido:hover { filter: none; }
#heroChoice .sel-estandarte:focus-visible .sel-estandarte__borde { box-shadow: 0 0 0 3px #fff3c4; }
#heroChoice .sel-estandarte__tela { position: absolute; inset: 0; overflow: hidden; clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
  background: linear-gradient(180deg, var(--sel-c1), var(--sel-c2)); }
#heroChoice .sel-estandarte__tela::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.1), transparent 30%, rgba(0,0,0,.55)); }
#heroChoice .sel-estandarte__figura { position: absolute; left: 50%; bottom: 10%; height: 80%; max-width: none; transform: translateX(-50%); filter: drop-shadow(0 10px 18px rgba(0,0,0,.7)); }
#heroChoice .sel-estandarte__borde { position: absolute; inset: -3px; z-index: -1; clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
  background: linear-gradient(135deg, #fff3c4, #c8963a 30%, #6b4a14 50%, #e9c46a 70%, #fff3c4); background-size: 300% 300%; animation: sel-oro 6s linear infinite; }
@keyframes sel-oro { to { background-position: 300% 0; } }
#heroChoice .sel-estandarte--elegido .sel-estandarte__borde { inset: -5px; filter: drop-shadow(0 0 18px rgba(233,196,106,.9)); }
#heroChoice .sel-estandarte__barra { position: absolute; left: -14px; right: -14px; top: -12px; height: 18px; border-radius: 9px; z-index: 3;
  background: linear-gradient(180deg, #ffe7a1, #9a6a1c); box-shadow: 0 3px 8px rgba(0,0,0,.7); }
#heroChoice .sel-estandarte__barra::before, #heroChoice .sel-estandarte__barra::after { content: ''; position: absolute; top: -4px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3c4, #b07d26 70%); }
#heroChoice .sel-estandarte__barra::before { left: -8px; }
#heroChoice .sel-estandarte__barra::after { right: -8px; }
#heroChoice .sel-estandarte__placa { position: absolute; left: 12px; right: 12px; top: 26px; text-align: center; z-index: 3; }
#heroChoice .sel-estandarte__nombre { font-family: 'Cinzel', serif !important; font-weight: 700; font-size: clamp(16px, 1.15vw, 22px); color: #fff; letter-spacing: .06em;
  text-shadow: 0 2px 6px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#heroChoice .sel-estandarte__sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #f1e3c4; text-shadow: 0 1px 4px #000; margin-top: 4px; }
#heroChoice .sel-estandarte__ultima { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); z-index: 3; white-space: nowrap; font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: #9be7b4; background: rgba(4,10,6,.7); border: 1px solid rgba(155,231,180,.4); border-radius: 99px; padding: 3px 10px; }
#heroChoice .sel-estandarte__papelera { position: absolute; top: 104px; right: 14px; z-index: 4; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(242,107,91,.6); background: rgba(20,6,6,.75); color: #f3b3ab; font-size: 16px; touch-action: manipulation; }
#heroChoice .sel-estandarte__papelera:hover { border-color: #f26b5b; box-shadow: 0 0 12px rgba(242,107,91,.45); }

/* «+ Nuevo héroe» (el botón fijo #createNewHeroBtn) */
#heroChoice .sel-nuevo { width: clamp(170px, 12vw, 230px); height: 76%; border: 2px dashed rgba(200,168,96,.55); border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(12,9,5,.45);
  color: #e9c46a; font-family: 'Cinzel', serif !important; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
#heroChoice .sel-nuevo:hover { border-color: #ffe7a1; color: #fff3c4; background: rgba(40,28,10,.5); }
#heroChoice .sel-nuevo__mas { width: 84px; height: 84px; border-radius: 50%; border: 2px solid #e9c46a; display: flex; align-items: center; justify-content: center; font-size: 46px;
  box-shadow: 0 0 24px rgba(233,196,106,.45); animation: sel-latido 2.4s ease-in-out infinite; }
@keyframes sel-latido { 50% { box-shadow: 0 0 42px rgba(233,196,106,.85); } }

/* ── Páginas ── */
#heroChoice .sel-paginas { position: absolute; left: 0; right: 0; top: 75vh; display: flex; justify-content: center; align-items: center; gap: 14px; z-index: 2;
  color: #c9b48c; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
#heroChoice .sel-paginas:empty { display: none; }
#heroChoice .sel-paginas__flecha { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c8963a; background: rgba(12,9,5,.75); color: #ffe7a1; cursor: pointer; font-size: 18px; }
#heroChoice .sel-paginas__flecha:disabled { opacity: .35; cursor: default; }

/* ── Cinta: información y «Entrar al mundo» ── */
#heroChoice .sel-cinta { position: absolute; left: 4vw; right: 4vw; bottom: 9vh; display: flex; align-items: center; justify-content: center; gap: 3vw; z-index: 2; }
#heroChoice .sel-cinta__info { width: min(640px, 42vw); padding: 16px 24px; background: rgba(12,9,5,.85); }
#heroChoice .sel-cinta__linea { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 15px; color: #d9c9a6; }
#heroChoice .sel-cinta__linea b { color: #fff3c4; font-weight: 600; }
#heroChoice .sel-cinta__grupo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: #c9b48c; }
#heroChoice .sel-cinta__rotulo { letter-spacing: .14em; text-transform: uppercase; font-size: 11px; color: #9a8662; margin-right: 4px; }
#heroChoice .sel-cinta__companero { padding: 3px 10px; border-radius: 99px; border: 1px solid rgba(200,168,96,.4); background: rgba(40,30,14,.5); color: #f1e3c4; }
#heroChoice .sel-cinta__vacio { font-style: italic; }
#heroChoice .sel-entrar { position: relative; overflow: hidden; cursor: pointer; border: 1px solid #e9c46a; border-radius: 50px; padding: 22px 64px;
  font-family: 'Cinzel', serif !important; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: clamp(16px, 1.15vw, 22px); color: #1b1406;
  background: linear-gradient(180deg, #ffe7a1 0%, #e0b252 45%, #b07d26 100%);
  box-shadow: 0 0 0 1px #5a3f10 inset, 0 0 26px rgba(233,196,106,.5), 0 8px 18px rgba(0,0,0,.6); }
#heroChoice .sel-entrar::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: sel-barrido 3.6s ease-in-out infinite; }
@keyframes sel-barrido { 0%, 55% { left: -60%; } 100% { left: 140%; } }
#heroChoice .sel-entrar:disabled { filter: grayscale(.8) brightness(.55); cursor: default; }
#heroChoice .sel-entrar:disabled::after { display: none; }

/* ── Pie: descargas y cerrar sesión ── */
#heroChoice .sel-pie { position: absolute; left: 4vw; right: 4vw; bottom: 2.6vh; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; z-index: 2; }
#heroChoice .sel-descargas h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #c9b48c; }
#heroChoice .sel-descargas__enlaces { display: flex; gap: 8px; }
#heroChoice .sel-descargas a { font-size: 12px; padding: 5px 10px; border-radius: 4px; border: 1px solid rgba(200,168,96,.45); color: #f1e3c4; text-decoration: none; background: rgba(12,9,5,.6); }
#heroChoice .sel-salir { margin-left: auto; cursor: pointer; border-radius: 5px; padding: 9px 18px; background: rgba(10,8,5,.75); color: #d9c9a6;
  border: 1px solid rgba(200,168,96,.45); font-family: 'Cinzel', serif !important; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
#heroChoice .sel-salir:hover { border-color: #e9c46a; color: #ffe7a1; }

/* ── Efectos reducidos ── */
body.ui-efectos-reducidos #heroChoice .sel-rayos,
body.ui-efectos-reducidos #heroChoice .sel-polvo { display: none; }
body.ui-efectos-reducidos #heroChoice .sel-estandarte__borde,
body.ui-efectos-reducidos #heroChoice .sel-entrar::after,
body.ui-efectos-reducidos #heroChoice .sel-nuevo__mas { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #heroChoice .sel-rayos, #heroChoice .sel-estandarte__borde, #heroChoice .sel-entrar::after, #heroChoice .sel-nuevo__mas { animation: none; }
}

/* ── Móvil (sólo tiene que seguir siendo usable): estandartes en fila con desplazamiento lateral ── */
@media (max-width: 760px) {
  #heroChoice .sel-fila { top: 12vh; height: 52vh; justify-content: flex-start; overflow-x: auto; }
  #heroChoice .sel-estandarte { width: 46vw; }
  #heroChoice .sel-cinta { flex-direction: column; bottom: 9vh; gap: 12px; }
  #heroChoice .sel-cinta__info { width: 100%; }
  #heroChoice .sel-entrar { padding: 16px 36px; }
}
