/* Look wie promptwerke.de: Kosmos, Eisblau K1, Space Grotesk / IBM Plex Sans (Schriften der Website, ../../assets/fonts – Einbindung 06.10.2026) */
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url(../../assets/fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(../../assets/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(../../assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(../../assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }

:root {
  --bg: #04060c; --tiefe: #13254a; --text: #eef4ff; --akzent: #9cc8ff; --leise: #9fb0c8;
  --tor: #7ff0d9; --stern: #ffd68a; --karte: rgba(9, 15, 30, .86); --linie: rgba(156, 200, 255, .22);
  --titel: 'Space Grotesk', system-ui, sans-serif; --text-f: 'IBM Plex Sans', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 16px/1.5 var(--text-f); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
[hidden] { display: none !important; }
#feld { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }

/* Knöpfe ≥ 44 px */
button, .knopf { font: 600 16px/1.2 var(--titel); color: var(--text); background: rgba(19, 37, 74, .55); border: 1px solid var(--linie); border-radius: 999px;
  min-height: 48px; padding: 12px 22px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s, border-color .15s, background-color .15s; }
button:hover, .knopf:hover { border-color: var(--akzent); }
button:active, .knopf:active { transform: scale(.97); }
button:focus-visible, .knopf:focus-visible, input:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
button.haupt { background: var(--akzent); color: #04060c; border-color: var(--akzent); }
button.haupt:hover { background: #b8d8ff; }
button.klein { min-height: 44px; padding: 8px 16px; font-size: 14px; }
button.rund { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; }
button.rund svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--akzent); }

/* Bildschirme (Menüs) */
.schirm { position: fixed; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 30%, rgba(19, 37, 74, .5), rgba(4, 6, 12, .25) 70%); overflow-y: auto; animation: einblenden .35s ease-out both; }
.schirm.halb { background: rgba(4, 6, 12, .55); }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.karte { width: min(100%, 460px); background: var(--karte); border: 1px solid var(--linie); border-radius: 22px; padding: 24px 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.karte.klein { width: min(100%, 380px); text-align: center; }
.karte.start { text-align: center; background: rgba(9, 15, 30, .6); }
h1, h2 { font-family: var(--titel); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(44px, 13vw, 68px); line-height: 1; margin: 6px 0 12px;
  background: linear-gradient(180deg, #ffffff, #e6edf7 45%, #aebdd2); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 24px; }
.ueber { font: 600 12px/1.4 var(--titel); letter-spacing: .16em; text-transform: uppercase; color: var(--akzent); margin: 0; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.knoepfe { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 6px; }
.knoepfe.reihe { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.knoepfe.reihe > * { flex: 1 1 140px; }
.reihe { display: flex; gap: 8px; }
.kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.kopf h2 { flex: 1; }
.gesamt { font: 600 14px var(--titel); color: var(--stern); }
.fuss { font-size: 12px; color: var(--leise); margin: 18px 0 0; }

/* Ton-Schalter */
.ton-zeile { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.schalter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--linie); border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--leise); }
.schalter input { width: 18px; height: 18px; accent-color: var(--akzent); }
.schalter:has(input:checked) { color: var(--text); border-color: rgba(156, 200, 255, .5); }

/* Levelauswahl */
.levelgitter { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.levelgitter button { width: 100%; aspect-ratio: 1; min-height: 52px; padding: 4px; border-radius: 14px; flex-direction: column; gap: 2px; font-size: 18px; }
.levelgitter button:disabled { opacity: .35; cursor: default; transform: none; border-color: var(--linie); }
.levelgitter .mini { display: flex; gap: 1px; height: 10px; }
.levelgitter .mini i { width: 10px; height: 10px; }
.stern-ico, .mini i, .wertung i { display: inline-block; background: currentColor; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.mini i { color: rgba(156, 200, 255, .25); } .mini i.an { color: var(--stern); }

/* Sondenbauer */
.feldname { display: block; font: 600 14px var(--titel); margin-bottom: 6px; }
input[type=text] { width: 100%; min-height: 48px; font: 16px var(--text-f); color: var(--text); background: rgba(4, 6, 12, .7); border: 1px solid var(--linie); border-radius: 14px; padding: 10px 14px; }
#vorschau { display: block; width: 100%; height: auto; aspect-ratio: 16/10; margin: 12px 0 6px; border-radius: 14px; background: #02040a; border: 1px solid var(--linie); }
.erkannt { min-height: 24px; margin: 0; font-size: 14px; color: var(--leise); }
.erkannt b { display: inline-block; background: rgba(156, 200, 255, .14); color: var(--text); border-radius: 999px; padding: 1px 10px; margin: 2px 2px; font-weight: 500; }

/* HUD */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 6, 12, .85), rgba(4, 6, 12, 0)); }
#hud > * { pointer-events: auto; }
.hud-mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
#hud-level { font: 700 15px var(--titel); }
#hud-titel { font-size: 13px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-rechts { display: flex; gap: 14px; font: 600 14px var(--titel); color: var(--leise); font-variant-numeric: tabular-nums; }
.hud-rechts b { color: var(--text); }
.hud-sterne b { color: var(--stern); } .hud-sterne .stern-ico { width: 13px; height: 13px; color: var(--stern); vertical-align: -1px; }
#meldung { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); text-align: center;
  font: 600 15px var(--titel); background: rgba(4, 6, 12, .8); border: 1px solid var(--linie); border-radius: 999px; padding: 10px 18px; pointer-events: none; animation: auftauchen .25s both; }
@keyframes auftauchen { from { opacity: 0; } to { opacity: 1; } }
#abbrechen { position: fixed; right: 12px; bottom: max(70px, calc(env(safe-area-inset-bottom) + 70px)); }

/* Ergebnis */
.wertung { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.wertung i { width: 46px; height: 46px; color: rgba(156, 200, 255, .2); }
.wertung i.an { color: var(--stern); filter: drop-shadow(0 0 10px rgba(255, 214, 138, .6)); animation: sternpop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.wertung i.an:nth-child(2) { animation-delay: .15s; } .wertung i.an:nth-child(3) { animation-delay: .3s; }
@keyframes sternpop { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.erg-zeile { margin: 4px 0; color: var(--leise); }
.erg-punkte { margin: 0; font: 600 18px var(--titel); } .erg-punkte b { font-size: 34px; color: var(--text); }
.pw p { color: var(--leise); }

/* Bestenliste */
.liste { list-style: none; padding: 0; margin: 0 0 12px; max-height: 42vh; overflow-y: auto; counter-reset: platz; }
.liste li { display: flex; gap: 10px; padding: 9px 10px; border-bottom: 1px solid rgba(156, 200, 255, .1); font-variant-numeric: tabular-nums; }
.liste li .p { width: 2.2em; color: var(--leise); font: 600 14px var(--titel); }
.liste li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste li .w { font: 600 15px var(--titel); color: var(--stern); }
.liste li.ich { background: rgba(156, 200, 255, .12); border-radius: 10px; }
.bl-eigen { font: 600 15px var(--titel); text-align: center; }
.fehler { color: #ffb0b0; min-height: 1.2em; font-size: 14px; margin: 6px 0 0; }
.datenschutz { margin-top: 10px; }

/* Knöpfe im Level: Zur Startseite, Levelauswahl, Pause (16.10.2026).
   Hochformat: eigene Zeile über der Level-Anzeige. Querformat (Klasse .quer setzt spiel.js): Spalte links neben dem Feld.
   spiel.js misst die Anzeige und hält das Spielfeld frei – nichts davon liegt über Sonde, Start, Sternen oder Ziel. */
#hud { flex-wrap: wrap; row-gap: 6px; }
.hud-nav { flex: 1 0 100%; display: flex; gap: 8px; align-items: center; }
.hud-knopf { min-height: 44px; padding: 8px 14px 8px 11px; font-size: 14px; gap: 7px; background: rgba(9, 15, 30, .82); border-color: rgba(156, 200, 255, .45); white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hud-knopf svg, .knopf.heim svg, #b-zur-auswahl svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hud-knopf.heim { color: #04060c; background: var(--akzent); border-color: var(--akzent); }
.hud-knopf.heim:hover { background: #b8d8ff; }
#hud-menue { margin-left: auto; }
/* Text nur für Bildschirmleser, wenn der Platz nicht reicht */
.hud-knopf .txt.sr, #hud:not(.quer) #hud-menue .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#hud:not(.quer) #hud-menue { width: 44px; padding: 0; }
@media (max-width: 379px) {
  #hud:not(.quer) #hud-levels .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #hud:not(.quer) #hud-levels { width: 44px; padding: 0; }
}
#hud.quer { right: auto; width: calc(184px + env(safe-area-inset-left, 0px)); flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 10px; background: none;
  padding-left: max(12px, env(safe-area-inset-left)); }
#hud.quer .hud-nav { flex: none; flex-direction: column; align-items: stretch; }
#hud.quer .hud-knopf { justify-content: flex-start; }
#hud.quer #hud-menue { margin-left: 0; }
#hud.quer .hud-rechts { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); flex-direction: column; align-items: flex-end; gap: 4px; }
/* Pause-Menü: dezent hereinschweben */
#s-pause .karte { animation: pauseRein .22s ease-out both; }
@keyframes pauseRein { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
#s-pause .knopf.heim, .knopf.heim-karte { gap: 8px; }
/* Zur Startseite in der Levelauswahl */
.knopf.heim-karte { min-height: 44px; padding: 8px 16px 8px 12px; font-size: 14px; margin: 0 0 14px; }

@media (prefers-reduced-motion: reduce) {
  .schirm, #meldung, .wertung i.an, #s-pause .karte { animation: none; }
  button, .knopf { transition: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .karte { padding: 16px; } .knoepfe { margin-top: 12px; gap: 8px; } h1 { font-size: 40px; }
}
