/* ============================================================================
   PROJECT OHANA — Sistema de Diseño Premium
   Versión: 2.0 | Optimizado para 60fps | PWA-ready
   ============================================================================ */

/* ─── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Paleta principal */
  --color-bg: #05070d;
  --color-bg-elevated: #0a1220;
  --color-bg-overlay: rgba(7, 16, 30, 0.85);
  
  /* Acentos */
  --accent-cyan: #7ee7ff;
  --accent-pink: #ff6aa8;
  --accent-gold: #ffe66a;
  --accent-lime: #5ecf6a;
  --accent-coral: #ff8a5c;
  
  /* Estados */
  --state-success: #2ec9c0;
  --state-warning: #ffb14a;
  --state-danger: #ff3860;
  --state-info: #5ad0ff;
  
  /* Texto */
  --text-primary: #f4f8ff;
  --text-secondary: #b8cbe0;
  --text-muted: #6e889c;
  
  /* Superficies */
  --surface-glass: rgba(7, 10, 18, 0.72);
  --surface-glass-hover: rgba(12, 20, 35, 0.82);
  --border-subtle: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(126, 231, 255, 0.35);
  
  /* Tipografía */
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radios */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(126, 231, 255, 0.3);
  --shadow-glow-pink: 0 0 30px rgba(255, 106, 168, 0.3);
  --shadow-glow-gold: 0 0 30px rgba(255, 230, 106, 0.3);
  
  /* Transiciones */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-index scale */
  --z-bg: 0;
  --z-game: 1;
  --z-fx: 5;
  --z-ui: 10;
  --z-hud: 20;
  --z-modal: 40;
  --z-intro: 60;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--color-bg);
  overflow: hidden;
  min-height: 100vh;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Utilidades ─────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*/* ─── Fondo Oceánico ─────────────────────────────────────────────────────── */
#ocean-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
  background: 
    radial-gradient(900px 380px at 50% -8%, rgba(90, 160, 255, 0.28), transparent 55%),
    linear-gradient(180deg, #071226 0%, #0a1830 48%, #071018 100%);
  contain: strict;
}

/* Estrellas con parallax */
.stars {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 12% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 42%, #cfe, transparent),
    radial-gradient(2px 2px at 46% 12%, #fff, transparent),
    radial-gradient(1px 1px at 62% 28%, #def, transparent),
    radial-gradient(2px 2px at 78% 16%, #fff, transparent),
    radial-gradient(1px 1px at 88% 38%, #cef, transparent),
    radial-gradient(1.5px 1.5px at 18% 68%, #fff, transparent),
    radial-gradient(1px 1px at 70% 62%, #fff, transparent);
  opacity: 0.55;
  animation: twinkle 4.8s ease-in-out infinite;
  will-change: opacity;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Aurora boreal */
.aurora {
  position: absolute;
  inset: 8% 10% auto;
  height: 28%;
  background: radial-gradient(ellipse at center, rgba(80, 220, 200, 0.18), transparent 70%);
  filter: blur(20px);
  animation: aurora-shift 12s ease-in-out infinite;
  will-change: transform;
}

@keyframes aurora-shift {
  0%, 100% { transform: translateX(-5%) scaleX(0.95); }
  50% { transform: translateX(5%) scaleX(1.05); }
}

/* Glow oceánico */
.ocean-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(20, 80, 120, 0.35));
  pointer-events: none;
}

/* Ondas SVG */
.wave-layer {
  position: absolute;
  left: -5%;
  width: 110%;
  bottom: -2px;
  height: 160px;
  fill: #0b2a3c;
  opacity: 0.55;
  will-change: transform;
}

.wave-front {
  fill: #0e3a4e;
  opacity: 0.7;
  height: 120px;
  animation: drift 14s linear infinite;
}

.wave-back {
  animation: drift 22s linear infinite reverse;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-80px); }
}

/* ─── Canvas del Juego ──────────────────────────────────────────────────── */
#game {
  position: fixed;
  inset: 0;
  z-index: var(--z-game);
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  image-rendering: auto;
}

/* ─── HUD ───────────────────────────────────────────────────────────────── */
#hud {
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  pointer-events: none;
  z-index: var(--z-hud);
}

body:not(.playing) #hud {
  display: none;
}

.hud-block {
  min-width: 240px;
  max-width: 340px;
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  backdrop-filter: blur(16px) saturate(180%);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hud-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hud-block.right {
  text-align: right;
}

/* Identificación del jugador */
.hud-ident {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.hud-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  position: relative;
  overflow: hidden;
}

.hud-avatar::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--color-bg-elevated);
  border-radius: calc(var(--radius-md) - 2px);
}

.hud-info {
  flex: 1;
}

.hud-kicker {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.hud-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Barras de estado */
.bars-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.bar-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 24px;
}

.bar {
  flex: 1;
  height: 10px;
  background: #10141c;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid #2c3344;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base), box-shadow var(--transition-base);
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.bar.hp .bar-fill {
  background: linear-gradient(90deg, var(--state-danger), var(--state-warning));
  box-shadow: 0 0 12px rgba(255, 56, 96, 0.4);
}

.bar.xp .bar-fill {
  background: linear-gradient(90deg, var(--state-info), #7a6bff);
  box-shadow: 0 0 10px rgba(90, 208, 255, 0.4);
}

.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Meta información */
.hud-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.hud-meta .level {
  color: var(--accent-gold);
  font-weight: 600;
}

.hud-meta .separator {
  color: var(--text-muted);
}

/* Panel derecho - Mundo */
.world-header {
  margin-bottom: var(--space-sm);
}

.world-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(126, 231, 255, 0.3);
}

/* Display de evolución */
.evo-display {
  margin: var(--space-sm) 0;
}

.evo-text {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.form-pips {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.pip.active {
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  transform: scale(1.2);
}

.pip.active ~ .pip {
  background: rgba(255, 255, 255, 0.08);
}

/* Combo y Score */
.combo-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
  font-size: 12px;
  color: var(--text-secondary);
}

.combo-count {
  color: var(--accent-gold);
  font-weight: 600;
}

#combo-num {
  font-family: var(--font-display);
  font-size: 14px;
}

/* ─── Acciones Superiores ───────────────────────────────────────────────── */
#top-actions {
  position: fixed;
  top: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: var(--space-sm);
  z-index: calc(var(--z-hud) + 1);
}

body.playing #top-actions {
  display: flex;
}

#top-actions button {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  color: var(--text-primary);
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

#top-actions button:hover {
  background: var(--surface-glass-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

#top-actions button:active {
  transform: translateY(0);
}

#top-actions button[aria-pressed="true"] {
  background: rgba(126, 231, 255, 0.15);
  border-color: var(--accent-cyan);
}

/* ─── Jefe ──────────────────────────────────────────────────────────────── */
#boss-wrap {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 56vw);
  z-index: var(--z-hud);
  pointer-events: none;
  text-align: center;
}

#boss-wrap.hidden {
  display: none;
}

.boss-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.boss-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 10px rgba(255, 100, 100, 0.5));
  animation: boss-pulse 2s ease-in-out infinite;
}

@keyframes boss-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.boss-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: #ff8aa0;
  text-shadow: 0 0 20px rgba(255, 100, 100, 0.5);
}

.bar.boss {
  height: 14px;
  border-color: #6a2030;
  background: #14080c;
}

.bar.boss .bar-fill {
  background: linear-gradient(90deg, #ff2d55, #ff8a3d);
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.4);
  animation: boss-health-pulse 1.5s ease-in-out infinite;
}

@keyframes boss-health-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ─── Combo Chip ───────────────────────────────────────────────────────── */
#combo-chip {
  position: fixed;
  top: 118px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  min-width: 72px;
  padding: var(--space-xs) var(--space-md);
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-gold);
  text-shadow: 
    0 2px 0 #120800, 
    0 0 14px rgba(0,0,0,0.85), 
    0 8px 24px rgba(255, 210, 80, 0.45);
  background: linear-gradient(180deg, rgba(8,12,20,0.72), rgba(8,12,20,0.45));
  border: 1px solid rgba(255,230,106,0.35);
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
  z-index: var(--z-ui);
  pointer-events: none;
  opacity: 0;
  transition: all var(--transition-bounce);
}

#combo-chip.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
#combo-chip.show .combo-value {
  display: inline-block;
  animation: combo-pop 0.28s ease;
}

.combo-value {
  display: inline-block;
  animation: combo-pop 0.3s var(--transition-bounce);
}

@keyframes combo-pop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
/* ─── Prompt ────────────────────────────────────────────────────────────── */
#prompt {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  z-index: var(--z-ui);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

#prompt.show { opacity: 1; }

.prompt-icon {
  color: var(--accent-cyan);
  animation: prompt-blink 1.5s ease-in-out infinite;
}

@keyframes prompt-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
/* ─── Prompt ────────────────────────────────────────────────────────────── */
#prompt {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  z-index: var(--z-ui);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

#prompt.show {
  opacity: 1;
}

.prompt-icon {
  color: var(--accent-cyan);
  animation: prompt-blink 1.5s ease-in-out infinite;
}

@keyframes prompt-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── Barra de Habilidades ─────────────────────────────────────────────── */
#ability-bar {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: var(--space-md);
  z-index: var(--z-hud);
}

body.playing #ability-bar {
  display: flex;
}

