:root {
    color-scheme: dark;
    --accent: #e8c86c;
    --text: #f7f2e8;
    --muted: #989687;
    --line-soft: rgba(232, 200, 108, 0.24);
    --panel-soft: rgba(17, 19, 15, 0.86);
    font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
button, a { font: inherit; }

.gallery-map-page {
    height: 100%;
    overflow: hidden;
    background: #10130f;
}

.gallery-map-chrome {
    position: fixed;
    z-index: 8;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    gap: 1rem;
    align-items: end;
    justify-content: flex-end;
    padding: 0.7rem 0.85rem 1.25rem;
    pointer-events: none;
    background: linear-gradient(rgba(10, 12, 9, 0.94), rgba(10, 12, 9, 0));
}
.gallery-map-chrome p { margin: 0; color: #c2bfae; font-size: clamp(0.62rem, 0.8vw, 0.76rem); text-align: right; }
.gallery-map-hint-touch { display: none; }

@media (hover: none) and (pointer: coarse) {
    .gallery-map-hint-mouse { display: none; }
    .gallery-map-hint-touch { display: inline; }
}

.gallery-photo-modal-close:hover,
.gallery-photo-modal-close:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.gallery-map-grid {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(232, 200, 108, 0.07), transparent 34%),
        linear-gradient(135deg, #0a0d09, #171c13 52%, #0c0f0b);
    cursor: default;
    touch-action: none;
    user-select: none;
}

.gallery-map-grid::before {
    position: fixed;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03), transparent 42%),
        repeating-linear-gradient(0deg, rgba(232, 200, 108, 0.035) 0 1px, transparent 1px 96px),
        repeating-linear-gradient(90deg, rgba(232, 200, 108, 0.035) 0 1px, transparent 1px 96px),
        radial-gradient(circle at 50% 50%, transparent, rgba(0, 0, 0, 0.24));
}

.gallery-map-grid.is-panning { cursor: grabbing; }

.gallery-map-tile {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(232, 200, 108, 0.22);
    outline: 0;
    background: #0c0e0b;
    cursor: zoom-in;
    transform-origin: 0 0;
    will-change: transform;
}

.gallery-map-tile:hover,
.gallery-map-tile:focus-visible { z-index: 2; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 1.2rem rgba(232, 200, 108, 0.16); }
.gallery-map-tile--central { box-shadow: 0 0 0 2px rgba(232, 200, 108, 0.72); }
.gallery-map-tile img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }

.gallery-map-back {
    position: fixed;
    z-index: 12;
    bottom: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
}
.gallery-map-back[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }

.gallery-map-loader {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-content: center;
    place-items: center;
    gap: 0.75rem;
    color: var(--accent);
    background:
        repeating-linear-gradient(0deg, rgba(232, 200, 108, 0.025) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(90deg, rgba(232, 200, 108, 0.025) 0 1px, transparent 1px 48px),
        #0d100c;
    transition: opacity 180ms ease;
}
.gallery-map-loader[hidden] { display: none; }
.gallery-map-loader img { width: 4rem; height: 4rem; object-fit: contain; }
.gallery-map-loader strong { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.gallery-map-loader span { width: 8rem; height: 2px; overflow: hidden; background: rgba(232, 200, 108, 0.16); }
.gallery-map-loader span::after { display: block; width: 45%; height: 100%; content: ""; background: var(--accent); animation: gallery-map-loading 820ms ease-in-out infinite alternate; }
@keyframes gallery-map-loading { to { transform: translateX(125%); } }

.site-modal.gallery-photo-modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 1rem;
    border: 0;
    color: #f7f2e8;
    background: rgba(0, 0, 0, 0.86);
}

.site-modal.gallery-photo-modal::backdrop { background: rgba(0, 0, 0, 0.82); }
.gallery-photo-modal figure { display: grid; width: 100%; height: 100%; margin: 0; place-items: center; align-content: center; gap: 0.65rem; }
.gallery-photo-modal-surface { display: grid; max-width: 96vw; max-height: calc(100vh - 2rem); place-items: center; gap: 0.65rem; }
.gallery-photo-modal img { display: block; max-width: 96vw; max-height: 88vh; object-fit: contain; }
.gallery-photo-modal figcaption { max-width: min(96vw, 61rem); color: var(--accent); font-size: 0.9rem; text-align: center; }
.gallery-photo-modal-close {
    position: fixed;
    z-index: 2;
    top: 0.85rem;
    right: 0.85rem;
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: #f7f2e8;
    background: rgba(17, 19, 15, 0.9);
    cursor: pointer;
    font-size: 1.8rem;
}

.gallery-maze-page {
    height: 100%;
    overflow: hidden;
    color: #f7f2e8;
    background:
        radial-gradient(circle at 50% 48%, rgba(107, 91, 49, 0.2), transparent 34%),
        linear-gradient(145deg, #0c100d, #171a15 48%, #090b09);
}

.gallery-maze-page::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(232, 200, 108, 0.025) 31px 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(232, 200, 108, 0.025) 31px 32px),
        linear-gradient(rgba(255, 255, 255, 0.018), transparent 28%, rgba(0, 0, 0, 0.18));
}

