:root { --knopf: 1; --nacht: #14162a; --creme: #f3e9d2; --rot: #b8202a; --neon: #ff3fb4; --cyan: #33e6ff; --gold: #f2c24b; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--nacht); color: var(--creme); overflow: hidden;
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none;
  touch-action: none; -webkit-touch-callout: none; }
/* HUD + Menüs in #ui: bei Browser-Zoom virtuelle Fläche ≥ 720 × 340 (src/ui_mass.js), verkleinert dargestellt. Darin cqw/cqh statt vw/vh
   und @container statt @media für Größen-Regeln (sonst gelten Handy-Regeln der echten, gezoomten Fläche). */
#ui { position: fixed; left: 0; top: 0; width: calc(100% / var(--ui, 1)); height: calc(100% / var(--ui, 1)); transform: scale(var(--ui, 1)); transform-origin: 0 0; container-type: size; }
#spiel { position: fixed; inset: 0; width: 100vw; height: 100vh; }
#spiel canvas { position: fixed; inset: 0; width: 100vw !important; height: 100vh !important; display: block; }
/* Neon-Noir-Farbstimmung (Charlys Referenz 18.11.): Violett in den Schatten, Magenta von unten, über dem Spiel, unter HUD/Menüs */
#farbstich { position: fixed; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(180deg, rgba(110, 40, 210, .52) 0%, rgba(60, 30, 170, .48) 55%, rgba(255, 40, 160, .4) 100%); }
body.ohne-farbstich #farbstich { display: none; }
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 55%, rgba(8,8,24,.55) 100%); }
button, .knopf { font: inherit; color: var(--creme); background: rgba(20,22,42,.85); border: 2px solid rgba(243,233,210,.35);
  border-radius: 12px; padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
button:active { transform: scale(.96); }
button:disabled { opacity: .6; cursor: wait; }
.haupt { background: var(--rot); border-color: var(--gold); font-weight: 800; font-size: 18px; padding: 12px 26px; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#oben-links { position: absolute; left: calc(12px + env(safe-area-inset-left)); top: calc(12px + env(safe-area-inset-top));
  max-width: min(46cqw, 420px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#auftrag { background: rgba(14,16,32,.72); border-left: 4px solid var(--neon); border-radius: 8px;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
#auftrag b { color: var(--neon); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
#auftrag span { font-size: 16px; font-weight: 600; }
#oben-rechts { position: absolute; right: calc(12px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top)); width: 168px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#minikarte { width: 168px; height: 168px; border-radius: 50%; border: 3px solid rgba(243,233,210,.6); background: #0d0f1e;
  box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
#fahndung { display: flex; gap: 4px; }
#fahndung i { width: 18px; height: 18px; display: block; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  background: rgba(243,233,210,.25); }
#fahndung i.an { background: var(--gold); }
#radio-anzeige, #geld-anzeige { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#radio-anzeige { background: rgba(14,16,32,.75); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--cyan); }
#k-pause { position: absolute; pointer-events: auto; right: calc(196px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top));
  width: 44px; height: 44px; padding: 0; border-radius: 50%; font-weight: 900; }
#hinweis { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: rgba(14,16,32,.8);
  border: 2px solid var(--gold); border-radius: 10px; padding: 8px 14px; font-weight: 700; white-space: nowrap; }
#toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); background: rgba(14,16,32,.85); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: 17px; text-align: center; max-width: 80cqw; }
#tempo { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
  font: 800 22px/1 system-ui, sans-serif; color: var(--creme); text-shadow: 0 2px 0 #000; }
#ziel-pfeil { position: absolute; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-bottom: 26px solid var(--gold); filter: drop-shadow(0 0 6px rgba(242,194,75,.8)); transform-origin: 50% 60%; }
#debug { position: absolute; left: 12px; bottom: 12px; font: 12px/1.3 ui-monospace, monospace; background: rgba(0,0,0,.6); padding: 6px 8px; border-radius: 6px; white-space: pre; }

#touch { position: fixed; inset: 0; pointer-events: none; }
#stick { position: absolute; left: calc(26px + env(safe-area-inset-left)); bottom: calc(26px + env(safe-area-inset-bottom));
  width: 150px; height: 150px; border-radius: 50%; background: rgba(243,233,210,.08); border: 2px solid rgba(243,233,210,.25); pointer-events: auto; }
