* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --hintergrund: #0b0b0d;
    --flaeche: rgba(16, 16, 19, .94);
    --linie: rgba(255, 255, 255, .18);
    --text: #f3f0e8;
    --sekundaer: #aaa59b;
    --akzent: #7a1731;
    --gold: #b89155;
}

html,
body,
#app {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--hintergrund);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

canvas {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

button {
    font: inherit;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 30%, rgba(122, 23, 49, .25), transparent 42%),
        linear-gradient(135deg, rgba(0, 0, 0, .72), rgba(0, 0, 0, .93));
    backdrop-filter: blur(10px);
}

.overlay.sichtbar {
    display: grid;
}

.startkarte {
    width: min(720px, 100%);
    padding: clamp(28px, 6vw, 64px);
    border: 1px solid var(--linie);
    background: linear-gradient(145deg, rgba(28, 27, 30, .96), rgba(10, 10, 12, .96));
    box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
    text-align: center;
}

.eyebrow {
    margin-bottom: 16px;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 7vw, 5.5rem);
    font-weight: 400;
    line-height: .95;
}

.untertitel {
    margin: 24px 0 8px;
    color: var(--sekundaer);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.einleitung {
    max-width: 520px;
    margin: 18px auto 28px;
    color: #d5d0c7;
    line-height: 1.6;
}

.primaer {
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, .38);
    background: var(--akzent);
    color: white;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.primaer:hover {
    filter: brightness(1.18);
    transform: translateY(-1px);
}

.steuerung-desktop {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin-top: 28px;
    color: var(--sekundaer);
    font-size: .85rem;
}

.steuerung-desktop b {
    color: var(--text);
}

.steuerung-mobil {
    display: none;
    margin-top: 24px;
    color: var(--sekundaer);
    font-size: .9rem;
    line-height: 1.5;
}

#hud {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

#bereich {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    padding: 8px 12px;
    border: 1px solid var(--linie);
    background: rgba(0, 0, 0, .58);
    color: var(--gold);
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

#werkhinweis {
    position: absolute;
    left: 50%;
    bottom: 24px;
    max-width: calc(100% - 40px);
    padding: 9px 14px;
    transform: translateX(-50%);
    border: 1px solid var(--linie);
    background: rgba(0, 0, 0, .68);
    color: #eee;
    font-size: .86rem;
    opacity: .7;
    transition: opacity .2s ease;
    backdrop-filter: blur(8px);
}

#werkhinweis.aktiv {
    opacity: 1;
    border-color: rgba(184, 145, 85, .7);
    color: white;
}

.iconbutton {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border: 1px solid var(--linie);
    background: rgba(0, 0, 0, .58);
    color: white;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

#fadenkreuz {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, .8);
}

.werkmodal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px 72px;
    background: rgba(5, 5, 7, .96);
    backdrop-filter: blur(15px);
}

.werkmodal.offen {
    display: flex;
}

.werkmodal figure {
    display: grid;
    grid-template-columns: minmax(250px, 58vh) minmax(230px, 380px);
    align-items: center;
    gap: clamp(24px, 5vw, 70px);
    max-width: 1180px;
    max-height: 90vh;
    margin: 0;
}

.werkmodal img {
    display: block;
    width: 100%;
    max-height: 86vh;
    object-fit: contain;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .65);
}

.werkmodal figcaption {
    align-self: center;
}

#modalnummer {
    color: var(--gold);
    font-size: .8rem;
    letter-spacing: .18em;
    text-transform: uppercase;
}

#modaltitel {
    margin: 12px 0 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 4.4rem);
    font-weight: 400;
    line-height: 1;
}

#modaltext {
    margin: 0;
    color: #c9c4bb;
    line-height: 1.65;
}

.modal-schliessen,
.modal-nav {
    position: absolute;
    border: 1px solid var(--linie);
    background: rgba(0, 0, 0, .42);
    color: white;
    cursor: pointer;
}

.modal-schliessen {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 1;
}

.modal-nav {
    top: 50%;
    width: 46px;
    height: 70px;
    transform: translateY(-50%);
    font-size: 2.5rem;
}

.modal-nav.links {
    left: 16px;
}

.modal-nav.rechts {
    right: 16px;
}

#mobilsteuerung {
    position: fixed;
    inset: auto 0 max(16px, env(safe-area-inset-bottom)) 0;
    z-index: 20;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
    pointer-events: none;
}

.steuerkreuz {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 52px);
    gap: 6px;
    pointer-events: auto;
}

.steuerkreuz button,
#mobilinfo {
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(0, 0, 0, .52);
    color: white;
    touch-action: none;
    backdrop-filter: blur(8px);
}

.steuerkreuz button[data-move="forward"] {
    grid-column: 2;
}

.steuerkreuz button[data-move="left"] {
    grid-column: 1;
    grid-row: 2;
}

.steuerkreuz button[data-move="backward"] {
    grid-column: 2;
    grid-row: 2;
}

.steuerkreuz button[data-move="right"] {
    grid-column: 3;
    grid-row: 2;
}

#mobilinfo {
    width: 74px;
    height: 52px;
    pointer-events: auto;
}

#ladeanzeige {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    gap: 14px;
    background: #09090b;
    color: #d7d2c9;
    text-align: center;
    transition: opacity .45s ease, visibility .45s ease;
}

#ladeanzeige.fertig {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: auto;
    border: 2px solid rgba(255, 255, 255, .16);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: drehen .8s linear infinite;
}

@keyframes drehen {
    to { transform: rotate(360deg); }
}

@media (max-width: 800px), (pointer: coarse) {
    .steuerung-desktop {
        display: none;
    }

    .steuerung-mobil {
        display: block;
    }

    #mobilsteuerung {
        display: flex;
    }

    #fadenkreuz {
        display: none;
    }

    #werkhinweis {
        bottom: 84px;
        font-size: .78rem;
    }

    .werkmodal {
        padding: 64px 18px 18px;
        overflow: auto;
    }

    .werkmodal figure {
        display: block;
        max-height: none;
    }

    .werkmodal img {
        max-height: 62vh;
    }

    .werkmodal figcaption {
        padding: 20px 4px 30px;
    }

    .modal-nav {
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .modal-nav.links {
        left: 18px;
    }

    .modal-nav.rechts {
        right: 18px;
    }
}

.versionswechsel {
    margin: 16px 0 0;
}

.versionswechsel a {
    color: var(--sekundaer);
    font-size: .86rem;
    text-decoration: none;
}

.versionswechsel a:hover {
    color: var(--text);
}


#modalserie {
    display: block;
    margin-bottom: 8px;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .13em;
    line-height: 1.45;
    text-transform: uppercase;
}

#modalserie + #modalnummer {
    display: block;
    color: var(--sekundaer);
    font-size: .72rem;
    letter-spacing: .11em;
    text-transform: uppercase;
}
