/* =========================================================
   FANTASMGALLERY // ORACLE
   Strict 100vh Scene Layout
   ========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-main: #E5E5E5;
    --border-accent: #7A7F82;
    --glow-accent: rgba(104, 110, 113, 0.72);
    --glow-soft: rgba(104, 110, 113, 0.30);
    --text-main: #333333;
    --text-deep: #1A1A1A;
    --mono: 'VT323', monospace;
    --page-pad: clamp(18px, 2.4vw, 42px);
    --photo-width: 520px;
    --photo-height: 420px;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--mono);
    font-size: 24px;
    -webkit-font-smoothing: none;
}

button {
    font-family: inherit;
}

body.modal-open {
    overflow: hidden;
}

/* ---------- СЕТКА НА 3 КОЛОНКИ ---------- */
.stage-grid {
    position: relative;
    display: grid;
    grid-template-columns: 26% 46% 28%;
    width: 100%;
    height: calc(100vh + 48px);
    overflow: visible;
}

.zone-left,
.zone-center,
.zone-right {
    position: relative;
    height: 100vh;
    min-width: 0;
}

.top-tier::before,
.zone-left::before,
.zone-center::before,
.zone-right::before {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(104, 110, 113, 0.26), transparent 70%);
    filter: blur(38px);
    pointer-events: none;
}

/* =========================================================
   ЛЕВАЯ ЗОНА: ДОСЬЕ И ФАЙЛЫ
   ========================================================= */
.zone-left {
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 34px 18px 24px var(--page-pad);
}

.zone-left > *,
.zone-center > * {
    position: relative;
    z-index: 1;
}

.oracle-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 24px;
    font-size: 26px;
    line-height: 1.05;
}

.meta-line {
    display: flex;
    gap: 12px;
}

.meta-line .k {
    color: #555;
}

.meta-line .v {
    color: var(--text-deep);
    font-weight: bold;
}

.file-explorer {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 95%;
}

.file-list-label {
    margin-bottom: 10px;
    color: rgba(51, 51, 51, 0.62);
    font-size: 17px;
    letter-spacing: 1px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    margin: 0;
    padding: 0 6px 0 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: none;
}

.file-list::-webkit-scrollbar {
    display: none;
}

.anonymous-wall {
    position: relative;
    z-index: 10;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 10px 12px;
    border: 1px solid rgba(104, 110, 113, 0.55);
    background: rgba(104, 110, 113, 0.04);
    box-shadow: inset 0 0 10px rgba(104, 110, 113, 0.08), 0 0 24px var(--glow-soft);
}

.wall-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wall-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 19px;
    font-weight: normal;
    line-height: 1;
    overflow-wrap: anywhere;
}

.wall-header span,
.wall-status {
    color: rgba(51, 51, 51, 0.75);
    font-size: 12px;
    letter-spacing: 1px;
}

.wall-feed {
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 7px 0;
    overflow: visible;
    border-top: 1px solid rgba(104, 110, 113, 0.35);
    border-bottom: 1px solid rgba(104, 110, 113, 0.35);
}

.wall-empty {
    margin: 0;
    color: rgba(51, 51, 51, 0.55);
    font-size: 14px;
    line-height: 1.2;
}

.wall-message {
    padding: 8px 0;
    border-bottom: 1px solid rgba(104, 110, 113, 0.24);
}

.wall-message-body {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.wall-message-time {
    color: rgba(51, 51, 51, 0.56);
    font-size: 11px;
}

.wall-form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wall-form textarea {
    display: block;
    width: 100%;
    min-height: 58px;
    padding: 7px 8px;
    border: 1px solid rgba(104, 110, 113, 0.5);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.28);
    color: var(--text-main);
    font: 16px/1.1 var(--mono);
    resize: vertical;
}

.wall-form textarea:focus-visible,
.wall-submit:focus-visible {
    outline: 2px solid var(--border-accent);
    outline-offset: 2px;
}

.wall-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wall-status {
    min-width: 0;
    overflow-wrap: anywhere;
}

.wall-submit {
    flex: none;
    padding: 5px 8px;
    border: 1px solid var(--border-accent);
    border-radius: 0;
    background: rgba(104, 110, 113, 0.08);
    color: var(--text-deep);
    font: 16px/1 var(--mono);
    cursor: pointer;
}