.ability-slot {
  min-width: 148px;
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  font-size: 12px;
  backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.ability-slot:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.hud-trait {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #ffe08a;
  opacity: 0.9;
}

.ability-slot .key {
  opacity: 0.78;
  font-weight: 700;
  color: var(--accent-cyan);
}

.ability-slot .name {
  display: block;
  margin-top: 2px;
  font-weight: 600;
}

.ability-slot .cd {
  height: 4px;
  background: #151820;
  margin-top: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.ability-slot .cd-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--abil, var(--accent-cyan)), #fff);
  transition: width 0.1s linear;
}

.ability-slot .cd-sec {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #ffe08a;
}

.ability-slot.cooling {
  filter: saturate(0.7);
}

/* ─── Menú Principal ───────────────────────────────────────────────────── */
#char-select {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(6px, 1.4vh, 14px);
  padding: clamp(56px, 6vh, 72px) var(--space-md) var(--space-md);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(1200px 520px at 50% -8%, rgba(70, 150, 255, 0.38), transparent 58%),
    radial-gradient(700px 420px at 8% 108%, rgba(255, 90, 150, 0.22), transparent 52%),
    radial-gradient(640px 360px at 92% 100%, rgba(40, 210, 180, 0.16), transparent 50%),
    linear-gradient(180deg, #071226 0%, #0a1730 46%, #08111d 100%);
}

#char-select.hidden {
  display: none;
}

/* Barra de marca */
.brand-bar {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.brand-bar a {
  color: #9ad7ff;
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  transition: all var(--transition-fast);
  position: relative;
}

.brand-bar a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-cyan);
  transition: width var(--transition-fast);
}

.brand-bar a:hover {
  color: var(--accent-cyan);
  opacity: 1;
}

.brand-bar a:hover::after {
  width: 100%;
}

.brand-gb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid #eef6ff;
  border-radius: 4px;
  color: #eef6ff !important;
  letter-spacing: 0.04em !important;
  font-weight: 800 !important;
  transition: all var(--transition-fast);
}

.brand-gb:hover {
  background: var(--accent-cyan);
  color: #071018 !important;
  border-color: var(--accent-cyan);
}

/* Escenario del título */
.title-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#title-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.title-palm {
  position: absolute;
  bottom: -40px;
  width: 240px;
  height: 360px;
  background:
    radial-gradient(130px 90px at 50% 16%, rgba(18, 46, 38, 0.92), transparent 72%),
    linear-gradient(180deg, transparent 20%, rgba(5, 16, 14, 0.96) 21%, rgba(5, 16, 14, 0.96) 100%);
  opacity: 0.5;
  filter: blur(0.3px);
}

.title-palm.left {
  left: -60px;
  transform: rotate(-8deg);
}

.title-palm.right {
  right: -70px;
  transform: scaleX(-1) rotate(-6deg);
}

.title-haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, rgba(7, 18, 26, 0.8));
}

/* Logo y título */
.title-stack {
  position: relative;
  text-align: center;
  z-index: 2;
  animation: title-rise 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) 0s both;
}

@keyframes title-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(9px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.logo-mark {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-sm);
  display: grid;
  place-items: center;
}

.logo-mark::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126,231,255,0.35), transparent 70%);
  animation: logo-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 1; }
}

.crest {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,244,190,0.95), rgba(255,196,90,0.35) 55%, transparent 70%),
    conic-gradient(from 0deg, rgba(126,231,255,0.55), rgba(255,214,120,0.55), rgba(255,120,180,0.55), rgba(126,231,255,0.55));
  box-shadow: 
    0 0 0 1.5px rgba(255,255,255,0.18) inset, 
    0 0 34px rgba(126,231,255,0.4), 
    0 0 60px rgba(255,200,120,0.22);
  animation: crest-spin 18s linear infinite;
}

@keyframes crest-spin {
  to { transform: rotate(360deg); }
}

.crest-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #0a1a2a, #071224 70%);
}

/* Título principal */
#char-select h1 {
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 0.9;
  text-shadow: 0 16px 60px rgba(70, 170, 255, 0.45);
}

#char-select h1 .project {
  font-size: clamp(15px, 2.6vw, 24px);
  font-weight: 600;
  letter-spacing: 0.58em;
  text-indent: 0.58em;
  text-transform: uppercase;
  color: #bfe0ff;
  animation: text-shine 3s ease-in-out infinite;
}

@keyframes text-shine {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

#char-select h1 .ohana {
  font-size: clamp(52px, 12vw, 118px);
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold) 55%, var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 24px rgba(126, 231, 255, 0.25));
  animation: shine-word 5s ease-in-out infinite, logo-rise 1.1s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}

@keyframes shine-word {
  0%, 100% { filter: brightness(1) drop-shadow(0 8px 24px rgba(126, 231, 255, 0.25)); }
  50% { filter: brightness(1.25) drop-shadow(0 12px 36px rgba(126, 231, 255, 0.4)); }
}

@keyframes logo-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(1.06);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #9ad7ff;
  margin-bottom: var(--space-sm);
}

.tagline {
  margin-top: var(--space-xs);
  max-width: 640px;
  color: #c9d7e8;
  font-size: 16px;
  line-height: 1.45;
}

.title-badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-sm);
}

.title-badges span {
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfe8ff;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: rgba(10, 20, 34, 0.5);
  border: 1px solid rgba(126, 231, 255, 0.28);
  position: relative;
  padding-left: 22px;
  transition: all var(--transition-fast);
}

.title-badges span:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.title-badges span::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Botones de acción */
#menu-row {
  display: flex;
  gap: var(--space-sm);
  z-index: 2;
  flex-wrap: wrap;
  justify-content: center;
  animation: title-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
}

.cta {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  padding: 13px 26px;
  cursor: pointer;
  font: 800 14px var(--font-body);
  letter-spacing: 0.05em;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.cta:hover::before {
  transform: translateX(100%);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta:active {
  transform: translateY(0);
}

.cta.primary {
  background: linear-gradient(100deg, var(--state-success), var(--state-info) 55%, var(--accent-cyan));
  color: #052018;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(46, 201, 192, 0.3);
  animation: cta-glow 2.8s ease-in-out infinite;
  font-size: 16px;
  padding: 15px 34px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes cta-glow {
  0%, 100% { box-shadow: 0 10px 30px rgba(46, 201, 192, 0.3); }
  50% { box-shadow: 0 12px 44px rgba(126, 231, 255, 0.55); }
}

.cta.primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 48px rgba(126, 231, 255, 0.55), 0 0 0 1px rgba(255,255,255,0.22) inset;
}

.cta.ghost {
  background: rgba(8, 14, 24, 0.5);
  border-color: rgba(126, 231, 255, 0.28);
}

.cta.ghost:hover {
  border-color: rgba(126, 231, 255, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Selector de personajes */
.pick-label {
  z-index: 2;
  margin-top: var(--space-sm);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #a9c9e0;
  position: relative;
  padding: 0 46px;
  animation: title-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both;
}

.pick-label::before,
.pick-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 231, 255, 0.6));
}

.pick-label::before {
  left: 0;
}

.pick-label::after {
  right: 0;
  transform: scaleX(-1);
}

#chars {
  --card-w: clamp(150px, 15.5vw, 224px);
  --portrait-h: clamp(76px, 12vh, 136px);
  --gap: clamp(10px, 1.2vw, 16px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 12px);
  z-index: 2;
  counter-reset: roster;
  animation: title-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s both;
}

.chars-grid {
  /* flex centrado: cualquier número de personajes queda centrado */
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  justify-content: center;
  padding: 10px 4px 4px;
}

/* Tarjetas de personaje */
.char-card {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: var(--space-sm) var(--space-sm) var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  font: inherit;
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--tint, var(--accent-cyan)) 26%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(8, 12, 20, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  color: var(--text-primary);
  counter-increment: roster;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  contain: layout style;
}

.char-card::before {
  content: counter(roster, decimal-leading-zero);
  position: absolute;
  top: var(--space-sm);
  left: var(--space-md);
  font: 800 10px/1 var(--font-body);
  letter-spacing: 0.1em;
  color: rgba(230, 244, 255, 0.55);
  z-index: 3;
}

.char-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--tint, var(--accent-cyan));
  box-shadow: 
    0 26px 50px rgba(0, 0, 0, 0.42), 
    0 0 30px color-mix(in srgb, var(--tint, var(--accent-cyan)) 40%, transparent);
}

.char-card.selected {
  border-color: var(--tint, var(--accent-cyan));
  box-shadow: 
    0 0 0 2px var(--tint, var(--accent-cyan)), 
    0 0 34px color-mix(in srgb, var(--tint, var(--accent-cyan)) 50%, transparent), 
    0 18px 40px rgba(0, 0, 0, 0.4);
}

.char-card.selected::after {
  content: '✓';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 22px;
  height: 22px;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tint, var(--accent-cyan));
  color: #051018;
  font: 800 12px var(--font-body);
  box-shadow: 0 0 14px color-mix(in srgb, var(--tint, var(--accent-cyan)) 70%, transparent);
}

/* Retrato */
.portrait {
  width: 100%;
  height: var(--portrait-h);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 78%, color-mix(in srgb, var(--tint, var(--accent-cyan)) 42%, transparent), transparent 60%),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(6, 14, 24, 0.4), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-md) + 2px);
  box-shadow: 
    inset 0 -20px 30px rgba(0, 0, 0, 0.35), 
    inset 0 0 0 1px color-mix(in srgb, var(--tint, var(--accent-cyan)) 30%, transparent);
  pointer-events: none;
}

