@font-face { font-family: 'Archive'; src: url('fonts/archive.ttf') format('truetype'); font-display: swap; }

/* --- SISTEMA DE COLOR --- */
:root {
    --ink-0: #0a111d;
    --ink-1: #0f1828;
    --ink-2: #152237;
    --ink-3: #1c2c45;
    --line: rgba(150, 182, 224, 0.14);
    --line-strong: rgba(150, 182, 224, 0.32);
    --text: #e9eef6;
    --text-dim: #a3b2c7;
    --text-faint: #8ba0b9;
    --accent: #5ab0ec;
    --accent-soft: rgba(90, 176, 236, 0.14);
    --accent-ink: #0a1a2b;
    --halo: #8fdcd4;
    --font-display: 'Archive', 'Zen Kaku Gothic New', sans-serif;
    --font-body: 'Zen Kaku Gothic New', 'Hiragino Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --cut: 12px;
    --ease: cubic-bezier(0.65, 0, 0.35, 1);
}
.key-mode-active {
    --ink-1: #1a1220;
    --ink-2: #23172b;
    --ink-3: #2e1f38;
    --line: rgba(232, 160, 205, 0.14);
    --line-strong: rgba(232, 160, 205, 0.32);
    --text-dim: #c3adbf;
    --text-faint: #b79aba;
    --accent: #e0579c;
    --accent-soft: rgba(224, 87, 156, 0.16);
    --accent-ink: #2a0c1c;
    --halo: #f2a7cc;
}

/* --- KEYFRAMES --- */
@keyframes reveal-logo { from { transform: translateX(0); } to { transform: translateX(105%); } }
@keyframes load-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes cascade-1 { from { transform: translate(0, 0); } to { transform: translate(-15%, -20%); } }
@keyframes cascade-2 { from { transform: translate(0, 0); } to { transform: translate(20%, 15%); } }
@keyframes cascade-3 { from { transform: translate(0, 0); } to { transform: translate(-25%, 10%); } }
@keyframes cascade-4 { from { transform: translate(0, 0); } to { transform: translate(10%, 25%); } }
@keyframes cascade-5 { from { transform: translate(0, 0); } to { transform: translate(-10%, -10%); } }
@keyframes cascade-6 { from { transform: translate(0, 0); } to { transform: translate(15%, -15%); } }

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text);
    margin: 0;
    padding: 1vw;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    background-color: var(--ink-0);
    background-image:
        linear-gradient(180deg, rgba(10, 17, 29, 0.72), rgba(10, 17, 29, 0.9)),
        url('images/campus-background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
/* Grano fijo sobre todo el viewport */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3000;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* === PANTALLA DE CARGA === */
#loading-screen {
    position: fixed; inset: 0;
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 56px,
        var(--ink-0);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 2000; transition: opacity 0.8s ease;
}
.logo-container { position: relative; width: 200px; overflow: hidden; }
.logo-image { width: 100%; height: auto; display: block; }
.logo-container::before { content: ''; position: absolute; inset: 0; background-color: var(--ink-0); animation: reveal-logo 1.05s ease-out forwards; }
.loading-caption {
    margin-top: 28px; width: 240px;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-faint); display: flex; justify-content: space-between;
}
.loading-bar { width: 240px; height: 1px; margin-top: 10px; background: var(--line); position: relative; overflow: hidden; }
.loading-bar::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: load-bar 1.15s var(--ease) forwards; }
#start-button { margin-top: 36px; min-width: 160px; }
#loading-screen.hidden { opacity: 0; pointer-events: none; }