.wall-submit:hover {
    background: var(--border-accent);
    box-shadow: 0 0 16px var(--glow-soft);
}

.wall-submit:disabled {
    opacity: 0.48;
    cursor: wait;
}

.captcha-modal {
    margin: auto;
    padding: 0;
    width: min(92vw, 400px);
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 2px solid var(--border-accent);
    border-radius: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--mono);
    box-shadow: 0 0 24px var(--glow-accent), 0 0 48px rgba(0, 0, 0, 0.45);
}

.captcha-modal::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
}

.captcha-modal-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 14px;
    background: rgba(104, 110, 113, 0.04);
    box-shadow: inset 0 0 12px rgba(104, 110, 113, 0.08);
}

.captcha-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(104, 110, 113, 0.45);
}

.captcha-modal-title {
    margin: 0;
    color: var(--text-deep);
    font-size: 20px;
    font-weight: normal;
    letter-spacing: 1px;
    line-height: 1.1;
}

.captcha-close {
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border-accent);
    border-radius: 0;
    background: rgba(104, 110, 113, 0.08);
    color: var(--text-deep);
    font: 18px/1 var(--mono);
    cursor: pointer;
}

.captcha-close:hover {
    background: var(--border-accent);
    color: #FFFFFF;
}

.captcha-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.captcha-instruction {
    margin: 0;
    color: var(--text-main);
    font-size: 16px;
    letter-spacing: 0.5px;
    text-align: center;
}

.captcha-target-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 1px solid var(--border-accent);
    background: #0d0f10;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.captcha-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.captcha-target-placeholder {
    color: rgba(229, 229, 229, 0.65);
    font-size: 14px;
    letter-spacing: 1px;
}

.captcha-choices {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.captcha-choice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    aspect-ratio: 1 / 1;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(104, 110, 113, 0.55);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.captcha-choice-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    display: block;
    width: 65%;
    height: 65%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: invert(1) brightness(0.12);
    pointer-events: none;
}

.captcha-choice:hover:not(:disabled),
.captcha-choice:focus-visible {
    border-color: var(--border-accent);
    background: rgba(104, 110, 113, 0.16);
    outline: 2px solid var(--border-accent);
    outline-offset: 1px;
}

.captcha-choice.selected {
    border-color: var(--text-deep);
    background: rgba(104, 110, 113, 0.28);
    box-shadow: inset 0 0 10px rgba(104, 110, 113, 0.25);
}

.captcha-choice:disabled {
    opacity: 0.55;
    cursor: default;
}

.captcha-status {
    min-height: 16px;
    color: rgba(51, 51, 51, 0.8);
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
    overflow-wrap: anywhere;
}

.captcha-status.verified {
    color: var(--text-deep);
    font-weight: bold;
}

.captcha-status.error {
    color: #7A2E2E;
}

.captcha-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(104, 110, 113, 0.45);
}

.captcha-refresh,
.captcha-verify {
    padding: 7px 12px;
    border: 1px solid var(--border-accent);
    border-radius: 0;
    background: rgba(104, 110, 113, 0.08);
    color: var(--text-deep);
    font: 16px/1 var(--mono);
    letter-spacing: 1px;
    cursor: pointer;
}

.captcha-verify {
    background: rgba(104, 110, 113, 0.18);
    font-weight: bold;
}

.captcha-refresh:hover:not(:disabled),
.captcha-verify:hover:not(:disabled) {
    background: var(--border-accent);
    color: #FFFFFF;
}

.captcha-refresh:disabled,
.captcha-verify:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.captcha-close:focus-visible,
.captcha-refresh:focus-visible,
.captcha-verify:focus-visible {
    outline: 2px solid var(--border-accent);
    outline-offset: 2px;
}

.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;
}

.file-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-accent);
    background: rgba(104, 110, 113, 0.035);
    color: var(--text-main);
    text-align: left;
    font: 22px/1.05 var(--mono);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(104, 110, 113, 0.07), 0 0 14px var(--glow-soft);
    transition: all 140ms ease;
}

.file-btn:hover,
.file-btn.active {
    background: #888888; /* Серый мыльный вместо голубого */
    color: #FFFFFF;
    border-color: #888888;
    box-shadow: 0 0 20px rgba(136, 136, 136, 0.4), 0 0 40px rgba(136, 136, 136, 0.2);
    transform: translateX(8px);
}

