/* Turniertafel – Styles. Farben über CSS-Variablen in :root (--bg, --fg, --c1, --c2, --gold).
   Klassenfarben setzt app.js als --accent über die Klassen .k0, .k1 … (Element #klassen-css). */
:root {
  --bg: #17457e; --fg: #fff; --c1: #e0367c; --c2: #35a845; --gold: #f5c518;
  --panel: color-mix(in srgb, var(--fg) 9%, var(--bg));
  --panel2: color-mix(in srgb, var(--fg) 4%, var(--bg));
  --line: color-mix(in srgb, var(--fg) 18%, transparent);
  --muted: color-mix(in srgb, var(--fg) 62%, var(--bg));
  --sans: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --score: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", var(--sans);
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); overflow: hidden; }
body.verlauf { background:
  radial-gradient(ellipse 70% 60% at 0% 0%, color-mix(in srgb, var(--c1) 26%, transparent), transparent 70%),
  radial-gradient(ellipse 70% 60% at 100% 100%, color-mix(in srgb, var(--c2) 26%, transparent), transparent 70%),
  var(--bg); }
button, input, select { font: inherit; color: inherit; }
#app { height: 100vh; display: flex; flex-direction: column; gap: 1.2vh; padding: 1.4vh 1.6vw; }

/* Kopf */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.2vh 1.4vw; border-radius: var(--r); border: 1px solid var(--line);
  background: linear-gradient(105deg, color-mix(in srgb, var(--c1) 34%, var(--panel)) 0%, var(--panel) 40%, var(--panel) 60%, color-mix(in srgb, var(--c2) 34%, var(--panel)) 100%); }
.brand-name { font-family: var(--score); font-weight: 700; font-size: clamp(1.4rem, 3vw, 3rem); line-height: 1; font-style: italic; letter-spacing: -.01em; }
.brand-name b { color: var(--gold); }
.brand-sub { color: var(--muted); font-size: clamp(.75rem, 1vw, 1.05rem); margin-top: .2em; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 1.2vw; min-width: 0; }
.slidetitle { font-size: clamp(1.1rem, 2.1vw, 2.2rem); font-weight: 600; text-align: center; line-height: 1.15; }
.cd { text-align: center; }
.side-logo { flex: 1 1 0; min-height: 9rem; position: relative; }
.side-logo img { position: absolute; inset: 4% 0; width: 100%; height: 92%; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); transform: rotate(-3deg); }
.clock { text-align: right; }
.clock-time { font-family: var(--score); font-size: clamp(1.6rem, 3.4vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.clock-day { color: var(--muted); font-size: clamp(.75rem, 1vw, 1.05rem); }
.clock-test { color: var(--gold); font-size: clamp(.7rem, .9vw, 1rem); font-weight: 600; }

/* Bühne */
#stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.slide { display: none; position: absolute; inset: 0; }
.slide.on { display: block; }
.fit { transform-origin: top left; display: flex; flex-direction: column; }
.fit > .now { flex: 1; }
@media (prefers-reduced-motion: no-preference) { .slide.enter .fit { animation: in .5s ease-out; } .live-dot { animation: pulse 1.4s ease-in-out infinite; } }
@keyframes in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .2; } }

