* { box-sizing: border-box; }
:root {
    color-scheme: dark;
    --text: #f3efe8;
    --sekundaer: #aaa49b;
    --akzent: #7a1731;
    --gold: #b89155;
    --linie: rgba(255,255,255,.18);
}
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
    background: #08080a;
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    overscroll-behavior: none;
    touch-action: none;
}
canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
button, a { font: inherit; }
.overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    background: radial-gradient(circle at 50% 24%, rgba(122,23,49,.27), transparent 42%), rgba(6,6,8,.95);
    backdrop-filter: blur(10px);
}
.overlay.sichtbar { display: grid; }
.karte {
    width: min(560px, 100%);
    max-height: 92dvh;
    overflow: auto;
    padding: 32px 24px;
    border: 1px solid var(--linie);
    background: linear-gradient(145deg, rgba(27,26,30,.97), rgba(10,10,12,.97));
    text-align: center;
}
.kicker { color: var(--gold); font-size: .73rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
h1 { margin: 13px 0 18px; font: 400 clamp(2.2rem, 11vw, 4.3rem)/.98 Georgia, serif; }
.karte p { color: #c4beb5; line-height: 1.58; }
.primaer {
    width: 100%;
    min-height: 54px;
    margin-top: 16px;
    border: 1px solid #a13a55;
    background: var(--akzent);
    color: white;
}
.wechsel { display: inline-block; margin-top: 18px; color: var(--sekundaer); font-size: .9rem; }
#hud { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
#bereich, #vollbild, #auswahl, #lookHinweis {
    position: absolute;
    border: 1px solid var(--linie);
    background: rgba(0,0,0,.56);
    backdrop-filter: blur(8px);
}
#bereich {
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    padding: 8px 11px;
    color: var(--gold);
    font-size: .72rem;
    letter-spacing: .13em;
    text-transform: uppercase;
}
#vollbild, #auswahl {
    top: max(14px, env(safe-area-inset-top));
    width: 44px;
    height: 44px;
    color: white;
    pointer-events: auto;
}
#vollbild { right: calc(max(14px, env(safe-area-inset-right)) + 52px); }
#auswahl { right: max(14px, env(safe-area-inset-right)); }
#lookHinweis {
    top: calc(max(14px, env(safe-area-inset-top)) + 54px);
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 10px;
    color: rgba(255,255,255,.7);
    font-size: .72rem;
    white-space: nowrap;
    transition: opacity .4s ease;
}
#preview {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 24;
    display: none;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    width: min(330px, calc(100% - 138px));
    padding: 10px;
    border: 1px solid rgba(184,145,85,.55);
    background: rgba(8,8,10,.88);
    box-shadow: 0 16px 50px rgba(0,0,0,.42);
    backdrop-filter: blur(12px);
}
#preview.sichtbar { display: grid; }
#preview img { width: 72px; height: 92px; object-fit: cover; }
#preview div { min-width: 0; }
#preview span { display: block; color: var(--gold); font-size: .66rem; letter-spacing: .11em; text-transform: uppercase; }
#preview strong { display: block; margin: 6px 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ansehen { min-height: 34px; padding: 6px 13px; border: 1px solid rgba(255,255,255,.25); background: var(--akzent); color: white; }
#joystick {
    position: fixed;
    left: max(18px, env(safe-area-inset-left));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 25;
    width: 106px;
    height: 106px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(0,0,0,.36);
    box-shadow: inset 0 0 28px rgba(255,255,255,.04);
    touch-action: none;
}
#stick {
    position: absolute;
    left: 50%; top: 50%;
    width: 48px; height: 48px;
    transform: translate(-50%,-50%);
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 50%;
    background: rgba(122,23,49,.68);
}
#modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    overflow: auto;
    padding: max(64px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    background: rgba(5,5,7,.97);
    backdrop-filter: blur(14px);
    touch-action: pan-y;
}
#modal.offen { display: block; }
#modalSchliessen {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 2;
    width: 46px; height: 46px;
    border: 1px solid var(--linie);
    background: rgba(0,0,0,.62);
    color: white;
    font-size: 2rem;
}
#modalBild { display: block; width: min(100%, 620px); max-height: 67dvh; margin: 0 auto; object-fit: contain; box-shadow: 0 22px 70px rgba(0,0,0,.58); }
.modalText { width: min(620px, 100%); margin: 22px auto 0; }
#modalNummer { color: var(--gold); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
#modalTitel { margin: 9px 0 13px; font: 400 clamp(2rem, 10vw, 3.8rem)/1 Georgia, serif; }
#modalBeschreibung { color: #c8c2b9; line-height: 1.6; }
.modalNavigation { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.modalNavigation button { min-height: 46px; border: 1px solid var(--linie); background: #17171a; color: white; }
#laden {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-content: center;
    gap: 12px;
    background: #08080a;
    text-align: center;
    transition: opacity .4s ease, visibility .4s ease;
}
#laden.fertig { opacity: 0; visibility: hidden; }
#laden span { width: 34px; height: 34px; margin: auto; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--gold); border-radius: 50%; animation: drehen .8s linear infinite; }
#laden p { margin: 0; color: var(--sekundaer); }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (orientation: landscape) and (max-height: 520px) {
    #joystick { width: 92px; height: 92px; }
    #stick { width: 42px; height: 42px; }
    #preview { width: min(320px, calc(100% - 128px)); }
    #modal { padding-top: 56px; }
    #modalBild { max-height: 62dvh; }
}


#previewSerie,
#modalSerie {
    display: block;
    color: var(--gold);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .10em;
    line-height: 1.35;
    text-transform: uppercase;
}

#previewNummer,
#modalNummer {
    display: block;
    margin-top: 3px;
    color: var(--sekundaer);
}


#starten {
    position: relative;
    z-index: 2;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#laden.fertig {
    pointer-events: none;
}