.portrait canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}
.portrait img.portrait-art {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  z-index: 1;
}
.portrait.has-art img.portrait-art { display: block; }
.portrait.has-art canvas { visibility: hidden; }

.look-switch { display: none; }
.look-switch button {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d5e6f4;
  background: rgba(8, 16, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}
.look-switch button.on {
  color: #1a1204;
  background: #ffe27a;
  border-color: #ffe27a;
}

/* Swatch de color */
.swatch {
  width: 48px;
  height: 4px;
  margin: var(--space-sm) auto 0;
  border-radius: var(--radius-full);
  background: var(--tint, var(--accent-cyan));
  box-shadow: 0 0 12px color-mix(in srgb, var(--tint, var(--accent-cyan)) 70%, transparent);
}

/* Info del personaje */
.char-card h3 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.role {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--tint, var(--accent-cyan)) 22%, rgba(10, 18, 30, 0.7));
  border: 1px solid color-mix(in srgb, var(--tint, var(--accent-cyan)) 45%, transparent);
  color: #fff;
  margin-bottom: var(--space-sm);
}

.char-card small {
  display: block;
  color: #b8cbe0;
  line-height: 1.4;
  font-size: 10.5px;
  min-height: 30px;
  max-width: 100%;
}

.stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.stats i {
  font-style: normal;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #e8f2ff;
}

.hint {
  margin-top: 6px;
  display: inline-block;
  font: 700 10px var(--font-body);
  color: #cfe1f2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    0 2px 0 rgba(255, 255, 255, 0.08) inset, 
    0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Footer */
.legal {
  z-index: 2;
  margin-top: var(--space-sm);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  max-width: 52ch;
}

.legal a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.legal a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ─── Modales ───────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(6px);
  padding: var(--space-md);
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.panel {
  width: min(520px, 92vw);
  background: rgba(10, 14, 24, 0.94);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: panel-in var(--transition-slow) var(--transition-bounce);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel.slim {
  width: min(320px, 90vw);
  text-align: center;
}

.panel h2 {
  font-family: var(--font-display);
  margin-bottom: var(--space-md);
  font-size: 24px;
}

.panel ul {
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.panel li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.panel kbd {
  display: inline-flex;
  min-width: 64px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: #1a2230;
  border: 1px solid #334;
  font: 700 11px var(--font-body);
  justify-content: center;
  flex-shrink: 0;
}

.panel .note {
  margin-top: var(--space-md);
  opacity: 0.7;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-accent);
}

/* Mapa */
.map-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: var(--space-md) 0;
}

.map-cell {
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: #161b24;
  border: 1px solid #2a3140;
  font: 700 11px var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xs);
  opacity: 0.45;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.map-cell.empty {
  opacity: 0;
  pointer-events: none;
  border: 0;
  background: transparent;
}

.map-cell.here {
  background: #164a55;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  opacity: 1;
  box-shadow: 0 0 12px rgba(126, 231, 255, 0.35);
  animation: map-pulse 2s ease-in-out infinite;
}

@keyframes map-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(126, 231, 255, 0.35); }
  50% { box-shadow: 0 0 20px rgba(126, 231, 255, 0.55); }
}

.map-cell.seen {
  background: #16351c;
  border-color: #3a6;
  opacity: 1;
}

.map-cell.lock {
  opacity: 0.3;
  color: #ff8aa0;
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.visited { background: #3a6; }
.dot.current { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.dot.locked { background: #ff8aa0; opacity: 0.5; }

/* Pausa */
.pause-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* ─── Mensajería del juego ─────────────────────────────────────────────── */
#notification-container {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: var(--z-ui);
  width: min(620px, 92vw);
  pointer-events: none;
}

#notification-container:has(.game-notification.objective) {
  top: auto;
  bottom: 132px;
  width: min(520px, 88vw);
}

body.boss-fight #notification-container:has(.game-notification:not(.objective)) {
  top: 140px;
}

.game-notification {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 12px 18px 13px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 18px;
  background: rgba(8, 12, 20, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px) saturate(140%);
  animation: notify-in 0.22s ease;
  cursor: pointer;
  pointer-events: auto;
}

.game-notification.closing {
  animation: notify-out 0.18s ease forwards;
  pointer-events: none;
}

.game-notification h2 {
  margin: 0;
  font: 800 11px var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.game-notification p {
  margin: 4px auto 0;
  max-width: 56ch;
  color: var(--text-secondary);
  font: 600 13px/1.35 var(--font-body);
}

.game-notification.room { border-color: rgba(126, 231, 255, 0.38); }
.game-notification.tutorial { border-color: rgba(255, 230, 106, 0.34); }
.game-notification.objective { border-color: rgba(184, 240, 144, 0.34); }
.game-notification.boss { border-color: rgba(255, 90, 104, 0.5); }
.game-notification.evolution,
.game-notification.evo { border-color: rgba(255, 230, 106, 0.55); }
.game-notification.error,
.game-notification.hurt { border-color: rgba(255, 100, 118, 0.55); }
.game-notification.done { border-color: rgba(184, 240, 144, 0.55); }

@keyframes notify-in {
  from { transform: translateY(-16px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes notify-out {
  to { transform: translateY(-10px) scale(0.98); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .game-notification,
  .game-notification.closing,
  .prompt-icon {
    animation: none;
  }
}
/* ─── Efectos ───────────────────────────────────────────────────────────── */
#fx-hurt,
#fx-heal {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-fx);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

#fx-hurt.on {
  opacity: 1;
  background: radial-gradient(circle at center, transparent 40%, rgba(180, 0, 30, 0.35));
  animation: hurt-pulse 0.5s ease-out;
}

#fx-heal.on {
  opacity: 1;
  background: radial-gradient(circle at center, transparent 45%, rgba(40, 200, 90, 0.22));
}

@keyframes hurt-pulse {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ─── Controles Táctiles ───────────────────────────────────────────────── */
#touch {
  display: none;
  position: fixed;
  left: var(--space-md);
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: calc(var(--z-hud) + 1);
  justify-content: space-between;
  touch-action: none;
}

#touch .col {
  display: flex;
  gap: var(--space-sm);
}

#touch .col.act {
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
}

#touch .act-row {
  display: flex;
  gap: var(--space-sm);
}

.touch-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  color: var(--text-primary);
  font-size: 18px;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.08s ease;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.touch-btn:active,
.touch-btn.held {
  transform: scale(0.92);
  filter: brightness(1.35);
}

.touch-btn.jump {
  background: color-mix(in srgb, var(--accent-cyan) 26%, var(--surface-glass));
  border-color: color-mix(in srgb, var(--accent-cyan) 55%, transparent);
  color: #eafcff;
  font-size: 20px;
}

.touch-btn.pw {
  position: relative;
  overflow: hidden;
  border-color: rgba(126, 231, 255, 0.42);
  color: #cdefff;
  font-size: 13px;
  font-weight: 800;
}

.touch-btn.pw b {
  position: relative;
  z-index: 1;
}

.touch-btn.pw::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(100% - var(--cd, 100%));
  background: rgba(4, 8, 14, 0.66);
  pointer-events: none;
  transition: height 0.1s linear;
}

.touch-btn.pw.cooling {
  color: #7f93a6;
}

.touch-btn.pw.off {
  display: none;
}

/* ─── Intro Cinemática ─────────────────────────────────────────────────── */
#ohana-intro {
  position: fixed;
  inset: 0;
  z-index: var(--z-intro);
  overflow: hidden;
  cursor: pointer;
  background: #040a18;
}

/* El canvas pinta el fondo; el iris de salida lo hace transparente */
#ohana-intro:has(canvas) { background: transparent; }

#ohana-intro canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.oi-skip {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200, 224, 255, 0.55);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  animation: oi-fade 0.6s ease 0.5s both;
  transition: color var(--transition-fast);
}

.oi-skip:hover {
  color: var(--text-primary);
}

@keyframes oi-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Skip de intro */
body.no-intro .title-stack,
body.no-intro #menu-row,
body.no-intro .pick-label,
body.no-intro #chars {
  animation-delay: 0s !important;
}

/* ─── Efecto de Jefe ──────────────────────────────────────────────────── */
body.boss-fight::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-fx);
  background:
    radial-gradient(ellipse at 50% 115%, rgba(255, 60, 20, 0.28), transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(80, 0, 20, 0.18), transparent 45%);
  animation: boss-magma 3.2s ease-in-out infinite alternate;
}

@keyframes boss-magma {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  :root {
    --space-md: 12px;
    --space-lg: 20px;
  }
  
  #top-actions {
    top: 6px;
    gap: 4px;
    transform: translateX(-50%) scale(0.86);
    transform-origin: top center;
  }
  
  .hud-block {
    min-width: 0;
    max-width: 42vw;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .hud-name {
    font-size: 16px;
  }
  
  #touch {
    display: flex;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
  }
  
  body.playing #ability-bar {
    display: none !important;
  }
  
  .touch-btn {
    width: 52px;
    height: 52px;
  }
  
  .touch-btn.pw {
    width: 48px;
    height: 48px;
  }
  
  #prompt {
    bottom: 172px;
  }
  
  
  .title-palm {
    display: none;
  }
  
  #combo-chip {
    top: 108px;
    font-size: 22px;
  }
    
  #notification-container {
    top: 88px;
    max-width: min(340px, 90vw);
  }

  #notification-container:has(.game-notification.objective) {
    top: auto;
    bottom: 154px;
  }

  body.boss-fight #notification-container:has(.game-notification:not(.objective)) {
    top: 176px;
  }
  
  #boss-wrap {
    top: 58px;
    width: min(540px, 78vw);
  }
  
  body.boss-fight #combo-chip {
    top: 118px;
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  #touch .col.move {
    flex-direction: column;
  }
  .touch-btn {
    width: 64px;
    height: 64px;
  }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
  #touch {
    display: flex;
  }
  
  body.playing #ability-bar {
    display: none !important;
  }
  
  .touch-btn {
    width: 54px;
    height: 54px;
  }
  
  .touch-btn.pw {
    width: 50px;
    height: 50px;
  }
  
  #prompt {
    bottom: 176px;
  }
  
  #top-actions {
    transform: translateX(-50%) scale(0.82);
    transform-origin: top center;
  }
}

