:root {
  --bg: #11131a;
  --text: #eef0f6;
  --muted: #9aa0b4;
  --panel: #1b1e28;
  --rand: #2c3040;
  --akzent: #ffd34d;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f9;
    --text: #161822;
    --muted: #5a6075;
    --panel: #ffffff;
    --rand: #d9dce6;
    --akzent: #b07d00;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 560px;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 { margin: 0; font-size: 2rem; letter-spacing: -0.02em; }
.untertitel { margin: 4px 0 0; color: var(--muted); }

.anzeige {
  display: flex;
  gap: 12px;
}
.anzeige > div {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.label { color: var(--muted); font-size: 0.9rem; }
.wert { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.status {
  margin: 0;
  min-height: 1.5em;
  font-weight: 600;
  text-align: center;
}
.status.fehler { color: #ff6b6b; }
.status.gut { color: #4cd97b; }

.brett {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 380px) {
  .brett { grid-template-columns: repeat(2, 1fr); }
}

.feld {
  --farbe: #888;
  aspect-ratio: 1;
  border: none;
  border-radius: 18px;
  background: var(--farbe);
  opacity: 0.4;
  filter: saturate(0.7);
  cursor: pointer;
  position: relative;
  transition: opacity 120ms, transform 120ms, filter 120ms, box-shadow 120ms;
  font: inherit;
}
.feld span {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.45);
}
.feld:disabled { cursor: default; }
.feld:not(:disabled):hover { opacity: 0.6; }
.feld:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
.feld.leuchtet {
  opacity: 1;
  filter: saturate(1.2) brightness(1.15);
  transform: scale(1.06);
  box-shadow: 0 0 28px 6px var(--farbe);
}

.feld[data-farbe="0"] { --farbe: #ff3b3b; }
.feld[data-farbe="1"] { --farbe: #ff8a1f; }
.feld[data-farbe="2"] { --farbe: #ffe02e; }
.feld[data-farbe="3"] { --farbe: #3ddc5a; }
.feld[data-farbe="4"] { --farbe: #22d3d3; }
.feld[data-farbe="5"] { --farbe: #3b7bff; }
.feld[data-farbe="6"] { --farbe: #9b5cff; }
.feld[data-farbe="7"] { --farbe: #ff5cc8; }

.steuerung {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}
.start {
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 12px 36px;
  border-radius: 999px;
  border: none;
  background: var(--akzent);
  color: #1a1400;
  cursor: pointer;
}
.start:disabled { opacity: 0.5; cursor: default; }
.start:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.ton { color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }

footer { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 8px; }
a { color: var(--akzent); }
a:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* ---------- Plattform ---------- */
main.breit { max-width: 760px; }
.zurueck { display: inline-block; margin-bottom: 8px; font-size: 0.9rem; text-decoration: none; }
.zurueck:hover { text-decoration: underline; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kachel {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--rand);
  color: var(--text); text-decoration: none;
  transition: transform 120ms, border-color 120ms;
}
.kachel:hover { transform: translateY(-2px); border-color: var(--akzent); }
.kachel:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
.kachel-symbol {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #11131a;
}
.farbe-1 { background: #ff5c8a; }
.farbe-2 { background: #4cd97b; }
.farbe-3 { background: #3b9bff; }
.farbe-4 { background: #ffd34d; }
.kachel-titel { font-size: 1.2rem; font-weight: 700; }
.kachel-text { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.kachel-rekord { margin-top: auto; padding-top: 6px; font-size: 0.85rem; font-weight: 600; color: var(--akzent); }

/* Reaktion */
.flaeche {
  min-height: 300px; border-radius: 20px; border: none;
  display: grid; place-items: center; text-align: center;
  font: inherit; font-size: 1.6rem; font-weight: 800; padding: 20px;
  background: var(--panel); color: var(--text); cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; white-space: pre-line;
}
.flaeche.warten { background: #c0392b; color: #fff; }
.flaeche.jetzt { background: #27ae60; color: #fff; }
.flaeche.zufrueh { background: #e67e22; color: #fff; }
.flaeche:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }
.zeiten { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0; padding: 0; list-style: none; }
.zeiten li { background: var(--panel); border: 1px solid var(--rand); border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; }

/* Zahlen-Blitz und Schnell-Rechnen */
.grossanzeige {
  min-height: 140px; border-radius: 20px; background: var(--panel); border: 1px solid var(--rand);
  display: grid; place-items: center; text-align: center; padding: 16px;
  font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 800; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.eingabe { display: flex; gap: 10px; }
.eingabe input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.5rem; font-weight: 700; text-align: center;
  padding: 10px 14px; border-radius: 14px; border: 1px solid var(--rand);
  background: var(--panel); color: var(--text); font-variant-numeric: tabular-nums;
}
.eingabe input:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.eingabe button, .knopf-leise {
  font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 14px;
  border: 1px solid var(--rand); background: var(--panel); color: var(--text); cursor: pointer;
}
.eingabe button:disabled { opacity: 0.5; cursor: default; }
.balken { height: 8px; border-radius: 999px; background: var(--rand); overflow: hidden; }
.balken > div { height: 100%; width: 100%; background: var(--akzent); transform-origin: left; }

/* Textseiten (Datenschutz) */
.text { text-align: left; line-height: 1.6; }
.text h2 { font-size: 1.15rem; margin: 1.6em 0 0.4em; }
.text p { margin: 0 0 0.8em; }

@media (prefers-reduced-motion: reduce) {
  .feld { transition: none; }
  .feld.leuchtet { transform: none; }
}
