/* Estilo 2D (F5): HUD y ventanas modernos y planos, a juego con el pixel art (paneles azul noche, bordes finos).
   Se carga después de los estilos del 3D y solo pisa lo visual. */
:root { --fTit: 'Pixelify Sans', system-ui, sans-serif; --ui: 1; --oro: #d6b25a; --oroC: #f0dc9a; --hierro: #141a2c; --hierroC: #2c3450; --panel: rgba(14, 16, 28, .9); --borde: rgba(255, 255, 255, .09); }
body { background: #141a2c; }
#lienzo2d { display: block; }

/* Ventanas */
.ventana { background: #141a2c; border: 1px solid #2c3450; border-radius: 12px; box-shadow: 0 12px 40px #0008; }
.ventana h2, .ventana h3 { font-family: system-ui, -apple-system, Segoe UI, sans-serif; letter-spacing: .2px; }
.b, button.b { border-radius: 8px; }
.celda { border-radius: 6px; background: #1c2236 !important; position: relative; }
.celda .simb { position: absolute; top: 1px; left: 3px; font-size: 11px; text-shadow: 0 1px 2px #000; }
.tarjeta { background: #181e30 !important; border-radius: 10px; }
.opcion select { background: #1c2236; color: #e6e8f0; border: 1px solid #2c3450; border-radius: 6px; }

/* HUD: orbes planos, barra de habilidades en panel */

/* Escala de la interfaz: crece con la pantalla (J.motor.aplicarTexto pone --ui = automático × Tamaño del texto).
   No se escala lo que va pegado al mouse o al mundo (#tip, #tipObj, #numeros) ni los controles táctiles. */
.ventana, #prompt, #aviso, #panel, #pruebas, #admin, #desafioT, #ayuda, #asRacha, #seleccion > * { zoom: var(--ui); }

/* Tipografía: títulos y números con letra pixelada; el texto largo sigue en sans para leerse bien */
.num { font-family: var(--fTit) !important; font-weight: 700 !important; letter-spacing: .5px; text-shadow: 0 2px 0 #0a0c18, 1px 0 0 #0a0c18, -1px 0 0 #0a0c18, 0 -1px 0 #0a0c18 !important; }
.ventana header h2, #panel h2, #seleccion h1 { color: #f0dc9a !important; letter-spacing: .5px; }

/* Ventanas y paneles: sin el marco de metal del 3D */
.ventana, #panel .caja { background: #141a2c !important; box-shadow: 0 0 0 1px #2c3450, 0 14px 40px #000a !important; border: 0 !important; border-radius: 12px !important; }
.ventana .b.on, .tabs .b.on { border-color: #d6b25a !important; background: #2a2a2a00 !important; color: #f0dc9a !important; box-shadow: inset 0 -2px 0 #d6b25a; }

/* Pantalla de inicio y de creación */
#seleccion button.on { border-color: #d6b25a !important; color: #f0dc9a !important; box-shadow: inset 0 -2px 0 #d6b25a; }
#seVista { display: block; margin: 0 auto 6px; image-rendering: pixelated; }
#seleccion { background: radial-gradient(ellipse at 50% 35%, #263052, #141a2c 65%, #0c1020) !important; }
#seleccion .ranura { background: #181e30 !important; border: 1px solid #2c3450 !important; border-radius: 12px !important; box-shadow: 0 8px 24px #0006; }
#seleccion .principal, button.principal { background: #d6b25a !important; color: #1a1408 !important; border: 0 !important; border-radius: 8px !important; font-weight: 600; }
#seleccion input, #seleccion button:not(.principal) { background: #1c2236; color: #e6e8f0; border: 1px solid #2c3450; border-radius: 8px; }

.seMini { display: block; margin: 0 auto 4px; image-rendering: pixelated; }
/* En la pantalla de personajes no van los botones del juego */

/* ===== Celular: vertical y horizontal ===== */
/* Pantalla de personajes: con scroll y compacta cuando falta alto o ancho */
#seleccion { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(12px, env(safe-area-inset-top)) 10px 16px; place-items: start center !important; }
#seleccion > .caja { margin: auto 0; }
@media (max-height: 560px) {
  #seleccion h1 { font-size: 20px !important; margin: 0 0 6px !important; } #seleccion h3 { margin: 6px 0 4px !important; }
  #seleccion .caja:has(#seVista) { display: grid; grid-template-columns: 150px 1fr; column-gap: 14px; align-items: start; }
  #seleccion .caja:has(#seVista) > h1 { grid-column: 1 / -1; }
  #seleccion .caja:has(#seVista) > #seVista { grid-row: 2 / span 8; width: 140px; height: auto; margin: 0; }
  #seleccion .caja:has(#seVista) > :not(h1):not(#seVista) { grid-column: 2; }
  #seleccion .chk { margin-top: 6px !important; } #seleccion .botones { margin-top: 8px !important; } #seleccion .tenue { font-size: 11px; margin: 4px 0; }
  #seleccion .ranura { min-height: 0 !important; padding: 8px !important; gap: 3px !important; } #seleccion .seMini { width: 56px; height: auto; }
}
@media (max-width: 620px) {
  #seleccion .ranuras { grid-template-columns: 1fr !important; }
  #seleccion .ranura { display: grid !important; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
  #seleccion .ranura > :not(.seMini) { grid-column: 2; } #seleccion .ranura > .seMini { grid-row: 1 / span 6; width: 64px; height: auto; }
  #seleccion .ranura.vacia { display: flex !important; }
  #seleccion .clases { display: flex; flex-wrap: wrap; gap: 6px; } #seleccion input#seNombre { width: 60%; }
  #seVista { width: 160px; height: auto; }
}
/* Inventario y ventanas anchas en pantallas angostas */
@media (max-width: 900px) {
  .invCols { grid-template-columns: 210px 1fr !important; gap: 10px !important; } #invDet { grid-column: 1 / -1; }
  .arbolHab { grid-template-columns: 1fr !important; } .talBarra { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .invCols { grid-template-columns: 1fr !important; } .invCols > section { min-width: 0; }
  .grilla { grid-template-columns: repeat(auto-fill, 46px) !important; } .bolsaGemas { grid-template-columns: repeat(auto-fill, 46px) !important; }
  .ascGrid, .pasivas, .logros, .asGrid { grid-template-columns: 1fr 1fr !important; } .equipo { grid-template-columns: repeat(2, 1fr) !important; }
}
/* Celular en horizontal: la info del piso bajo la fila de botones, el minimapa debajo */
/* Juego en vertical (celular): controles más chicos para que no se pisen; orbes arriba a la izquierda */
@media (orientation: portrait) {
  body.movil #inv .ventana, body.movil #tal .ventana { zoom: .86; }
  body.movil .ventana { width: 98vw !important; max-height: 86vh; padding: 8px !important; }
}
