:root {
  --led-on:  #ff9a14;
  --led-off: #2b1604;
  --ui-fg:   #e9eaec;
  --ui-dim:  #8b9096;
  --ui-bg:   #16181b;
  --ui-line: #2a2e33;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding: min(4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, #191c20 0%, #0a0b0c 72%);
  color: var(--ui-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

#stage { width: 100%; display: flex; justify-content: center; }
.panel { width: 100%; display: flex; justify-content: center; }

/* ---------- LED-Punktmatrix ---------- */

.led-frame {
  width: min(1180px, 100%);
  padding: clamp(9px, 1.5vw, 20px);
  border: 1px solid #212326;
  border-radius: 14px;
  background: linear-gradient(#15171a, #08090a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 30px 70px rgba(0, 0, 0, .75);
}

.led-dots {
  position: relative;
  aspect-ratio: var(--led-aspect, 92 / 21);
  border-radius: 4px;
  background: #080400;
  overflow: hidden;
}

.led-dots canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#led-on { filter: drop-shadow(0 0 4px rgba(255, 150, 20, .5)); }

.led-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 42%),
    radial-gradient(140% 120% at 50% -25%, rgba(255, 255, 255, .05), transparent 62%);
}

/* ---------- TFT-Monitor ---------- */

.lcd-frame {
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #1f2124;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .75);
  font-size: var(--u, 10px);
  line-height: 1;
}

.lcd-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1.6em;
  padding: 1.5em 2em;
  border-bottom: .12em solid #202020;
}

.lcd-logo {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: .25em;
  background: #0069b4;
  color: #fff;
  font-size: 2.2em;
  font-weight: 800;
}

.lcd-station {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 3.2em;
  font-weight: 700;
  letter-spacing: -.01em;
}

.lcd-clock {
  color: #fff;
  font-size: 3.2em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lcd-rows {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.lcd-row {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.6em;
  padding: 0 2em;
  border-bottom: .1em solid #171717;
}

.lcd-row.is-empty { color: #4a4a4a; }
.lcd-row.is-now { animation: blink 1s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: .25; } }

.lcd-badge {
  display: grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  border-radius: .22em;
  color: #fff;
  font-size: 2.4em;
  font-weight: 800;
  letter-spacing: -.02em;
}

.lcd-dest {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 4.2em;
  font-weight: 700;
  letter-spacing: -.01em;
}

.lcd-min {
  display: flex;
  align-items: baseline;
  gap: .28em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.lcd-min b { font-size: 4.6em; font-weight: 700; }
.lcd-min i { font-size: 2em; font-style: normal; color: #b9b9b9; }

.lcd-note {
  grid-column: 1 / -1;
  text-align: center;
  color: #7a7a7a;
  font-size: 3em;
  font-weight: 600;
}

.lcd-foot {
  flex: 0 0 auto;
  padding: 1.15em 2em;
  border-top: .12em solid #202020;
  overflow: hidden;
}

.lcd-ticker {
  white-space: nowrap;
  color: #ffb545;
  font-size: 2.2em;
  font-weight: 600;
}

/* ---------- Bedienung ---------- */

#cog {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 50%;
  background: rgba(22, 24, 27, .82);
  color: var(--ui-dim);
  cursor: pointer;
  opacity: .32;
  transition: opacity .2s, color .2s;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#cog:hover, #cog:focus-visible { opacity: 1; color: var(--ui-fg); }

#settings {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: rgba(18, 20, 23, .94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.set-head { display: flex; align-items: center; justify-content: space-between; }
.set-head h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; }

#close {
  border: 0;
  background: none;
  color: var(--ui-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ui-dim); }
.field .row { display: flex; gap: 8px; }
.field .row input { flex: 1; }

select, input[type="time"], .set-foot button, .field .row button {
  padding: 9px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ui-fg);
  font: inherit;
  font-size: 13px;
}

.set-foot button, .field .row button { cursor: pointer; }
.set-foot button:hover, .field .row button:hover { border-color: #3d434a; }

.check { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: #ff9a14; }

.set-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--ui-line); padding-top: 14px; }
.set-foot button { width: 100%; }

.hint { margin: 0; font-size: 11px; line-height: 1.7; color: var(--ui-dim); }
.hint.dim { color: #5c6167; }

kbd {
  padding: 1px 5px;
  border: 1px solid var(--ui-line);
  border-radius: 4px;
  background: #1d2024;
  font: inherit;
  font-size: 10px;
}

@media (max-width: 560px) {
  body { padding: 12px; }
}
