/* =====================================================================
   Broadcast-Look (v0.3): dunkles Glas, schmale Schrift, Großbuchstaben,
   farbige Kennstreifen statt Rahmen, große Zahlen – wie Regatta-TV-Grafiken.
   Bewusst als eigene Schicht nach app.css geladen.
   ===================================================================== */
:root {
  --bg: #04070c;
  --panel: rgba(5, 10, 18, 0.84);
  --panel-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f6f9fc;
  --text-2: #c9d6e2;
  --accent: #22e4ff;
  --hot: #ffd60a;
  --up: #22e4ff;
  --down: #ff4fd8;
  --green: #2bea7f;
  --yellow: #ffd60a;
  --red: #ff4b4b;
  --calm: #7fa8ff;
  --radius: 3px;
  --cond: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  font-family: "Bahnschrift", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
/* schmale Variante für Überschriften und Zahlen (Bahnschrift hat eine Breiten-Achse) */
.panel-head h2, .group h3, .card-head h4, .big .val, #clock, .brand b, .race-btn, .intro-title, .intro-btn .t,
.race-legs th, #race-hud b, #race-hud .k, .lbl, .facts dt, .facts dd, .intro-stat .k, .intro-stat .v, .load-title, .pill, .cams button, #t-ticks {
  font-family: var(--cond); font-stretch: 85%;
}
.panel-head h2, .group h3, .card-head h4, .facts dt, .race-legs th, .intro-stat .k, #race-hud .k {
  text-transform: uppercase; letter-spacing: .09em;
}

