/* ── Box Mover — Optik der DOM-Teile über der three.js-Bühne (Neubau Nachtlauf 31.10.2026) ──────────────────────────────────
   WAS: HUD oben rechts (Level, Züge, Schübe, Par), Leiste unten (Rückgängig, Neu, Menü, Pfeile), Startbildschirm-Norm sb-* als Glaskarte,
        Levelübersicht (3 Hallen × 10 Kacheln mit Sternen), Lösungskarte mit einfliegenden Sternen, Pause, Meldung, Laden, Handy-Pfeilkreuz.
        Aufbau/Klassen nach games/croak-hop/css/spiel.css; Farben eigene: Hafenhalle im Abendlicht (Bernstein, Backstein, Signalgrün).
   ÄNDERN: Farben nur in :root. Oben links ~64×56 px bleiben frei für die GameZone-Pille.
        Schriften nur von fonts.hirsing.eu (Alfa Slab One = Titel/Ziffern, wie Schablonenschrift auf Frachtkisten; Baloo 2 = Bedienung). */
@font-face { font-family: 'Alfa Slab One'; font-display: swap; src: url('https://fonts.hirsing.eu/alfa-slab-one-v21-latin/alfa-slab-one-v21-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 500; font-display: swap; src: url('https://fonts.hirsing.eu/baloo-2-v23-latin/baloo-2-v23-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 700; font-display: swap; src: url('https://fonts.hirsing.eu/baloo-2-v23-latin/baloo-2-v23-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url('https://fonts.hirsing.eu/baloo-2-v23-latin/baloo-2-v23-latin-800.woff2') format('woff2'); }

:root {
  --bernstein: #f2a516; --gold: #ffd36b; --ziegel: #c4552c; --gruen: #5be37a; --stahl: #8fb4c8;
  --nacht: #140c08; --text: #fff4e4; --leise: #d2bfa6;
  --glas: rgba(36, 20, 10, 0.5); --glas-dicht: rgba(30, 17, 9, 0.84); --glas-rand: rgba(242, 165, 22, 0.32);
  --leucht: 0 0 8px rgba(242, 165, 22, 0.75), 0 0 20px rgba(242, 165, 22, 0.35);
  --titel: 'Alfa Slab One', 'Baloo 2', Georgia, serif; --sans: 'Baloo 2', system-ui, sans-serif;
  --oben: max(10px, env(safe-area-inset-top)); --unten: max(10px, env(safe-area-inset-bottom));
  --links: max(10px, env(safe-area-inset-left)); --rechts: max(10px, env(safe-area-inset-right));
  --pille: 58px;   /* Höhe des freien Streifens oben für die GameZone-Pille */
}
html { box-sizing: border-box; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--nacht); color: var(--text); font-family: var(--sans);
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
.hud *, .ebene *, .leiste *, .meldung, .laden, .fehler { box-sizing: border-box; }
.versteckt { display: none !important; }

/* ── Bühne ─────────────────────────────────────────────────────────────── */
#buehne { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none;
  background: radial-gradient(ellipse at 50% 40%, #4a2a14, var(--nacht) 70%); }   /* nur bis die Szene steht */

/* ── HUD oben rechts ───────────────────────────────────────────────────── */
.hud { position: fixed; top: var(--oben); right: var(--rechts); z-index: 10; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud-tafel, .knoepfe { pointer-events: auto; }
.hud-tafel { display: flex; gap: 14px; align-items: center; padding: 5px 16px 6px; border-radius: 16px; background: var(--glas);
  border: 1px solid var(--glas-rand); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.hud-wert { text-align: center; min-width: 34px; }
.hud-wert span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--leise); }
.hud-wert b { font: 400 clamp(20px, 2.2vw, 27px)/1.1 var(--titel); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); font-variant-numeric: tabular-nums; }
#hud-level { color: var(--bernstein); text-shadow: var(--leucht); }
.hud-par b { color: var(--gold); }
.hud-par.drueber b { color: var(--leise); }
.knoepfe { display: flex; gap: 8px; }
.rund { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; font: inherit;
  border: 1px solid var(--glas-rand); background: var(--glas); color: var(--bernstein);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.rund svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rund .strich-aus { display: none; }
.rund.aus .strich-aus, .rund[aria-pressed="true"] .strich-aus { display: inline; }
.rund.aus .welle, .rund[aria-pressed="true"] .welle { display: none; }
.rund.aus, .rund[aria-pressed="true"] { color: var(--leise); }
body.im-menue .hud-tafel, body.im-menue #pause-knopf, body.im-menue .leiste { visibility: hidden; }

/* ── Leiste unten ──────────────────────────────────────────────────────── */
.leiste { position: fixed; left: 50%; bottom: var(--unten); transform: translateX(-50%); z-index: 11; display: flex; gap: 8px; padding: 6px;
  border-radius: 20px; background: var(--glas); border: 1px solid var(--glas-rand); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.l-knopf { display: flex; align-items: center; gap: 7px; min-height: 46px; padding: 6px 16px; border-radius: 14px; border: 0; cursor: pointer;
  background: rgba(255, 244, 228, 0.07); color: var(--text); font: 700 15.5px var(--sans); }
.l-knopf svg { width: 21px; height: 21px; fill: none; stroke: var(--bernstein); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.l-knopf:hover:not(:disabled) { background: rgba(242, 165, 22, 0.18); }
.l-knopf:disabled { opacity: 0.4; cursor: default; }
.l-knopf[aria-pressed="true"] { background: rgba(242, 165, 22, 0.28); }
.nur-finger { display: none; }
@media (pointer: coarse) { .nur-finger { display: flex; } }

/* ── Meldung ───────────────────────────────────────────────────────────── */
.meldung { position: fixed; left: 50%; top: 20%; z-index: 30; max-width: calc(100% - 32px); padding: 8px 24px; pointer-events: none; text-align: center;
  font: 400 clamp(22px, 3.6vw, 42px)/1.15 var(--titel); letter-spacing: 0.04em; color: #fff; text-shadow: 0 3px 0 rgba(60, 25, 5, 0.6), var(--leucht);
  opacity: 0; transform: translate(-50%, -12px) scale(0.96); transition: opacity .25s, transform .25s; }
.meldung.an { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ── Ebenen ────────────────────────────────────────────────────────────── */
.ebene { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--oben) + var(--pille)) var(--rechts) var(--unten) var(--links); }
/* Startbildschirm (Norm sb-*): links Glaskarte, rechts läuft die Demo */
.sb { justify-content: flex-start; padding-left: max(var(--links), clamp(16px, 6vw, 96px));
  background: linear-gradient(90deg, rgba(20, 12, 8, 0.6) 0%, rgba(20, 12, 8, 0.25) 40%, transparent 68%); }
.sb-karte { width: min(460px, 100%); max-height: 100%; overflow-y: auto; scrollbar-width: none; padding: 22px 24px 18px; border-radius: 24px;
  background: var(--glas); border: 1px solid var(--glas-rand); backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.sb-vortitel { font-size: 12.5px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bernstein); margin-bottom: 4px; }
.sb-titel { margin: 0; font: 400 clamp(42px, 5vw, 70px)/0.95 var(--titel); letter-spacing: 0.02em; text-transform: uppercase;
  color: #ffe6b8; text-shadow: 0 3px 0 #8a3a14, 0 6px 0 rgba(60, 20, 5, 0.6), 0 0 30px rgba(242, 165, 22, 0.35); }
.sb-unterzeile { margin: 10px 0 14px; color: var(--leise); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.45; }
.sb-stand { margin: 0 0 8px; font-weight: 700; color: var(--gold); font-size: 15px; min-height: 1em; }
.sb-start { width: 100%; margin: 6px 0 8px; padding: 13px; border: 0; border-radius: 16px; cursor: pointer; font: 400 22px var(--titel);
  letter-spacing: 0.04em; color: #2a1405; background: linear-gradient(180deg, #ffc84a, var(--bernstein) 60%, #d9850a);
  box-shadow: 0 4px 0 #8a4a08, 0 10px 26px rgba(242, 165, 22, 0.35); transition: filter .15s, transform .15s; }
.sb-start:hover { filter: brightness(1.08); } .sb-start:active { transform: translateY(2px); box-shadow: 0 2px 0 #8a4a08; }
.sb-zweit { width: 100%; margin: 0 0 14px; padding: 10px; border-radius: 14px; border: 1px solid var(--glas-rand); background: rgba(255, 244, 228, 0.06);
  color: var(--text); font: 700 16px var(--sans); cursor: pointer; }
.sb-zweit:hover { background: rgba(242, 165, 22, 0.16); }
.sb-hilfe { padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(242, 165, 22, 0.2); background: rgba(255, 255, 255, 0.03); font-size: 14.5px; color: var(--leise); }
.sb-hilfe summary { color: var(--text); font-weight: 700; cursor: pointer; }
.sb-hilfe p { margin: 8px 0 0; line-height: 1.5; }
.sb-sprache { margin-top: 12px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--glas-rand); background: none; color: var(--leise); font: 500 13.5px var(--sans); cursor: pointer; }

/* Pause / Ende / Übersicht: Glaskarte mittig */
#pause, #ende, #uebersicht { background: rgba(20, 12, 8, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.karte { width: min(420px, 100%); max-height: 100%; overflow-y: auto; padding: 24px 26px; text-align: center; border-radius: 22px;
  background: var(--glas-dicht); border: 1px solid var(--glas-rand); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); scrollbar-width: thin; }
.karte-breit { width: min(700px, 100%); }
.karte h2 { margin: 0 0 10px; font: 400 clamp(26px, 4vw, 36px)/1.1 var(--titel); letter-spacing: 0.02em; color: #ffe6b8; text-shadow: 0 3px 0 #6a2a0c; }
.karte p { margin: 6px 0 0; color: var(--leise); }
.karte p a { color: var(--bernstein); }
.karte .rekord { color: var(--gold); font-weight: 800; }
.knopf-gross { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 16px; cursor: pointer; font: 400 20px var(--titel);
  color: #2a1405; background: linear-gradient(180deg, #ffc84a, var(--bernstein) 60%, #d9850a); box-shadow: 0 4px 0 #8a4a08; }
.knopf-leise { display: block; width: 100%; margin-top: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--glas-rand); background: none;
  color: var(--text); font: 700 15.5px var(--sans); cursor: pointer; }
.knopf-gross:hover, .knopf-leise:hover { filter: brightness(1.12); }
/* Sterne der Lösungskarte: fliegen einzeln ein (Verzögerung je Stern im Stil-Attribut) */
.sterne { display: flex; justify-content: center; gap: 10px; margin: 6px 0 8px; font-size: 52px; line-height: 1; }
.sterne i { font-style: normal; color: rgba(255, 244, 228, 0.16); }
.sterne i.an { color: var(--gold); text-shadow: 0 0 14px rgba(255, 200, 60, 0.8), 0 3px 0 #8a4a08; animation: einfliegen .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes einfliegen { from { transform: translateY(-60px) scale(2.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ende-zeile { margin: 4px 0 0; color: var(--text); font-size: 17px; font-weight: 700; }

/* Levelübersicht: je Halle eine Reihe mit 12 Kacheln (Lauf 01.11.: 6 Hallen × 12, js/kern/level.js HALLEN), Handy 2 Reihen à 6 */
.halle { margin: 12px 0 0; text-align: left; }
.halle h3 { margin: 0 0 6px; font: 800 14px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bernstein); }
.kacheln { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.kachel { position: relative; aspect-ratio: 1; min-height: 44px; border-radius: 10px; border: 1px solid rgba(242, 165, 22, 0.35); cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #8a5a2c, #6a3f1c); color: #fff4e4; font: 400 17px var(--titel); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.kachel small { position: absolute; left: 0; right: 0; bottom: 2px; font: 700 9.5px var(--sans); letter-spacing: -0.02em; color: var(--gold); }
.kachel.geloest { background: linear-gradient(180deg, #3f8a4a, #2a6034); border-color: rgba(91, 227, 122, 0.5); }
.kachel.aktuell { outline: 2px solid var(--bernstein); outline-offset: 1px; }
.kachel:disabled { cursor: default; background: rgba(255, 255, 255, 0.06); color: rgba(255, 244, 228, 0.3); border-color: rgba(255, 255, 255, 0.08); box-shadow: none; }
.kachel:not(:disabled):hover { filter: brightness(1.15); }

/* Laden / WebGL fehlt */
.laden, .fehler { position: fixed; left: 50%; bottom: calc(var(--unten) + 18px); transform: translateX(-50%); z-index: 25; padding: 8px 18px; border-radius: 999px;
  background: var(--glas-dicht); border: 1px solid var(--glas-rand); color: var(--leise); font-size: 14px; }
.laden.weg { opacity: 0; transition: opacity .5s; pointer-events: none; }
.fehler { top: 50%; bottom: auto; transform: translate(-50%, -50%); color: #fff; border-color: var(--ziegel); max-width: calc(100% - 32px); text-align: center; }

/* ── Handy-Pfeilkreuz (nur Finger, im Spiel, wenn eingeschaltet) — rechts über der Leiste ── */
.steuer { display: none; position: fixed; right: calc(var(--rechts) + 4px); bottom: calc(var(--unten) + 74px); z-index: 12;
  grid-template-columns: 58px 58px 58px; grid-template-rows: 54px 54px; gap: 6px; }
.steuer button { border-radius: 16px; border: 1px solid var(--glas-rand); background: var(--glas); color: var(--bernstein); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: none; }
.steuer svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.steuer .k-hoch { grid-column: 2; grid-row: 1; } .steuer .k-links { grid-column: 1; grid-row: 2; } .steuer .k-runter { grid-column: 2; grid-row: 2; } .steuer .k-rechts { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { body.kreuz:not(.im-menue) .steuer { display: grid; } }

/* ── Handy / schmal ────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hud { gap: 6px; flex-direction: column-reverse; align-items: flex-end; }   /* Tafel unter die Knöpfe — neben der Pille ist kein Platz */
  .hud-tafel { gap: 10px; padding: 3px 10px 4px; border-radius: 14px; }
  .hud-wert span { font-size: 9.5px; } .hud-wert b { font-size: 19px; }
  .rund { width: 40px; height: 40px; } .rund svg { width: 20px; height: 20px; }
  .leiste { left: var(--links); right: var(--rechts); transform: none; justify-content: space-between; gap: 6px; }
  .l-knopf { flex: 1; flex-direction: column; justify-content: center; gap: 1px; min-height: 54px; padding: 4px 6px; font-size: 13px; }
  .l-knopf svg { width: 23px; height: 23px; }
  .sb { justify-content: center; padding-left: var(--links); align-items: flex-end; background: linear-gradient(0deg, rgba(20, 12, 8, 0.8) 0%, rgba(20, 12, 8, 0.35) 55%, transparent 80%); }
  .sb-karte { padding: 16px 16px 12px; border-radius: 20px; }
  .sb-titel { font-size: 42px; }
  .sb-unterzeile { margin: 6px 0 10px; font-size: 14.5px; }
  .sb-start { font-size: 20px; padding: 12px; }
  .kacheln { grid-template-columns: repeat(6, 1fr); }
  .karte { padding: 18px 16px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ebene { padding-top: var(--oben); padding-left: max(var(--links), 72px); }
  .sb { align-items: center; justify-content: flex-start; }
  .sb-karte { width: min(720px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-content: start; padding: 12px 16px; }
  .sb-vortitel, .sb-titel, .sb-unterzeile { grid-column: 1 / -1; } .sb-titel { font-size: 38px; } .sb-unterzeile { margin: 2px 0 8px; font-size: 13.5px; }
  .sb-hilfe, .sb-sprache, .gz-info { grid-column: 1 / -1; }
  .karte { padding: 14px 18px; } .knopf-gross { margin-top: 10px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .meldung, .sterne i.an { animation: none; transition: none; } }