/* ─── Accesibilidad ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .stars,
  .aurora,
  .crest,
  .cta.primary,
  .cta.primary::after,
  .logo-mark::before,
  #char-select h1 .ohana,
  body.boss-fight::after {
    animation: none !important;
  }
  
  .title-stack,
  #menu-row,
  .pick-label,
  #chars {
    animation-delay: 0s !important;
  }
  
  .oi-ring {
    display: none;
  }
  
  .oi-kicker,
  .oi-word,
  .oi-tag,
  .oi-skip {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
}

/* Focus visible para accesibilidad */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: rgba(255, 255, 255, 0.4);
    --text-secondary: #fff;
  }
}


/* ─── Portada v21: composición centrada · 8 tarjetas ───────────────────── */
.cta.hidden { display: none; }
.title-stack { margin-top: 0; }
.legal { margin-bottom: 0; padding-top: 0; }
.logo-mark { display: none; }
#char-select {
  justify-content: flex-start;
  gap: 8px;
  padding: 52px 16px 8px;
  overflow: hidden;
}
#char-select h1 { flex-direction: row; align-items: baseline; gap: 12px; }
#char-select h1 .project { font-size: 12px; letter-spacing: 0.42em; text-indent: 0; }
#char-select h1 .ohana { font-size: clamp(34px, 4.4vw, 56px) !important; }
.tagline { margin: 2px 0 0; font-size: 13px; }
.title-badges { margin-top: 6px; }
#chars {
  --portrait-h: clamp(78px, 15vh, 132px);
  flex: 1;
  min-height: 0;
  width: min(1100px, 100%);
  justify-content: center;
}
#chars .char-card { padding: 8px 8px 10px; }
#chars .char-card h3 { margin-top: 6px; font-size: clamp(15px, 1.3vw, 18px); }
.pick-label { margin-top: 0; }

/* La intro ya no congela el menú: si el canvas falla, los botones siguen vivos. */
.legal { animation: title-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both; }

#char-select h1 .ohana { font-size: clamp(34px, 4.4vw, 56px); }
.char-card .h-move {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #d5e4f5;
}
.char-card .role.r1 { background: rgba(80, 180, 90, 0.28); border-color: rgba(140, 230, 140, 0.55); }
.char-card .role.r2 { background: rgba(200, 160, 40, 0.28); border-color: rgba(255, 220, 120, 0.55); }
.char-card .role.r3 { background: rgba(180, 60, 50, 0.32); border-color: rgba(255, 140, 120, 0.6); }
.char-card small { display: none; }
.char-card .swatch { display: none; }
.char-card .portrait canvas { image-rendering: auto; }

/* Pantallas altas: se muestra la cadena de evoluciones */
@media (min-height: 1000px) and (min-width: 900px) {
  .char-card small { display: block; margin-top: 4px; min-height: 0; }
}
@media (max-height: 1199px) and (min-width: 641px) {
  .logo-mark { display: none; }
}

/* Pantallas bajas: título compacto */
@media (max-height: 780px) and (min-width: 641px) {
  .logo-mark { display: none; }
  .eyebrow { margin-bottom: 2px; font-size: 11px; }
  .tagline { font-size: 14px; margin-top: 0; }
  .title-badges { margin-top: 6px; }
  .title-badges span { padding-top: 3px; padding-bottom: 3px; }
  .cta { padding: 10px 22px; }
  .cta.primary { padding: 12px 30px; }
  .char-card .hint { display: none; }
  .legal p:first-child { display: none; }
}

/* Escritorio estrecho / tablet: 4 columnas más prietas */
@media (max-width: 900px) and (min-width: 641px) {
  #chars { --card-w: calc((100vw - 2 * var(--space-md) - 3 * var(--gap) - 8px) / 4); }
}

.chars-dots { display: none; gap: 6px; justify-content: center; }

/* Móvil: carrusel horizontal con snap (solo scroll dentro del carrusel) */
@media (max-width: 640px) {
  #char-select { padding-top: 60px; overflow-y: auto; }
  #char-select h1 { flex-direction: column; align-items: center; }
  #chars { --portrait-h: clamp(100px, 17vh, 150px); --card-w: min(46vw, 200px); }
  .chars-grid {
    display: grid;
    width: calc(100% + 2 * var(--space-md));
    margin: 0 calc(-1 * var(--space-md));
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    justify-content: start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: calc(50% - var(--card-w) / 2);
    padding: 12px calc(50% - var(--card-w) / 2) 10px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  }
  .chars-grid::-webkit-scrollbar { display: none; }
  .char-card { scroll-snap-align: center; }
  .char-card:hover { transform: none; }
  .char-card .hint { display: none; }
  .title-badges { display: none; }
  .logo-mark { width: 52px; height: 52px; margin-bottom: 4px; }
  .crest { width: 42px; height: 42px; }
  .eyebrow { font-size: 10px; letter-spacing: 0.22em; }
  #menu-row { width: 100%; max-width: 360px; }
  #menu-row .cta { flex: 1 1 0; justify-content: center; padding: 12px 14px; }
  #menu-row .cta.primary { flex-basis: 100%; order: -1; }
  .chars-dots { display: flex; }
}


.chars-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all var(--transition-fast);
}
.chars-dots i.on { width: 18px; border-radius: 3px; background: var(--dot, var(--accent-cyan)); }

/* Diez fichas: dos filas de cinco, mismo ancho, centradas */
@media (min-width: 641px) {
  .chars-grid {
    display: grid;
    width: min(1180px, 100%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .chars-grid > .char-card { width: auto; flex: none; }
}

/* Carrusel: un personaje al centro, dos asomando, flechas. */
.title-stack { display: block; order: 0; flex: none; }
#char-select {
  justify-content: flex-start;
  gap: 8px;
  padding: 60px 12px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(900px 520px at 50% 8%, rgba(255, 214, 120, 0.22), transparent 58%),
    radial-gradient(700px 480px at 50% 78%, rgba(40, 160, 190, 0.28), transparent 62%),
    radial-gradient(520px 360px at 12% 100%, rgba(255, 90, 150, 0.16), transparent 60%),
    linear-gradient(180deg, #071226 0%, #0c2040 42%, #071820 100%);
}
#menu-row { order: 2; margin-top: 8px; }
.legal { order: 3; }
#chars {
  order: 1;
  position: relative;
  width: min(1040px, 100%);
  height: clamp(240px, 48dvh, 440px);
  flex: none;
  --portrait-h: min(24dvh, 190px);
}
#chars .chars-grid {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  grid-template-columns: none;
}
#chars .char-card {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(320px, 44vw);
  margin: 0;
  padding: 12px 12px 16px;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.45s ease;
}
#chars .char-card.is-prev,
#chars .char-card.is-next {
  opacity: 0.5;
  pointer-events: auto;
  filter: saturate(0.85);
  z-index: 2;
}
#chars .char-card.is-prev { transform: translate(calc(-50% - min(34vw, 300px)), -46%) scale(0.78); }
#chars .char-card.is-next { transform: translate(calc(-50% + min(34vw, 300px)), -46%) scale(0.78); }
#chars .char-card.selected {
  opacity: 1;
  filter: none;
  z-index: 3;
  pointer-events: auto;
  transform: translate(-50%, -46%) scale(1);
}
#chars .char-card h3 { font-size: clamp(22px, 2.4vw, 32px); margin-top: 10px; }
.roster-arrow {
  position: absolute;
  top: 42%;
  z-index: 6;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(7, 18, 32, 0.55);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.roster-arrow.prev { left: 0; }
.roster-arrow.next { right: 0; }
.roster-arrow:hover { background: rgba(126, 231, 255, 0.22); border-color: #7ee7ff; }
#chars .chars-dots { display: flex; position: absolute; left: 0; right: 0; bottom: 0; }
@media (max-width: 640px) {
  #chars { height: clamp(240px, 40dvh, 400px); --portrait-h: min(22dvh, 170px); }
  #char-select h1 { flex-direction: row; gap: 8px; }
  .tagline { max-width: 300px; margin-inline: auto; }
  #chars .chars-grid {
    display: block;
    width: 100%;
    margin: 0;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
  }
  #chars .char-card { scroll-snap-align: none; width: min(240px, 62vw); }
  #chars .char-card.is-prev { transform: translate(calc(-50% - 28vw), -46%) scale(0.72); }
  #chars .char-card.is-next { transform: translate(calc(-50% + 28vw), -46%) scale(0.72); }
  .roster-arrow { width: 44px; height: 44px; font-size: 28px; }
}

#chars .char-card h3 { order: 4; }
#chars .char-card .role { order: 5; margin: 8px 0 0; }
#chars .char-card .h-move { order: 6; }

#help,
#map-overlay,
#pause-overlay,
#win-cinema,
#evo-stage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 20, 0.72);
  pointer-events: auto;
}
#help.open,
#map-overlay.open,
#pause-overlay.open,
#win-cinema.show,
#evo-stage.show {
  display: flex;
}
#help .panel,
#map-overlay .panel,
#pause-overlay .panel {
  width: min(520px, calc(100vw - 32px));
  max-height: min(78vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 22px 22px 18px;
  border-radius: 20px;
  background: rgba(7, 14, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
#help ul,
#help p {
  margin: 10px 0 0;
  color: #d5e4f5;
  font-size: 14px;
  line-height: 1.45;
}
#help kbd,
#map-overlay kbd {
  display: inline-block;
  margin: 0 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #122033;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
}
#pause-overlay .panel {
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#room-banner,
#prompt {
  display: none;
}
#room-banner.show,
#prompt.show {
  display: block;
}
#form-pips b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
#form-pips b.on {
  background: #7ee7ff;
}
#form-pips b.active {
  transform: scale(1.2);
}

