/* Aufbau und Layout der Turnier-App. Farben und Schriften: theme.css */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--surface);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.cond { font-family: var(--font-display); }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.is-admin .topbar-inner { max-width: 1320px; }
.logo { width: 34px; height: 31px; flex: none; display: block; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.brand { min-width: 0; flex: 1; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--fg);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.icon-btn {
  flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600;
}

/* ---------- Demo-Leiste ---------- */
.demo-panel {
  max-width: 640px; margin: 0 auto;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.is-admin .demo-panel { max-width: 1320px; }
.demo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.demo-note { font-size: .8rem; color: var(--muted); }

/* ---------- Hauptbereich ---------- */
.main {
  max-width: 640px; margin: 0 auto;
  padding-top: 16px;
  padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 18px;
}
.is-admin .main { max-width: 1320px; padding-bottom: 32px; }
.section { display: grid; gap: 10px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 1.35rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: .9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: .9rem;
}
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 40px; font-weight: 600; font-size: .88rem; line-height: 1.15; padding: 4px; }
.seg button small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }

.side-badge {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; color: var(--on-side);
}
.side-badge.a { background: var(--side-a); }
.side-badge.b { background: var(--side-b); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: .75rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tag.live { background: var(--live); color: #fff; }
.tag.win { background: var(--win-soft); color: var(--win); }

/* ---------- Tab-Leiste ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar-h); }
.tabbar a {
  display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted);
  font-size: .72rem; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); }

/* ---------- Start / Teamwahl ---------- */
.hero-start { display: grid; gap: 6px; padding-top: 6px; }
.hero-start h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
.team-group { display: grid; gap: 8px; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.team-btn {
  min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; text-align: left; padding: 8px 14px;
  box-shadow: var(--shadow); overflow-wrap: anywhere;
}
.team-btn:active { transform: scale(.98); }
.team-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.notice { display: grid; gap: 12px; padding: 16px; }
.notice h2 { font-size: 1.4rem; }
.notice ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.notice details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Mein Team ---------- */
.team-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.team-head h1 { font-size: clamp(2rem, 10vw, 2.9rem); overflow-wrap: anywhere; }
.team-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.status {
  border-radius: 18px; padding: 16px; display: grid; gap: 14px; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.status.state-live { border-color: var(--live); box-shadow: 0 0 0 2px var(--live), var(--shadow); }
.status.state-next { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.status-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.status-title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.countdown { text-align: right; flex: none; }
.countdown b { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .75rem; color: var(--muted); }
.where { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.where-field { font-family: var(--font-display); font-weight: 700; font-size: 3.1rem; line-height: .9; }
.where-field small { display: block; font-size: .8rem; font-family: var(--font-body); font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.where-side { display: grid; gap: 4px; min-width: 0; }
.side-line { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; }
.vs { font-size: .95rem; overflow-wrap: anywhere; }
.vs b { font-family: var(--font-display); font-size: 1.15rem; }
.status-foot { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }

.mini-hall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--floor); padding: 8px; border-radius: 10px; }
.mini-court { display: grid; grid-template-rows: 1fr 2px 1fr; height: 64px; border-radius: 4px; overflow: hidden; border: 1.5px solid var(--court-line); background: var(--court); position: relative; }
.mini-court .h { display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .8rem; color: var(--muted); }
.mini-court .n { background: var(--net); }
.mini-court .h.on-a { background: var(--side-a); color: var(--on-side); }
.mini-court .h.on-b { background: var(--side-b); color: var(--on-side); }
.mini-label { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); margin-top: 3px; letter-spacing: .05em; }
.mini-tribune { grid-column: 1 / -1; text-align: center; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 2px dashed var(--floor-line); padding-top: 4px; }

.alarm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.alarm-row .lbl { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; }
.dot-ok { width: 10px; height: 10px; border-radius: 50%; background: var(--win); flex: none; }
.dot-off { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }

.game-list { display: grid; }
.game {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 12px 14px; border-top: 1px solid var(--line);
}
.game:first-child { border-top: 0; }
.game-time { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.game-time small { display: block; font-family: var(--font-body); font-size: .7rem; color: var(--muted); font-weight: 600; }
.game-main { min-width: 0; }
.game-opp { font-weight: 600; overflow-wrap: anywhere; }
.game-sub { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.game-res { text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.game-res small { display: block; font-family: var(--font-body); font-size: .7rem; font-weight: 700; letter-spacing: .06em; }
.res-w { color: var(--win); }
.res-l { color: var(--muted); }

/* ---------- Tabellen ---------- */
.table-card { overflow: hidden; }
.table-card h3 { font-size: 1.2rem; padding: 12px 14px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.table-card .sub { padding: 0 14px 8px; font-size: .78rem; color: var(--muted); }
.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 6px 8px; }
.standings th:nth-child(2) { text-align: left; }
.standings td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: right; font-size: .95rem; }
.standings td.rank { width: 34px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; position: relative; }
.standings td.rank::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 3px 3px 0; background: transparent; }
.standings tr.q-H td.rank::before, .standings tr.q-K td.rank::before { background: var(--win); }
.standings tr.q-T td.rank::before { background: var(--side-b); }
.standings td.team { text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.standings td.team small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.standings td.pts { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.standings tr.me td { background: var(--accent-soft); }
.standings tr.placeholder td.team { color: var(--muted); font-style: italic; font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.bracket { display: grid; gap: 14px; }
.bracket-col { display: grid; gap: 8px; align-content: center; }
.bracket-col h3 { font-size: 1.05rem; }
.ko-card { padding: 10px 12px; display: grid; gap: 4px; }
.ko-head { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); font-weight: 600; }
.ko-line { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.ko-line span:first-child { overflow-wrap: anywhere; min-width: 0; }
.ko-line.tbd span:first-child { color: var(--muted); font-style: italic; font-weight: 500; }
.ko-line.won { color: var(--win); }
.ko-line.me span:first-child { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }
@media (min-width: 600px) { .bracket { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Halle ---------- */
.hall { background: var(--floor); border-radius: var(--radius); padding: 10px 10px 0; display: grid; gap: 8px; border: 1px solid var(--floor-line); }
.hall-wall { display: flex; justify-content: space-between; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.courts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.court-wrap { display: grid; gap: 5px; min-width: 0; }
.court-label { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; }
.court-label b { font-family: var(--font-display); font-size: 1.05rem; }
.court-label span { font-size: .7rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.court {
  display: grid; grid-template-rows: minmax(0, 1fr) 4px minmax(0, 1fr);
  aspect-ratio: 9 / 17; max-width: 100%;
  border: 2px solid var(--court-line); border-radius: 6px; overflow: hidden; background: var(--court); position: relative;
}
.half { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 6px 4px; text-align: center; position: relative; min-width: 0; }
.half.b { background: var(--side-b-soft); }
.half.a { background: var(--side-a-soft); }
.half .side-badge { position: absolute; top: 5px; left: 5px; width: 18px; height: 18px; font-size: .72rem; border-radius: 5px; }
.half.a .side-badge { top: auto; bottom: 5px; }
.half-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(.82rem, 3.6vw, 1.1rem); line-height: 1.05; overflow-wrap: anywhere; hyphens: auto; }
.half-name.tbd { color: var(--muted); font-weight: 600; font-style: italic; }
.half-score { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.half.mine { box-shadow: inset 0 0 0 3px var(--fg); }
.half.mine::after { content: "IHR"; position: absolute; top: 4px; right: 4px; font-size: .6rem; font-weight: 800; letter-spacing: .08em; background: var(--fg); color: var(--bg); padding: 1px 5px; border-radius: 4px; }
.half.a.mine::after { top: auto; bottom: 4px; }
.net { background: var(--net); position: relative; }
.net::before, .net::after { content: ""; position: absolute; top: -3px; width: 4px; height: 10px; background: var(--net); border-radius: 2px; }
.net::before { left: -2px; } .net::after { right: -2px; }
.court.idle .half { background: transparent; }
.court-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 8px; }
.court-foot { font-size: .72rem; text-align: center; color: var(--muted); font-weight: 600; min-height: 1.2em; }
.court-foot.live { color: var(--live); }
.tribune {
  margin: 4px -10px 0; padding: 10px; border-radius: 0 0 var(--radius) var(--radius); text-align: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  background: repeating-linear-gradient(90deg, var(--surface-2) 0 14px, var(--surface) 14px 16px);
  border-top: 1px solid var(--floor-line);
}
.hall-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); }
.hall-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Spielplan ---------- */
.phase { display: grid; gap: 10px; scroll-margin-top: 80px; }
.phase-head { display: grid; gap: 2px; }
.phase-head h2 { font-size: 1.5rem; }
.phase-head p { margin: 0; font-size: .82rem; color: var(--muted); }
.slot { display: grid; gap: 8px; scroll-margin-top: 80px; }
.slot-head { display: flex; align-items: center; gap: 8px; }
.slot-time { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.slot-exp { font-size: .78rem; color: var(--muted); }
.slot-games { display: grid; gap: 8px; }
@media (min-width: 560px) { .slot-games.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .slot-games.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg { padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.pg.live { border-color: var(--live); }
.pg.mine { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pg.dim { opacity: .38; }
.pg-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.pg-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pg-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.2; }
.pg-name.tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.pg-score { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.pg-line.won .pg-name, .pg-line.won .pg-score { color: var(--win); }
.break { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.break::before, .break::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* ---------- Alarm-Overlay ---------- */
.alarm {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background: rgb(8 14 20 / .55); backdrop-filter: blur(4px);
}
.alarm-card {
  width: min(440px, 100%); border-radius: 22px; padding: 24px 20px 20px; display: grid; gap: 14px; text-align: center;
  background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / .35); border: 3px solid var(--accent);
  animation: pop .35s ease-out;
}
.alarm-card.haupt { border-color: var(--live); }
.alarm-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.alarm-card.haupt .alarm-kicker { color: var(--live); }
.alarm-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 11vw, 3.2rem); line-height: .95; }
.alarm-field { display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; flex-wrap: wrap; }
.alarm-ring { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--accent); display: grid; place-items: center; animation: ring 1s infinite; }
.alarm-card.haupt .alarm-ring { background: var(--live); }
.alarm-ring svg { width: 32px; height: 32px; color: #fff; }
@keyframes ring { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-14deg) } 40% { transform: rotate(12deg) } 60% { transform: rotate(-8deg) } }
@keyframes pop { from { transform: scale(.92); opacity: 0 } to { transform: none; opacity: 1 } }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.is-admin .toast-wrap { bottom: 20px; }
.toast { background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow); max-width: 520px; animation: pop .25s ease-out; }

/* ---------- Turnierleitung ---------- */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 230px minmax(0, 1fr); } .slot-list { max-height: 46vh; } }
@media (min-width: 1200px) { .admin-grid { grid-template-columns: 240px minmax(0, 1fr) 300px; } .slot-list { max-height: calc(100vh - 200px); } }
.slot-list { display: grid; gap: 4px; padding: 8px; max-height: calc(100vh - 220px); overflow-y: auto; }
@media (max-width: 899px) { .slot-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; max-height: none; } }
.slot-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; text-align: left;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent;
}
.slot-item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.slot-item b { font-family: var(--font-display); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.slot-item span { font-size: .8rem; color: var(--muted); }
.progress { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.progress.full { background: var(--win-soft); color: var(--win); }
.slot-phase { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }

.entry-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .entry-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .entry-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.entry { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.entry.saved { border-color: var(--win); }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.entry-head b { font-family: var(--font-display); font-size: 1.35rem; }
.entry-head span { font-size: .78rem; color: var(--muted); font-weight: 600; text-align: right; }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.score-team { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.score-team span:last-child { overflow-wrap: anywhere; }
.score-input {
  width: 4.2ch; min-height: 56px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 2rem;
  border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.tie-box { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--side-b-soft); font-size: .85rem; font-weight: 600; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.entry-actions .btn-primary { flex: 1; min-width: 140px; }
.entry-msg { font-size: .8rem; color: var(--win); font-weight: 600; }
.entry-locked { font-size: .85rem; color: var(--muted); }

.log { padding: 12px 14px; display: grid; gap: 10px; }
.log h3 { font-size: 1.15rem; }
.log-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; font-size: .84rem; padding-top: 8px; border-top: 1px solid var(--line); }
.log-item b { font-family: var(--font-display); font-size: 1rem; font-variant-numeric: tabular-nums; }
.log-item .k { font-weight: 700; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.log-item .k.vor { color: var(--accent); }
.log-item .k.haupt { color: var(--live); }
.log-item.past { opacity: .6; }
.delay { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }

.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; width: 100%; }
.field .hint { font-size: .75rem; color: var(--muted); }
.class-groups { display: grid; gap: 12px; }
@media (min-width: 700px) { .class-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .class-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.class-card { padding: 14px; display: grid; gap: 8px; }
.class-card h3 { font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 359px) {
  .standings .col-s { display: none; }
  .where-field { font-size: 2.6rem; }
}

/* ---------- Laufende Spiele kräftig hervorheben ---------- */
.court.is-live { border-color: var(--live); box-shadow: 0 0 0 2px var(--live), 0 6px 18px rgb(212 42 63 / .25); }
.court.is-live .half.b { background: var(--side-b); color: var(--on-side); }
.court.is-live .half.a { background: var(--side-a); color: var(--on-side); }
.court.is-live .half .side-badge { background: var(--on-side); color: var(--fg); }
.court.is-live .half.b .side-badge { color: var(--side-b); }
.court.is-live .half.a .side-badge { color: var(--side-a); }
.court.is-live .half.mine { box-shadow: inset 0 0 0 3px var(--on-side); }
.court.is-live .half.mine::after { background: var(--on-side); color: var(--fg); }
.half-score { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 7vw, 2.1rem); line-height: 1; font-variant-numeric: tabular-nums; }
.live-chip, .court-label .live-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 5px;
  background: var(--live); color: #fff; font-size: .62rem; font-weight: 800 !important; letter-spacing: .08em;
}
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.court-foot.live { font-weight: 700; }
.pg-line.is-live .pg-score { color: var(--live); }
.ko-card.live { border-color: var(--live); box-shadow: 0 0 0 2px var(--live), var(--shadow); }
.live-score-line { font-size: .95rem; }
.live-score-line b { font-family: var(--font-display); font-size: 1.3rem; color: var(--live); font-variant-numeric: tabular-nums; }
.back-link {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-weight: 600;
}
.standings td.team small.undecided { color: var(--side-b); font-weight: 600; }

/* ---------- Anpfiff (Turnierleitung) ---------- */
.kick { padding: 16px; display: grid; gap: 12px; }
.kick.is-running { border-color: var(--live); box-shadow: 0 0 0 2px var(--live), var(--shadow); }
.kick-btn {
  width: 100%; min-height: 76px; border: 0; border-radius: 16px; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1; box-shadow: var(--shadow);
}
.kick-btn svg { width: 34px; height: 34px; flex: none; }
.kick-btn span { display: grid; gap: 4px; text-align: left; }
.kick-btn small { font-family: var(--font-body); font-weight: 600; font-size: .85rem; opacity: .9; }
.kick-btn:active { transform: scale(.99); }
.kick-main { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.kick-title { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.kick-sub { font-size: .88rem; color: var(--muted); }
.kick-sub b { color: var(--fg); font-variant-numeric: tabular-nums; }
.kick-clock { text-align: right; }
.kick-clock b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--live); font-variant-numeric: tabular-nums; }
.kick-clock span { font-size: .75rem; color: var(--muted); }
.kick-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.kick-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.kick-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.kick-foot .neg { color: var(--live); font-weight: 700; }
.confirm-box { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { font-family: var(--font-display); font-size: 1.6rem; min-width: 4ch; text-align: center; }
.stepper .btn { min-width: 44px; font-size: 1.2rem; }
.is-admin .kick { margin-bottom: 0; }

/* ---------- Ungefähre Zeiten (Schüler) ---------- */
.countdown .time-ca { font-size: 1.7rem; }
.countdown .rest { display: block; margin-top: 6px; font-size: .85rem; font-weight: 700; color: var(--live); }
.net-chip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; box-shadow: 0 0 0 2px var(--court); }
.half.b { padding-top: 24px; }
.half.a { padding-bottom: 24px; }

/* ---------- Gleichstand-Auswahl ---------- */
.tie-btn { min-height: 48px; flex: 1 1 140px; }
.tie-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Letzter Aufruf ---------- */
.recall-link { color: var(--live); }
.recall-info { font-size: .8rem; font-weight: 700; color: var(--live); }
.recall-box { background: var(--side-b-soft); }
.alarm.last { background: var(--live); backdrop-filter: none; animation: last-flash 1s steps(2, start) 4; }
@keyframes last-flash { 50% { background: #8f1424; } }
.last-card { width: min(460px, 100%); display: grid; gap: 14px; text-align: center; color: #fff; }
.last-ring { background: #fff; margin: 0 auto; }
.last-ring svg { color: var(--live); }
.last-kicker { font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.alarm.last .alarm-title { color: #fff; font-size: clamp(2.4rem, 12vw, 3.6rem); }
.alarm.last .alarm-field { color: #fff; flex-direction: column; gap: 4px; }
.last-warn { margin: 0; padding: 14px; border-radius: 14px; background: rgb(0 0 0 / .22); font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.last-btn { background: #fff; color: #8f1424; border-color: #fff; min-height: 54px; font-size: 1.1rem; }
.entry-grid { align-items: start; }

/* ---------- Feld + Seite groß (Mein Team und Alarme) ---------- */
.field-block { display: grid; gap: 4px; }
.field-big { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 11vw, 3rem); line-height: 1; }
.side-badge.big { width: 1.15em; height: 1.15em; font-size: inherit; border-radius: .22em; }
.field-block .vs { font-size: 1.05rem; }
.status-sub { font-size: .95rem; margin-top: 4px; color: var(--fg); }
.status-sub b { font-family: var(--font-display); font-size: 1.15rem; }
.group-line { font-size: .88rem; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.alarm-card .field-block, .last-card .field-block { justify-items: center; }
.last-card .field-block .vs { color: #fff; }
.last-card .mini-hall { text-align: center; }
.last-card .mini-label, .last-card .mini-tribune { color: var(--muted); }

/* ---------- Turnierleitung schlank ---------- */
.kick-bar { padding: 12px 16px; display: grid; gap: 10px; }
.kick-bar.is-running { border-color: var(--live); box-shadow: 0 0 0 2px var(--live), var(--shadow); }
.kick-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.kick-info { flex: 1; min-width: 200px; }
.kick-bar .kick-title { font-size: 1.35rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kick-timer { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--live); font-variant-numeric: tabular-nums; }
.kick-bar .kick-btn { min-height: 68px; font-size: 1.7rem; }
.menu-box { justify-items: start; gap: 8px; }
.menu-box .kick-foot { border-top: 0; padding-top: 0; }
.results-head { flex-wrap: wrap; align-items: center; }
.results-phase { font-family: var(--font-body); font-size: .9rem; font-weight: 600; }
.pager { display: flex; gap: 6px; }
.pager .icon-btn { font-size: 1.3rem; min-width: 44px; }
.pager .icon-btn[disabled] { opacity: .35; cursor: default; }
.entry-head .ok { color: var(--win); font-weight: 700; }
.entry-actions .icon-btn { font-size: 1.2rem; }
.missing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--side-b); }
.drawer-tab {
  position: fixed; right: env(safe-area-inset-right, 0px); top: 45%; z-index: 25;
  display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px 0 0 12px;
  border: 1px solid var(--line); border-right: 0; background: var(--surface); box-shadow: var(--shadow);
  font-size: .75rem; font-weight: 700; color: var(--accent);
}
.drawer-tab svg { width: 20px; height: 20px; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 35; width: min(360px, 92vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgb(0 0 0 / .18);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(14px, env(safe-area-inset-right, 0px)) 20px 14px;
  animation: slide-in .2s ease-out;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { font-size: 1.3rem; }
.drawer .log { padding: 0; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-tab { top: auto; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: calc(16px + env(safe-area-inset-right, 0px));
  grid-auto-flow: column; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; border-right: 1px solid var(--line); font-size: .9rem; }

/* ---------- Verbindung und Anmeldung ---------- */
.live-pill.offline { background: var(--side-b-soft); color: var(--side-b); }
.live-pill.offline .live-dot { background: var(--side-b); animation: none; }
.login { max-width: 440px; margin: 24px auto 0; padding: 20px; display: grid; gap: 14px; }
.login h1 { font-size: 2rem; }
.login-form { grid-template-columns: 1fr !important; }
.login-msg { margin: 0; min-height: 1.2em; color: var(--live); font-weight: 600; font-size: .9rem; }
.logout-chip { margin-left: auto; }

/* ---------- Disqualifizieren ---------- */
.tag.dq { background: var(--live); color: #fff; }
.standings td.team small.dq-note { color: var(--live); font-weight: 700; }
.dq-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dq-link { justify-self: start; color: var(--muted); font-size: .82rem; }
.dq-btn { background: var(--live); border-color: var(--live); color: #fff; }
.status.state-dq { border-color: var(--live); }

/* ---------- Zeitplan-Ampel ---------- */
.time-light { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: .88rem; line-height: 1.35; }
.time-light i { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; }
.time-light.green { background: var(--win-soft); }
.time-light.green i { background: var(--win); }
.time-light.yellow { background: var(--side-b-soft); }
.time-light.yellow i { background: var(--side-b); }
.time-light.red { background: var(--live); color: #fff; }
.time-light.red i { background: #fff; }

/* ---------- Datenschutz-Hinweis ---------- */
.privacy-note { margin: 8px 0 0; font-size: .75rem; line-height: 1.45; color: var(--muted); }
.privacy-note a { color: var(--muted); }

/* ---------- Teamalarm (Web Push) ---------- */
.small { font-size: .8rem; }
.notice ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.push-on .lbl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.consent { margin: 0; font-size: .85rem; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.privacy-note p { margin: 8px 0 0; }
.privacy-details { font-size: .8rem; line-height: 1.45; }
.privacy-details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.privacy-details p { margin: 6px 0 0; }
.kick-bar.is-overdue { box-shadow: 0 0 0 2px var(--live), var(--shadow); }
.kick-remind { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--live); color: #fff; font-size: .92rem; line-height: 1.35; }
.kick-remind .btn { background: #fff; color: var(--nl-navy); border-color: #fff; }
.kick-remind .btn-primary { background: var(--nl-navy); color: #fff; border-color: var(--nl-navy); }
.kick-btn:disabled { opacity: .7; cursor: progress; }
.ok { color: var(--win); font-weight: 700; }
.push-card { display: grid; gap: 10px; padding: 14px 16px; }
.push-sum { display: grid; gap: 4px; font-size: .85rem; line-height: 1.4; }
.push-zero { color: var(--live); font-weight: 600; }
.push-errs { color: var(--side-b); }
.push-count { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-weight: 700; color: var(--win); }
.push-count svg { width: 13px; height: 13px; }
.push-count.zero { color: var(--live); }