/* =========================================================
   ЦЕНТРАЛЬНАЯ ЗОНА: ЭТАЖИРОВАНИЕ
   ========================================================= */
.zone-center {
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 24px 10px 14px;
}

/* ЛОГОТИП КАК НА СКРИНЕ 2 */
.top-tier {
    position: relative;
    z-index: 9;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px;
    overflow: hidden;
}

.top-left-art {
    position: absolute;
    top: 0;
    left: 0;
    width: min(35vw, 380px);
    max-width: 45%;
    height: auto;
    object-fit: contain;
    object-position: left top;
    pointer-events: none;
    z-index: 2;
    opacity: 0.92;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
    transition: transform 300ms ease;
}

.frame-crop {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(90vw, 1080px);
    max-width: 1080px;
    min-height: 0;
    padding: 0;
    overflow: visible;
    isolation: isolate;
}

.frame-img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
    filter:
        drop-shadow(0 0 6px rgba(0, 0, 0, 0.24))
        drop-shadow(0 0 20px var(--glow-soft))
        drop-shadow(0 0 42px rgba(104, 110, 113, 0.20));
}

.gallery-title {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0 10px;
    color: var(--text-main);
    font-size: clamp(38px, 5vw, 84px);
    letter-spacing: 0.08em;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 18px var(--glow-soft);
    pointer-events: none;
}

.gallery-title::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: -45% 8%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(229, 229, 229, 0.94) 0%, rgba(229, 229, 229, 0.76) 58%, transparent 100%);
    filter: blur(8px);
}

/* ЭКРАН ПРОЕКЦИИ */
.projection-tier {
    position: relative;
    z-index: 4;
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 4px;
}

.projection-tier.flicker {
    opacity: 0.52;
}

.projection-screen {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    border: 2px solid var(--border-accent);
    background: #000;
    box-shadow:
        0 0 40px 10px rgba(120, 120, 120, 0.35),
        0 0 80px 20px rgba(150, 150, 150, 0.2);
    isolation: isolate;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 6px 12px;
    background: var(--border-accent);
    color: var(--text-deep);
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.screen-viewport {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    height: auto;
    background: #000;
    overflow: hidden;
}

.screen-viewport img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    filter: drop-shadow(0 0 18px rgba(160, 164, 166, 0.48));
    cursor: zoom-in;
}

.screen-year-overlay {
    position: absolute;
    bottom: 8px;
    left: 10px;
    padding: 1px 6px;
    background: rgba(229, 229, 229, 0.85);
    color: #000000;
    font-size: 15px;
    font-weight: bold;
    font-family: var(--mono);
    line-height: 1.1;
    pointer-events: none;
    z-index: 2;
}

.wall-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(104, 110, 113, 0.24);
}

.wall-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.wall-message-author {
    font-weight: normal;
    font-size: 13px;
    color: var(--text-deep);
}

.wall-message-time {
    color: rgba(51, 51, 51, 0.56);
    font-size: 11px;
}
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.image-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.modal-viewport {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: fit-content;
    padding: 0;
    border: 2px solid var(--border-accent);
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 0 18px rgba(104, 110, 113, 0.26), 0 0 40px rgba(104, 110, 113, 0.18);
}

.modal-viewport img {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    background: #000;
    filter: drop-shadow(0 0 22px rgba(180, 184, 186, 0.5));
}

.modal-close,
.modal-nav {
    position: absolute;
    z-index: 3;
    border: 1px solid var(--border-accent);
    background: rgba(104, 110, 113, 0.08);
    color: #fff;
    cursor: pointer;
    transition: all 140ms ease;
}

.modal-close {
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    font: 24px/1 var(--mono);
}

.modal-nav {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    font-size: 24px;
}

.modal-nav.prev {
    left: 22px;
}

.modal-nav.next {
    right: 22px;
}

.modal-close:hover,
.modal-nav:hover {
    background: var(--border-accent);
    color: var(--text-deep);
    box-shadow: 0 0 12px var(--glow-accent);
}

/* ПОДВАЛ */
.bottom-tier {
    position: relative;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 20px 10px 24px;
    color: var(--text-main);
    text-align: center;
    font-size: 21px;
}

.bottom-status {
    color: rgba(51, 51, 51, 0.52);
    font-size: 15px;
    letter-spacing: 1px;
}

