/* Trivial Trainer - Retro-Arcade-Look */
:root {
  --bg: #0a0a12;
  --neon: #39ff14;
  --neon-dim: #1f8a0c;
  --gelb: #ffd700;
  --rot: #ff2e2e;
  --blau: #00e5ff;
  --panel: #12121f;
  --rand: #2a2a44;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--neon);
  font-family: 'VT323', monospace;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-x: hidden;
}

/* CRT-Rahmen mit Vignette */
.crt {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: radial-gradient(ellipse at center, #14142400 0%, #000 140%);
  padding: 24px 20px 40px;
  border-radius: 10px;
}

/* Bewegte Scanline */
.scanline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 5;
}

header { text-align: center; margin-bottom: 28px; }

h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: var(--gelb);
  text-shadow: 0 0 8px var(--gelb), 0 0 2px #fff;
  letter-spacing: 1px;
  line-height: 1.6;
}

.spielerzeile { margin-top: 14px; font-size: 22px; color: var(--blau); }
#spielername { color: var(--neon); }

.panel {
  background: var(--panel);
  border: 2px solid var(--rand);
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: 0 0 18px rgba(57,255,20,0.08), inset 0 0 30px rgba(0,0,0,0.5);
}

.prompt {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--neon);
  text-align: center;
  margin-bottom: 20px;
  animation: blink 1.4s steps(2) infinite;
  line-height: 1.8;
}
@keyframes blink { 50% { opacity: 0.35; } }

input {
  width: 100%;
  background: #0c0c16;
  border: 2px solid var(--neon-dim);
  color: var(--neon);
  font-family: 'VT323', monospace;
  font-size: 28px;
  padding: 10px 14px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 18px;
  outline: none;
}
input:focus { border-color: var(--neon); box-shadow: 0 0 10px var(--neon-dim); }

button {
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  border: none;
  transition: transform 0.05s, box-shadow 0.15s;
}
button:active { transform: translateY(2px); }

.gross {
  width: 100%;
  background: var(--neon-dim);
  color: #fff;
  font-size: 14px;
  padding: 16px;
  border: 2px solid var(--neon);
  border-radius: 6px;
  text-shadow: 0 0 4px #000;
  box-shadow: 0 0 14px rgba(57,255,20,0.3);
}
.gross:hover { background: var(--neon); color: #04120a; }

.mini {
  background: transparent;
  color: var(--blau);
  font-size: 9px;
  padding: 6px 8px;
  border: 1px solid var(--rand);
  border-radius: 4px;
  margin-top: 12px;
}
.mini:hover { color: #fff; border-color: var(--blau); }

/* Kategorie-Grid */
.kat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kat-btn {
  background: #0c0c16;
  border: 2px solid var(--rand);
  border-radius: 6px;
  color: var(--neon);
  font-family: 'VT323', monospace;
  font-size: 22px;
  padding: 18px 10px;
  text-align: center;
  line-height: 1.1;
}
.kat-btn:hover { border-color: var(--gelb); color: var(--gelb); box-shadow: 0 0 12px rgba(255,215,0,0.25); }
.kat-btn .quote { display: block; font-size: 16px; color: var(--blau); margin-top: 6px; }

/* Quiz */
.quiz-kopf {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--gelb);
  margin-bottom: 18px;
}
.frage {
  font-size: 27px;
  line-height: 1.25;
  margin-bottom: 22px;
  color: #eaffea;
  min-height: 60px;
}

.opt-liste { display: flex; flex-direction: column; gap: 10px; }
.opt {
  background: #0c0c16;
  border: 2px solid var(--rand);
  border-radius: 6px;
  color: var(--neon);
  font-family: 'VT323', monospace;
  font-size: 23px;
  padding: 12px 16px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
}
.opt .buchstabe {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--gelb);
  min-width: 20px;
}
.opt:hover:not(:disabled) { border-color: var(--neon); box-shadow: 0 0 10px var(--neon-dim); }
.opt:disabled { cursor: default; opacity: 0.9; }
.opt.richtig { border-color: var(--neon); background: rgba(57,255,20,0.15); color: #fff; }
.opt.falsch { border-color: var(--rot); background: rgba(255,46,46,0.15); color: #fff; }

.feedback {
  margin-top: 18px;
  padding: 14px;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1.3;
  border: 1px solid var(--rand);
  background: #0c0c16;
}
.feedback .status { font-family: 'Press Start 2P', monospace; font-size: 12px; display: block; margin-bottom: 8px; }
.feedback.ok .status { color: var(--neon); }
.feedback.nok .status { color: var(--rot); }
.feedback .erkl { color: #cfe8ff; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  h1 { font-size: 16px; }
  .frage { font-size: 24px; }
  .kat-btn { font-size: 19px; }
}


/* Statistik */
.stat-gesamt {
  text-align: center;
  font-size: 22px;
  color: var(--blau);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rand);
}
.stat-gesamt b { color: var(--gelb); font-size: 26px; }

.stat-zeile { margin-bottom: 18px; }
.stat-kopf {
  display: flex;
  justify-content: space-between;
  font-size: 21px;
  margin-bottom: 6px;
}
.stat-kopf .kat-name { color: var(--neon); }
.stat-kopf .kat-zahl { color: #9fb4c8; font-size: 18px; }

/* gestapelter Fortschrittsbalken */
.stat-balken {
  display: flex;
  height: 18px;
  border: 1px solid var(--rand);
  border-radius: 4px;
  overflow: hidden;
  background: #0c0c16;
}
.stat-balken span { height: 100%; }
.seg-gemeistert { background: var(--neon); }
.seg-sitzt      { background: #7ed957; }
.seg-lernen     { background: var(--gelb); }
.seg-neu        { background: var(--rot); }

.stat-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 4px;
  font-size: 16px;
  color: #9fb4c8;
}
.stat-legende i {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}


/* Bestenliste */
.top-spalten {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 8px;
}
.top-titel {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--gelb);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.5;
}
.top-liste {
  list-style: none;
  counter-reset: rang;
}
.top-liste li {
  counter-increment: rang;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 21px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rand);
}
.top-liste li::before {
  content: counter(rang) ".";
  color: var(--blau);
  font-size: 16px;
  min-width: 26px;
}
.top-liste li .nm { flex: 1; color: var(--neon); margin-left: 4px; }
.top-liste li .wt { color: var(--gelb); font-family: 'Press Start 2P', monospace; font-size: 12px; }
.top-liste li:nth-child(1) .nm { color: var(--gelb); }
.top-leer { color: #6d7f92; font-size: 18px; text-align: center; padding: 10px; }

/* Serie im Quiz-Kopf */
#quizSerie { color: var(--rot); }

@media (max-width: 480px) {
  .top-spalten { grid-template-columns: 1fr; gap: 22px; }
}