/* === MARCO PRINCIPAL === */
.glow-wrapper {
    position: relative; width: 98vw; max-width: 1400px; aspect-ratio: 16 / 9; z-index: 1;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: opacity 0.6s 0.3s ease-in-out;
}
.glow-wrapper.loaded { opacity: 1; visibility: visible; }
/* Corchetes de esquina en lugar del halo difuminado */
.glow-wrapper::before {
    content: ''; position: absolute; inset: -9px; pointer-events: none; z-index: 2;
    --b: var(--accent);
    background:
        linear-gradient(var(--b), var(--b)) top left / 28px 1px,
        linear-gradient(var(--b), var(--b)) top left / 1px 28px,
        linear-gradient(var(--b), var(--b)) top right / 28px 1px,
        linear-gradient(var(--b), var(--b)) top right / 1px 28px,
        linear-gradient(var(--b), var(--b)) bottom left / 28px 1px,
        linear-gradient(var(--b), var(--b)) bottom left / 1px 28px,
        linear-gradient(var(--b), var(--b)) bottom right / 28px 1px,
        linear-gradient(var(--b), var(--b)) bottom right / 1px 28px;
    background-repeat: no-repeat;
    opacity: 0.7;
}
.infographic-container {
    position: relative; width: 100%; height: 100%;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(160deg, var(--ink-3) 0%, var(--ink-1) 55%, var(--ink-0) 100%);
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
    transition: background 0.6s ease;
}
/* Viñeta suave */
.infographic-container::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(5, 9, 16, 0.55) 100%);
}

.background-layer { position: absolute; top: -25%; left: -25%; width: 150%; height: 150%; background-repeat: repeat; background-size: 750px auto; z-index: 0; pointer-events: none; transition: filter 0.5s ease-in-out; }
.layer-1 { background-image: url('images/bg_layer_1.png'); opacity: 0.07; animation: cascade-1 120s linear infinite; }
.layer-2 { background-image: url('images/bg_layer_2.png'); opacity: 0.1; animation: cascade-2 95s linear infinite; }
.layer-3 { background-image: url('images/bg_layer_3.png'); opacity: 0.05; animation: cascade-3 150s linear infinite; }
.layer-4 { background-image: url('images/bg_layer_4.png'); opacity: 0.08; animation: cascade-4 110s linear infinite alternate; }
.layer-5 { background-image: url('images/bg_layer_5.png'); opacity: 0.05; animation: cascade-5 130s linear infinite alternate; }
.layer-6 { background-image: url('images/bg_layer_6.png'); opacity: 0.07; animation: cascade-6 160s linear infinite; }

/* === PANELES === */
.panel { position: absolute; top: 0; height: 100%; transition: transform 0.7s var(--ease); z-index: 3; }
.panel-center { left: 25%; width: 50%; display: flex; justify-content: center; align-items: flex-end; }
.panel-left, .panel-right { width: 50%; padding: 4.5% 5.5% 4%; }
.panel-left { left: 0; transform: translateX(-100%); }
.panel-right { right: 0; transform: translateX(100%); }
.infographic-container.show-left .panel-left { transform: translateX(0); }
.infographic-container.show-left .panel-center { transform: translateX(50%); }
.infographic-container.show-right .panel-right { transform: translateX(0); }
.infographic-container.show-right .panel-center { transform: translateX(-50%); }

/* Cabecera tipo ficha de estudiante */
.file-header {
    position: absolute; top: 4.5%; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 14px; white-space: nowrap;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--text-faint); z-index: 4; pointer-events: none;
}
.file-header b { color: var(--text); font-weight: 500; }
.file-header .dot { width: 6px; height: 6px; background: var(--accent); animation: blink 2.4s steps(1) infinite; }
.file-header .sep { width: 24px; height: 1px; background: var(--line-strong); }
.file-header .tag-key { display: none; }
.key-mode-active .file-header .tag-key { display: inline; }
.key-mode-active .file-header .tag-aris { display: none; }

/* Nombre gigante en contorno detrás del personaje */
.name-mark {
    position: absolute; left: 50%; top: 10%; transform: translateX(-50%);
    font-family: var(--font-display); font-size: clamp(5rem, 17vw, 15rem); line-height: 0.8;
    letter-spacing: 0.02em; color: transparent; -webkit-text-stroke: 1px var(--line-strong);
    pointer-events: none; z-index: 0; white-space: nowrap;
}
.name-mark .tag-key { display: none; }
.key-mode-active .name-mark .tag-key { display: inline; }
.key-mode-active .name-mark .tag-aris { display: none; }