#knauf { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(243,233,210,.3); border: 2px solid rgba(243,233,210,.55); }
#knoepfe { position: absolute; right: calc(20px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, 66px); grid-auto-rows: 66px; gap: 10px; pointer-events: none; }
#knoepfe button { pointer-events: auto; }   /* 19.11.: die Rasterfläche (auch zu Fuß 3 × 2 Felder) lag am Handy über dem Pause-Knopf → Tipp kam nie an */
#knoepfe { transform: scale(var(--knopf)); transform-origin: right bottom; }
#stick { transform: scale(var(--knopf)); transform-origin: left bottom; }
#knoepfe button { width: 66px; height: 66px; padding: 0; border-radius: 50%; font-weight: 800; font-size: 13px; }
#knoepfe .gross { grid-column: 3; grid-row: 2; background: rgba(184,32,42,.85); border-color: var(--gold); font-size: 22px; }
#k-bremse { grid-column: 2; grid-row: 2; } #k-drift { grid-column: 1; grid-row: 2; } #k-hupe { grid-column: 2; grid-row: 1; } #k-radio { grid-column: 3; grid-row: 1; }
#knoepfe.zu-fuss .fahren { display: none; }
body.stop #touch, body.stop #hinweis, body.stop #ziel-pfeil { visibility: hidden; }   /* Dialog/Menü offen: Steuerung weg, Tippen auf den Dialog geht weiter */
body.touch #tempo { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); }
#knoepfe button.gedrueckt { background: rgba(243,233,210,.35); }

.tafel { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,10,24,.72); backdrop-filter: blur(2px); }
.tafel .inhalt { max-width: min(560px, 92cqw); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center;
  background: rgba(20,22,42,.92); border: 2px solid rgba(255,63,180,.55); border-radius: 18px; padding: 22px 26px; }
.tafel h1 { margin: 0; font-size: 64px; letter-spacing: .04em; color: #fff; text-shadow: 3px 3px 0 var(--neon), -2px -2px 0 var(--cyan); }
.tafel h2 { margin: 0; }
.tafel .logo { width: min(440px, 80cqw); height: auto; max-height: 34cqh; object-fit: contain; margin: -6px 0 4px; }
.tafel .unter { margin: -8px 0 0; color: var(--gold); font-weight: 700; }
.tafel p { margin: 0; }
.steuerung { font-size: 13px; opacity: .8; } .fein { font-size: 11px; opacity: .55; }
body:not(.touch) .steuerung.touch { display: none; } body.touch .steuerung.pc { display: none; }
#hochkant { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  #hochkant { display: grid; place-items: center; position: fixed; inset: 0; background: var(--nacht); font-size: 20px; font-weight: 700; z-index: 10; }
}
@container (max-height: 430px) {
  #minikarte { width: 120px; height: 120px; } #k-pause { right: calc(148px + env(safe-area-inset-right)); }
  #auftrag span { font-size: 14px; } .tafel h1 { font-size: 44px; }
  .tafel .inhalt { padding: 12px 18px; gap: 8px; } .tafel .logo { max-height: 30cqh; margin: 0; }
}

/* ---- Menüs, Dialog, Missionskarte, Minispiel (Spiel-Ausbau 18.11.) ---- */
.spalte { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: min(320px, 80cqw); }
.reihe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.reihe > * { flex: 1 1 0; }
.fein-info { margin: 0; color: var(--cyan); font-size: 14px; }
.tafel.durchsichtig { background: rgba(10, 10, 24, .35); backdrop-filter: none; align-items: end; padding-bottom: 6cqh; }
.karte-intro { max-width: min(620px, 92cqw); text-align: left; align-items: stretch; }
.karte-intro .intro-titel { color: var(--neon); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.karte-intro #intro-name { color: var(--gold); }
.karte-intro p { font-size: 19px; line-height: 1.4; }
#dialog { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(640px, 92cqw);
  background: rgba(14, 16, 32, .94); border: 2px solid var(--gold); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; z-index: 6; }
#dialog b { color: var(--gold); } #dialog span { font-size: 18px; } #dialog small { opacity: .55; align-self: flex-end; font-size: 11px; }
#missionskarte { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; z-index: 5;
  display: flex; flex-direction: column; gap: 4px; text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,.7); }