.assistant-signature {
    margin-top: 6px;
    color: rgba(51, 51, 51, 0.52);
    font-size: 13px;
    letter-spacing: 1px;
    text-shadow: 0 0 12px var(--glow-soft);
}

/* =========================================================
   ПРАВАЯ ЗОНА: БАШНЯ С ПРОВОДАМИ В КРАЯ ЭКРАНА
   ========================================================= */
.zone-right {
    z-index: 1;
    position: absolute;
    top: -100vh;
    left: 0;
    right: 0;
    width: 100%;
    height: 200vh;
    overflow: visible;
    pointer-events: none;
}

.tower-art {
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    width: min(112.5vh, 100vw);
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: right top;
    filter:
        drop-shadow(0 0 12px rgba(0, 0, 0, 0.18))
        drop-shadow(0 0 28px var(--glow-soft))
        drop-shadow(0 0 54px rgba(104, 110, 113, 0.22));
    opacity: 0.98;
    z-index: 0;
}

.stage-tower-bg {
    display: none;
}

@media (max-width: 1100px) {
    .zone-right {
        display: none !important;
    }
    .stage-tower-bg {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        pointer-events: none;
        overflow: hidden;
    }
    .tower-art-bg {
        width: min(95%, 480px);
        height: auto;
        max-width: 100%;
        object-fit: contain;
        object-position: center;
        opacity: 0.96;
        filter:
            drop-shadow(0 0 12px rgba(0, 0, 0, 0.18))
            drop-shadow(0 0 28px var(--glow-soft))
            drop-shadow(0 0 54px rgba(104, 110, 113, 0.22));
    }
    #projectionStage {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 400px;
        padding: 16px 12px;
        overflow: visible;
    }
    .projection-screen {
        position: relative;
        z-index: 5;
    }
}

@media (min-width: 701px) and (max-width: 1100px) {
    .top-tier {
        min-height: 0;
        padding: 12px 12px calc(12px + 6.8vw);
        overflow: visible;
    }

    .frame-crop {
        width: clamp(480px, 66vw, 760px);
        transform: scale(1.18);
        transform-origin: center top;
    }

    .gallery-title {
        font-size: clamp(54px, 7.3vw, 80px);
    }

    .stage-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
        grid-template-areas:
            "projection directory"
            "wall wall";
        align-items: start;
        column-gap: clamp(20px, 4vw, 48px);
        row-gap: clamp(24px, 3vw, 36px);
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0 clamp(20px, 3vw, 40px);
        overflow: visible;
    }

    .zone-left,
    .zone-center {
        display: contents;
    }

    .zone-left::before,
    .zone-center::before,
    .zone-right::before {
        display: none;
    }

    .zone-left,
    .zone-center,
    .zone-right {
        height: auto;
        min-width: 0;
    }

    .oracle-meta {
        display: none;
    }

    .zone-right {
        position: relative;
        inset: auto;
        grid-area: tower;
        display: grid;
        place-items: center;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .tower-art {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        height: auto;
        max-width: 100%;
        margin-inline: auto;
        object-position: center;
    }

    #projectionStage {
        grid-area: projection;
        align-self: start;
        min-width: 0;
        width: 100%;
        padding: 0;
    }

    .file-explorer {
        grid-area: directory;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 0;
        padding: 0;
    }

    .file-list {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .file-btn {
        min-height: 44px;
        padding: 8px 10px;
        font-size: clamp(18px, 2vw, 21px);
        overflow-wrap: anywhere;
    }

    .file-btn:hover,
    .file-btn.active {
        transform: none;
    }

    .anonymous-wall {
        grid-area: wall;
        width: 100%;
        min-height: 0;
        max-height: none;
        margin: 0 0 24px;
    }

    .wall-feed {
        max-height: min(48vh, 460px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .projection-tier {
        flex: none;
        min-width: 0;
        margin: 0;
    }

    .projection-screen {
        width: 100%;
        max-width: 100%;
    }

    .screen-viewport img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        max-width: 100%;
    }

    .screen-header {
        gap: 8px;
        white-space: normal;
        font-size: clamp(16px, 2vw, 20px);
    }

    .wall-mobile-title {
        display: block;
        margin: 0;
        color: var(--text-main);
        font-size: 20px;
        line-height: 1;
    }

    .wall-header h2 {
        display: none;
    }

    .wall-form-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px 10px;
    }

    .wall-status,
    .wall-character-count {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .wall-character-count {
        display: block;
        color: rgba(51, 51, 51, 0.65);
        font-size: 14px;
        text-align: right;
        white-space: nowrap;
    }

    .wall-submit {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 44px;
        padding-inline: 12px;
    }

    .captcha-choice,
    .captcha-refresh {
        min-height: 44px;
    }

    .wall-form textarea {
        min-height: 72px;
    }

    .bottom-tier {
        padding-inline: 20px;
    }

    .bottom-tier > * {
        overflow-wrap: anywhere;
    }

    .modal-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        left: 12px;
        right: auto;
        width: 48px;
        height: 48px;
        font-family: var(--mono);
        line-height: 1;
    }

    .modal-nav.next {
        right: 12px;
        left: auto;
    }
}

