/* ═══════════════════════════════════════════════════════════════
   Tignarius CMS – 3D World Stylesheet
   Inherits theme from frontend.css
   ═══════════════════════════════════════════════════════════════ */

/* ── CRITICAL: Lock viewport, prevent any scroll/bounce on iOS ── */
.page-3d,
.page-3d body {
    position: fixed;
    inset: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #000;
    width: 100%;
    height: 100%;
}
.page-3d .site-main {
    position: fixed;
    inset: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Main Container (covers entire viewport) ── */
#3d-world-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background-color: var(--loading-bg, #8b2520);
    background-image: var(--loading-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: var(--font-body);
    color: #ede5db;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    touch-action: none;
}

/* ── Logo (z:33) ── */
#logo-3d {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 33;
    padding: 18px 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.logo-3d__img { height: 36px; width: auto; display: block; }
#logo-3d .logo-3d__name {
    font-family: var(--font-display);
    font-size: 20px;
    color: #fff;
    font-style: var(--logo-style, italic);
}
#logo-3d .logo-3d__sub {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    letter-spacing: .06em;
    text-transform: uppercase;
    font-style: normal;
    margin-top: 1px;
}

/* ── 3D Viewer (fills container) ── */
#3d-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--red, #8b2520);
    cursor: crosshair !important;
    overflow: hidden !important;
}
#3d-viewer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: crosshair !important;
    outline: none;
    border: none;
    touch-action: none;
}

/* ── Menu Buttons (z:20 via #view-wall) ── */
#menu-button-container {
    position: absolute;
    top: 12px;
    right: 12px;
}
@media (min-width: 768px) {
    #menu-button-container { top: 20px; right: 20px; }
}

.menu-button {
    width: 60px;
    height: 60px;
    color: white;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 10px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    background: rgba(0,0,0,.15);
    backdrop-filter: blur(4px);
    cursor: pointer;
    text-align: center;
}
.menu-button i,
.menu-button i::before {
    font-size: 44px !important;
    line-height: 1 !important;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    text-align: center;
}
.menu-button:active,
.menu-button:focus,
.menu-button:focus-visible {
    border: 1px solid white;
    box-shadow: none;
    outline: none;
}
.menu-button:active i,
.menu-button:focus i,
.menu-button:focus-visible i { color: white; }

@media (hover: hover) and (pointer: fine) {
    .menu-button:hover {
        background: rgba(255,255,255,.15);
        border-color: #fff;
    }
    .menu-button:hover i { color: #fff; }
}

#info-icon i {
    font-size: 0;
    display: inline-flex;
    align-items: center;
    position: absolute;
    left: 5px;
}

#info-icon i:before {
    content: "";
    display: inline-block;
    width: 50px;
    height: 50px;
    background-image: url("../images/icons/icon_aurin.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ── Loading Screen ── */
#loading-overlay-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    background-color: var(--loading-bg, #8b2520);
    background-image: var(--loading-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.loading-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-screen__images {
    position: relative;
    width: min(50vw, 50vh);
    height: min(50vw, 50vh);
    flex-shrink: 0;
}

.loading-screen__back,
.loading-screen__front {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.loading-screen__back {
    filter: blur(20px);
    transition: filter 150ms ease;
}

.loading-screen__front {
    z-index: 1;
}

.loading-screen__info {
    margin-top: 24px;
    text-align: center;
}

.loading-screen__percent {
    font-family: var(--font-display);
    font-size: 18px;
    color: rgba(255,255,255,.7);
    letter-spacing: .1em;
    font-variant-numeric: tabular-nums;
}

#loading-overlay-container-simple {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    inset: 0;
    z-index: 4;
    background: #000000;
}

.loading-screen-simple {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-screen-icon {
    font-size: 3rem;  /* Larger for visibility */
    animation: pulse-glow 1.5s ease-in-out infinite both;  /* Smooth infinite pulse */
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(0.95);
    }
}

@keyframes pulse-glow {
    0% {
        transform: scale(0.95);
        text-shadow: 0 0 0 currentColor;
    }
    70% {
        transform: scale(1.05);
        text-shadow: 0 0 20px currentColor;
    }
    100% {
        transform: scale(0.95);
        text-shadow: 0 0 0 currentColor;
    }
}

/* ── Cookie / Disclaimer Wall (z:88) ── */
#cookie-wall {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 88;
    color: #ede5db;
}
.cookie-wall__inner {
    max-width: 420px;
    padding: 32px;
    text-align: center;
}
.cookie-wall__title {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 16px;
}
.cookie-wall__desc {
    font-size: 14px;
    color: rgba(237,229,219,.55);
    margin-bottom: 20px;
}
.cookie-wall__label {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 13px;
    color: rgba(237,229,219,.55);
    margin-bottom: 16px;
    cursor: pointer;
}
#cookie-wall a { color: var(--gold); text-decoration: underline; font-weight: normal; }
#accept-cookies-button {
    padding: 12px 32px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font: 600 14px var(--font-body);
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s;
}
#accept-cookies-button:not(.disabled) { opacity: 1 !important; }
#accept-cookies-button.disabled { pointer-events: none; }