.aris-main-image { position: relative; z-index: 1; height: 95%; width: auto; object-fit: contain; transition: transform 0.35s var(--ease), filter 0.35s ease; cursor: pointer; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.35)); }
.aris-main-image:hover { filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.35)) brightness(1.05); transform: translateY(-4px); }
.aris-main-image.no-weapon-active { transform: translateX(7px); }
.aris-main-image.no-weapon-active:hover { transform: translateX(7px) translateY(-4px); }
.aris-main-image.robot-form { height: 75%; transform: translateY(-10%); }
.aris-main-image.robot-form:hover { transform: translateY(calc(-10% - 4px)); }

.floating-controls { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.floating-controls > * { pointer-events: auto; }
.expressions-container { position: absolute; top: 40%; left: 8%; z-index: 11; }

/* === TIPOGRAFÍA DE PANEL === */
.panel-content { transition: opacity 0.3s ease-in-out; }
.panel-content h2 {
    font-family: var(--font-display); font-weight: normal; color: var(--text);
    font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.05; letter-spacing: 0.01em;
    margin: 0 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
    position: relative;
}
.panel-content h2::before {
    content: attr(data-eyebrow);
    display: block; margin-bottom: 10px;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--accent);
}
.panel-content h2::after {
    content: ''; position: absolute; left: 0; bottom: -1px; width: 56px; height: 1px; background: var(--accent);
}
.panel-content p { font-family: var(--font-body); line-height: 1.75; font-size: clamp(0.82rem, 1.2vw, 0.95rem); }

/* === BOTONES === */
.control-btn, .info-btn, .back-btn {
    --c: var(--accent);
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--c); color: var(--accent-ink);
    border: none; padding: 11px 22px;
    font-family: var(--font-display); font-size: clamp(0.78rem, 1.2vw, 0.95rem); letter-spacing: 0.04em;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.control-btn:hover, .back-btn:hover { background: var(--text); color: var(--ink-0); }
.control-btn:active, .info-btn:active, .back-btn:active { transform: translateY(1px); }

.back-btn {
    margin-top: 22px; background: transparent; color: var(--text-dim);
    padding: 10px 18px 10px 14px;
    box-shadow: inset 0 0 0 1px var(--line-strong);
    clip-path: none;
}
.back-btn::before { content: '←'; font-family: var(--font-mono); color: var(--accent); transition: transform 0.2s ease; }
.back-btn:hover { background: var(--accent-soft); color: var(--text); }
.back-btn:hover::before { transform: translateX(-3px); }

/* Barra de navegación inferior */
.main-info-buttons {
    position: absolute; bottom: 7%; left: 50%; translate: -50% 0;
    display: flex; gap: 0; z-index: 6;
    background: rgba(10, 17, 29, 0.62);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    padding: 5px;

}
.info-btn {
    background: transparent; color: var(--text);
    clip-path: none; padding: 10px 18px; white-space: nowrap;
    font-size: clamp(0.72rem, 1.05vw, 0.88rem);
}
.info-btn + .info-btn { box-shadow: -1px 0 0 0 var(--line); }
.info-btn .btn-idx { font-family: var(--font-mono); font-size: 0.72em; color: var(--accent); letter-spacing: 0.06em; transition: color 0.2s ease; }
.info-btn:hover { background: var(--accent); color: var(--accent-ink); }
.info-btn:hover .btn-idx { color: var(--accent-ink); }

#key-mode-activate-btn { --c: #e0579c; background: #e0579c; color: #2a0c1c; margin-top: 14px; }
#key-mode-activate-btn:hover { background: var(--text); color: var(--ink-0); }
.key-mode-active #key-mode-deactivate-btn { background: #5ab0ec; color: #0a1a2b; }
.key-mode-active #key-mode-deactivate-btn:hover { background: var(--text); color: var(--ink-0); }
#key-robot-toggle, #key-mode-deactivate-btn { margin-top: 14px; }

/* === MENÚS DE EXPRESIONES === */
#toggle-expressions-btn { background: rgba(10, 17, 29, 0.62); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); clip-path: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#toggle-expressions-btn::before { content: ''; width: 7px; height: 7px; border: 1px solid var(--accent); transform: rotate(45deg); }
#toggle-expressions-btn:hover { background: var(--accent); color: var(--accent-ink); }
#toggle-expressions-btn:hover::before { border-color: var(--accent-ink); }