body:not(.playing) #touch {
  display: none !important;
}
.ability-slot {
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.touch-btn.interact {
  color: #ffe6a6;
  border-color: rgba(255, 214, 120, 0.65);
}
[data-dialog] .panel {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
@media (max-width: 820px) {
  #touch .col,
  #touch .act-row {
    gap: 6px;
  }
  .touch-btn,
  .touch-btn.pw {
    width: clamp(44px, 11vw, 52px);
    height: clamp(44px, 11vw, 52px);
  }
}


/* ==========================================================
   V34.1 FINAL VIEWPORT LOCK
   ========================================================== */

#room-banner.show {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
}

#prompt.show {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
}

#ability-bar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
}

#map-overlay.open {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#map-overlay.open > .panel {
  position: relative !important;
  inset: auto !important;
  margin: 0 auto !important;
  transform: none !important;
  max-width: min(760px, calc(100vw - 32px)) !important;
}

/* Cierre visual de Mundo 1 */
.hud-block {
  border-color: rgba(126, 231, 255, 0.28);
  background: rgba(6, 12, 22, 0.72);
}
.bar { height: 12px; }
.world-name { letter-spacing: 0.04em; }
#room-banner, .room-banner {
  letter-spacing: 0.16em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.cta.primary {
  box-shadow: 0 8px 24px rgba(126, 231, 255, 0.25);
}
#demo-obj {
  letter-spacing: 0.02em;
}

.journey { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #ffe66a; margin-top: 2px; }


/* ==========================================================================
   OHANA POLISH PASS · roster carousel + controls rail
   ========================================================================== */
#chars {
  overflow: hidden;
  isolation: isolate;
}

#chars .chars-grid {
  position: relative;
  overflow: visible;
  width: 100%;
  height: 100%;
}

#chars .char-card {
  box-sizing: border-box;
  overflow: hidden;
  width: min(320px, 29vw);
  max-height: min(390px, 44dvh);
  padding: 14px 14px 15px;
  transition:
    transform .38s cubic-bezier(.2,.82,.2,1),
    opacity .30s ease,
    filter .30s ease,
    box-shadow .30s ease;
}

#chars .char-card.is-prev2,
#chars .char-card.is-next2 {
  opacity: .25;
  pointer-events: none;
  filter: saturate(.72) blur(.15px);
  z-index: 1;
  transform: translate(calc(-50% - min(38vw, 420px)), -46%) scale(.60);
}

#chars .char-card.is-prev2 { transform: translate(calc(-50% - min(38vw, 420px)), -46%) scale(.60); }
#chars .char-card.is-next2 { transform: translate(calc(-50% + min(38vw, 420px)), -46%) scale(.60); }

#chars .char-card.is-prev,
#chars .char-card.is-next {
  opacity: .52;
  filter: saturate(.84);
  z-index: 2;
  box-shadow: 0 16px 34px rgba(0,0,0,.30);
}

#chars .char-card.is-prev {
  transform: translate(calc(-50% - min(25vw, 280px)), -47%) scale(.80);
}
#chars .char-card.is-next {
  transform: translate(calc(-50% + min(25vw, 280px)), -47%) scale(.80);
}

#chars .char-card.selected {
  transform: translate(-50%, -54%) scale(1);
  opacity: 1;
  filter: none;
  z-index: 4;
  box-shadow:
    0 0 0 2px var(--tint, var(--accent-cyan)),
    0 26px 64px rgba(0,0,0,.42),
    0 0 38px color-mix(in srgb, var(--tint, var(--accent-cyan)) 42%, transparent);
}

#chars .portrait {
  flex: 0 0 auto;
  width: 100%;
}
#chars .char-card h3,
#chars .char-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#chars .char-card .h-move { white-space: nowrap; }

#controls-hint {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(1100px, calc(100vw - 24px));
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(4,9,17,.74);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  color: #d8e6f3;
  font: 700 9px/1 Outfit, system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
}
#controls-hint span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#controls-hint kbd {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font: 800 8px/1 Outfit, system-ui, sans-serif;
}

@media (max-width: 900px) {
  #controls-hint { gap: 5px; font-size: 8px; }
  #controls-hint span:nth-child(n+5) { display: none; }
}
@media (max-width: 640px) {
  #chars { height: clamp(230px, 39dvh, 390px); }
  #chars .char-card {
    width: min(250px, 66vw);
    max-height: min(360px, 42dvh);
  }
  #chars .char-card.is-prev2,
  #chars .char-card.is-next2 {
    opacity: 0;
    pointer-events: none;
  }
  #chars .char-card.is-prev,
  #chars .char-card.is-next {
    opacity: .50;
  }
  #chars .char-card.is-prev { transform: translate(calc(-50% - 31vw), -47%) scale(.72); }
  #chars .char-card.is-next { transform: translate(calc(-50% + 31vw), -47%) scale(.72); }
  #chars .char-card.selected { transform: translate(-50%, -54%) scale(1); }
  #controls-hint {
    bottom: max(6px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 12px);
    overflow: hidden;
    white-space: nowrap;
  }
}
@media (hover: none) and (pointer: coarse) {
  #controls-hint { display: none; }
}
body.playing #controls-hint { display: flex; }
body:not(.playing) #controls-hint { display: none; }


/* Final roster rail: simple three-card composition, no clipped labels. */
#chars .char-card.is-prev2,
#chars .char-card.is-next2 { opacity: 0; pointer-events: none; }
#chars .char-card.is-prev,
#chars .char-card.is-next {
  width: min(300px, 24vw);
  max-height: min(350px, 42dvh);
}
#chars .char-card.is-prev { transform: translate(calc(-50% - min(26vw, 300px)), -48%) scale(.78); }
#chars .char-card.is-next { transform: translate(calc(-50% + min(26vw, 300px)), -48%) scale(.78); }
#chars .char-card.selected {
  width: min(340px, 27vw);
  max-height: min(390px, 46dvh);
}
#chars .char-card h3 { overflow: visible; text-overflow: clip; }
#chars .char-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#controls-hint {
  bottom: 82px;
  padding: 8px 14px;
  font-size: 10px;
  gap: 10px;
}
@media (max-width: 900px) {
  #controls-hint { bottom: 74px; }
}
@media (max-width: 640px) {
  #chars .char-card.is-prev,
  #chars .char-card.is-next { width: min(240px, 62vw); }
  #chars .char-card.selected { width: min(270px, 70vw); }
}


/* Roster is a viewport rail. The card center is always the screen center. */
#chars { width: 100vw; max-width: 100vw; }


/* ============================================================================
   OHANA — PREMIUM ART DIRECTION / 2026
   One visual language: cinematic, tactile, restrained.
   ============================================================================ */

:root {
  --ohana-panel: rgba(5, 10, 20, .78);
  --ohana-panel-strong: rgba(5, 10, 20, .90);
  --ohana-line: rgba(196, 226, 255, .16);
  --ohana-line-hot: rgba(126, 231, 255, .42);
  --ohana-text-dim: rgba(210, 228, 246, .68);
  --ohana-shadow: 0 18px 55px rgba(0,0,0,.42);
}

/* The game gets a subtle cinematic frame instead of another pile of effects. */
body.playing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.055);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.28),
    inset 0 0 110px rgba(0,0,0,.16);
}

/* HUD: compact, premium, readable at a glance. */
body.playing #hud {
  padding: 10px;
}

body.playing .hud-block {
  min-width: 226px;
  max-width: 300px;
  padding: 10px 13px 12px;
  border: 1px solid var(--ohana-line);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(13,24,40,.88), rgba(4,9,17,.76));
  box-shadow: var(--ohana-shadow), inset 0 1px 0 rgba(255,255,255,.055);
  backdrop-filter: blur(18px) saturate(135%);
}

body.playing .hud-block:hover {
  transform: none;
  box-shadow: var(--ohana-shadow), 0 0 24px rgba(126,231,255,.09);
}

body.playing .hud-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 34%),
    linear-gradient(145deg, rgba(126,231,255,.9), rgba(103,86,255,.72));
  box-shadow: 0 5px 18px rgba(0,0,0,.3);
}

body.playing .hud-name {
  font-size: 20px;
  letter-spacing: .035em;
}

