/* Gestaltung des Autoradios: dunkel, große Tasten, ein Bildschirm ohne Scrollen.
   Hochkant liegen Anzeige, Pfeile und Speicher untereinander, quer liegen
   Anzeige und Pfeile links, die Speicher rechts. */

:root {
  --grund: #0b0d10;
  --taste: #1c2128;
  --taste-gedrueckt: #2c343e;
  --rand: #2f3741;
  --schrift: #e9edf2;
  --schrift-leise: #8b96a3;
  --leuchten: #ffb238;          /* Bernstein wie eine Radioanzeige */
  --leuchten-schwach: #6b5126;
  --abstand: 12px;
  --rundung: 18px;
  --lang-druecken-zeit: 700ms;  /* muss zu LANG_DRUECKEN_MS in radio.js passen */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--grund);
  color: var(--schrift);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--rand);
  background: var(--taste);
  border-radius: var(--rundung);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
button:active, button.gedrueckt { background: var(--taste-gedrueckt); }

.radio {
  height: 100dvh;
  padding: max(var(--abstand), env(safe-area-inset-top)) var(--abstand) max(var(--abstand), env(safe-area-inset-bottom));
  display: grid;
  gap: var(--abstand);
  grid-template-rows: 1.1fr 1fr 2fr;
  grid-template-areas: "anzeige" "suchlauf" "speicher";
}

/* Anzeige */
.anzeige {
  grid-area: anzeige;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #050607;
  min-width: 0;
}
.anzeige-logo {
  height: clamp(44px, 12vw, 80px);
  max-width: 70%;
  object-fit: contain;
  border-radius: 8px;
}
.anzeige-logo[hidden] { display: none; }
.anzeige.aus .anzeige-logo { opacity: .4; }
.anzeige-zeile1 {
  font-size: clamp(26px, 8vw, 54px);
  font-weight: 700;
  color: var(--leuchten);
  text-shadow: 0 0 14px rgba(255, 178, 56, .35);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anzeige-zeile2 {
  font-size: clamp(15px, 4vw, 22px);
  color: var(--schrift-leise);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anzeige.aus .anzeige-zeile1 { color: var(--leuchten-schwach); text-shadow: none; }
.anzeige.sucht .anzeige-zeile1 { opacity: .55; }

/* Pfeile */
.suchlauf {
  grid-area: suchlauf;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--abstand);
}
.pfeil { font-size: clamp(40px, 12vw, 72px); }

/* Speichertasten */
.speicher {
  grid-area: speicher;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: var(--abstand);
}
.speichertaste {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  min-width: 0;
  overflow: hidden;
}
.speichertaste-nummer { font-size: clamp(24px, 7vw, 40px); font-weight: 700; }
.speichertaste-name {
  font-size: clamp(13px, 3.6vw, 18px);
  color: var(--schrift-leise);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.speichertaste.leer .speichertaste-nummer { color: var(--schrift-leise); }
.speichertaste.laeuft { border-color: var(--leuchten); }
.speichertaste.laeuft .speichertaste-nummer { color: var(--leuchten); }

/* Langer Druck: ein Balken füllt sich, bis gespeichert ist. */
.speichertaste::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 5px;
  width: 0;
  background: var(--leuchten);
}
.speichertaste.haelt::after { width: 100%; transition: width var(--lang-druecken-zeit) linear; }

/* Quer: Anzeige und Pfeile links, Speicher rechts. */
@media (orientation: landscape) {
  .radio {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "anzeige speicher" "suchlauf speicher";
  }
  .anzeige-logo { height: clamp(36px, 9vh, 64px); }
  .anzeige-zeile1 { font-size: clamp(24px, 4.5vw, 50px); }
  .pfeil { font-size: clamp(36px, 7vw, 64px); }
  .speichertaste-nummer { font-size: clamp(22px, 4vw, 36px); }
  .speichertaste-name { font-size: clamp(12px, 2vw, 16px); }
}