/* ── WebGL Check Wall (z:20) ── */
#check-requirements-wall {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}
.requirements__inner { text-align: center; padding: 32px; }
.requirements__icon { font-size: 48px; margin-bottom: 16px; }
.requirements__title { font-family: var(--font-display); font-size: 22px; }
.requirements__text { font-size: 14px; color: rgba(237,229,219,.55); margin-top: 8px; }

/* ── Extra Page (z:10) ── */
#extra-page {
    position: absolute;
    inset: 0;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ede5db;
    padding: 20px;
    z-index: 10;
}
#extra-page a { color: #fff; font-weight: bold; }

/* ── Mobile Control Wall (z:88) ── */
#mobile-control-wall {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: end;
    justify-content: center;
    z-index: 88;
}
#init-control-button {
    padding: 16px 40px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 12px;
    font: 600 16px var(--font-body);
    cursor: pointer;
    margin-bottom: 100px;
}

/* ── Desktop Drag Overlay (z:50) ── */
.desktop-drag-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 50;
}
.desktop-drag-overlay.is-visible { opacity: 1; }
.desktop-drag-overlay > .content {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .6);
    backdrop-filter: blur(8px);
    padding: 18px 28px;
    border-radius: 12px;
    max-width: min(420px, 90vw);
    text-align: center;
    color: var(--red, #8b2520);
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.desktop-drag-overlay .title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: bold;
    letter-spacing: .02em;
    margin-bottom: 4px;
}
.desktop-drag-overlay .text {
    font-size: 13px;
    color: rgba(28,18,16,.6);
}

/* ── View Wall / HUD (z:20) ── */
#view-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}
#view-wall * { pointer-events: auto; }

/* ── Map Overlay (z:40) ── */
#map-overlay {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 77;
    background: rgba(26, 18, 14, .92);
    backdrop-filter: blur(12px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    color: #ede5db;
}
#map-overlay a { color: var(--gold); }
.map-overlay__inner { max-width: 600px; margin: 0 auto; padding: 32px 20px; }
.map-overlay__header { text-align: center; margin-bottom: 32px; }
.map-overlay__title { font-family: var(--font-display); font-size: 28px; margin-bottom: 8px; }

.marker { cursor: pointer; }

/* ── Location Section Titles ── */
.location-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--red);
    margin-bottom: 12px;
}
.location-section-title--panorama {
    color: var(--gold);
    margin-top: 24px;
}

/* ── Location Buttons ── */
.location {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    color: #ede5db;
    font-family: inherit;
    font-size: inherit;
    transition: all .2s;
}
.location:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
}
.location--panorama {
    background: rgba(184,149,62,.05);
    border-color: rgba(184,149,62,.1);
}
.location--panorama:hover {
    background: rgba(184,149,62,.12);
    border-color: rgba(184,149,62,.2);
}
.location__icon { font-size: 22px; flex-shrink: 0; }
.location__info { flex: 1; min-width: 0; }
.location__name { font-weight: 600; font-size: 14px; }
.location__desc { font-size: 12px; color: rgba(237,229,219,.45); margin-top: 2px; }
.location__key { margin-left: auto; font-size: 12px; font-family: monospace; color: rgba(237,229,219,.25); flex-shrink: 0; }
.location__badge-panorama { margin-left: auto; font-size: 11px; color: var(--gold); font-weight: 600; flex-shrink: 0; }

/* ── Info Overlay (z:88) ── */
#info-overlay {
    position: absolute;
    inset: 0;
    padding: 40px;
    z-index: 88;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#info-close-button {
    position: absolute;
    top: 20px; right: 40px;
}