body.playing .hud-trait {
  color: rgba(255,224,138,.82);
  font-size: 10px;
}

body.playing .bar {
  height: 8px;
  border-color: rgba(255,255,255,.10);
  background: rgba(0,0,0,.34);
}

body.playing .bar-fill {
  box-shadow: none;
}

body.playing .hud-meta {
  font-size: 10px;
  color: var(--ohana-text-dim);
}

body.playing .world-name {
  font-size: 17px;
  letter-spacing: .02em;
}

body.playing .evo-text {
  font-size: 9px;
  letter-spacing: .18em;
}

body.playing .form-pips {
  gap: 5px;
}

body.playing .form-pips b {
  width: 7px;
  height: 7px;
  border-radius: 3px;
}

body.playing .combo-display {
  font-size: 10px;
  color: var(--ohana-text-dim);
}

/* Top actions become one coherent control strip. */
body.playing #top-actions {
  top: 12px;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(4,8,15,.62);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

body.playing #top-actions button {
  min-height: 30px;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(231,242,255,.76);
  font-size: 9px;
}

body.playing #top-actions button:hover,
body.playing #top-actions button[aria-pressed="true"] {
  background: rgba(126,231,255,.11);
  color: #f4fbff;
  box-shadow: none;
}

/* Ability bar: cards become deliberate game controls, not dashboard widgets. */
body.playing #ability-bar {
  bottom: 14px;
  gap: 8px;
}

body.playing .ability-slot {
  min-width: 132px;
  padding: 9px 11px;
  border-radius: 13px;
  border-color: rgba(255,255,255,.11);
  background:
    linear-gradient(145deg, rgba(10,19,32,.88), rgba(4,8,15,.80));
  box-shadow: 0 12px 30px rgba(0,0,0,.30);
}

body.playing .ability-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(126,231,255,.34);
  box-shadow: 0 15px 34px rgba(0,0,0,.34), 0 0 20px rgba(126,231,255,.08);
}

body.playing .ability-slot .key {
  font-size: 9px;
  letter-spacing: .12em;
}

body.playing .ability-slot .name {
  font-size: 11px;
}

body.playing .ability-slot .cd {
  height: 3px;
  margin-top: 7px;
}

/* Prompt becomes a small diegetic hint rather than a floating notification. */
body.playing #prompt {
  bottom: 86px;
  padding: 7px 11px;
  border-radius: 999px;
  border-color: rgba(126,231,255,.18);
  background: rgba(4,9,17,.78);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
  font-size: 10px;
}

/* Combo: make it feel like feedback, not a permanent billboard. */
body.playing #combo-chip {
  top: 116px;
  min-width: 64px;
  padding: 5px 13px;
  border: 1px solid rgba(255,230,106,.24);
  background: rgba(8,12,20,.62);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  font-size: 23px;
}

/* Touch controls: large targets, clear grouping, no accidental overlap. */
@media (hover: none) and (pointer: coarse), (max-width: 820px) {
  body.playing #touch {
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    align-items: flex-end;
    z-index: calc(var(--z-hud) + 2);
  }

  body.playing #touch .col {
    gap: 8px;
  }

  body.playing #touch .col.move {
    padding: 7px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    background: rgba(4,9,17,.58);
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
  }

  body.playing #touch .col.act {
    padding: 7px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 20px;
    background: rgba(4,9,17,.58);
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
  }

  body.playing #touch .act-row {
    gap: 7px;
  }

  body.playing .touch-btn {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.13);
    background:
      linear-gradient(145deg, rgba(27,43,61,.88), rgba(7,13,23,.88));
    color: rgba(239,248,255,.88);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.08),
      0 7px 18px rgba(0,0,0,.28);
    transition: transform 80ms ease, filter 80ms ease, border-color 120ms ease;
    -webkit-tap-highlight-color: transparent;
  }

  body.playing .touch-btn:active,
  body.playing .touch-btn.held {
    transform: translateY(2px) scale(.95);
    filter: brightness(1.25);
    border-color: rgba(126,231,255,.45);
    box-shadow: inset 0 2px 7px rgba(0,0,0,.35);
  }

  body.playing .touch-btn.jump {
    width: 62px;
    height: 62px;
    border-radius: 19px;
    background:
      linear-gradient(145deg, rgba(34,107,129,.94), rgba(8,38,52,.94));
    border-color: rgba(126,231,255,.38);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.12),
      0 9px 24px rgba(0,0,0,.32),
      0 0 18px rgba(126,231,255,.09);
  }

  body.playing .touch-btn.pw {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 12px;
  }

  body.playing .touch-btn.interact {
    border-color: rgba(255,230,106,.30);
    color: #fff0a8;
  }

  body.playing #prompt {
    bottom: 142px;
  }

  body.playing #ability-bar {
    display: none !important;
  }
}

/* Portrait phones: movement stays compact and usable. */
@media (max-width: 820px) and (orientation: portrait) {
  body.playing #touch .col.move {
    flex-direction: row;
  }

  body.playing .touch-btn {
    width: 54px;
    height: 54px;
  }

  body.playing .touch-btn.jump {
    width: 60px;
    height: 60px;
  }
}

/* Notifications share the same visual grammar. */
body.playing #notification-container .game-notification {
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(5,10,18,.84);
  box-shadow: 0 14px 40px rgba(0,0,0,.34);
  backdrop-filter: blur(16px) saturate(125%);
}

/* Pause/map/help surfaces. */
#pause-overlay,
#help,
#map-overlay {
  backdrop-filter: blur(7px);
}

#pause-overlay .panel,
#help .panel,
#map-overlay .panel,
#help > div,
#map-overlay > div {
  border: 1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(145deg, rgba(13,23,38,.96), rgba(4,8,15,.94));
  box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}

/* Avoid hover-lift jitter on game UI. */
body.playing button,
body.playing .ability-slot {
  will-change: transform;
}

/* Reduced motion keeps the same visual hierarchy without animation. */
@media (prefers-reduced-motion: reduce) {
  body.playing #touch .touch-btn,
  body.playing .ability-slot {
    transition: none;
  }
}

/* ============================================================================
   OHANA — ROSTER LOWERING HOTFIX
   Keep the title/difficulty cleanly separated from the selected hero.
   ============================================================================ */
#chars .char-card {
  top: 64%;
}
#chars .char-card.is-prev {
  transform: translate(calc(-50% - min(26vw, 300px)), -40%) scale(.78);
}
#chars .char-card.is-next {
  transform: translate(calc(-50% + min(26vw, 300px)), -40%) scale(.78);
}
#chars .char-card.selected {
  transform: translate(-50%, -46%) scale(1);
}
.roster-arrow {
  top: 58%;
}
@media (max-width: 640px) {
  #chars .char-card.is-prev {
    transform: translate(calc(-50% - 31vw), -40%) scale(.72);
  }
  #chars .char-card.is-next {
    transform: translate(calc(-50% + 31vw), -40%) scale(.72);
  }
  #chars .char-card.selected {
    transform: translate(-50%, -46%) scale(1);
  }
  .roster-arrow {
    top: 58%;
  }
}

/* ============================================================================
   OHANA — MENU HIERARCHY PASS
   Final visual ordering: title -> difficulty -> hero -> actions.
   ============================================================================ */

/* 01. Keep the title visually above every roster layer. */
#char-select .title-stack {
  position: relative;
  z-index: 8;
  transform: translateY(-8px);
}

/* 02. Give the tagline a controlled reading width. */
#char-select .tagline {
  max-width: min(560px, 88vw);
  margin-inline: auto;
}

/* 03. Keep difficulty controls in their own clean interaction layer. */
#char-select #difficulty {
  position: relative;
  z-index: 9;
  margin-top: 2px;
}

/* 04. Add a small visual breathing gap before the hero rail. */
#char-select #chars {
  margin-top: 4px;
}

/* 05. The selected hero remains the visual anchor, without oversized glow. */
#chars .char-card.selected {
  box-shadow:
    0 0 0 1px var(--tint, var(--accent-cyan)),
    0 22px 52px rgba(0,0,0,.46),
    0 0 28px color-mix(in srgb,var(--tint,var(--accent-cyan)) 24%,transparent);
}

/* 06. Improve portrait readability against the cinematic background. */
#chars .char-card.selected .portrait {
  background:
    radial-gradient(circle at 50% 78%, color-mix(in srgb,var(--tint,var(--accent-cyan)) 48%,transparent), transparent 62%),
    linear-gradient(180deg,rgba(12,20,34,.34),rgba(2,7,13,.52));
}

/* 07. Make secondary cards quieter instead of visually competing with Kilo. */
#chars .char-card.is-prev,
#chars .char-card.is-next {
  opacity: .42;
  filter: saturate(.78) brightness(.88);
}

/* 08. Smaller arrows keep navigation subordinate to the hero. */
#chars .roster-arrow {
  width: 50px;
  height: 50px;
  font-size: 30px;
  top: 58%;
}

/* 09. Keep the action row detached from the character art. */
#char-select #menu-row {
  margin-top: 2px;
  position: relative;
  z-index: 9;
}

/* 10. Footer becomes information, not another competing visual element. */
#char-select .legal {
  opacity: .62;
  position: relative;
  z-index: 3;
}

@media (max-width: 640px) {
  #char-select .title-stack {
    transform: translateY(-4px);
  }
  #chars .roster-arrow {
    width: 44px;
    height: 44px;
    font-size: 28px;
    top: 58%;
  }
  #chars .char-card.is-prev,
  #chars .char-card.is-next {
    opacity: .34;
  }
}

