body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* Auth-Screen */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 200;
  flex-direction: column;
  gap: 24px;
}

.auth-screen.versteckt { display: none; }

.auth-screen h1 {
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.auth-screen .code-eingabe {
  display: flex;
  gap: 12px;
}

.auth-screen .code-eingabe input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--r-m);
  color: var(--text);
  caret-color: var(--akzent);
  outline: none;
}

.auth-screen .code-eingabe input:focus {
  border-color: var(--akzent);
}

.auth-screen .fehler {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--rot);
  min-height: 1.2em;
}

/* Haupt-Layout: Querformat, zwei Spalten */
.app {
  display: none;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr auto;
  gap: 0;
}

.app.sichtbar {
  display: grid;
}

/* Kopfzeile ueber volle Breite */
.kopf {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rand);
  gap: 16px;
}

.kopf .verbindung {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.kopf .verbindung .punkt {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.kopf .verbindung.verbunden .punkt {
  background: var(--gruen);
  box-shadow: 0 0 8px var(--gruen);
}

/* F1 Delta Timer */
.timer-block {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--mono);
}

.timer-haupt {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  min-width: 90px;
  text-align: right;
}

.timer-delta {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--r-s);
  min-width: 100px;
  text-align: center;
  letter-spacing: 0.02em;
  transition: all 0.3s;
}

.timer-delta.voraus {
  background: var(--gruen-leise);
  color: var(--gruen);
}

.timer-delta.hinterher {
  background: var(--rot-leise);
  color: var(--rot);
}

.timer-delta.neutral {
  background: var(--flaeche-2);
  color: var(--text-3);
}

/* Linke Spalte: Folie + Notizen */
.links {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 12px;
  overflow: hidden;
  border-right: 1px solid var(--rand);
}

.aktuelle-folie {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.aktuelle-folie .nr {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--akzent);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.aktuelle-folie h2 {
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.notizen-bereich {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.notizen-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.notizen-text {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 400;
}

/* Rechte Spalte: Controls */
.rechts {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  overflow-y: auto;
}

/* Navigation */
.nav-reihe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.knopf {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  color: var(--text);
  padding: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-m);
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
}

.knopf:active {
  transform: scale(0.96);
  background: var(--flaeche-2);
}

.knopf.primaer {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--bg);
}

.knopf.primaer:active { background: #d4932a; }

.knopf.aktiv {
  border-color: var(--akzent);
  color: var(--akzent);
  background: var(--akzent-leise);
}

.knopf.klein {
  min-height: 40px;
  padding: 8px;
  font-size: 0.65rem;
}

.knopf-reihe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Trennlinie */
.trenner {
  height: 1px;
  background: var(--rand);
  margin: 2px 0;
}

/* Demo-Controls */
.demo-controls {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.demo-controls.sichtbar { display: flex; }

.demo-controls .label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Last-Slider */
.slider-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-kopf {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-2);
}

.slider-kopf .wert {
  color: var(--akzent);
  font-weight: 700;
}

input[type='range'] {
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--rand);
  border-radius: 2px;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--akzent);
  border-radius: 50%;
  margin-top: -10px;
}

/* Folien-Liste (Overlay) */
.folien-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.folien-overlay.offen { display: block; }

.folien-overlay .kopf-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.folien-overlay .kopf-zeile h3 {
  font-weight: 600;
  font-size: 1.2rem;
}

.folien-eintrag {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--rand);
  cursor: pointer;
}

.folien-eintrag:active { background: var(--flaeche); }

.folien-eintrag.aktiv { background: var(--akzent-leise); }

.folien-eintrag .e-nr {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--akzent);
  width: 28px;
  flex-shrink: 0;
}

.folien-eintrag .e-titel {
  font-size: 0.95rem;
  font-weight: 500;
}

.folien-eintrag .e-zeit {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
}