.expressions-menu, .key-expressions-menu, .key-robot-expressions-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    display: none; grid-template-columns: repeat(3, 46px); gap: 6px;
    background: rgba(10, 17, 29, 0.88);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    padding: 10px; max-height: 236px; overflow-y: auto;
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease; z-index: 12;
}
.key-robot-expressions-menu { grid-template-columns: repeat(4, 46px); }
.expressions-menu.visible, .key-expressions-menu.visible, .key-robot-expressions-menu.visible { display: grid; opacity: 1; transform: none; pointer-events: auto; }
.expression-btn {
    width: 46px; height: 46px; padding: 0;
    background-color: var(--ink-2); background-repeat: no-repeat;
    border: none; box-shadow: inset 0 0 0 1px var(--line-strong);
    font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    transition: box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.expression-btn.face { background-size: 520% auto; background-position: 46% 7%; filter: saturate(0.7) brightness(0.85); }
.expression-btn:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); filter: none; }
.expression-btn.active { box-shadow: inset 0 0 0 2px var(--accent); background-color: var(--accent-soft); color: var(--text); filter: none; }
.key-expressions-menu .expression-btn.active, .key-robot-expressions-menu .expression-btn.active { background-color: var(--accent); color: var(--accent-ink); }

/* === INTERRUPTOR DE ARMA === */
.weapon-toggle {
    position: absolute; top: 15%; right: 8%; width: 104px; height: 30px;
    background: rgba(10, 17, 29, 0.62); box-shadow: inset 0 0 0 1px var(--line-strong);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    cursor: pointer; transition: background-color 0.25s ease;
}
.weapon-toggle::before { content: ''; position: absolute; width: 22px; height: 22px; background: var(--text-dim); top: 4px; left: 4px; transition: transform 0.3s var(--ease), background-color 0.25s ease; }
.weapon-toggle::after { content: 'Sin arma'; position: absolute; top: 50%; right: 11px; transform: translateY(-50%); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.weapon-toggle.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.weapon-toggle.active::before { transform: translateX(74px); background: var(--accent); }
.weapon-toggle.active::after { content: 'Con arma'; left: 11px; right: auto; color: var(--text); }

/* === CONTROLES DE VOLUMEN === */
#volume-controls-wrapper {
    position: absolute; bottom: 14px; right: 18px; display: flex; flex-direction: column; gap: 8px;
    background: rgba(10, 17, 29, 0.78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    padding: 12px 14px; z-index: 1001; opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
#volume-controls-wrapper.visible { opacity: 1; pointer-events: auto; }
.volume-control-container { display: flex; align-items: center; gap: 10px; }
.volume-control-container .vol-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-faint); width: 34px; }
.volume-control-container svg { width: 14px; height: 14px; color: #5ab0ec; flex-shrink: 0; }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; width: 130px; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: rgba(150, 182, 224, 0.3); }
input[type=range]::-moz-range-track { height: 2px; background: rgba(150, 182, 224, 0.3); }
input[type=range]::-moz-range-progress { height: 2px; background: #5ab0ec; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -5px; background: #e9eef6; height: 12px; width: 12px; transform: rotate(45deg); transition: background-color 0.2s ease; }
input[type=range]::-moz-range-thumb { border: none; border-radius: 0; background: #e9eef6; height: 10px; width: 10px; transform: rotate(45deg); }
input[type=range]:hover::-webkit-slider-thumb { background: #5ab0ec; }

/* === GLOBO DE DIÁLOGO === */
#voice-line-bubble {
    position: absolute; bottom: 40%; left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.9) rotateX(180deg);
    min-width: 150px; max-width: 320px;
    background-image: url('images/text_bubble.png'); background-size: 100% auto; background-repeat: no-repeat; background-position: center bottom;
    padding: 28px 25px 20px 25px;
    display: flex; justify-content: center; align-items: center;
    z-index: 20; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease; min-height: 85px;
}
#voice-line-bubble.visible { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotateX(180deg); }
#voice-line-text {
    font-family: var(--font-body); font-weight: 500; font-size: 14px; text-align: center; color: #1b2a44;
    transform: rotateX(180deg); max-width: 100%; margin: -3px 0 0 0;
    word-wrap: break-word; white-space: normal; line-height: 1.45;
    transition: opacity 0.2s ease-in-out, transform 0.3s ease;
}

/* === CONTENIDO CON SCROLL === */
#panel-profile, #panel-origins, #panel-combat, #panel-lore, #panel-kit { display: flex; flex-direction: column; height: 100%; }
#panel-profile h2, #panel-origins h2, #panel-combat h2, #panel-lore h2, #panel-kit h2 { flex-shrink: 0; }
.profile-scroll-container { flex-grow: 1; overflow-y: auto; padding-right: 14px; min-height: 0; }

.profile-item {
    position: relative; counter-increment: item;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 0 0 1px var(--line);
    padding: 18px 20px 18px;
    margin-bottom: 10px;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
    transition: background-color 0.4s ease;
}
.profile-item::before { content: ''; position: absolute; top: 0; left: 0; width: 28px; height: 2px; background: var(--accent); }
.profile-item p { margin: 0; padding: 0; line-height: 1.7; color: var(--text-dim); }
.profile-item p strong { color: var(--text); font-weight: 700; }
.profile-item > p:first-child { padding-right: 32px; }
.profile-item > p:first-child > strong:only-child { font-family: var(--font-display); font-weight: normal; font-size: 1.05em; letter-spacing: 0.01em; }
.profile-item p + p { margin-top: 8px; font-size: 0.9em; }
.profile-item img.clickable-image { width: 100%; max-width: 240px; display: block; margin-top: 14px; box-shadow: 0 0 0 1px var(--line-strong); cursor: zoom-in; transition: filter 0.3s ease, box-shadow 0.3s ease; filter: saturate(0.9); }
.profile-item img.clickable-image:hover { filter: saturate(1.05) brightness(1.06); box-shadow: 0 0 0 1px var(--accent); }
.profile-item img.clickable-image.wide { max-width: 100%; }
.image-row { display: flex; gap: 8px; margin-top: 14px; }
.image-row img.clickable-image { width: calc(50% - 4px); margin-top: 0; object-fit: cover; aspect-ratio: 16 / 10; }
.profile-item .image-pair { display: flex; gap: 8px; align-items: flex-start; }
.profile-item .image-pair img.clickable-image { width: calc(50% - 4px); }

/* Perfil como tabla de datos */
.data-sheet { margin: 0 0 14px; padding: 0; }
.data-row { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.data-row dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.data-row dd { margin: 0; font-size: clamp(0.85rem, 1.2vw, 0.98rem); color: var(--text); }
.data-row dd small { color: var(--text-faint); font-size: 0.85em; margin-left: 6px; }

#panel-profile .back-btn, #panel-origins .back-btn, #panel-combat .back-btn, #panel-lore .back-btn, #panel-kit .back-btn { flex-shrink: 0; width: fit-content; }

/* Barras de scroll */
.profile-scroll-container::-webkit-scrollbar, .expressions-menu::-webkit-scrollbar, .key-expressions-menu::-webkit-scrollbar, .key-robot-expressions-menu::-webkit-scrollbar { width: 3px; }
.profile-scroll-container::-webkit-scrollbar-track, .expressions-menu::-webkit-scrollbar-track, .key-expressions-menu::-webkit-scrollbar-track, .key-robot-expressions-menu::-webkit-scrollbar-track { background: var(--line); }
.profile-scroll-container::-webkit-scrollbar-thumb, .expressions-menu::-webkit-scrollbar-thumb, .key-expressions-menu::-webkit-scrollbar-thumb, .key-robot-expressions-menu::-webkit-scrollbar-thumb { background-color: var(--accent); }
.profile-scroll-container, .expressions-menu, .key-expressions-menu, .key-robot-expressions-menu { scrollbar-width: thin; scrollbar-color: var(--accent) var(--line); }

/* === MODO KEY === */
.key-mode-active .background-layer { filter: hue-rotate(-80deg) saturate(1.3); }
.key-mode-active .aris-main-image:hover { filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.35)) brightness(1.05); }
.profile-item.key-mode-info { background: linear-gradient(180deg, rgba(224, 87, 156, 0.09), rgba(224, 87, 156, 0.03)); }

