:root {
  --bg: #070B1E; --surface: rgba(17, 24, 51, .94); --line: rgba(143, 184, 255, .22); --text: #EAF0FF; --muted: #A7B4D6; --primary: #8FB8FF; --gold: #FFD27A; --on-gold: #1a1405;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
/* Rotlicht: auch die Oberfläche nur in Rot, sonst wäre die Dunkelanpassung gleich wieder weg */
body.red { --surface: rgba(30, 4, 2, .95); --line: rgba(255, 75, 62, .3); --text: #FF6A5C; --muted: #C9463B; --primary: #FF4B3E; --gold: #FF4B3E; --on-gold: #1c0200; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); overflow: hidden; overscroll-behavior: none; }
canvas#sky { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
canvas#sky:active { cursor: grabbing; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(var(--st) + 10px) 12px 10px; z-index: 5; pointer-events: none; }
.top > * { pointer-events: auto; }
.spacer { flex: 1; pointer-events: none; }
.chip { display: flex; align-items: center; gap: 5px; max-width: 46vw; min-height: 44px; padding: 0 12px 0 9px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.chip svg { width: 17px; height: 17px; }
.chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; }
.clock { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: 0 1px 3px #000; }
.icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 8px 12px calc(var(--sb) + 10px); z-index: 5; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; flex: 1 1 0; min-width: 0; min-height: 54px; padding: 4px 2px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; }
.tool span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.zoom { display: flex; gap: 6px; }

.toast { position: fixed; top: calc(var(--st) + 66px); left: 50%; transform: translateX(-50%); width: min(92vw, 420px); margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 14px; text-align: center; z-index: 6; }
.guidebar, .corrbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 82px); display: flex; align-items: center; gap: 10px; max-width: 92vw; padding: 7px 8px 7px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; z-index: 5; font-size: 14px; white-space: nowrap; }
.guidebar span { overflow: hidden; text-overflow: ellipsis; }
.guidebar { border-color: var(--gold); }
.corrbar { bottom: calc(var(--sb) + 130px); font-size: 13px; }
.link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; padding: 0 6px; }

.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 560px); max-height: 62vh; max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px calc(var(--sb) + 18px); background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; z-index: 8; }
.sheet.tall { max-height: 88vh; max-height: 88dvh; height: 88vh; height: 88dvh; z-index: 9; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet h2 { margin: 0; font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; }
.sheet h3 { margin: 20px 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 20px; border: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 14px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.story { margin: 14px 0 0; }
.warn { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 12px; color: var(--gold); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 24px; background: var(--gold); color: var(--on-gold); font-weight: 650; text-decoration: none; }
.secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }

.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.row b { font-weight: 600; }
.row small { display: block; color: var(--muted); font-size: 13px; }
.row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .tag { color: var(--muted); font-size: 12px; white-space: nowrap; }
input[type=search], input[type=text], select { width: 100%; min-height: 46px; padding: 0 14px; margin-top: 12px; color: var(--text); font: inherit; font-size: 16px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; }
select option { background: #111833; color: #EAF0FF; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
label input { margin-top: 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); margin: 0; font-size: 15px; color: var(--text); }
.toggle input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold); flex: none; }
.hint { color: var(--muted); font-size: 13.5px; }
.legal { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.legal a { color: var(--primary); }

.start { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: radial-gradient(90% 60% at 50% 30%, #18244f 0%, #070B1E 72%); text-align: center; overflow-y: auto; }
.start-in { max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.start img { border-radius: 20px; }
.start h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.15; }
.start p { margin: 0; color: var(--muted); }
.start .primary { width: 100%; margin-top: 10px; font-size: 17px; }
body.red .start { background: #120100; }
.noscript { position: fixed; inset: auto 0 40%; text-align: center; }
@media (min-width: 700px) { .tool { flex: 0 0 96px; } .bottom { justify-content: center; } }