@media (max-width: 700px) {
    .top-tier {
        min-height: 0;
        padding: 14px 0 0;
        overflow: visible;
    }

    .frame-crop {
        width: min(93%, 620px);
        margin-bottom: 3.8vw;
        transform: scale(1.07);
        transform-origin: center top;
    }

    .gallery-title {
        font-size: clamp(32px, 9.5vw, 48px);
        letter-spacing: 0.02em;
    }

    .stage-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "projection"
            "directory"
            "wall";
        align-items: start;
        gap: 22px;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .zone-left,
    .zone-center {
        display: contents;
    }

    .zone-left::before,
    .zone-center::before,
    .zone-right::before {
        display: none;
    }

    .zone-left,
    .zone-center,
    .zone-right {
        height: auto;
        min-width: 0;
    }

    .oracle-meta {
        display: none;
    }

    .zone-right {
        position: relative;
        inset: auto;
        grid-area: tower;
        display: grid;
        place-items: center;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .tower-art {
        position: relative;
        top: auto;
        right: auto;
        width: min(100%, 400px);
        height: auto;
        max-width: 100%;
        margin-inline: auto;
        object-position: center;
    }

    #projectionStage {
        grid-area: projection;
        align-self: start;
        min-width: 0;
        width: 100%;
        padding: 0 12px;
    }

    .projection-tier {
        flex: none;
        min-height: 0;
        margin: 0;
    }

    .projection-screen {
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
    }

    .screen-viewport img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        max-width: 100%;
    }

    .screen-header {
        flex-wrap: wrap;
        gap: 6px 8px;
        padding: 6px 8px;
        font-size: 16px;
        white-space: normal;
    }

    #screenTitle {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .screen-viewport {
        max-width: 100%;
    }

    .file-explorer {
        grid-area: directory;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 0;
        padding: 0 16px;
    }

    .file-list {
        height: auto;
        min-height: 0;
        overflow: visible;
        gap: 6px;
    }

    .file-btn {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 20px;
        overflow-wrap: anywhere;
    }

    .file-btn:hover,
    .file-btn.active {
        transform: none;
    }

    .anonymous-wall {
        grid-area: wall;
        width: auto;
        min-height: 0;
        max-height: none;
        margin: 0 16px;
        padding: 12px;
    }

    .wall-mobile-title {
        display: block;
        margin: 0;
        color: var(--text-main);
        font-size: 20px;
        line-height: 1;
    }

    .wall-header h2 {
        display: none;
    }

    .wall-feed {
        max-height: min(48vh, 400px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .wall-form textarea {
        min-height: 72px;
    }

    .wall-form-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px 8px;
    }

    .wall-status,
    .wall-character-count {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .wall-character-count {
        display: block;
        color: rgba(51, 51, 51, 0.65);
        font-size: 13px;
        text-align: right;
        white-space: nowrap;
    }

    .wall-submit {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 44px;
        padding: 8px 10px;
        font-size: 15px;
    }

    .bottom-tier {
        padding: 18px 16px 22px;
        font-size: 18px;
    }

    .bottom-tier > * {
        overflow-wrap: anywhere;
    }

    .modal-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        left: 8px;
        right: auto;
        width: 44px;
        height: 44px;
        font-family: var(--mono);
        line-height: 1;
    }

    .modal-nav.next {
        right: 8px;
        left: auto;
    }
}

.line-overlay {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    height: auto;
    width: auto;
    max-height: 80%;
    max-width: 30%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
    opacity: 0.85;
    transition: opacity 180ms ease;
}

.line-overlay.hidden {
    display: none;
}