.gallery-maze {
    --maze-gap: clamp(6px, 0.8vw, 12px);
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    height: 100svh;
    min-height: 0;
    padding: clamp(7px, 1vw, 14px);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: var(--maze-gap);
    overflow: hidden;
}

.gallery-maze-help-heading span {
    display: block;
    color: #989687;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gallery-admin-orientation {
    margin: 0;
    color: #77766c;
    font-size: 0.58rem;
    line-height: 1.2;
    text-align: right;
}

.gallery-maze-empty { display: grid; min-height: 0; margin: 0; place-items: center; color: #bbb8ad; }

.gallery-maze-stage {
    --maze-side: clamp(9rem, 14vw, 16rem);
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: var(--maze-side) minmax(0, 1fr) var(--maze-side);
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "north current east"
        "back current controls"
        "west current south";
    column-gap: var(--maze-gap);
    row-gap: 0;
    align-content: center;
}

.gallery-maze-back-slot,
.gallery-maze-control-slot {
    display: grid;
    min-width: 0;
    min-height: 0;
    padding-block: var(--maze-gap);
    place-items: center;
}
.gallery-maze-back-slot { grid-area: back; }
.gallery-maze-control-slot { grid-area: controls; }
.gallery-maze-back {
    width: min(100%, 10.5rem);
    text-align: center;
}
.gallery-maze-back[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }

.gallery-maze-desktop-controls {
    display: grid;
    width: 100%;
    gap: clamp(0.45rem, 1vw, 0.8rem);
    place-items: center;
}
.gallery-maze-space-control {
    display: grid;
    width: 100%;
    gap: 0.3rem;
    place-items: center;
    color: #aaa79b;
    font-size: clamp(0.58rem, 0.78vw, 0.72rem);
    line-height: 1.25;
    text-align: center;
}
.gallery-maze-space-control kbd,
.gallery-maze-space-key {
    display: grid;
    min-width: min(100%, 7rem);
    min-height: 1.55rem;
    padding: 0.2rem 0.65rem;
    place-items: center;
    border: 1px solid rgba(232, 200, 108, 0.58);
    color: var(--accent);
    background: #090b08;
    box-shadow: inset 0 -2px rgba(255, 255, 255, 0.06);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
}
.gallery-maze-mobile-meta { display: none; }

.gallery-maze-current {
    grid-area: current;
    display: grid;
    min-width: 0;
    min-height: 0;
    margin: 0;
    place-items: center;
}

.gallery-maze-screen {
    position: relative;
    display: grid;
    width: 100%;
    height: auto;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    min-width: 0;
    min-height: 0;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(232, 200, 108, 0.55);
    background: #050605;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 1rem 3rem rgba(0, 0, 0, 0.42), inset 0 0 4rem rgba(232, 200, 108, 0.035);
}
.gallery-maze-screen::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.018) 3px 4px);
}
.gallery-maze-current img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: cover;
}
.gallery-maze-current figcaption {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    display: -webkit-box;
    max-height: 5.4rem;
    min-height: 2.8rem;
    padding: 1.7rem 0.85rem 0.6rem;
    overflow: hidden;
    color: #ffff55;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    font-family: "OpenMine CZ", monospace;
    font-size: clamp(1.6rem, 2.35vw, 2.15rem);
    line-height: 1.15;
    text-align: center;
    text-shadow: 2px 2px 0 #3f3f00, 0 1px 3px #000;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.gallery-maze-neighbor {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 0;
    width: 100%;
    padding: 0;
    align-self: start;
    place-items: stretch;
    overflow: visible;
    border: 0;
    color: #f7f2e8;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: filter 120ms ease, opacity 120ms ease;
}
.gallery-maze-neighbor--north { grid-area: north; }
.gallery-maze-neighbor--east { grid-area: east; }
.gallery-maze-neighbor--south { grid-area: south; align-self: end; }
.gallery-maze-neighbor--west { grid-area: west; align-self: end; }
.gallery-maze-neighbor:hover,
.gallery-maze-neighbor:focus-visible {
    z-index: 3;
    outline: none;
    filter: brightness(1.14);
}
.gallery-maze-neighbor:hover .gallery-maze-neighbor-window,
.gallery-maze-neighbor:focus-visible .gallery-maze-neighbor-window { border-color: var(--accent); }
.gallery-maze-neighbor:disabled { cursor: not-allowed; opacity: 0.34; filter: none; }
.gallery-maze-neighbor img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: center; }