/* ============================================================================
   OHANA — MENU READABILITY PASS 2
   Ten small corrections for spacing, layering and responsive stability.
   ============================================================================ */

/* 01. Brand navigation stays above decorative title FX. */
#char-select .brand-bar {
  position: relative;
  z-index: 12;
}

/* 02. Decorative sky can never intercept menu interaction. */
#char-select .title-sky {
  pointer-events: none;
}

/* 03. Title stack gets a stable stacking context. */
#char-select .title-stack {
  z-index: 10;
  position: relative;
  isolation: isolate;
}

/* 04. Difficulty controls remain compact and do not grow into the hero rail. */
#char-select #difficulty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
}

/* 05. Action buttons stay on one coherent row on desktop. */
#char-select #menu-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* 06. Hero rail cannot visually escape its own composition. */
#char-select #chars {
  overflow: hidden;
  isolation: isolate;
}

/* 07. Navigation arrows stay centered on the lowered hero rail. */
#char-select #chars .roster-arrow {
  z-index: 10;
  transform: translateY(-50%);
}

/* 08. Legal copy never steals attention from the playable controls. */
#char-select .legal {
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

/* 09. Prevent the main menu from becoming taller than the viewport. */
#char-select {
  overflow: hidden;
}

/* 10. Respect reduced motion without leaving transition artifacts. */
@media (prefers-reduced-motion: reduce) {
  #char-select *,
  #char-select *::before,
  #char-select *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  #char-select #menu-row {
    gap: 7px;
  }
  #char-select #menu-row .cta {
    min-width: 0;
    padding-inline: 12px;
  }
}

/* ============================================================================
   OHANA — ROSTER FINISHING PASS
   Ten restrained refinements for the character selector.
   ============================================================================ */

/* 01. Keyboard focus is visible without adding another permanent glow. */
#chars .char-card:focus-visible,
#chars .roster-arrow:focus-visible,
#char-select #difficulty button:focus-visible,
#char-select #menu-row button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* 02. Selected hero does not jump on pointer hover. */
#chars .char-card.selected:hover {
  border-color: var(--tint, var(--accent-cyan));
}

/* 03. Secondary portraits are quieter but remain readable. */
#chars .char-card.is-prev .portrait,
#chars .char-card.is-next .portrait {
  filter: saturate(.82) brightness(.9);
}

/* 04. Character names get a stable optical baseline. */
#chars .char-card h3 {
  min-height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 05. Role badges stay compact and never force card growth. */
#chars .char-card .role {
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 06. Description copy remains secondary to the portrait. */
#chars .char-card small {
  max-width: 24ch;
  opacity: .86;
}

/* 07. Stats become a quiet information row rather than a second focal point. */
#chars .char-card .stats {
  opacity: .78;
  transform: scale(.96);
}

/* 08. Hint pills do not overpower the selected hero. */
#chars .char-card .hint {
  opacity: .82;
  box-shadow: none;
}

/* 09. Touch devices should not retain desktop hover amplification. */
@media (hover: none) {
  #chars .char-card:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  #chars .char-card.selected:hover {
    box-shadow:
      0 0 0 1px var(--tint, var(--accent-cyan)),
      0 22px 52px rgba(0,0,0,.46),
      0 0 28px color-mix(in srgb,var(--tint,var(--accent-cyan)) 24%,transparent);
  }
}

/* 10. Very short screens preserve the hero before decorative copy. */
@media (max-height: 720px) {
  #char-select .title-stack {
    transform: translateY(-12px) scale(.94);
    transform-origin: center top;
  }
  #char-select #difficulty {
    transform: scale(.94);
  }
  #char-select .legal {
    margin-top: 2px;
  }
}

/* ============================================================================
   OHANA — 100 REAL ART-DIRECTION IMPROVEMENTS
   ============================================================================ */
/* IMPROVEMENT 001 */
#char-select{isolation:isolate;}
/* IMPROVEMENT 002 */
#char-select{background:radial-gradient(900px 520px at 50% 6%,rgba(126,231,255,.12),transparent 58%),radial-gradient(700px 480px at 50% 78%,rgba(40,160,190,.18),transparent 62%),linear-gradient(180deg,#050b18 0%,#0a1830 48%,#07141b 100%);}
/* IMPROVEMENT 003 */
#char-select{padding-top:72px;}
/* IMPROVEMENT 004 */
#char-select{padding-bottom:22px;}
/* IMPROVEMENT 005 */
#char-select{gap:12px;}
/* IMPROVEMENT 006 */
#char-select .brand-bar{top:18px;}
/* IMPROVEMENT 007 */
#char-select .brand-bar{height:34px;}
/* IMPROVEMENT 008 */
#char-select .brand-bar{padding-inline:12px;}
/* IMPROVEMENT 009 */
#char-select .brand-bar{border-color:rgba(126,231,255,.16);}
/* IMPROVEMENT 010 */
#char-select .brand-bar{background:rgba(3,9,18,.58);}
/* IMPROVEMENT 011 */
#char-select .brand-bar{box-shadow:0 10px 30px rgba(0,0,0,.2);}
/* IMPROVEMENT 012 */
#char-select .brand-bar a{font-size:10px;}
/* IMPROVEMENT 013 */
#char-select .brand-bar a{letter-spacing:.16em;}
/* IMPROVEMENT 014 */
#char-select .brand-bar .brand-gb{font-size:12px;}
/* IMPROVEMENT 015 */
#char-select .title-stack{max-width:760px;}
/* IMPROVEMENT 016 */
#char-select .title-stack{margin-inline:auto;}
/* IMPROVEMENT 017 */
#char-select .eyebrow{color:#b8e6ff;}
/* IMPROVEMENT 018 */
#char-select .eyebrow{font-weight:700;}
/* IMPROVEMENT 019 */
#char-select h1{margin-top:4px;}
/* IMPROVEMENT 020 */
#char-select h1 .project{opacity:.88;}
/* IMPROVEMENT 021 */
#char-select h1 .ohana{filter:drop-shadow(0 12px 30px rgba(126,231,255,.18));}
/* IMPROVEMENT 022 */
#char-select .tagline{font-size:15px;}
/* IMPROVEMENT 023 */
#char-select .tagline{color:#d4e1ef;}
/* IMPROVEMENT 024 */
#char-select .tagline{margin-inline:auto;}
/* IMPROVEMENT 025 */
#char-select .tagline{max-width:520px;}
/* IMPROVEMENT 026 */
#char-select #difficulty{margin-top:4px;}
/* IMPROVEMENT 027 */
#char-select #difficulty{padding:4px;}
/* IMPROVEMENT 028 */
#char-select #difficulty{border-radius:999px;}
/* IMPROVEMENT 029 */
#char-select #difficulty{background:rgba(2,8,16,.52);}
/* IMPROVEMENT 030 */
#char-select #difficulty{border:1px solid rgba(255,255,255,.1);}
/* IMPROVEMENT 031 */
#char-select #difficulty button{border-radius:999px;}
/* IMPROVEMENT 032 */
#char-select #difficulty button{font-size:10px;}
/* IMPROVEMENT 033 */
#char-select #difficulty button{letter-spacing:.1em;}
/* IMPROVEMENT 034 */
#char-select #difficulty button{text-transform:uppercase;}
/* IMPROVEMENT 035 */
#char-select #difficulty button{background:transparent;}
/* IMPROVEMENT 036 */
#char-select #difficulty button:hover{background:rgba(255,255,255,.07);}
/* IMPROVEMENT 037 */
#char-select #difficulty button:focus-visible{outline:2px solid #fff;}
/* IMPROVEMENT 038 */
#char-select #menu-row{margin-top:8px;}
/* IMPROVEMENT 039 */
#char-select #menu-row{gap:12px;}
/* IMPROVEMENT 040 */
#char-select #menu-row .cta{border-radius:14px;}
/* IMPROVEMENT 041 */
#char-select #menu-row .cta{min-height:48px;}
/* IMPROVEMENT 042 */
#char-select #menu-row .cta{padding-inline:22px;}
/* IMPROVEMENT 043 */
#char-select #menu-row .cta.primary{min-width:154px;}
/* IMPROVEMENT 044 */
#char-select #menu-row .cta.primary{box-shadow:0 14px 34px rgba(46,201,192,.24);}
/* IMPROVEMENT 045 */
#char-select #menu-row .cta.primary:hover{box-shadow:0 18px 42px rgba(126,231,255,.34);}
/* IMPROVEMENT 046 */
#char-select #menu-row .cta.ghost{background:rgba(5,12,22,.72);}
/* IMPROVEMENT 047 */
#char-select #menu-row .cta.ghost{border-color:rgba(255,255,255,.14);}
/* IMPROVEMENT 048 */
#char-select #menu-row .cta.ghost:hover{border-color:rgba(126,231,255,.45);}
/* IMPROVEMENT 049 */
#chars{height:clamp(250px,43dvh,390px);}
/* IMPROVEMENT 050 */
#chars{margin-top:2px;}
/* IMPROVEMENT 051 */
#chars .chars-grid{height:100%;}
/* IMPROVEMENT 052 */
#chars .chars-grid{position:relative;}
/* IMPROVEMENT 053 */
#chars .char-card{top:58%;}
/* IMPROVEMENT 054 */
#chars .char-card{border-radius:24px;}
/* IMPROVEMENT 055 */
#chars .char-card{padding:14px 14px 18px;}
/* IMPROVEMENT 056 */
#chars .char-card{background:linear-gradient(180deg,rgba(19,31,49,.94),rgba(5,11,20,.96));}
/* IMPROVEMENT 057 */
#chars .char-card{border-color:rgba(255,255,255,.12);}
/* IMPROVEMENT 058 */
#chars .char-card{box-shadow:0 24px 60px rgba(0,0,0,.42);}
/* IMPROVEMENT 059 */
#chars .char-card:hover{transform:translate(-50%,-49%) scale(1.015);}
/* IMPROVEMENT 060 */
#chars .char-card.selected{width:min(350px,29vw);}
/* IMPROVEMENT 061 */
#chars .char-card.selected{max-height:min(400px,48dvh);}
/* IMPROVEMENT 062 */
#chars .char-card.selected{transform:translate(-50%,-48%) scale(1);}
/* IMPROVEMENT 063 */
#chars .char-card.selected{border-width:1px;}
/* IMPROVEMENT 064 */
#chars .char-card.selected{box-shadow:0 0 0 1px var(--tint,var(--accent-cyan)),0 26px 70px rgba(0,0,0,.5),0 0 44px color-mix(in srgb,var(--tint,var(--accent-cyan)) 22%,transparent);}
/* IMPROVEMENT 065 */
#chars .char-card.selected::before{color:var(--tint,var(--accent-cyan));}
/* IMPROVEMENT 066 */
#chars .char-card.selected::after{width:26px;}
/* IMPROVEMENT 067 */
#chars .char-card.selected::after{height:26px;}
/* IMPROVEMENT 068 */
#chars .char-card.selected::after{font-size:13px;}
/* IMPROVEMENT 069 */
#chars .char-card .role{font-size:9px;}
/* IMPROVEMENT 070 */
#chars .char-card .role{letter-spacing:.16em;}
/* IMPROVEMENT 071 */
#chars .char-card .role{padding:5px 11px;}
/* IMPROVEMENT 072 */
#chars .char-card h3{font-size:clamp(23px,2.7vw,34px);}
/* IMPROVEMENT 073 */
#chars .char-card h3{margin:10px 0 5px;}
/* IMPROVEMENT 074 */
#chars .char-card .h-move{font-size:11px;}
/* IMPROVEMENT 075 */
#chars .char-card .h-move{color:#e7f5ff;}
/* IMPROVEMENT 076 */
#chars .char-card .h-move{opacity:.86;}
/* IMPROVEMENT 077 */
#chars .char-card small{font-size:10px;}
/* IMPROVEMENT 078 */
#chars .char-card small{color:#b7cbe0;}
/* IMPROVEMENT 079 */
#chars .char-card .hint{margin-top:9px;}
/* IMPROVEMENT 080 */
#chars .char-card .hint{border-color:rgba(255,255,255,.1);}
/* IMPROVEMENT 081 */
#chars .char-card .hint{background:rgba(255,255,255,.045);}
/* IMPROVEMENT 082 */
#chars .char-card.selected .hint{background:color-mix(in srgb,var(--tint,var(--accent-cyan)) 12%,transparent);}
/* IMPROVEMENT 083 */
#chars .char-card.selected .hint{border-color:color-mix(in srgb,var(--tint,var(--accent-cyan)) 30%,transparent);}
/* IMPROVEMENT 084 */
#chars .char-card.is-prev,#chars .char-card.is-next{width:min(285px,23vw);}
/* IMPROVEMENT 085 */
#chars .char-card.is-prev,#chars .char-card.is-next{max-height:min(330px,40dvh);}
/* IMPROVEMENT 086 */
#chars .char-card.is-prev,#chars .char-card.is-next{opacity:.34;}
/* IMPROVEMENT 087 */
#chars .char-card.is-prev,#chars .char-card.is-next{filter:saturate(.65) brightness(.78);}
/* IMPROVEMENT 088 */
#chars .char-card.is-prev{transform:translate(calc(-50% - min(28vw,310px)),-40%) scale(.72);}
/* IMPROVEMENT 089 */
#chars .char-card.is-next{transform:translate(calc(-50% + min(28vw,310px)),-40%) scale(.72);}
/* IMPROVEMENT 090 */
#chars .char-card.is-prev:hover{opacity:.55;}
/* IMPROVEMENT 091 */
#chars .char-card.is-next:hover{opacity:.55;}
/* IMPROVEMENT 092 */
#chars .char-card.is-prev::after,#chars .char-card.is-next::after{display:none;}
/* IMPROVEMENT 093 */
#chars .roster-arrow{top:58%;}
/* IMPROVEMENT 094 */
#chars .roster-arrow{width:52px;}
/* IMPROVEMENT 095 */
#chars .roster-arrow{height:52px;}
/* IMPROVEMENT 096 */
#chars .roster-arrow{background:rgba(4,11,20,.74);}
/* IMPROVEMENT 097 */
#chars .roster-arrow{border-color:rgba(126,231,255,.22);}
/* IMPROVEMENT 098 */
#chars .roster-arrow:hover{background:rgba(126,231,255,.14);}
/* IMPROVEMENT 099 */
#chars .roster-arrow.prev{left:12px;}
/* IMPROVEMENT 100 */
#chars .roster-arrow.next{right:12px;}