#missionskarte small { color: var(--cyan); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 15px; }
#missionskarte strong { font-size: clamp(26px, 5cqw, 44px); color: #fff; text-shadow: 3px 3px 0 var(--neon), -2px -2px 0 var(--cyan); }
#tipp { background: rgba(14, 16, 32, .78); border-left: 4px solid var(--gold); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
#fortschritt { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); width: 160px; height: 10px; border-radius: 5px;
  background: rgba(14, 16, 32, .85); border: 2px solid var(--neon); overflow: hidden; }
#fortschritt i { display: block; height: 100%; width: 0; background: var(--neon); }
#geld-anzeige { background: rgba(14,16,32,.75); border-radius: 8px; padding: 3px 9px; font-size: 13px; color: var(--gold); font-weight: 700; }
#karte-bild { width: min(512px, 84cqw); height: auto; max-height: 62cqh; border-radius: 10px; border: 2px solid rgba(243,233,210,.3); image-rendering: pixelated; }
.inhalt.breit { max-width: min(600px, 94cqw); }
.legende { font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.legende i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 3px; }
.p-ich { background: var(--neon); } .p-ziel { background: var(--gold); } .p-ort { background: #e8c27a; } .p-polizei { background: #4d7dff; }
.tasten { border-collapse: collapse; font-size: 14px; text-align: left; }
.tasten th, .tasten td { padding: 5px 9px; border-bottom: 1px solid rgba(243,233,210,.15); }
.tasten th { font-weight: 600; color: var(--gold); }
body.touch .tasten td:nth-child(2), body:not(.touch) .tasten td:nth-child(3) { opacity: .45; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: min(360px, 80cqw); font-size: 15px; }
.option select, .option input[type=range] { flex: 0 0 150px; font: inherit; }
.option input[type=checkbox] { width: 22px; height: 22px; }
#abspann-text { display: flex; flex-direction: column; gap: 6px; }
#abspann-text p { margin: 0; } #abspann-text .gross { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 var(--neon); }
@container (max-height: 430px) {
  #missionskarte { top: 24%; } #missionskarte strong { font-size: 24px; } #missionskarte small { font-size: 12px; }
  #dialog span { font-size: 15px; } #tipp { font-size: 12px; }
  #toast { top: 36%; font-size: 15px; max-width: 56cqw; } #oben-rechts { width: 120px; }
  .karte-intro p { font-size: 16px; } .tafel .inhalt { max-height: 94cqh; overflow-y: auto; }
}

/* ---- Bild-Tafeln (Codex ART-2b-A, 18.11.): Menü, Intro, Kapitelkarten, Pause, Abspann ---- */
.bildtafel { background: var(--nacht) center / cover no-repeat; backdrop-filter: none; }
.startmenue { background-image: linear-gradient(90deg, rgba(10,10,24,0) 55%, rgba(10,10,24,.55) 100%), url(assets/ui/bilder/ui_menue_hintergrund.webp);
  background-position: 38% 50%; display: block; }
@container (max-width: 1280px) { .startmenue { background-image: linear-gradient(90deg, rgba(10,10,24,0) 50%, rgba(10,10,24,.6) 100%), url(assets/ui/bilder/ui_menue_hintergrund_720.webp); } }
.startmenue .logo { position: absolute; left: 50%; top: calc(3cqh + env(safe-area-inset-top)); transform: translateX(-50%);
  width: auto; height: min(26cqh, 300px); max-width: 60cqw; margin: 0; filter: drop-shadow(0 6px 18px rgba(0,0,0,.55)); }
.menue-panel { position: absolute; right: calc(4cqw + env(safe-area-inset-right)); bottom: calc(5cqh + env(safe-area-inset-bottom));
  max-width: min(400px, 44cqw) !important; background: rgba(14,16,32,.82) !important; border-color: rgba(255,63,180,.45) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.menue-panel .spalte { min-width: min(300px, 40cqw); }
.grund { background-image: linear-gradient(rgba(10,10,24,.45), rgba(10,10,24,.62)), url(assets/ui/bilder/ui_pause_hintergrund.webp); }
.tafel.intro { background: var(--nacht); display: block; }
.tafel-bild { position: absolute; inset: 0; background: center / cover no-repeat; transition: opacity .35s; }
.tafel-bild.weg { opacity: 0; }
.tafel.intro .karte-intro { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(4cqh + env(safe-area-inset-bottom));
  width: min(760px, 92cqw); max-width: none; background: rgba(14,16,32,.86); border-color: rgba(242,194,75,.6); }
.tafel.kapitel { background: rgba(8,8,22,.78); z-index: 7; }
.kapitel-karte { position: relative; width: min(960px, 82cqw, 128cqh); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(255,63,180,.6); background: rgba(14,16,32,.95); box-shadow: 0 18px 60px rgba(0,0,0,.6); animation: kapitel-rein .45s ease-out; }
.kapitel-karte img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: auto; }
.kapitel-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 22px 16px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(rgba(14,16,32,0), rgba(14,16,32,.92) 45%); text-shadow: 0 2px 0 #000; }
.kapitel-text small { color: var(--cyan); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.kapitel-text strong { font-size: clamp(22px, 3.6cqw, 38px); color: #fff; line-height: 1.1; text-shadow: 3px 3px 0 var(--neon), -2px -2px 0 rgba(51,230,255,.8); }
.kapitel-text span { font-size: 16px; color: var(--creme); opacity: .9; }
.kapitel-karte .weiter-hinweis { position: absolute; right: 12px; top: 10px; font-size: 11px; opacity: .75; background: rgba(14,16,32,.7); padding: 3px 8px; border-radius: 6px; }
@keyframes kapitel-rein { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.tafel.abspann { background-image: linear-gradient(90deg, rgba(10,10,24,0) 45%, rgba(10,10,24,.7) 100%), url(assets/ui/bilder/ui_abspann.webp);
  background-position: 30% 50%; display: block; }
.abspann-panel { position: absolute; right: calc(4cqw + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); max-width: min(440px, 46cqw) !important;
  background: rgba(14,16,32,.86) !important; text-align: left !important; align-items: stretch !important; }
@container (max-height: 430px) {
  .startmenue .logo { height: 30cqh; top: 2cqh; }
  .menue-panel { bottom: 3cqh; right: 3cqw; padding: 10px 14px !important; gap: 6px !important; }
  .menue-panel .unter, .menue-panel .fein { display: none; }
  .menue-panel button, .menue-panel .knopf { padding: 7px 12px; } .menue-panel .haupt { font-size: 16px; padding: 8px 18px; }
  .menue-panel .spalte { gap: 6px; }
  .tafel.intro .karte-intro { bottom: 3cqh; padding: 10px 16px; } .karte-intro p { font-size: 15px; }
  .kapitel-karte { width: min(88cqw, 150cqh); } .kapitel-text { padding: 26px 16px 10px; } .kapitel-text span { font-size: 13px; }
  .abspann-panel { padding: 8px 12px !important; max-width: 31cqw !important; right: 2cqw; gap: 6px !important; } #abspann-text .gross { font-size: 16px; } #abspann-text p { font-size: 11.5px; }
  .abspann-panel .haupt { font-size: 14px; padding: 7px 12px; }   /* Abspannbild: Figuren stehen bis 0,69 der Breite (Codex safe_area) */
}
@container (max-width: 700px) {
  .menue-panel { max-width: 56cqw !important; } .abspann-panel { max-width: 60cqw !important; }
}
/* Schmale Seitenverhältnisse (Tablet 4:3): Abspannbild ganz zeigen, Tafel darunter mittig – sonst verdeckt sie den Spieler */
@container (max-aspect-ratio: 3/2) {
  .tafel.abspann { background-size: 100% auto; background-position: 50% 8%; }
  .abspann-panel { top: auto; bottom: calc(3cqh + env(safe-area-inset-bottom)); right: 50%; transform: translateX(50%); max-width: min(560px, 92cqw) !important; text-align: center !important; }
}

/* ---- Icons von Codex ART-2b (HUD, 19.11.) ---- */
#fahndung { gap: 2px; }
#fahndung i { clip-path: none; width: 24px; height: 23px; background: transparent url(assets/ui/icons/icon_fahndungsstern_aus_64.png) center / contain no-repeat;
  image-rendering: pixelated; opacity: .55; }
#fahndung i.an { background-color: transparent; background-image: url(assets/ui/icons/icon_fahndungsstern_an_64.png); background-size: contain; background-position: center; background-repeat: no-repeat; opacity: 1; filter: drop-shadow(0 0 5px rgba(255, 70, 90, .8)); animation: stern-puls .9s ease-in-out infinite alternate; }
@keyframes stern-puls { from { transform: scale(1); } to { transform: scale(1.12); } }
#geld-anzeige::before, #radio-anzeige::before, #sammel-tickets::before, #sammel-waende::before {
  content: ''; display: inline-block; width: 17px; height: 17px; margin-right: 5px; vertical-align: -4px;
  background: center / contain no-repeat; image-rendering: pixelated; }
#geld-anzeige::before { background-image: url(assets/ui/icons/icon_burger_taler_64.png); }
#radio-anzeige::before { background-image: url(assets/ui/icons/icon_radio_64.png); }
#sammel-anzeige { display: flex; gap: 10px; background: rgba(14,16,32,.75); border-radius: 8px; padding: 3px 9px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
#sammel-tickets::before { background-image: url(assets/ui/icons/icon_burger_ticket_64.png); }
#sammel-waende::before { background-image: url(assets/ui/icons/icon_spraydose_64.png); width: 11px; }
#sammel-anzeige[hidden] { display: none; }
#inventar { display: flex; gap: 5px; justify-content: flex-end; }
#inventar img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; background: rgba(14,16,32,.78);
  border: 2px solid rgba(242,194,75,.7); border-radius: 8px; padding: 3px; animation: ico-rein .35s ease-out; }
@keyframes ico-rein { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
#fortschritt { overflow: visible; }
#fortschritt i { border-radius: 3px; }
#fortschritt .ico-spray { position: absolute; left: -24px; top: 50%; width: 14px; height: 24px; transform: translateY(-50%); image-rendering: pixelated; object-fit: contain; }
#toast img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; margin-right: 8px; }
#hinweis.schluessel::before { content: ''; display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px;
  background: url(assets/ui/icons/icon_autoschluessel_64.png) center / contain no-repeat; image-rendering: pixelated; }
.legende i.p-ziel, .legende i.p-polizei, .legende i.p-ort { border-radius: 0; width: 13px; height: 14px; background: transparent center / contain no-repeat; image-rendering: pixelated; vertical-align: -2px; }
.legende i.p-ziel { background-image: url(assets/ui/icons/icon_map_ziel_24.png); }
.legende i.p-polizei { background-image: url(assets/ui/icons/icon_map_polizei_24.png); }
.legende i.p-ort { background-image: url(assets/ui/icons/icon_map_el_camino_24.png); }
.abspann-pokal { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; align-self: center; filter: drop-shadow(0 0 10px rgba(242,194,75,.6)); }
@container (max-height: 430px) { #fahndung i { width: 19px; height: 18px; } #inventar img { width: 28px; height: 28px; } .abspann-pokal { width: 40px; height: 40px; } }
@container (max-height: 430px) { .tasten { font-size: 12px; } .tasten th, .tasten td { padding: 2px 7px; } #steuerung h2 { font-size: 18px; } }

/* ---- Dialog-Porträts (Codex ART-2c, 19.11.) ---- */
#dialog { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: start; }
#dialog #dialog-bild { grid-row: 1 / span 3; width: 84px; height: 84px; border-radius: 10px; border: 2px solid rgba(255,63,180,.65); object-fit: cover; image-rendering: auto; background: #1a1430; }
#dialog #dialog-bild[hidden] { display: none; }
#dialog.handy #dialog-bild { border-color: rgba(51,230,255,.8); box-shadow: 0 0 12px rgba(51,230,255,.35); }
#dialog.ohne-bild { grid-template-columns: 1fr; }
#dialog small { grid-column: 2; } #dialog.ohne-bild small { grid-column: 1; }
@container (max-height: 430px) { #dialog #dialog-bild { width: 58px; height: 58px; } }

/* ---- Minispiel-Baustein (Story v2.0) ---- */
.minispiel .inhalt { width: min(560px, 94cqw); max-width: none; border-color: rgba(51,230,255,.55); position: relative; }
.minispiel h2 { color: #fff; text-shadow: 2px 2px 0 var(--neon); }
.ms-text { font-size: 16px; } .ms-status { font-size: 13px; color: var(--cyan); min-height: 1.2em; margin: 0; }
.ms-zeit { position: absolute; right: 14px; top: 10px; font: 800 15px/1 system-ui, sans-serif; color: var(--gold); font-variant-numeric: tabular-nums; }
.ms-zeit.knapp { color: #ff5b6e; animation: stern-puls .5s ease-in-out infinite alternate; }
.ms-feld { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ms-leiste { position: relative; width: 100%; height: 38px; border-radius: 19px; background: #2a1c30; border: 2px solid rgba(243,233,210,.4); overflow: hidden; touch-action: none; cursor: pointer; }
.ms-gruen { position: absolute; top: 0; bottom: 0; background: linear-gradient(#59d27a, #2f9a4d); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.ms-zeiger { position: absolute; top: -2px; bottom: -2px; width: 7px; margin-left: -3.5px; background: #fff; box-shadow: 0 0 10px #fff; }
.ms-zeiger.ok { background: #6f6; box-shadow: 0 0 14px #6f6; } .ms-zeiger.falsch { background: #f44; box-shadow: 0 0 14px #f44; }
.ms-pips { display: flex; gap: 8px; } .ms-pips i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold); } .ms-pips i.an { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.ms-knoepfe { display: flex; gap: 12px; justify-content: center; width: 100%; }
.ms-gross { min-height: 64px; min-width: 150px; font-size: 20px; font-weight: 900; touch-action: none; }
.ms-l, .ms-r { flex: 1 1 0; background: rgba(51,230,255,.15); border-color: var(--cyan); }
.ms-puls { width: 74px; height: 74px; border-radius: 50%; border: 4px solid rgba(243,233,210,.35); transition: background .08s, border-color .08s; }
.ms-puls.jetzt { border-color: var(--gold); background: rgba(242,194,75,.35); box-shadow: 0 0 20px rgba(242,194,75,.6); }
.ms-puls.treffer { background: rgba(80,255,120,.6); } .ms-puls.fehler { background: rgba(255,70,90,.6); }
.ms-seite { font: 900 22px/1 system-ui, sans-serif; color: #fff; letter-spacing: .06em; }
.ms-fortschritt { width: 100%; height: 14px; border-radius: 7px; background: #2a1c30; border: 2px solid var(--neon); overflow: hidden; } .ms-fortschritt i { display: block; height: 100%; width: 0; background: var(--neon); transition: width .12s; }
.ms-raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.ms-fach { min-height: 70px; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px 10px; }
.ms-fach b { font-size: 14px; } .ms-fach small { font-size: 12px; opacity: .75; }
.ms-fach.offen { background: rgba(60,60,80,.85); } .ms-fach.treffer { border-color: #6f6; background: rgba(40,110,60,.85); }
.ms-auswahl { display: flex; flex-direction: column; gap: 8px; width: 100%; } .ms-option { min-height: 50px; text-align: left; font-size: 16px; }
.ms-abbruch { font-size: 13px; padding: 6px 12px; opacity: .8; }
@container (max-height: 430px) {
  .minispiel .inhalt { gap: 6px !important; padding: 10px 14px !important; } .ms-text { font-size: 14px; } .minispiel h2 { font-size: 18px; }
  .ms-gross { min-height: 54px; font-size: 17px; } .ms-puls { width: 52px; height: 52px; } .ms-fach { min-height: 52px; padding: 5px 8px; } .ms-option { min-height: 42px; font-size: 14px; }
}

/* ---- Story v2.0: Alarm, Countdown, Knall-Blitz, Schwarzblende ---- */
#alarm-anzeige { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(150,16,40,.9);
  border: 2px solid #ff6f86; border-radius: 10px; padding: 6px 14px; font: 900 17px/1.2 system-ui, sans-serif; color: #fff; letter-spacing: .04em;
  animation: stern-puls .6s ease-in-out infinite alternate; font-variant-numeric: tabular-nums; z-index: 4; white-space: nowrap; }
#countdown { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); font: 900 min(28cqh, 220px)/1 system-ui, sans-serif; color: #fff;
  text-shadow: 6px 6px 0 var(--neon), -4px -4px 0 var(--cyan); pointer-events: none; z-index: 8; }
#countdown.puls { animation: cd-puls .9s ease-out; }
@keyframes cd-puls { from { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1); } }
#blitz { position: fixed; inset: 0; background: #fff8e0; pointer-events: none; z-index: 9; opacity: 0; }
#blitz.an { animation: blitz .65s ease-out; }
@keyframes blitz { from { opacity: .95; } to { opacity: 0; } }
#schwarzblende { position: fixed; inset: 0; background: #05040a; color: #f3e9d2; display: grid; place-items: center; text-align: center; padding: 0 10cqw;
  font: 700 clamp(18px, 3cqw, 30px)/1.4 system-ui, sans-serif; z-index: 9; opacity: 0; pointer-events: none; }
#schwarzblende.an { opacity: 1; transition: opacity .45s; } #schwarzblende.weg { opacity: 0; transition: opacity .55s; }
body.im-kanal #minikarte { filter: brightness(.35) saturate(.4); }
body.im-kanal #oben-rechts::after { content: 'UNTER OVI'; position: absolute; top: 72px; right: 50px; font: 900 13px/1 system-ui, sans-serif; color: var(--neon); letter-spacing: .1em; }
@container (max-height: 430px) { #alarm-anzeige { top: calc(52px + env(safe-area-inset-top)); font-size: 14px; } body.im-kanal #oben-rechts::after { top: 50px; right: 34px; } }

/* Story v2.0 (19.11.): flache Handys quer – Info-Spalte links neben die Minikarte statt darunter, sonst überdeckt sie Hupe/Radio */
@container (max-height: 430px) {
  #oben-rechts { width: auto; display: grid; grid-template-columns: auto 120px; column-gap: 6px; row-gap: 4px; align-items: start; justify-items: end; }
  #minikarte { grid-column: 2; grid-row: 1 / span 6; }
  #fahndung, #radio-anzeige, #geld-anzeige, #sammel-anzeige, #inventar { grid-column: 1; }
  #radio-anzeige { max-width: 150px; }
  #k-pause { right: calc(52px + env(safe-area-inset-right)); top: calc(178px + env(safe-area-inset-top)); }
  #toast { top: 50%; max-width: 46cqw; }
  #alarm-anzeige { left: 42%; top: calc(96px + env(safe-area-inset-top)); font-size: 13px; max-width: 28cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 19.11. (Charly: am Handy im Browser unspielbar): sehr flache Fläche (Galaxy quer mit Browserleiste ~340 hoch): Pause-Knopf nach oben
   links neben die Info-Spalte (unter der Minikarte kollidierte er im Auto mit Hupe/Radio), Menütafeln kompakter (sonst unten abgeschnitten) */
@container (max-height: 380px) {
  #k-pause { top: calc(12px + env(safe-area-inset-top)); right: calc(296px + env(safe-area-inset-right)); }
  .tafel.grund .inhalt { padding: 8px 14px; gap: 6px; } .tafel.grund h2 { font-size: 18px; } .tafel.grund .spalte { gap: 6px; }
  .tafel.grund button, .tafel.grund .knopf { padding: 6px 12px; } .tafel.grund .haupt { font-size: 16px; padding: 7px 18px; }
  #karte-bild { max-height: 56cqh; }
}

/* ---------- Story-Punkte + Bestenliste (19.11.2026) ---------- */
#abspann-text .abspann-punkte { font-size: 20px; font-weight: 800; color: var(--gold); }
#abspann-text .abspann-punkte b { font-size: 26px; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 2px 2px 0 var(--neon); }
.tafel.bestenliste { z-index: 11; touch-action: auto; }
.bl-panel { position: relative; width: min(460px, 92cqw); max-height: 92cqh; overflow-y: auto; gap: 8px !important; align-items: stretch !important; text-align: left !important;
  -webkit-user-select: text; user-select: text; padding: 18px 20px !important; }
.bl-panel h2 { color: #fff; text-shadow: 2px 2px 0 var(--neon); font-size: 24px; }
.bl-art { font-size: 11px; letter-spacing: .14em; color: var(--cyan); font-weight: 800; }
.bl-zu { position: absolute; right: 10px; top: 8px; padding: 2px 11px; font-size: 22px; line-height: 1.1; border-radius: 10px; }
.bl-deins { margin: 0; } .bl-punkte { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.bl-aufst { width: 100%; border-collapse: collapse; font-size: 13px; }
.bl-aufst td { padding: 2px 4px; border-bottom: 1px solid rgba(243,233,210,.12); } .bl-aufst td.n, .bl-aufst td.p { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl-aufst td.p { font-weight: 700; color: var(--gold); }
.bl-grund { color: var(--cyan); font-size: 13px; }
.bl-aufst-box summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--cyan); padding: 2px 0; } .bl-grund:empty { display: none; }
.bl-lbl { font-size: 13px; font-weight: 700; } .bl-reihe { display: flex; gap: 8px; }
#blAlias { flex: 1; min-width: 0; font: 800 20px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; color: #fff;
  background: rgba(10,10,24,.9); border: 2px solid var(--gold); border-radius: 10px; padding: 8px 10px; -webkit-user-select: text; user-select: text; touch-action: auto; }
.bl-go { padding: 8px 16px; font-size: 16px; }
.bl-hinweis, .bl-fuss { font-size: 11.5px; opacity: .8; } .bl-hinweis a, .bl-fuss a { color: var(--cyan); }
.bl-msg { min-height: 1.2em; font-weight: 700; color: var(--cyan); } .bl-msg:empty { min-height: 0; } .bl-msg.gut { color: var(--gold); }
.bl-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.bl-liste li { display: grid; grid-template-columns: 2.4em 1fr auto; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(243,233,210,.06); font-variant-numeric: tabular-nums; }
.bl-liste li .name { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .1em; } .bl-liste li .wert { font-weight: 800; color: var(--gold); }
.bl-liste li.ich { background: rgba(255,63,180,.28); outline: 1px solid var(--neon); } .bl-liste li.leer { display: block; opacity: .75; }
@container (max-height: 430px) { .bl-panel { padding: 10px 14px !important; max-height: 96cqh; } .bl-panel h2 { font-size: 18px; } .bl-aufst { font-size: 11.5px; } .bl-fuss { display: none; } }

/* 19.11. (Charly am Galaxy: „Bildschirm arg voll, alles so mittig, dass man die Spielfigur nicht mehr sieht“, „E-Knopf nicht eingeblendet“) */
body.stop.e-weiter #knoepfe #k-aktion { visibility: visible; }            /* Dialog: E-Knopf bleibt (E / Tippen = weiter) */
#auftrag.neu { animation: auftrag-neu 1.4s ease-out; }
@keyframes auftrag-neu { 0% { box-shadow: 0 0 0 3px var(--gold); background: rgba(70, 40, 110, .95); } 100% { box-shadow: 0 0 0 0 rgba(242,194,75,0); } }
#radio-anzeige.weg { display: none; }
body.grafik-spar #farbstich, body.grafik-spar #vignette { display: none; }   /* Leistungs-Check: Mischmodus-Ebene über dem ganzen Bild kostet am Handy viel */
body:not(.zahnrad) button[aria-label="Lokale Spieldaten verwalten"] { display: none !important; }   /* ⚙ der Spielhalle nur in Start/Pause */
@container (max-height: 430px) {
  /* Bildmitte frei: Meldungen oben mittig zwischen Auftrag und Pause/Info, Hinweis tiefer; Auftrag schmaler */
  #oben-links { max-width: min(36cqw, 340px); }
  #auftrag span { font-size: 13px; } #auftrag { padding: 6px 10px; }
  #toast { top: calc(12px + env(safe-area-inset-top)); left: 50%; max-width: 24cqw; font-size: 13px; padding: 6px 10px; }
  #toast img { width: 20px; height: 20px; margin-right: 6px; }
  #hinweis { bottom: calc(58px + env(safe-area-inset-bottom)); font-size: 14px; padding: 6px 12px; }
}

/* Rechtslinks im Startmenü (Veröffentlichung 19.11.) – auch am Handy sichtbar, wo .fein sonst ausgeblendet ist */
.fein.recht a { color: var(--cyan); text-decoration: none; } .fein.recht a:hover { text-decoration: underline; }
@container (max-height: 430px) { .menue-panel .fein.recht { display: block; font-size: 10px; opacity: .7; } }

/* Premiere-Bild (Codex ART-3): Burgername als Leuchtschrift im leeren Neonschild oben rechts (Bildkoordinaten 57–84 % × 3–15 %) */
#kap-schild { position: absolute; left: 57%; top: 3.6%; width: 27%; height: 11%; display: flex; align-items: center; justify-content: center;
  font: 900 calc(min(960px, 82cqw, 128cqh) * 0.03)/1 system-ui, sans-serif; letter-spacing: .08em; color: #ffe1f4; white-space: nowrap;
  text-shadow: 0 0 3px #ff3fb4, 0 0 9px #ff3fb4, 0 0 18px rgba(255,63,180,.8); pointer-events: none; }
@container (max-height: 430px) { #kap-schild { font-size: calc(min(88cqw, 150cqh) * 0.03); } }