.gallery-maze-neighbor-window {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(145, 143, 128, 0.46);
    background: linear-gradient(145deg, rgba(39, 42, 36, 0.96), rgba(15, 17, 14, 0.96));
    box-shadow: inset 0 0 1.8rem rgba(255, 255, 255, 0.025);
    transition: border-color 120ms ease;
}

.gallery-maze-neighbor-heading {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    min-width: 0;
    min-height: 0;
    padding: 0.35rem 0.4rem 0.85rem;
    gap: 0.32rem;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.82), transparent);
    line-height: 1;
    pointer-events: none;
}
.gallery-maze-key {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(232, 200, 108, 0.52);
    border-radius: 0;
    color: var(--accent);
    background: rgba(8, 9, 7, 0.86);
    box-shadow: none;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.67rem;
}
.gallery-maze-direction {
    overflow: hidden;
    color: #eeece4;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.gallery-maze-neighbor-note {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: -webkit-box;
    min-width: 0;
    padding: 1.2rem 0.35rem 0.38rem;
    overflow: hidden;
    color: #ffff55;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    font-family: "OpenMine CZ", monospace;
    font-size: clamp(1.2rem, 1.55vw, 1.5rem);
    line-height: 1.12;
    text-align: center;
    text-shadow: 1px 1px 0 #3f3f00, 0 1px 2px #000;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.gallery-maze-blocked {
    display: grid;
    width: 100%;
    height: 100%;
    padding-top: 1.5rem;
    place-items: center;
    color: #8d8b80;
    background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, 0.018) 8px 9px);
    font-size: 0.67rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-maze-stage.is-arriving .gallery-maze-screen { animation: gallery-maze-arrive 220ms ease-out; }
.gallery-maze-stage.is-arriving .gallery-maze-neighbor { animation: gallery-maze-panel-arrive 220ms ease-out; }
@keyframes gallery-maze-arrive {
    from { opacity: 0.42; filter: brightness(0.55); transform: scale(0.987); }
    to { opacity: 1; filter: brightness(1); transform: scale(1); }
}
@keyframes gallery-maze-panel-arrive {
    from { opacity: 0.35; }
    to { opacity: 1; }
}

.gallery-maze-photo-hold {
    position: fixed;
    z-index: 30;
    right: 0.55rem;
    bottom: 0.55rem;
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f1eee4;
    background: rgba(8, 9, 7, 0.66);
    cursor: zoom-in;
    font-size: 1rem;
    opacity: 0.55;
    touch-action: none;
}
.gallery-maze-photo-hold:focus-visible { border-color: var(--accent); outline: none; opacity: 1; }
.gallery-maze.is-photo-held .gallery-maze-neighbor,
.gallery-maze.is-photo-held .gallery-maze-back-slot,
.gallery-maze.is-photo-held .gallery-maze-control-slot,
.gallery-maze.is-photo-held .gallery-maze-footer,
.gallery-maze.is-photo-held .gallery-maze-rotate-hint { opacity: 0; pointer-events: none; }
.gallery-maze.is-photo-held .gallery-maze-current {
    position: fixed;
    z-index: 50;
    inset: 0;
    margin: 0;
    padding: 0;
    background: #000;
}
.gallery-maze.is-photo-held .gallery-maze-screen { width: 100%; height: 100%; border: 0; box-shadow: none; }
.gallery-maze.is-photo-held .gallery-maze-current img { object-fit: contain; }
.gallery-maze.is-photo-held .gallery-maze-photo-hold { z-index: 60; opacity: 0.72; cursor: zoom-out; }