/* ============================================================================
   OHANA — ROSTER COMPOSITION RESET 218
   One deliberate layout layer. The carousel is a stage, not a pile of cards.
   ============================================================================ */
#char-select {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto minmax(270px, 1fr) auto auto;
  grid-template-areas:
    "brand"
    "title"
    "difficulty"
    "chars"
    "menu"
    "legal";
  align-content: stretch;
  justify-items: center;
  gap: 0;
  min-height: 100dvh;
  padding: 68px 20px 18px;
  overflow: hidden;
}
#char-select .brand-bar { grid-area: brand; position:absolute; top:16px; left:20px; right:20px; }
#char-select .title-stack { grid-area: title; width:min(760px,100%); margin:0; transform:none; }
#char-select #difficulty { grid-area:difficulty; margin:8px 0 0; }
#char-select #chars {
  grid-area:chars;
  width:min(1180px,100%);
  height:100%;
  min-height:270px;
  margin:0;
  align-self:stretch;
  justify-self:center;
  overflow:visible;
}
#char-select #chars .chars-grid {
  position:relative;
  width:100%;
  height:100%;
  overflow:visible;
}
#char-select #chars .char-card {
  top:62%;
}
#char-select #chars .char-card.selected {
  transform:translate(-50%,-50%) scale(1);
}
#char-select #chars .char-card.is-prev {
  transform:translate(calc(-50% - min(27vw,310px)),-45%) scale(.72);
}
#char-select #chars .char-card.is-next {
  transform:translate(calc(-50% + min(27vw,310px)),-45%) scale(.72);
}
#char-select #chars .char-card.is-prev2,
#char-select #chars .char-card.is-next2 {
  opacity:0;
  pointer-events:none;
}
#char-select #chars .roster-arrow {
  top:62%;
  transform:translateY(-50%);
}
#char-select #menu-row {
  grid-area:menu;
  margin:8px 0 0;
}
#char-select .legal {
  grid-area:legal;
  margin-top:8px;
}
#char-select .chars-dots {
  bottom:8px;
}
.touch-btn.special-u {
  border-color:rgba(255,216,74,.48);
  box-shadow:0 0 18px rgba(255,216,74,.14);
  color:#fff4b0;
}
.touch-btn.special-u::after {
  content:"★";
  position:absolute;
  top:3px;
  right:5px;
  font-size:7px;
  opacity:.8;
}
.ability-slot[data-supreme="1"] {
  border-color:color-mix(in srgb,var(--abil,#ffd84a) 58%,transparent);
  box-shadow:0 0 22px color-mix(in srgb,var(--abil,#ffd84a) 18%,transparent);
}
.ability-slot[data-supreme="1"] .key {
  color:#fff3a2;
}
@media (max-width:900px) and (min-width:641px) {
  #char-select {
    padding-inline:12px;
    grid-template-rows:auto auto auto minmax(250px,1fr) auto auto;
  }
  #char-select #chars .char-card.is-prev {
    transform:translate(calc(-50% - 25vw),-45%) scale(.68);
  }
  #char-select #chars .char-card.is-next {
    transform:translate(calc(-50% + 25vw),-45%) scale(.68);
  }
}
@media (max-width:640px) {
  #char-select {
    grid-template-rows:auto auto auto minmax(255px,1fr) auto auto;
    padding:60px 10px 12px;
  }
  #char-select .brand-bar { left:10px; right:10px; top:12px; }
  #char-select .title-stack { transform:none; }
  #char-select #difficulty { margin-top:5px; }
  #char-select #chars { min-height:255px; }
  #char-select #chars .char-card {
    width:min(260px,68vw);
    max-height:min(370px,46dvh);
    top:62%;
  }
  #char-select #chars .char-card.selected {
    transform:translate(-50%,-50%) scale(1);
  }
  #char-select #chars .char-card.is-prev {
    transform:translate(calc(-50% - 30vw),-45%) scale(.66);
  }
  #char-select #chars .char-card.is-next {
    transform:translate(calc(-50% + 30vw),-45%) scale(.66);
  }
  #char-select #chars .roster-arrow { top:62%; }
  #char-select #menu-row { margin-top:4px; }
  #char-select .legal { margin-top:5px; }
}
