[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.glow-wrapper { width: min(98vw, 1400px, calc((100svh - 26px) * 16 / 9)); }
.infographic-container { box-shadow: inset 0 0 70px #0a17251a; }
.glow-wrapper.loaded { transition-delay: 0s; }
#loading-screen { transition-duration: .33s; }

.file-header { top: 4%; }
.file-header h1 { margin: 0; color: var(--text); font: inherit; font-weight: 500; }
.name-mark { top: 12%; }
.portrait-voice {
    position: absolute; z-index: 1; inset: auto 0 0;
    display: grid; place-items: end center; width: 100%; height: 95%;
    padding: 0; border: 0; background: transparent; cursor: pointer;
}
.portrait-voice:disabled { cursor: default; }
#aris-main-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; object-position: center bottom; pointer-events: none; }
#aris-main-image.robot-form { height: 84%; }
.portrait-voice:hover img:not(.robot-form) { filter: drop-shadow(0 24px 30px #0006) brightness(1.05); }
.portrait-voice:focus-visible { outline: 2px solid var(--accent); outline-offset: -7px; }

.main-info-buttons { width: max-content; max-width: calc(100% - 38px); z-index: 8; }
.info-btn { min-height: 44px; }
.info-btn[aria-expanded='true'] { color: var(--accent); background: var(--accent-soft); }
.info-btn:focus-visible, .control-btn:focus-visible, .weapon-toggle:focus-visible { outline-offset: -4px; }
.weapon-toggle { border: 0; }
.expressions-menu { grid-template-columns: repeat(3, 46px); }
.expressions-menu.robot-expressions { grid-template-columns: repeat(4, 46px); }
.expression-btn[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); }

.details {
    position: absolute; z-index: 4; inset: 0 auto 0 0;
    width: 50%; height: 100%; padding: 4.5% 5.5% 4%;
}
.show-right .details { left: auto; right: 0; }
.panel-variant { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-content { -webkit-user-select: text; user-select: text; }
.panel-content h2 { outline: none; }
.profile-scroll-container { scrollbar-width: auto; }
.profile-item p:first-child { padding-right: 0; }
.gallery-thumb {
    display: block; width: min(100%, 260px); padding: 0; margin: 12px 0 0;
    border: 1px solid var(--line-strong); background: var(--ink-0); cursor: zoom-in;
}
.gallery-thumb.wide { width: 100%; }
.gallery-thumb:hover { border-color: var(--accent); }
.image-pair .gallery-thumb, .image-row .gallery-thumb { width: calc(50% - 4px); }
.image-row .gallery-thumb { margin-top: 0; }
.profile-item button.gallery-thumb img.clickable-image { width: 100%; max-width: none; margin: 0; box-shadow: none; }
.image-pair img { aspect-ratio: 16 / 10; object-fit: contain; }
.video-container video { aspect-ratio: 720 / 332; }

.show-left .main-info-buttons { left: 75%; }
.show-right .main-info-buttons { left: 25%; }
.is-detail .main-info-buttons { max-width: calc(50% - 22px); }
.is-detail .info-btn { padding-inline: clamp(6px, .75vw, 14px); }
.show-left #volume-controls-wrapper { right: calc(50% + 20px); }
#volume-controls-wrapper { z-index: 7; padding: 7px 10px; gap: 3px; }
.volume-control-container { gap: 8px; }
.volume-control-container .vol-label { text-transform: uppercase; color: var(--text-dim); }
.music-toggle, .voice-icon {
    width: 22px; height: 22px; padding: 0; display: grid; place-items: center;
    color: var(--accent); border: 0; background: transparent;
}
.music-toggle { cursor: pointer; }
.music-toggle[aria-pressed='false'] { opacity: .66; }
.music-toggle:hover { background: var(--accent-soft); }
.volume-control-container svg { color: var(--accent); }

#voice-line-bubble {
    --caption-measure: clamp(155px, var(--caption-width, 40%), min(345px, 88%));
    width: var(--caption-measure); max-width: none; min-width: 0;
    left: clamp(calc(var(--caption-measure) / 2 + 4px), var(--caption-x, 50%), calc(100% - var(--caption-measure) / 2 - 4px));
    bottom: clamp(14%, var(--caption-y, 60%), 75%);
    padding: 9px 16px; opacity: 1; transform: translateX(-50%);
    border: 1px solid var(--accent); border-radius: 9px;
    background: #edf6ff; box-shadow: 0 7px 24px #04080d80;
}
#voice-line-bubble[data-anchor='left'] { left: clamp(4px, var(--caption-x), calc(100% - var(--caption-measure) - 4px)); transform: none; }
#voice-line-bubble[data-anchor='right'] { left: clamp(calc(var(--caption-measure) + 4px), var(--caption-x), calc(100% - 4px)); transform: translateX(-100%); }
#voice-line-bubble::before { content: ''; position: absolute; top: -5px; left: calc(50% - 4px); width: 8px; height: 8px; transform: rotate(45deg); border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); background: #edf6ff; }
#voice-line-text { margin: 0; transform: none; }

#image-popup-overlay {
    inset: 0; width: min(950px, calc(100% - 28px)); height: auto; max-height: calc(100% - 28px); margin: auto;
    padding: 51px 15px 15px; border: 1px solid var(--line-strong); background: var(--ink-1);
    color: var(--text); opacity: 1; overflow: auto;
}
#image-popup-overlay[open] { display: block; }
#image-popup-overlay::backdrop { background: #080c14eb; backdrop-filter: blur(5px); }
#image-popup-overlay figure { margin: 0; display: grid; justify-items: center; }
#image-popup-overlay figcaption { width: 100%; display: flex; justify-content: space-between; gap: 9px; margin-top: 10px; color: var(--text-dim); }
#popup-image { display: block; max-width: 100%; max-height: 69svh; min-height: 0; object-fit: contain; }
#popup-close { top: 6px; right: 7px; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-strong); background: var(--ink-2); }
.gallery-controls { display: flex; justify-content: center; gap: 8px; margin-top: 9px; }
.gallery-controls .popup-arrow { position: static; translate: none; transform: none; width: 44px; height: 44px; }
.no-script { position: fixed; z-index: 2400; bottom: 5%; max-width: 90%; }

@media (801px <= width <= 1150px) {
    .is-detail .main-info-buttons { flex-wrap: wrap; justify-content: center; bottom: 10%; }
    .is-detail .info-btn { flex: 1 1 48%; min-height: 34px; }
}

@media (max-width: 800px) {
    body { min-height: 100svh; }
    .glow-wrapper { width: 100%; height: 100svh; min-height: 420px; }
    .file-header { display: flex; border: 0; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .name-mark { top: 17%; }
    .portrait-voice { height: calc(100% - 202px); bottom: clamp(112px, 15.2svh, 130px); padding-inline: 8px; }
    #aris-main-image { margin: 0; }
    .main-info-buttons { left: 50%; bottom: max(13px, env(safe-area-inset-bottom)); width: calc(100% - 28px); }
    .info-btn { white-space: normal; line-height: 1.16; text-wrap: balance; }
    .expressions-container { top: max(17px, env(safe-area-inset-top)); }
    #toggle-expressions-btn { min-height: 39px; }
    .weapon-toggle { right: max(16px, env(safe-area-inset-right)); top: max(19px, env(safe-area-inset-top)); height: 35px; }
    .weapon-toggle::before { top: 6px; }
    #volume-controls-wrapper { right: max(16px, env(safe-area-inset-right)); top: calc(max(19px, env(safe-area-inset-top)) + 43px); padding: 5px 9px; }
    .details { width: 100%; padding: max(20px, env(safe-area-inset-top)) 17px max(17px, env(safe-area-inset-bottom)); background: var(--ink-1); }
    .profile-scroll-container { padding-bottom: 8px; }
    .is-detail #stage, .is-detail .main-info-buttons, .is-detail #volume-controls-wrapper { display: none; }
    #voice-line-bubble { bottom: clamp(16%, calc(var(--caption-y, 60%) - 13%), 68%); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