/* ── Footer (z:33) ── */
#footer-3d {
    position: absolute;
    bottom: 0; left: 0;
    z-index: 33;
    width: 100%;
    padding: 16px 20px;
    color: rgba(255,255,255,.4);
    background: linear-gradient(transparent, rgba(0,0,0,.3));
    font-size: 11px;
}
#footer-3d a { color: rgba(255,255,255,.5); text-decoration: none; font-weight: normal; }

/* ── Shared ── */
.btn { border: 1px solid #fff; }
.btn:hover { border: 1px solid #fff; }
.btn:focus { border: 1px solid #fff; color: #fff; outline: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: normal; }

/* ── Wizard ── */
.wizard {
    position: absolute;
    inset: 0;
    text-align: center;
    color: #ede5db;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Back Button (inherits .menu-button) ── */
#back-button {
    text-decoration: none;
    color: #fff;
}

/* ── Location Label (bottom center) ── */
#location-label {
    display: none;
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 15px;
    color: rgba(255, 255, 255, .85);
    letter-spacing: .03em;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .4s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
/* ═══ 🎙️ Audio-Guide Overlay (Bootstrap-resistent) ═══ */
#guide-overlay.guide-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: none;
    padding: 0 16px 24px;
    pointer-events: none;
}
#guide-overlay.guide-overlay.is-visible {
    display: flex !important;
    justify-content: center;
    animation: guideSlideUp .35s ease-out;
}
@keyframes guideSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
#guide-overlay .guide-overlay__panel {
    pointer-events: auto;
    width: 100%;
    max-width: 720px;
    background: rgba(20, 14, 10, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 235, 181, 0.25);
    border-radius: 12px;
    padding: 18px 48px 16px 22px;
    color: #fdf3d3;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    position: relative;
    box-sizing: border-box;
}
#guide-overlay .guide-overlay__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 235, 181, 0.7);
    margin-bottom: 8px;
    font-weight: 600;
}
#guide-overlay .guide-overlay__title:empty { display: none; }
#guide-overlay .guide-overlay__text {
    font-size: 16px;
    line-height: 1.55;
    min-height: 3em;
    font-family: Georgia, 'Baskervville', serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #fdf3d3;
}
#guide-overlay .guide-overlay__text::after {
    content: '▌';
    color: rgba(255, 235, 181, 0.6);
    margin-left: 2px;
    animation: guideCaret 1s steps(2) infinite;
}
#guide-overlay.is-done .guide-overlay__text::after { display: none; }
@keyframes guideCaret { 50% { opacity: 0; } }

/* Buttons: Bootstrap-Button-Styles werden hier vollständig überschrieben.
   Höhere Spezifität (#guide-overlay + Doppelklasse) und !important. */
#guide-overlay button.guide-overlay__close,
#guide-overlay button.guide-overlay__btn {
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: inherit !important;
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    outline: none !important;
}

#guide-overlay button.guide-overlay__close {
    position: absolute !important;
    top: 6px !important;
    right: 10px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 235, 181, 0.7) !important;
    font-size: 26px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#guide-overlay button.guide-overlay__close:hover,
#guide-overlay button.guide-overlay__close:focus {
    background: rgba(255, 235, 181, 0.15) !important;
    color: #fdf3d3 !important;
}

#guide-overlay .guide-overlay__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 235, 181, 0.15);
}
#guide-overlay button.guide-overlay__btn {
    background: rgba(255, 235, 181, 0.12) !important;
    border: 1px solid rgba(255, 235, 181, 0.3) !important;
    color: #fdf3d3 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}
#guide-overlay button.guide-overlay__btn:hover,
#guide-overlay button.guide-overlay__btn:focus {
    background: rgba(255, 235, 181, 0.25) !important;
}
#guide-overlay button.guide-overlay__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
}
#guide-overlay .guide-overlay__status {
    font-size: 12px;
    color: rgba(255, 235, 181, 0.6);
    flex: 1;
}

/* Info-Icon: disabled-Zustand wenn kein Guide-Text */
.menu-button.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 600px) {
    #guide-overlay.guide-overlay { padding: 0 8px 12px; }
    #guide-overlay .guide-overlay__panel { padding: 14px 40px 12px 16px; }
    #guide-overlay .guide-overlay__text { font-size: 14px; }
}