.chip { display: inline-block; padding: .08em .55em; border-radius: 999px; font-size: .62em; font-weight: 700; color: #fff; vertical-align: middle; white-space: nowrap; }
.chip { background: var(--accent, var(--muted)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(.8rem, 1.4vw, 1.6rem); }
.h { font-size: clamp(1.1rem, 1.8vw, 2rem); font-weight: 600; margin: 0 0 .6em; }
.muted { color: var(--muted); }
.tbd { color: var(--muted); font-style: italic; }
.small { font-size: clamp(.8rem, 1.05vw, 1.15rem); color: var(--muted); }

/* Jetzt */
.now { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.4vw; }
@media (max-width: 900px) { .now { grid-template-columns: 1fr; } }
.hero { border-top: 10px solid var(--accent, var(--line)); display: flex; flex-direction: column; justify-content: space-between; gap: 2.6vh; min-height: 50vh; }
.hero-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.6vh; }
.hero-bot { display: flex; flex-direction: column; gap: 1.6vh; }
.hero-head-wrap { padding-bottom: 1.6vh; border-bottom: 1px solid var(--line); }
.cd .small { font-size: clamp(.9rem, 1.3vw, 1.4rem); margin-bottom: .3em; }
.hero-head { display: flex; gap: .8em; align-items: center; flex-wrap: wrap; font-size: clamp(1rem, 1.6vw, 1.8rem); }
.badge { font-weight: 700; display: inline-flex; align-items: center; gap: .4em; }
.live-dot { width: .7em; height: .7em; border-radius: 50%; background: var(--accent); }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2vw; }
.teamc { container-type: inline-size; min-width: 0; }
.team { font-size: min(clamp(1.4rem, 3.6vw, 4rem), calc(100cqw / (var(--len, 12) * .58))); font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team.nmw > .nt { white-space: nowrap; }
.team.gast { text-align: right; }
.score { font-family: var(--score); font-weight: 700; font-size: clamp(3rem, 8vw, 9rem); line-height: .9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score.vs { font-size: clamp(1.6rem, 3.4vw, 3.6rem); color: var(--muted); font-weight: 400; }
.sub { font-size: clamp(1rem, 2vw, 2.2rem); }
.prog { display: grid; grid-template-columns: 12fr 2fr 12fr; gap: 6px; }
.prog > div { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); }
.countdown { font-family: var(--score); font-size: clamp(2.2rem, 6vw, 6.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.side { display: flex; flex-direction: column; gap: 1.4vw; }
.list { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 3.3em auto minmax(0, 1fr) auto; align-items: center; gap: .6em; padding: .55em 0; border-bottom: 1px solid var(--line); font-size: clamp(.95rem, 1.22vw, 1.5rem); }
.row:last-child { border-bottom: 0; }
.row-teams { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row-teams .nmw { display: inline-flex; }
.row-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.row-res { font-family: var(--score); font-weight: 700; font-size: 1.2em; font-variant-numeric: tabular-nums; }

/* Tabellen */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1.4vw; }
.tcard { border-top: 8px solid var(--accent); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: clamp(1rem, 1.8vw, 2.1rem); }
th { font-size: .62em; color: var(--muted); font-weight: 600; text-align: right; padding: .3em .45em; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: .42em .45em; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th.l, td.l { text-align: left; }
td.team-c { font-weight: 600; }
td.pkt { font-family: var(--score); font-weight: 700; font-size: 1.15em; line-height: 1; vertical-align: middle; }
tr.q td:first-child { box-shadow: inset 5px 0 0 var(--accent); }
.note { font-size: clamp(.8rem, 1.1vw, 1.2rem); color: var(--muted); margin-top: .7em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1.4vw; margin-top: 1.4vw; }
.kpi-l { color: var(--muted); font-size: clamp(.8rem, 1.1vw, 1.2rem); }
.kpi-v { font-family: var(--score); font-weight: 700; font-size: clamp(2rem, 4.4vw, 4.8rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-v small { font-size: .45em; color: var(--muted); font-weight: 400; }
.kpi-v.kpi-name { font-family: var(--sans); font-size: clamp(1.2rem, 2.2vw, 2.3rem); line-height: 1.15; }
.kpi { border-left: 6px solid var(--accent); }
.kpi .bar i { background: var(--accent); }
.kpi-title { margin-top: 1.4vw; font-size: clamp(.9rem, 1.3vw, 1.4rem); font-weight: 600; color: var(--muted); }
.kpi-title .chip { font-size: .75em; }
.kpi-title + .kpis { margin-top: .6vw; }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .5em; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c1), var(--c2)); }

/* Baum */
.tree { border-top: 8px solid var(--accent); display: flex; flex-direction: column; gap: 2.2vh; }
.br { display: grid; grid-template-columns: minmax(0, 1fr) 2.4rem minmax(0, 1fr); }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: .8vh; }
.conn { position: relative; }
.conn::before { content: ""; position: absolute; left: 0; width: 50%; top: 25%; bottom: 25%; border: 3px solid var(--accent); border-left: 0; border-radius: 0 10px 10px 0; }
.conn::after { content: ""; position: absolute; left: 50%; right: 0; top: 50%; border-top: 3px solid var(--accent); }
.conn.many::before { top: 12.5%; bottom: 12.5%; }
.m { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); padding: .45em .7em; font-size: clamp(1rem, 1.7vw, 1.9rem); }
.m.big { border: 3px solid var(--accent); }
.m.live { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.m-head { display: flex; justify-content: space-between; gap: .5em; font-size: .6em; color: var(--muted); }
.m-head b { color: var(--accent); }
.m-t { display: flex; justify-content: space-between; gap: .5em; line-height: 1.35; }
.m-t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-t .s { font-family: var(--score); font-weight: 700; font-variant-numeric: tabular-nums; }
.m-t.win span:first-child { font-weight: 700; }
.m-t.lose { color: var(--muted); }
.subm { display: grid; grid-template-columns: minmax(0, 1fr) 2.4rem minmax(0, 1fr); align-items: center; }
.subm .small { text-align: right; }
.subm .m { grid-column: 3; }
.champ { text-align: center; font-size: clamp(1rem, 1.6vw, 1.8rem); }
.champ b { color: var(--gold); }

/* Hochrechnung */
.vorl { font-style: italic; }
.slot { display: inline-block; font-style: normal; font-weight: 600; font-size: .55em; vertical-align: middle; margin-left: .45em; padding: .05em .4em; border: 1.5px dashed var(--muted); border-radius: 5px; color: var(--muted); white-space: nowrap; }
.m.vorlm { border-style: dashed; }
.nmw { display: flex; align-items: center; min-width: 0; }
.nmw.r, .team.gast.nmw { justify-content: flex-end; }
.nmw > .nt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nmw > .slot { flex: none; }
.fopp .nmw, .row .nmw { display: inline-flex; vertical-align: middle; max-width: 100%; }
.vorl-note { display: flex; align-items: center; gap: .5em; }
.vorl-note .slot { font-size: .8em; margin: 0; }

/* Spielplan des Tages */
.tag-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .4em; }
.tl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4vw; align-items: start; }
@media (max-width: 900px) { .tl-cols { grid-template-columns: 1fr; } }
.tl-col { padding-top: .4em; padding-bottom: .4em; }
.tl { display: grid; grid-template-columns: 3.1em auto minmax(0, 1fr) 3em minmax(0, 1fr) 3.2em; gap: .55em; align-items: center; padding: .38em .3em; border-bottom: 1px solid var(--line); font-size: clamp(.9rem, 1.5vw, 1.8rem); border-radius: 8px; }
.tl:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-n.r { text-align: right; }
.tl-score { text-align: center; font-family: var(--score); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-ph { font-size: .7em; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl.later { opacity: .6; }
.tl.done .tl-n { font-weight: 500; }
.tl.next { box-shadow: inset 4px 0 0 var(--gold); }
.tl.live { background: color-mix(in srgb, var(--accent, var(--c1)) 29%, transparent); font-weight: 700; }
.tl.live .tl-score { color: var(--fg); }

/* Team im Fokus */
.focus { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.4vw; }
@media (max-width: 900px) { .focus { grid-template-columns: 1fr; } }
.fhero { border-top: 10px solid var(--accent); display: flex; flex-direction: column; gap: 2.2vh; }
.fname { font-size: clamp(2rem, 5vw, 5.6rem); font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.fplatz { display: flex; align-items: baseline; gap: .6em; }
.fbig { font-family: var(--score); font-weight: 700; font-size: clamp(2.6rem, 6vw, 6.4rem); line-height: .9; color: var(--accent); }
.fstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6vw; }
.fstat { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: .5em .6em; }
.fv { font-family: var(--score); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2.8rem); font-variant-numeric: tabular-nums; line-height: 1.05; }
.finfo { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1vw; }
.fnext { font-size: clamp(1.05rem, 1.7vw, 1.9rem); font-weight: 600; }
.frow { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) auto 3em 1.8em; gap: .6em; align-items: center; padding: .5em 0; border-bottom: 1px solid var(--line); font-size: clamp(.95rem, 1.4vw, 1.6rem); }
.frow:last-of-type { border-bottom: 0; }
.fopp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fopp { color: var(--fg); }
.wl { width: 1.6em; height: 1.6em; border-radius: 6px; display: inline-grid; place-items: center; font-weight: 800; font-size: .8em; color: #fff; }
.wl.w { background: #2e9e45; } .wl.d { background: #7d7d88; } .wl.l { background: #c8344a; }

/* Rekorde */
.fit > .recs { flex: 1; }
.recs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 1.4vw; }
@media (max-width: 1100px) { .recs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; } }
@media (max-width: 700px) { .recs { grid-template-columns: 1fr; } }
.rec { display: flex; flex-direction: column; gap: 1.2vh; position: relative; overflow: hidden; border-top: 6px solid var(--line); min-height: 15rem; }
.rec.gold { border-top-color: var(--gold); }
.rec-h { display: flex; align-items: center; gap: .5em; font-size: clamp(1rem, 1.5vw, 1.7rem); font-weight: 600; }
.rec-i { width: 2.2em; height: 2.2em; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.rec-wm { position: absolute; right: -10%; bottom: -24%; width: 62%; height: auto; aspect-ratio: 1; opacity: .09; filter: grayscale(1); pointer-events: none; transform: rotate(-12deg); }
.rec > :not(.rec-wm) { position: relative; z-index: 1; }
.rec-b { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.4vh; }
.rec-f { display: flex; flex-direction: column; gap: .5vh; }
.rec-big { font-family: var(--score); font-weight: 700; font-size: clamp(3rem, 6.5vw, 7.5rem); line-height: .95; font-variant-numeric: tabular-nums; }
.rec-big small { font-size: .38em; font-weight: 600; color: var(--muted); }
.rec.empty .rec-big { color: var(--muted); opacity: .5; }
.rec-sub { font-size: clamp(1.1rem, 1.9vw, 2.2rem); font-weight: 700; }
.rec-d { font-size: clamp(.9rem, 1.2vw, 1.35rem); }
.rec-team { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: .5em .8em; border-radius: 10px; background: var(--panel2); border-left: 5px solid var(--accent); }
.rec-tn { display: flex; flex-direction: column; gap: .2em; font-size: clamp(1.05rem, 1.7vw, 2rem); font-weight: 700; min-width: 0; }
.rec-tn .chip { align-self: flex-start; font-size: .5em; }
.rec-v { font-family: var(--score); font-weight: 700; font-size: clamp(1.6rem, 3vw, 3.4rem); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; }
.rec-v small { font-size: .35em; font-weight: 600; color: var(--muted); font-family: var(--sans); }
.rec-list { display: flex; flex-wrap: wrap; gap: .45em; }
.rec-pill { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: .25em .8em .25em .35em; font-size: clamp(.9rem, 1.25vw, 1.4rem); }
.cmp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8em; align-items: center; font-size: clamp(1.1rem, 1.8vw, 2.1rem); }
.cmp .chip { font-size: .6em; }
.cmp-bar { height: 1.1em; border-radius: 999px; background: var(--line); overflow: hidden; }
.cmp-bar i { display: block; height: 100%; border-radius: 999px; }
.cmp-bar i { background: var(--accent); }