/* === POPUP DE IMAGEN === */
#image-popup-overlay {
    position: fixed; inset: 0; background: rgba(8, 12, 20, 0.9);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    z-index: 1000; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease-in-out;
}
#image-popup-overlay.visible { opacity: 1; }
#popup-image { max-width: 80vw; max-height: 80vh; transition: filter 0.5s ease; }
#popup-image[src*="millennium_location.webp"], #popup-image[src*="academy_loading_screen_5.webp"], #popup-image[src*="alice_weapon.webp"] { filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)); }
#popup-image:not([src*="millennium_location.webp"]):not([src*="academy_loading_screen_5.webp"]):not([src*="alice_weapon.webp"]) { box-shadow: 0 0 0 1px rgba(150, 182, 224, 0.32), 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
#popup-close {
    position: absolute; top: 24px; right: 24px; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 1.6rem; line-height: 1; color: #e9eef6;
    box-shadow: inset 0 0 0 1px rgba(150, 182, 224, 0.32);
    cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; z-index: 1002;
}
#popup-close:hover { background: #e9eef6; color: #0a111d; }
.popup-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; padding: 0;
    background: rgba(10, 17, 29, 0.6); color: #e9eef6;
    border: none; box-shadow: inset 0 0 0 1px rgba(150, 182, 224, 0.32);
    font-family: var(--font-mono); font-size: 1.1rem; cursor: pointer; z-index: 1001;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.popup-arrow:hover { background: #5ab0ec; color: #0a1a2b; }
.popup-arrow.prev { left: 24px; }
.popup-arrow.next { right: 24px; }

/* === VIDEO === */
.video-container { width: 100%; margin-top: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-strong); background: var(--ink-0); }
.video-container video { width: 100%; height: auto; display: block; opacity: 1; transition: opacity 0.4s ease-in-out; }
.video-container video.video-fade { opacity: 0; }