/* --- Kopfzeile */
#top { height: 56px; background: linear-gradient(#04070cf2, #04070c00); }
.brand b { font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.brand b em { font-style: normal; color: var(--accent); }
.brand span { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
#clock { border-radius: var(--radius); background: var(--panel); border: 0; box-shadow: inset 3px 0 0 var(--accent);
  font-size: 15px; letter-spacing: .03em; padding: 6px 12px 6px 14px; }
#clock .tag { border-radius: 2px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; background: #0d3a46; color: var(--accent); }
#clock .tag.fc { background: #3d3205; color: var(--hot); }
#banner, #banner.ok, #banner.bad { border-radius: var(--radius); border: 0; background: var(--panel); color: var(--text); }
#banner { box-shadow: inset 3px 0 0 var(--red); }
#banner.ok { box-shadow: inset 3px 0 0 var(--green); }
#banner.bad { box-shadow: inset 3px 0 0 var(--calm); }
.icon-btn, #lang { border-radius: var(--radius); border-color: var(--line); background: var(--panel); }

/* --- Panels */
.panel { border: 0; border-radius: var(--radius); box-shadow: 0 10px 30px #0008, inset 0 2px 0 rgba(34, 228, 255, .55); }
.panel-head { background: linear-gradient(var(--panel) 75%, transparent); }
.panel-head h2 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head h2::before { content: ""; width: 10px; height: 14px; background: var(--accent); transform: skewX(-18deg); }
.collapse { border-radius: var(--radius); }
.group h3 { color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.group select, .group input[type=number], .race-opts select, .mini, .cams button, .pill {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: var(--radius); }
.cams button:hover, .pill:hover, .mini:hover { border-color: var(--accent); background: rgba(34, 228, 255, .1); }

/* --- Karten: Kennstreifen links statt Rahmen */
.card { border: 0; border-radius: var(--radius); background: var(--panel-2); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .35); padding: 10px 10px 10px 13px; }
.card:hover { box-shadow: inset 3px 0 0 var(--accent); }
.card.race, .card.race:hover { box-shadow: inset 3px 0 0 var(--hot); }
.card-head h4 { font-size: 13px; font-weight: 700; }
.leg { width: 12px; height: 12px; border-radius: 0; transform: skewX(-18deg); }
.leg.up { background: var(--up); } .leg.down { background: var(--down); }
.lamp { border-radius: 1px; transform: skewX(-18deg); width: 12px; height: 12px; }
.big .val { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.big .unit { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.facts { gap: 2px 10px; }
.facts dt { font-size: 10.5px; padding-top: 2px; }
.facts dd { font-size: 14px; }
.hint { border-radius: var(--radius); background: rgba(34, 228, 255, .08); box-shadow: inset 2px 0 0 var(--accent); }
.hint.warn { background: rgba(255, 75, 75, .12); box-shadow: inset 2px 0 0 var(--red); }
.hint.cur { background: rgba(43, 234, 127, .08); box-shadow: inset 2px 0 0 var(--green); }
.note { border-radius: var(--radius); }

/* --- Rennen */
.race-btn { border: 0; border-radius: var(--radius); background: var(--hot); color: #0b0b0b; text-transform: uppercase;
  letter-spacing: .08em; font-size: 17px; padding: 12px; box-shadow: 0 6px 22px #ffd60a33;
  clip-path: polygon(0 0, 100% 0, 100% 70%, calc(100% - 12px) 100%, 0 100%); }
.race-btn:hover { background: #ffe24d; }
.race-btn.stale { animation: pulseHot 1.6s ease-in-out infinite; }
@keyframes pulseHot { 50% { background: #fff07a; } }
.race-legs th { font-size: 10px; color: var(--text-2); font-weight: 600; }
.race-legs td.up { color: var(--up); } .race-legs td.down { color: var(--down); }
.race-legs tr.cur { background: rgba(255, 214, 10, .14); }
.race-play .btn { border-radius: var(--radius); border: 0; background: var(--hot); color: #0b0b0b; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pill.race-mini { background: var(--hot); color: #0b0b0b; border: 0; }
.btn { border-radius: var(--radius); }

/* --- Zeitleiste */
#timeline { border-radius: var(--radius); border: 0; box-shadow: 0 10px 30px #0008, inset 0 2px 0 rgba(34, 228, 255, .55); }
#t-ticks span.day { color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
#legend .bar { border-radius: 1px; }

/* --- 3D-Beschriftungen */
.lbl { border: 0; border-radius: 1px; background: rgba(4, 8, 14, .86); box-shadow: inset 2px 0 0 rgba(255, 255, 255, .5);
  text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding: 2px 7px 2px 9px; }
.lbl.place { box-shadow: none; background: none; text-shadow: 0 1px 3px #000, 0 0 8px #000a; }
.lbl.mark { box-shadow: inset 2px 0 0 var(--hot); }
.lbl.mark.start { box-shadow: inset 2px 0 0 #fff; }
.lbl.leg.up { box-shadow: inset 2px 0 0 var(--up); } .lbl.leg.down { box-shadow: inset 2px 0 0 var(--down); }
.lbl.station { text-transform: none; letter-spacing: 0; box-shadow: inset 2px 0 0 var(--accent); }

/* --- Popup + Dialog */
#popup { border-radius: var(--radius); }
dialog#info { background: #070d16; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px #000c, inset 0 2px 0 var(--accent); }
dialog#info h3 { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }

/* --- Ladebildschirm */
#loading { background: radial-gradient(ellipse at 50% 60%, #0b2233 0%, #04070c 70%); gap: 18px; }
.load-title { font-size: clamp(30px, 6vw, 56px); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.load-title em, .intro-title .hl { font-style: normal; color: var(--accent); }
.load-bar { width: min(320px, 70vw); height: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.load-bar i { display: block; width: 35%; height: 100%; background: var(--accent); animation: loadSlide 1.2s ease-in-out infinite; }
@keyframes loadSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
#loading-text { margin: 0; font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .1em; }

/* --- Startbildschirm */
#intro { position: fixed; inset: 0; z-index: 12; display: flex; align-items: flex-end; pointer-events: none; opacity: 0; transition: opacity .7s ease; }
body.intro-on #intro { opacity: 1; pointer-events: auto; }
.intro-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 7, 12, .92) 0%, rgba(4, 7, 12, .7) 38%, rgba(4, 7, 12, .05) 72%),
              linear-gradient(0deg, rgba(4, 7, 12, .85) 0%, rgba(4, 7, 12, 0) 45%); }
.intro-inner { position: relative; padding: 0 clamp(18px, 5vw, 72px) clamp(64px, 11vh, 120px); max-width: 760px;
  animation: introIn .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes introIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.intro-kicker { display: flex; align-items: center; gap: 10px; font-family: var(--cond); font-stretch: 85%; text-transform: uppercase;
  letter-spacing: .22em; font-size: 13px; color: var(--accent); font-weight: 600; }
.intro-kicker .stripe { width: 34px; height: 4px; background: var(--accent); transform: skewX(-24deg); }
.intro-title { margin: 6px 0 4px; font-size: clamp(46px, 9.5vw, 112px); line-height: .9; font-weight: 700; text-transform: uppercase;
  letter-spacing: .01em; display: flex; flex-wrap: wrap; gap: 0 .22em; text-shadow: 0 4px 30px #000a; }
.intro-sub { margin: 10px 0 22px; font-size: clamp(15px, 1.6vw, 19px); color: var(--text-2); max-width: 34em; }
.intro-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 2px; margin-bottom: 22px; max-width: 680px; }
.intro-stat { background: rgba(5, 10, 18, .78); padding: 9px 12px 10px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18); min-height: 72px; }
.intro-stat.hl { box-shadow: inset 0 2px 0 var(--accent); }
.intro-stat .k { font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.intro-stat .v { font-size: 30px; font-weight: 700; line-height: 1.05; margin-top: 3px; font-variant-numeric: tabular-nums; }
.intro-stat .v small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 3px; letter-spacing: .04em; }
.intro-stat .d { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.intro-stat .lampi { display: inline-block; width: 9px; height: 9px; margin-right: 6px; transform: skewX(-18deg); vertical-align: 1px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 230px; padding: 13px 22px 12px 18px;
  border: 0; border-radius: var(--radius); cursor: pointer; text-align: left; background: rgba(255, 255, 255, .1); color: var(--text);
  box-shadow: inset 3px 0 0 #fff; transition: transform .15s, background .15s;
  clip-path: polygon(0 0, 100% 0, 100% 68%, calc(100% - 14px) 100%, 0 100%); }
.intro-btn:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 255, 255, .16); }
.intro-btn .t { font-size: 21px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.intro-btn .s { font-size: 12.5px; opacity: .85; }
.intro-btn.primary { background: var(--hot); color: #0b0b0b; box-shadow: 0 10px 34px #ffd60a40; }
.intro-btn.primary:hover:not(:disabled) { background: #ffe24d; }
.intro-btn.primary .go { display: inline-block; margin-left: 4px; }
.intro-btn:disabled { cursor: progress; opacity: .75; }
.intro-btn:focus-visible, .intro-langs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.intro-langs { display: flex; gap: 4px; margin-top: 18px; }
.intro-langs button { background: none; border: 0; color: var(--text-2); font-family: var(--cond); font-stretch: 85%; font-weight: 700;
  letter-spacing: .1em; padding: 4px 8px; cursor: pointer; border-bottom: 2px solid transparent; }
.intro-langs button.on { color: var(--text); border-bottom-color: var(--accent); }
.intro-foot { position: absolute; right: clamp(18px, 4vw, 48px); bottom: 18px; font-size: 11px; color: var(--text-2); opacity: .8;
  letter-spacing: .04em; max-width: 60vw; text-align: right; }
/* Rest der Oberfläche während des Startbildschirms ausblenden */
#top, #left, #right, #timeline { transition: opacity .6s ease, transform .6s ease; }
body.intro-on #top, body.intro-on #left, body.intro-on #right, body.intro-on #timeline,
body.intro-on #labels, body.intro-on #race-hud, body.intro-on #popup { opacity: 0; pointer-events: none; }
body.intro-on #left { transform: translateX(-20px); }
body.intro-on #right { transform: translateX(20px); }
body.intro-on #timeline { transform: translateY(20px); }

/* --- Renn-Einblendung oben mittig */
#race-hud { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 6; display: grid;
  grid-template-columns: auto auto auto auto; background: rgba(4, 8, 14, .9); box-shadow: 0 10px 30px #0009, inset 0 2px 0 var(--hot);
  border-radius: var(--radius); overflow: hidden; pointer-events: none; }
#race-hud[hidden] { display: none; }
#race-hud > div { padding: 6px 14px 8px; display: flex; flex-direction: column; align-items: flex-start; }
#race-hud .k { font-size: 9.5px; color: var(--text-2); font-weight: 600; }
#race-hud b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
#race-hud i { font-style: normal; font-size: 10px; color: var(--text-2); margin-top: 1px; }
#race-hud .hud-leg { background: var(--hot); color: #0b0b0b; }
#race-hud .hud-leg .k { color: #0b0b0bcc; }
#race-hud #hud-mode { font-family: var(--cond); font-stretch: 85%; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
#race-hud .hud-cell + .hud-cell { box-shadow: inset 1px 0 0 var(--line); }
#race-hud .hud-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 4px; padding: 0; background: rgba(255, 255, 255, .08); }
#race-hud .hud-bar span { flex: 1; position: relative; background: rgba(255, 255, 255, .12); }
#race-hud .hud-bar span i { position: absolute; top: 0; bottom: 0; left: 0; margin: 0; }
#race-hud .hud-bar span.up i { background: var(--up); }
#race-hud .hud-bar span.down i { background: var(--down); }

@media (max-width: 820px) {
  #top { height: 52px; }
  .intro-shade { background: linear-gradient(0deg, rgba(4, 7, 12, .96) 0%, rgba(4, 7, 12, .78) 55%, rgba(4, 7, 12, .15) 100%); }
  .intro-inner { padding-bottom: 80px; }
  .intro-langs { margin-top: 12px; }
  .intro-stats { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
  .intro-stat { min-height: 0; }
  .intro-stat .v { font-size: 24px; }
  .intro-sub { margin-bottom: 14px; }
  .intro-btn { min-width: 0; flex: 1 1 100%; }
  .intro-foot { left: 18px; right: 18px; text-align: left; max-width: none; bottom: 14px; }
  #race-hud { top: 58px; }
  #race-hud > div { padding: 5px 9px 6px; }
  #race-hud b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-inner, .load-bar i, .race-btn.stale { animation: none; }
  #intro, #top, #left, #right, #timeline { transition: none; }
}