/* Verschobene Zeiten */
.moved { color: var(--gold) !important; font-weight: 700; }
.shift { background: #f6f6f9; border: 1px solid #e3e3e8; border-radius: 12px; padding: .7rem .9rem; margin-bottom: .6rem; }
.shift-t { font-weight: 600; margin-bottom: .4rem; }
.shift input[type=number] { width: 4.2rem; text-align: center; padding: .3rem; border: 1px solid #c9c9d1; border-radius: 6px; background: #fff; color: #1b1b1f; font-size: 1.05rem; }
.er input.tz { width: 100%; text-align: center; padding: .25rem .1rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #6b6b75; font-variant-numeric: tabular-nums; font-size: .95rem; }
.er input.tz:hover, .er input.tz:focus { border-color: #c9c9d1; background: #fff; }
.er input.tz.moved { color: #b07d00 !important; background: #fff6d6; }

/* Schiedsrichter */
.seg { display: inline-flex; background: #ececf1; border-radius: 999px; padding: 3px; margin-bottom: .8rem; }
.seg button { border: 0; background: none; padding: .4rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 600; color: #4a4a55; }
.seg button[aria-current="true"] { background: #fff; color: #1b1b1f; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.sr-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; align-items: start; padding: .6rem 0; border-bottom: 1px solid #ececf0; }
.sr-row.past { opacity: .55; }
@media (max-width: 620px) { .sr-row { grid-template-columns: 1fr 1fr; } .sr-g { grid-column: 1 / -1; } }
.sr-top { display: flex; gap: .45rem; align-items: center; font-size: .85rem; }
.sr-top .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-ph { color: #6b6b75; }
.sr-m { font-size: .95rem; margin-top: .15rem; }
.sr-m.tbd { color: #8a8a94; font-style: italic; }
.sr-slot select { width: 100%; padding: .35rem; border-radius: 8px; border: 1px solid #c9c9d1; background: #fff; color: #1b1b1f; font-size: .92rem; }
.sr-slot select.fix { border-color: #17457e; background: #eef3fb; font-weight: 600; }
.sr-slot select.sug { border-style: dashed; background: #fafafa; }
.sr-st { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .2rem; font-size: .76rem; }
.tag-fix { background: #17457e; color: #fff; border-radius: 4px; padding: 0 .35rem; }
.tag-sug { border: 1px dashed #8a8a94; color: #6b6b75; border-radius: 4px; padding: 0 .35rem; }
.sr-warn { color: #c8344a; font-weight: 600; }
.sr-note { color: #8a6d00; }
.sr-sum { display: flex; flex-wrap: wrap; gap: .35rem; }
.sr-pill { background: #f1f1f4; border-radius: 999px; padding: .2rem .7rem .2rem .3rem; font-size: .85rem; }
.sr-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6em; font-size: clamp(.95rem, 1.4vw, 1.6rem); color: var(--muted); }
.sr-lbl { text-transform: uppercase; letter-spacing: .1em; font-size: .7em; font-weight: 700; }
.sr-who { color: var(--fg); font-weight: 600; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: .15em .7em .15em .3em; }
.frow.sr { color: var(--muted); }
.wl.sr { background: var(--gold); color: #1a1a1a; font-size: .65em; }

/* Leiste unten */
.nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.dots { display: flex; gap: .35rem; flex-wrap: wrap; }
.btn { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .35em .9em; font-size: clamp(.8rem, .95vw, 1rem); }
.btn:hover { border-color: var(--fg); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[aria-current="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.pri { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 600; }
.timer { flex: 1 1 6rem; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c1), var(--c2)); }
body.kiosk .nav { opacity: 0; transition: opacity .4s; }
body.kiosk .nav:hover, body.kiosk .nav:focus-within { opacity: 1; }

/* Dialoge (immer hell, gut lesbar) */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(760px, 96vw); max-height: 92vh; background: #fff; color: #1b1b1f; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.dlg-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid #e3e3e8; z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 1.25rem; }
.dlg-body { padding: 1rem 1.2rem 1.4rem; overflow: auto; max-height: calc(92vh - 4.5rem); }
dialog .btn { background: #f1f1f4; border-color: #d6d6dc; color: #1b1b1f; }
dialog .btn.pri { background: #17457e; border-color: #17457e; color: #fff; }
.fl { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: .4rem; margin-bottom: .8rem; flex-wrap: wrap; }
.tabs .btn[aria-current="true"] { background: #1b1b1f; color: #fff; }
.er { display: grid; grid-template-columns: 4em auto minmax(0, 1fr) 3.4em .8em 3.4em minmax(0, 1fr) 2.2em; gap: .45rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid #ececf0; }
.er .ph { grid-column: 1 / -1; font-size: .8rem; color: #6b6b75; margin-bottom: -.3rem; }
.er .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er .nm.r { text-align: right; }
.er .nm.tbd { color: #8a8a94; font-style: italic; }
.er input[type=number] { width: 100%; text-align: center; font-size: 1.2rem; padding: .35rem 0; border: 1px solid #c9c9d1; border-radius: 8px; background: #fff; color: #1b1b1f; }
.er input.done { background: #eaf6ec; border-color: #7cc487; }
.er .x { border: 0; background: none; cursor: pointer; color: #9a9aa5; font-size: 1.1rem; }
.er .pen { grid-column: 3 / 8; font-size: .9rem; }
.er .pen select { padding: .25rem; border-radius: 6px; border: 1px solid #c9c9d1; background: #fff; color: #1b1b1f; }
.er .t { color: #6b6b75; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .er { grid-template-columns: 3.8em minmax(0, 1fr) 3em .6em 3em minmax(0, 1fr) 1.8em; } .er .chipc { display: none; } .er .pen { grid-column: 2 / 7; } }
.sec { margin: 1.2rem 0 .5rem; font-weight: 600; }
.sw { width: 2.6rem; height: 2.6rem; border-radius: 10px; border: 2px solid #d6d6dc; cursor: pointer; }
.sw[aria-pressed="true"] { outline: 3px solid #17457e; outline-offset: 2px; }
input[type=color] { width: 3.2rem; height: 2.6rem; border: 1px solid #c9c9d1; border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.setrow { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid #ececf0; }
.setrow input[type=number] { width: 4.5rem; padding: .3rem; border: 1px solid #c9c9d1; border-radius: 6px; background: #fff; color: #1b1b1f; }
.hint { font-size: .85rem; color: #6b6b75; margin: .3rem 0 0; }
.toast { position: fixed; left: 50%; bottom: 4vh; transform: translateX(-50%); background: #1b1b1f; color: #fff; padding: .6rem 1.1rem; border-radius: 999px; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 10; }
.toast.on { opacity: 1; }

/* ---------- Weitere Platzierungsspiele im Turnierbaum ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .8vh 1vw; }

/* ---------- Startbildschirm, Einrichtung, Code (Dialoge, immer hell) ---------- */
dialog.wide { width: min(1120px, 98vw); }
.lead { font-size: 1.05rem; margin: 0 0 1rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .7rem; }
.opt { display: flex; flex-direction: column; gap: .3rem; text-align: left; cursor: pointer; border: 1px solid #d6d6dc; background: #f6f6f9; border-radius: 12px; padding: .9rem 1rem; color: #1b1b1f; font: inherit; }
.opt:hover { border-color: #17457e; }
.opt b { font-size: 1.05rem; }
.opt span { font-size: .88rem; color: #55555f; }
.opt.pri { background: #17457e; border-color: #17457e; color: #fff; }
.opt.pri span { color: #dfe7f3; }
.fehler { background: #fdecec; border: 1px solid #f1b5b5; color: #7a1f1f; border-radius: 10px; padding: .6rem .9rem; margin-bottom: .8rem; }
.fehler ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.warn { background: #fff6d6; border: 1px solid #ecd27a; border-radius: 10px; padding: .6rem .9rem; margin-bottom: .8rem; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .7rem 1rem; }
.ff { display: flex; flex-direction: column; gap: .25rem; }
.ff-l { font-size: .85rem; font-weight: 600; color: #4a4a55; }
dialog input[type=text], dialog input[type=number], dialog input[type=date], dialog input[type=time], dialog select, dialog textarea {
  padding: .35rem .45rem; border: 1px solid #c9c9d1; border-radius: 6px; background: #fff; color: #1b1b1f; font: inherit; font-size: .95rem; min-width: 0; }
dialog textarea { resize: vertical; line-height: 1.4; }
dialog input[type=color] { width: 2.6rem; height: 2.1rem; padding: 0 .1rem; border: 1px solid #c9c9d1; border-radius: 6px; background: #fff; }
.logo-vs { width: 5rem; height: 5rem; border: 1px dashed #c9c9d1; border-radius: 10px; display: grid; place-items: center; background: #6b7487; }
.logo-vs img { max-width: 92%; max-height: 92%; }
.logo-vs .hint { color: #fff; margin: 0; }
.kcard { border: 1px solid #e3e3e8; border-left: 8px solid var(--kf, #888); border-radius: 12px; padding: .8rem .9rem; margin-top: .8rem; background: #fbfbfd; }
.kcard-h { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.kcard-h .kname { font-weight: 700; font-size: 1.05rem; width: 12rem; }
.kgruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .7rem; margin-top: .6rem; }
dialog .x { border: 0; background: none; cursor: pointer; color: #9a9aa5; font-size: 1.1rem; padding: .2rem .4rem; }
dialog .x:hover { color: #b3261e; }
.tag-zeile { padding: .25rem 0; }
.erzeugen { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid #e3e3e8; }
.plan-tab { display: flex; flex-direction: column; gap: .3rem; }
.plan-tag { font-weight: 700; margin-top: .7rem; padding-bottom: .2rem; border-bottom: 2px solid #1b1b1f; }
.pz { display: grid; grid-template-columns: 6.5rem 5.6rem 6.5rem 9rem minmax(6rem, 1fr) minmax(8rem, 1.6fr) .6rem minmax(8rem, 1.6fr) 2rem; gap: .35rem; align-items: center; }
.pz.ko { background: #f6f6f9; border-radius: 8px; }
.pz-ph { min-width: 0; }
@media (max-width: 900px) { .pz { grid-template-columns: 1fr 1fr 1fr; padding: .4rem 0; border-bottom: 1px solid #ececf0; } .pz > span:nth-of-type(2) { display: none; } }
.code-gross { font-family: var(--score); font-size: 3.4rem; font-weight: 700; letter-spacing: .08em; text-align: center; padding: .6rem; margin: .4rem 0 .8rem; background: #f6f6f9; border-radius: 12px; }
.code-inp { font-family: var(--score); font-size: 1.6rem !important; letter-spacing: .1em; text-transform: uppercase; width: 9rem; text-align: center; }