/* === ICONOS DE HABILIDAD === */
.skill-title-container { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.profile-item > p.skill-title-container:first-child > strong { font-family: var(--font-display); font-weight: normal; font-size: 1.02em; line-height: 1.3; }
.skill-icon { width: 38px; height: 38px; flex-shrink: 0; padding: 4px; background: var(--ink-0); box-shadow: inset 0 0 0 1px var(--line-strong); object-fit: contain; }

/* === RESPONSIVE (PANELES DESDE ABAJO) === */
@media (max-width: 800px) {
    body { padding: 0; overflow-x: hidden; }
    .glow-wrapper { width: 100vw; height: 100vh; height: 100dvh; max-width: none; aspect-ratio: unset; }
    .glow-wrapper::before { display: none; }
    .infographic-container { border: none; clip-path: none; }

    .panel-center { width: 100%; left: 0; }
    .panel-left, .panel-right {
        width: 100%; height: 100%; top: 0; left: 0; padding: 28px 20px;
        background: var(--ink-1);
        z-index: 10;
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .infographic-container.show-left .panel-left,
    .infographic-container.show-right .panel-right { transform: translateY(0); }
    .infographic-container.show-left .panel-center,
    .infographic-container.show-right .panel-center { transform: none; }

    .file-header { display: none; }
    .name-mark { top: 16%; font-size: 34vw; }
    .aris-main-image { height: 70%; margin-bottom: 22%; }
    .aris-main-image.robot-form { height: 55%; }

    .main-info-buttons { bottom: 20px; width: calc(100% - 32px); flex-wrap: wrap; justify-content: center; }
    .info-btn { padding: 12px 8px; font-size: 0.75rem; flex: 1 1 48%; }
    .info-btn + .info-btn { box-shadow: none; }

    .expressions-container { top: 20px; left: 16px; }
    .weapon-toggle { top: 22px; right: 16px; }
    #voice-line-bubble { bottom: 35%; max-width: 280px; }
    .data-row { grid-template-columns: 7.5em 1fr; }
    .profile-scroll-container { padding-bottom: 80px; }
    #volume-controls-wrapper { bottom: auto; top: 64px; right: 16px; padding: 8px 10px; gap: 6px; }
    #volume-controls-wrapper input[type=range] { width: 72px; }
    .volume-control-container .vol-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .background-layer, .file-header .dot, .main-info-buttons { animation: none !important; }
}
