/* PULSE RUNNER — Optik. Neon auf tiefem Blau, alles ohne Bilddateien
   auskommend: die Buehne ist ein Canvas, die Bedienung darueber. */

:root {
  --tief: #07070f;
  --dunkel: #0f1024;
  --neon: #35f0ff;
  --neon2: #ff3ea5;
  --gelb: #ffd23f;
  --text: #e8ecff;
  --grau: #8a90b8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--tief); color: var(--text);
  font: 16px/1.5 system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#buehne { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.versteckt { display: none !important; }

/* --- Schichten ueber der Buehne ------------------------------------------- */
.schicht {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  overflow-y: auto;
  /* Abgedunkelt, damit die Simulation dahinter sichtbar bleibt, ohne den
     Text zu stoeren. */
  background: linear-gradient(180deg, rgba(7,7,15,.92), rgba(7,7,15,.78));
  backdrop-filter: blur(2px);
}

header { text-align: center; margin: min(6vh, 48px) 0 18px; }
h1 {
  margin: 0; font-size: clamp(34px, 9vw, 76px); letter-spacing: .12em; font-weight: 800;
  color: #fff; text-shadow: 0 0 18px var(--neon), 0 0 46px rgba(53,240,255,.45);
}
.unter { margin: 10px auto 0; max-width: 42ch; color: var(--grau); }
.unter strong { color: var(--neon2); font-weight: 600; }
.wer { margin: 6px 0 0; color: var(--grau); font-size: 14px; }
.wer b { color: var(--gelb); }

.reiter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; justify-content: center; }
.reiter-knopf {
  background: transparent; color: var(--grau); border: 1px solid #2a2d55;
  padding: 8px 18px; border-radius: 999px; font: inherit; cursor: pointer;
}
.reiter-knopf.an { color: var(--tief); background: var(--neon); border-color: var(--neon); font-weight: 700; }

.liste {
  width: min(880px, 100%);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.hinweis { grid-column: 1 / -1; color: var(--grau); margin: 0 0 8px; }

.karte {
  background: #12142c; border: 1px solid #262a55; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; text-align: left; color: inherit; font: inherit;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .1s;
}
.karte:hover { border-color: var(--neon); }
.karte:active { transform: scale(.98); }
.karte .nr { color: var(--grau); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.karte .titel { font-weight: 700; font-size: 17px; }
.karte .zeit { color: var(--gelb); font-size: 13px; }
.karte .offen { color: var(--grau); font-size: 13px; }
.karte.geschafft { border-color: #2f7d5b; }
.karte .stufe { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--neon), var(--neon2)); }

/* --- Knoepfe. Achtung: ein <a> erbt keine button-Regeln, deshalb haengt
       alles an der Klasse. ------------------------------------------------- */
.btn {
  display: inline-block; background: #1b1e3d; color: var(--text);
  border: 1px solid #33376a; border-radius: 10px; padding: 10px 18px;
  font: inherit; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { border-color: var(--neon); }
.btn.gross { padding: 14px 26px; font-size: 18px; font-weight: 700; }
.btn.klein { padding: 6px 12px; font-size: 14px; }
.btn.portal { background: var(--neon2); border-color: var(--neon2); color: #1a0413; font-weight: 700; }

footer { margin: 22px 0 10px; display: flex; gap: 10px; align-items: center; }

#schau-form { grid-column: 1 / -1; display: flex; gap: 8px; }
#schau-code {
  flex: 1; background: #12142c; border: 1px solid #33376a; border-radius: 10px;
  color: var(--text); padding: 10px 14px; font: inherit; letter-spacing: .3em; text-transform: uppercase;
}

/* --- Anzeige im Spiel ------------------------------------------------------ */
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: 8px 10px; pointer-events: none; }
#hud .btn { pointer-events: auto; }
.fortschritt { height: 6px; background: #191c3a; border-radius: 3px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--neon), var(--neon2)); }
#hud .zeile { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--grau); }
#levelname { color: var(--text); font-weight: 700; }
#versuche { margin-left: auto; }
.tipp {
  margin: 10px auto 0; max-width: 46ch; text-align: center; color: var(--gelb);
  background: rgba(7,7,15,.6); border-radius: 10px; padding: 6px 12px; font-size: 14px;
}

#schau-band {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 8px; background: rgba(255,62,165,.16); border-bottom: 1px solid var(--neon2);
  font-size: 14px;
}

#ende { justify-content: center; gap: 14px; }
#ende h2 { font-size: clamp(28px, 7vw, 52px); margin: 0; color: #fff; text-shadow: 0 0 20px var(--neon); }
#ende p { margin: 0; color: var(--grau); }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* --- Tempostufen und Levelzaehler ------------------------------------------ */
.stufen-erklaerung {
  width: min(880px, 100%); margin: 0 0 14px; color: var(--grau); font-size: 14px;
}
.stufen-erklaerung strong { color: var(--gelb); font-weight: 600; }
.zaehler { color: var(--neon); font-variant-numeric: tabular-nums; }
.stufe-marke { color: var(--gelb); }
.stufenzeile { color: var(--grau); font-size: 14px; }
.karte .stufe-best { color: var(--neon); font-size: 13px; }
.btn.stufe-knopf.an { background: var(--neon); border-color: var(--neon); color: var(--tief); font-weight: 700; }

/* Das "Plopp": das Feld springt kurz auf, statt einfach da zu sein. */
@keyframes plopp {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#ende:not(.versteckt) > * { animation: plopp .38s cubic-bezier(.2,1.4,.4,1) both; }
#ende:not(.versteckt) > *:nth-child(2) { animation-delay: .06s; }
#ende:not(.versteckt) > *:nth-child(3) { animation-delay: .1s; }
#ende:not(.versteckt) > *:nth-child(4) { animation-delay: .14s; }
#ende:not(.versteckt) > *:nth-child(5) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  #ende:not(.versteckt) > * { animation: none; }
}