.gallery-maze-rotate-hint { display: none; }

.gallery-maze-footer {
    display: flex;
    width: 100%;
    margin: 0 auto;
    padding: 0.08rem 0 0;
    gap: 0.35rem 1rem;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: clamp(0.55rem, 0.75vw, 0.7rem);
    line-height: 1.2;
    text-align: center;
}
.gallery-maze-footer a { color: var(--accent); text-decoration: none; }
.gallery-maze-footer a:hover,
.gallery-maze-footer a:focus-visible { color: var(--text); outline: none; }

.site-modal.gallery-maze-help {
    width: min(calc(100% - 2rem), 43rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: clamp(0.85rem, 2vw, 1.25rem);
    overflow: auto;
    border: 1px solid rgba(232, 200, 108, 0.5);
    border-radius: 0;
    color: #f7f2e8;
    background:
        radial-gradient(circle at 50% 0, rgba(232, 200, 108, 0.08), transparent 38%),
        #121510;
    box-shadow: 0 1.5rem 6rem rgba(0, 0, 0, 0.72);
}
.site-modal.gallery-maze-help::backdrop { background: rgba(0, 0, 0, 0.84); }
.gallery-maze-help-heading { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
.gallery-maze-help-heading h2 {
    margin: 0.18rem 0 0;
    color: var(--accent);
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(1.15rem, 2.7vw, 1.65rem);
    text-transform: uppercase;
}
.gallery-maze-help-close {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f7f2e8;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    font-size: 1.4rem;
    text-decoration: none;
}
.gallery-maze-help-close:hover,
.gallery-maze-help-close:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.gallery-maze-help-intro { margin: 0.85rem 0; color: #d6d3c8; line-height: 1.45; }
.gallery-maze-help-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.gallery-maze-help-modes section {
    display: grid;
    min-width: 0;
    margin: 0;
    padding: 0.75rem;
    gap: 0.65rem;
    align-content: start;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.025);
}
.gallery-maze-help-modes p { margin: 0; color: #c9c7bd; font-size: 0.85rem; line-height: 1.4; }
.gallery-maze-wasd {
    display: grid;
    width: max-content;
    margin: auto;
    grid-template-columns: repeat(3, 2rem);
    grid-template-rows: repeat(2, 2rem);
    gap: 0.25rem;
}
.gallery-maze-keyboard-demo { display: grid; gap: 0.5rem; place-items: center; }
.gallery-maze-wasd kbd {
    display: grid;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(232, 200, 108, 0.58);
    border-radius: 0;
    color: var(--accent);
    background: #090b08;
    box-shadow: inset 0 -2px rgba(255, 255, 255, 0.06);
    font-family: Consolas, "Courier New", monospace;
}
.gallery-maze-wasd kbd:nth-child(1) { grid-column: 2; grid-row: 1; }
.gallery-maze-wasd kbd:nth-child(2) { grid-column: 1; grid-row: 2; }
.gallery-maze-wasd kbd:nth-child(3) { grid-column: 2; grid-row: 2; }
.gallery-maze-wasd kbd:nth-child(4) { grid-column: 3; grid-row: 2; }
.gallery-maze-layout-demo {
    display: grid;
    width: min(100%, 12rem);
    aspect-ratio: 16 / 7;
    margin: auto;
    grid-template-columns: 1.8rem minmax(0, 1fr) 1.8rem;
    grid-template-rows: 1.8rem minmax(0, 1fr) 1.8rem;
    gap: 0.18rem;
}
.gallery-maze-layout-demo i {
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #364f53, #6d573d);
}
.gallery-maze-layout-demo-current { grid-column: 2; grid-row: 1 / 4; }
.gallery-maze-layout-demo-north { grid-column: 1; grid-row: 1; }
.gallery-maze-layout-demo-west { grid-column: 1; grid-row: 3; }
.gallery-maze-layout-demo-east { grid-column: 3; grid-row: 1; }
.gallery-maze-layout-demo-south { grid-column: 3; grid-row: 3; }
.gallery-maze-enter {
    display: block;
    margin: 0 0 0 auto;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: rgba(0, 0, 0, 0.42);
    cursor: pointer;
    font-weight: 700;
}
.gallery-maze-enter:hover,
.gallery-maze-enter:focus-visible { color: #121510; background: var(--accent); outline: none; }
.gallery-maze-help-footer {
    display: flex;
    min-width: 0;
    margin-top: 0.9rem;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

@media (hover: none) and (pointer: coarse) {
    .gallery-maze-key { display: none; }
    .gallery-maze-photo-hold { display: grid; }
    .gallery-maze-desktop-controls,
    .gallery-maze-footer { display: none; }
    .gallery-maze-mobile-meta {
        display: grid;
        max-width: 100%;
        gap: 0.25rem;
        place-items: center;
        color: var(--muted);
        font-size: clamp(0.42rem, 1.2vw, 0.58rem);
        line-height: 1.15;
        text-align: center;
    }
    .gallery-maze-mobile-meta a { color: var(--accent); text-decoration: none; }
}

@media (max-height: 540px) {
    .gallery-maze { --maze-gap: 5px; padding: 5px; }
    .gallery-maze-stage { --maze-side: clamp(5.1rem, 14vw, 7.5rem); }
    .gallery-maze-neighbor-heading { padding: 0.24rem 0.28rem 0.58rem; gap: 0.2rem; }
    .gallery-maze-key { width: 1.05rem; height: 1.05rem; font-size: 0.55rem; }
    .gallery-maze-direction { font-size: 0.5rem; }
    .gallery-maze-neighbor-note { padding: 0.9rem 0.2rem 0.24rem; font-size: clamp(0.9rem, 2.2vw, 1.1rem); -webkit-line-clamp: 3; }
    .gallery-maze-current figcaption { min-height: 2rem; padding: 1.2rem 0.5rem 0.3rem; font-size: clamp(1rem, 2.5vw, 1.35rem); }
    .gallery-maze-back { padding: 0.38rem 0.35rem; font-size: 0.58rem; }
    .gallery-maze-space-control { gap: 0.18rem; font-size: 0.48rem; }
    .gallery-maze-space-control kbd,
    .gallery-maze-space-key { min-height: 1.1rem; padding: 0.12rem 0.3rem; font-size: 0.5rem; }
    .site-modal.gallery-maze-help { width: min(calc(100% - 1rem), 43rem); max-height: calc(100dvh - 0.7rem); padding: 0.65rem; }
    .gallery-maze-help-heading h2 { font-size: 1rem; }
    .gallery-maze-help-heading span { display: none; }
    .gallery-maze-help-close { width: 1.85rem; height: 1.85rem; font-size: 1.1rem; }
    .gallery-maze-help-intro { margin: 0.45rem 0; font-size: 0.75rem; line-height: 1.3; }
    .gallery-maze-help-modes { gap: 0.45rem; }
    .gallery-maze-help-modes section { padding: 0.45rem; grid-template-columns: auto minmax(0, 1fr); gap: 0.55rem; align-items: center; }
    .gallery-maze-help-modes p { font-size: 0.68rem; line-height: 1.28; }
    .gallery-maze-wasd { grid-template-columns: repeat(3, 1.35rem); grid-template-rows: repeat(2, 1.35rem); gap: 0.15rem; }
    .gallery-maze-layout-demo { width: 7.2rem; }
    .gallery-maze-enter { margin: 0 0 0 auto; padding: 0.42rem 0.65rem; font-size: 0.72rem; }
    .gallery-maze-help-footer { margin-top: 0.45rem; }
    .gallery-admin-orientation { font-size: 0.48rem; }
    .gallery-maze-footer { font-size: 0.48rem; }
}

@media (max-width: 960px) and (max-height: 540px) {
    .gallery-maze-photo-hold { display: grid; }
}

@media (orientation: portrait) and (max-width: 720px) {
    .gallery-maze-rotate-hint {
        position: fixed;
        z-index: 40;
        right: 3.25rem;
        bottom: 0.55rem;
        left: 0.55rem;
        display: block;
        margin: 0;
        padding: 0.5rem 0.65rem;
        border: 1px solid rgba(232, 200, 108, 0.38);
        color: #e6e2d7;
        background: rgba(8, 9, 7, 0.88);
        font-size: 0.7rem;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-maze-neighbor { transition: none; }
    .gallery-maze-stage.is-arriving .gallery-maze-screen,
    .gallery-maze-stage.is-arriving .gallery-maze-neighbor { animation: none; }
}
