/* Dart Live – mobile-first, dunkles Theme */
:root {
  --bg: #0f1720;
  --bg-2: #16212d;
  --card: #1c2937;
  --card-2: #233344;
  --line: #2e4053;
  --text: #e8eef4;
  --muted: #93a4b5;
  --accent: #22c55e;      /* Dartboard-Grün */
  --accent-2: #16a34a;
  --red: #ef4444;         /* Dartboard-Rot */
  --amber: #f59e0b;
  --blue: #38bdf8;
  --radius: 14px;
  --tap: 48px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .25);
  --topbar-height: 57px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.center { text-align: center; }
.inline { display: inline; }

/* ---------- Kopfzeile & Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .9rem; padding-top: max(.5rem, env(safe-area-inset-top));
  background: rgba(15, 23, 32, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--red) 0 22%, #fff 23% 32%, var(--accent) 33% 55%, #111 56% 100%); box-shadow: 0 0 0 2px #fff2; }
.mainnav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; min-width: 0; }
.mainnav a, .linkbtn {
  color: var(--text); text-decoration: none; padding: .55rem .75rem; border-radius: 10px;
  background: none; border: 0; font: inherit; cursor: pointer; min-height: 40px;
}
.mainnav a[aria-current], .mainnav a:hover, .linkbtn:hover { background: var(--card); }
/* Menü-Button: nur auf schmalen Bildschirmen sichtbar (layout.js schaltet is-menu-open). */
.menu-toggle { display: none; }
@media (max-width: 759px) {
  /* Auf Handys nicht sticky: die aufgeklappte Navigation frisst sonst den Inhalt.
     position: relative dient nur noch als Anker für das Dropdown. */
  .topbar { position: relative; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: var(--tap); min-height: var(--tap);
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer;
  }
  .mainnav { display: none; }
  .topbar.is-menu-open .mainnav {
    display: flex; flex-direction: column; align-items: stretch; gap: .15rem;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    background: var(--bg-2); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .5rem .75rem;
  }
  .topbar.is-menu-open .mainnav a, .topbar.is-menu-open .mainnav .linkbtn { text-align: left; }
  .topbar.is-menu-open .mainnav form { width: 100%; }
}
@media (max-width: 560px) {
  .topbar, .mainnav { flex-wrap: wrap; }
}
.token-new svg { max-width: 100%; height: auto; }
.subnav {
  display: flex; flex-wrap: wrap; gap: .25rem; padding: .5rem .9rem;
  background: var(--bg-2); border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.subnav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; }
.subnav a[aria-current] { background: var(--accent); color: #04120a; font-weight: 600; }

.container { max-width: 1280px; margin: 0 auto; padding: 1rem .75rem 3rem; }
.page-title { font-size: 1.45rem; margin: .25rem 0 1rem; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head .page-title { margin: 0; }
.section-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.4rem 0 .6rem; }
.past-divider { border-top: 2px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

/* ---------- Karten, Listen ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.card > summary { cursor: pointer; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary:not(.btn)::before { content: "▸ "; color: var(--muted); }
details[open] > summary:not(.btn)::before { content: "▾ "; }
details[open] > summary.btn { margin-bottom: 1rem; }
.guest-request > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.guest-request > summary h2 { font-size: 1.15rem; margin: 0; }
.guest-request > summary::before { color: var(--accent); font-size: 1.3rem; }
.guest-request-hint { color: var(--accent); font-size: .85rem; font-weight: 600; margin-left: auto; }
.guest-request .when-open { display: none; }
.guest-request[open] .when-open { display: inline; }
.guest-request[open] .when-closed { display: none; }
.guest-request[open] > summary { margin-bottom: 1rem; }
.guest-request > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.list { display: flex; flex-direction: column; gap: .5rem; padding: 0; margin: 0 0 1rem; list-style: none; }
.online-seat { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-bottom: 1rem; }
.online-seat:last-child { margin-bottom: 0; }
.online-game { display: grid; gap: .4rem; }
.online-game .actions { margin: 0 0 .65rem .25rem; }
.list-item {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem;
}
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: .2rem 0; }
.empty { text-align: center; color: var(--muted); }

/* Private messages: mailbox folders, conversation list and replies. */
.pm-layout { display: grid; gap: 1rem; align-items: start; }
.pm-sidebar, .pm-main { min-width: 0; }
.pm-sidebar h2 { overflow-wrap: anywhere; }
.pm-folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin-top: 1rem; }
.pm-folders a { padding: .65rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.pm-folders a:hover, .pm-folders a[aria-current] { background: var(--card-2); }
.pm-folders a[aria-current] { box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
.pm-thread { display: block; color: var(--text); text-decoration: none; border-left: 4px solid var(--line); overflow-wrap: anywhere; }
.pm-thread:hover, .pm-thread:focus-visible { background: var(--card-2); border-color: var(--blue); }
.pm-thread.is-unread { border-left-color: var(--accent); }
.pm-thread-top, .pm-message header, .pm-list-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.pm-thread h3 { margin: .6rem 0 .35rem; }
.pm-preview { margin: 0; }
.pm-thread-heading { overflow-wrap: anywhere; }
.pm-thread-heading h2 { margin-top: 1rem; }
.pm-conversation { display: grid; }
.pm-message { min-width: 0; overflow-wrap: anywhere; border-left: 3px solid var(--blue); }
.pm-message.is-mine { border-left-color: var(--accent); background: var(--bg-2); }
.pm-message .message-text { margin-bottom: 0; }
.pm-compose { margin-top: 1rem; }
.pm-empty { padding: 2rem 1rem; text-align: center; }
@media (min-width: 800px) {
  .pm-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .pm-folders { grid-template-columns: 1fr; }
}

/* System messages and lightweight presence. */
.system-notice { position: relative; padding: 1rem 3.5rem 1rem 1rem; margin-bottom: 1rem; border: 2px solid var(--blue); border-left-width: 5px; border-radius: var(--radius); background: #38bdf80c; overflow-wrap: anywhere; }
.system-notice-warning { border-color: var(--red); background: #ef44440c; }
.system-notice p { margin: .5rem 0 0; }
.system-notice[hidden] { display: none; }
.notice-close { position: absolute; right: .25rem; top: .25rem; width: 44px; height: 44px; color: var(--text); background: transparent; border: 0; border-radius: 8px; font-size: 1.6rem; cursor: pointer; }
.notice-close:hover, .notice-close:focus-visible { background: var(--card-2); }
.online-panel { margin-top: 1rem; margin-bottom: 1rem; padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.online-panel summary { font-size: .9rem; }
.online-panel ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.online-panel li { border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; overflow-wrap: anywhere; max-width: 100%; }
.online-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .4rem; background: var(--accent); }
.maintenance-page { max-width: 720px; margin: 3rem auto; text-align: center; padding: clamp(1rem, 4vw, 3rem); }
.maintenance-symbol { font-size: 3rem; color: var(--blue); }
.maintenance-countdown { font-size: clamp(1.25rem, 5vw, 2.5rem); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--blue); }

/* Forum: topic board and author columns, without a framework. */
.forum-board { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; margin-bottom: 1.25rem; }
.forum-board-heading { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: 1rem; background: var(--card-2); }
.forum-board-heading h2 { margin: 0; }
.forum-board-heading > span { font-size: .8rem; }
.forum-topic { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: 1rem; border-top: 1px solid var(--line); }
.forum-topic:hover { background: var(--bg-2); }
.forum-topic h3 { margin: 0; line-height: 1.5; }
.forum-topic h3 a { text-decoration: none; overflow-wrap: anywhere; }
.forum-topic p { margin: .25rem 0 0; }
.forum-topic-icon { color: var(--blue); font-size: 1.7rem; text-align: center; }
.forum-replies { display: flex; flex-direction: column; text-align: center; }
.forum-replies strong { font-size: 1.25rem; }
.forum-last { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .35rem .6rem; }
.page-forum .conversation { display: grid; gap: .75rem; }
.forum-post { display: grid; gap: .75rem; margin: 0; }
.forum-author { padding-bottom: .5rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.forum-author strong { display: block; color: var(--blue); }
.forum-author time { display: block; margin-top: .35rem; }
@media (min-width: 760px) {
  .forum-topic { grid-template-columns: 2.5rem minmax(0, 1fr) 6rem 13rem; gap: 1rem; }
  .forum-last { grid-column: auto; display: flex; flex-direction: column; gap: .2rem; }
  .forum-post { grid-template-columns: 11rem minmax(0, 1fr); }
  .forum-author { border: 0; border-right: 1px solid var(--line); padding-right: 1rem; padding-bottom: 0; }
}
@media print { .online-panel, .notice-close { display: none; } }

/* Global notepad: outside page-specific containers that Live/Scorer redraw. */
.notepad { position: fixed; right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 75; }
.notepad[hidden], .notepad-panel[hidden] { display: none; }
.notepad [hidden] { display: none !important; }
.notepad > .btn { float: right; box-shadow: var(--shadow); }
.notepad-panel { display: flex; flex-direction: column; gap: .45rem; width: min(25rem, calc(100vw - 2.5rem)); max-height: calc(100dvh - 5.5rem); overflow-y: auto; padding: 1rem; margin-bottom: .5rem; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.notepad-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.notepad-heading h2, .notepad-panel p { margin: 0; }
#notepad-personal > p { margin-bottom: .45rem; }
#notepad-team-notes { display: grid; gap: .6rem; overflow-wrap: anywhere; }
.notepad-team-note { margin: 0; padding: .75rem; }
.notepad-team-note .message-text { margin-top: .5rem; }
.notepad-panel textarea { width: 100%; min-height: 9rem; height: 28dvh; resize: vertical; flex-shrink: 0; }
.notepad-unsaved #notepad-toggle { border-color: var(--amber); }
body:has(.notepad) > main { padding-bottom: 5.5rem; }
@media print { .notepad { display: none !important; } }

/* ---------- Buttons & Badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .6rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .05s, background .15s;
}
.btn:hover { background: #2b3f54; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04120a; }
.btn-primary:hover { background: #34d46c; }
.btn-danger { background: transparent; border-color: var(--red); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, .15); }
.btn-small { min-height: 38px; padding: .35rem .8rem; font-size: .9rem; }
.btn-big { min-height: 58px; font-size: 1.1rem; flex: 1; }
.btn-block { width: 100%; }
.badge {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle;
}
.badge-live { background: var(--red); color: #fff; border-color: var(--red); animation: pulse 1.6s infinite; }
.badge-planned { color: var(--blue); border-color: #1e4f66; }
.badge-finished { color: var(--accent); border-color: #1d5133; }
.badge-board { color: var(--amber); border-color: #6b4a10; }
.badge-perm { font-weight: 500; }
.badge-player { color: var(--blue); border-color: #1e4f66; font-weight: 500; }
.badge-user { color: var(--accent); border-color: #1d5133; font-weight: 500; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Meldungen ---------- */
.flash { padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: rgba(34, 197, 94, .12); border-color: #1d5133; }
.flash-error { background: rgba(239, 68, 68, .12); border-color: #7f1d1d; }
#toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translate(-50%, 150%);
  background: var(--card-2); border: 1px solid var(--line); padding: .8rem 1.2rem; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 100; transition: transform .2s; max-width: calc(100% - 2rem);
}
#toast:not(.show) { pointer-events: none; visibility: hidden; }  /* ausgeblendet keine Klicks abfangen */
#toast.show { transform: translate(-50%, 0); }
#toast.toast-ok { border-color: var(--accent); }
#toast.toast-error { border-color: var(--red); }
body.offline .topbar { border-bottom-color: var(--red); }
body.offline .topbar::after { content: "offline – versuche erneut …"; color: #fca5a5; font-size: .8rem; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: .8rem; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .55rem .75rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-size: 1rem;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); min-height: var(--tap); }
label.check input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
label.check.disabled { opacity: .5; }
.perms { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .9rem; display: grid; gap: 0; margin: 0; }
.perms legend { color: var(--muted); padding: 0 .3rem; font-size: .9rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: .8rem; }
.inline-form { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
/* Zeilennummern (data-line-numbers): Gutter überdeckt den linken Rand des
   Textareas (absolute, beeinflusst keine Größe), Zeilenhöhe 1:1. */
.line-area { position: relative; }
.line-area textarea { padding-left: 3rem; line-height: 1.45; }
.line-numbers {
  position: absolute; left: 0; top: 0; bottom: 0; pointer-events: none;
  border: 1px solid var(--line); border-radius: 10px 0 0 10px;
  background: var(--bg-2); color: var(--muted); padding: .55rem .5rem;
  font-size: 1rem; line-height: 1.45; text-align: right; white-space: pre;
  font-variant-numeric: tabular-nums; overflow: hidden; user-select: none;
}
.inline-form .grow { flex: 1; min-width: 200px; }
.danger-zone { border-color: #5b1f1f; }

/* Historische Spielergebnisse: gleicher Heim-/Gast-Aufbau wie im Spielbericht. */
.backfill-game { scroll-margin-top: 5rem; }
.backfill-double { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .8rem; }
.backfill-double input { display: block; width: 7rem; }
.backfill-legs { margin: .7rem 0; }
.backfill-leg { display: grid; grid-template-columns: 2.5rem repeat(4, minmax(0, 1fr)); gap: .35rem; align-items: center; margin: .4rem 0; }
.backfill-leg input { width: 100%; min-width: 0; padding: .45rem; }
.backfill-labels { font-size: .8rem; color: var(--muted); }
.backfill-mobile-label { display: none; }
@media (max-width: 520px) {
  .backfill-labels { display: none; }
  .backfill-leg { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .backfill-leg > span:first-child { grid-column: 1 / -1; font-weight: 700; }
  .backfill-mobile-label { display: block; font-size: .8rem; color: var(--muted); }
}

/* ---------- Spieltag-Übersicht ---------- */
.match-list { display: grid; gap: .75rem; }
.match-tile {
  display: block; text-decoration: none; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; transition: border-color .15s, transform .1s;
}
.match-tile:hover { border-color: var(--accent); }
.match-tile.status-live { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.match-tile-head, .match-tile-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.match-tile-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin: .5rem 0; }
.match-tile .team { font-weight: 700; }
.match-tile .team-away { text-align: right; }
.match-tile .score { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Scoreboard ---------- */
.match-head { position: sticky; top: var(--topbar-height); z-index: 10; }
.match-head .scoreboard { position: static; }
.points-chart { position: static; margin-top: .6rem; }
.points-chart summary { font-weight: 700; cursor: pointer; }
.points-chart-scroll { overflow-x: auto; margin-top: .8rem; }
.points-chart svg { display: block; width: 100%; min-width: 520px; height: auto; }
.points-grid { stroke: var(--line); fill: var(--muted); font-size: 11px; }
.points-grid text { stroke: none; }
.points-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.points-H { stroke: var(--accent); }
.points-G { stroke: var(--blue); }
.points-marker.points-H { fill: var(--accent); }
.points-marker.points-G { fill: var(--blue); }
.points-legend { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .8rem; }
.points-home { color: var(--accent); }
.points-away { color: var(--blue); }
.match-events:empty { display: none; }
.match-events { display: grid; gap: .4rem; max-height: 35vh; overflow-y: auto; margin-bottom: .5rem; }
.match-event { padding: .65rem .8rem; background: #243747; border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.match-event { position: relative; padding-right: 3rem; }
.event-dismiss { position: absolute; right: .3rem; top: .3rem; min-width: 2.5rem; min-height: 2.5rem; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font-size: 1.5rem; cursor: pointer; }
.event-dismiss:hover, .event-dismiss:focus-visible { background: #ffffff20; }
.match-event p { margin: .25rem 0; }
.match-event .actions { margin-top: .4rem; }
.match-event-status { font-weight: 700; }
.match-event.accepted { border-color: #4ade80; }
.match-event.rejected { border-color: #fb7185; }
body.tv .match-head { top: 0; }
@media print { .match-head { position: static; } .match-events { display: none; } }
.scoreboard {
  position: sticky; top: var(--topbar-height); z-index: 10;
  background: linear-gradient(180deg, #1d2d3d, #172433); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow);
}
/* Auf Handys ist die Topbar nicht sticky (Menü-Button, siehe oben) → Sticky-Elemente
   kleben an der echten Seitenoberkante. Steht nach den Basisregeln, damit es gewinnt. */
@media (max-width: 759px) {
  .match-head, .scoreboard { top: 0; }
}
.scoreboard.status-live { border-color: #7f1d1d; }
.sb-meta, .sb-sub { display: flex; flex-wrap: wrap; gap: .4rem .9rem; justify-content: center; font-size: .85rem; color: var(--muted); }
.sb-sub b { color: var(--text); }
.sb-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .6rem; margin: .4rem 0; }
/* Nur zwischen Wörtern umbrechen; zu lange Einzelwörter mit Silbentrennung (lang="de"). */
.sb-team { font-weight: 700; font-size: 1rem; overflow-wrap: break-word; hyphens: auto; line-height: 1.2; text-wrap: balance; }
.sb-team.lead { color: var(--accent); }
.sb-away { text-align: right; }
.sb-score { font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; gap: .3rem; }
.sb-score .sep { color: var(--muted); }

.live-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.tabs { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
.tabs button {
  flex: none; min-height: 40px; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; cursor: pointer;
}
.tabs button.active { background: var(--text); color: var(--bg); font-weight: 700; }
.tabs .count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }

/* ---------- Spielkarten (Live) ---------- */
.game-grid { display: grid; gap: .6rem; }
.game { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; }
.game.is-running { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.game.is-finished { opacity: .92; }
.game.flash-update { animation: flashUpdate 1.2s ease-out; }
@keyframes flashUpdate { from { background: #2f4a2f; } }
.game-head { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.game-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .3rem; }
.game.is-current { outline: 2px solid var(--blue); }
.game.can-enter { cursor: pointer; }
.game.can-enter:hover { border-color: var(--blue); }
.game.can-enter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-row { display: flex; justify-content: space-between; gap: .6rem; padding: .2rem 0; }
.game-row .names { overflow-wrap: anywhere; }
.game-row .player-name { display: block; overflow-wrap: break-word; }
.game-row .legs-count { font-weight: 800; font-size: 1.2rem; min-width: 1.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.game-row.won { color: var(--accent); font-weight: 700; }
.game-row.lost { color: var(--muted); }
.game details { margin-top: .4rem; font-size: .85rem; }
.game summary { color: var(--muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }

.lineup { margin-top: 1.4rem; }
.lineup-grid { display: grid; gap: 1rem; margin-top: .8rem; }
.slot { display: inline-block; min-width: 2.6em; font-weight: 700; color: var(--amber); }

/* ---------- Admin ---------- */
.tile-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1.5rem; }
.tile {
  display: grid; gap: .2rem; padding: 1.1rem; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.tile:hover { border-color: var(--accent); }
.tile-icon { font-size: 1.6rem; }
.split { display: grid; gap: 1rem; }
.nav-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.nav-list a { display: block; padding: .6rem .7rem; border-radius: 10px; color: var(--text); text-decoration: none; }
.nav-list a[aria-current], .nav-list a:hover { background: var(--card-2); }
.player-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.player-row { display: grid; gap: .4rem; grid-template-columns: 1fr 1fr; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.player-row.inactive { opacity: .6; }
.player-row .actions, .player-row .btn-primary { grid-column: 1 / -1; }
.lineup-form { gap: .45rem; }
.lineup-row { display: grid; grid-template-columns: 2.8em 1fr; gap: .4rem; align-items: center; }
.lineup-row input { grid-column: 2; }
.lineup-row.reserve .slot { color: var(--muted); }
.grid-2-wide { display: grid; gap: 1rem; }
.user.inactive { opacity: .7; }
.user summary { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.user form { margin-top: 1rem; }
/* Mehrfachlöschung: Häkchen links neben der Karte (außerhalb des <details>). */
.user-row { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: 1rem; }
.user-row .card { flex: 1; min-width: 0; margin-bottom: 0; }
.user-row .bulk-check, .user-row .bulk-check-spacer { flex: none; width: 1.35rem; }
.user-row .bulk-check { margin-top: 1.05rem; min-height: 0; }
.bulk-delete-card { border-left: 4px solid var(--accent, #4a6fa5); }

/* ---------- Ergebniserfassung ---------- */
.status-bar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
body.editor-open { overflow: hidden; }
.editor-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
.editor {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 94vh; overflow-y: auto;
  background: var(--bg-2); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow);
}
/* Nur beim Öffnen einblenden – nicht bei jedem Neuzeichnen (sonst "zuckt" das Fenster bei jedem Tipp). */
.editor.is-opening { animation: slideUp .18s ease-out; }
@keyframes slideUp { from { transform: translateY(40px); } }
.editor-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.editor-head > div:first-child { flex: 1; }
.editor-names { font-weight: 700; }
.editor-score { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.btn-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.editor-meta { display: flex; gap: 1rem; align-items: end; margin-bottom: .8rem; }
.editor-meta label { flex: 0 0 auto; }
.board-input { width: 6em; }
.switch { display: flex !important; align-items: center; gap: .5rem; color: var(--text) !important; min-height: var(--tap); }
.switch input { width: 26px; min-height: 26px; height: 26px; accent-color: var(--red); }
.leg-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.leg-chip { padding: .5rem .8rem; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.leg-chip.has-result { background: rgba(34, 197, 94, .14); border-color: var(--accent-2); }
.leg-chip.on { border-color: var(--blue); background: #1b3346; }
.leg-chip.has-result.on { background: rgba(34, 197, 94, .22); }
.leg-form { display: grid; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; }
.leg-form h3 { margin: 0; }
.field { display: grid; gap: .35rem; }
.field-label { font-size: .85rem; color: var(--muted); }
.field-row { display: grid; gap: .8rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; }
.seg button {
  min-height: 52px; padding: .4rem .6rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere;
}
.seg button.on { background: var(--accent); border-color: var(--accent); color: #04120a; }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: .35rem; }
.stepper button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-size: 1.5rem; cursor: pointer; }
.stepper input, .big-input { min-height: 52px; text-align: center; font-size: 1.4rem; font-weight: 700; }
.preview { text-align: center; color: var(--muted); min-height: 1.5em; }
.preview b { color: var(--text); }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.done { text-align: center; display: grid; gap: .8rem; padding: 1rem; background: var(--card); border-radius: var(--radius); margin-bottom: .8rem; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .editor.is-opening { animation: none; }
  .container { padding: 1.25rem 1.25rem 3rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); align-items: end; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); align-items: end; }
  .grid-2 > .btn, .grid-4 > .btn { grid-column: 1 / -1; justify-self: start; }
  .span-2 { grid-column: 1 / -1; }
  .match-list { grid-template-columns: repeat(2, 1fr); }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .lineup-grid { grid-template-columns: 1fr 1fr; }
  .sb-team { font-size: 1.25rem; }
  .sb-score { font-size: 3rem; }
  .player-row { grid-template-columns: 2fr 2fr 1fr 1.2fr auto auto; align-items: center; }
  .player-row .actions, .player-row .btn-primary { grid-column: auto; }
  .lineup-row { grid-template-columns: 2.8em 1fr 1fr; }
  .lineup-row input { grid-column: auto; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .editor {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: min(640px, 94vw); border-radius: 18px; border: 1px solid var(--line);
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .match-list { grid-template-columns: repeat(3, 1fr); }
  .game-grid { grid-template-columns: repeat(4, 1fr); }
  .split { grid-template-columns: 280px 1fr; align-items: start; }
  .grid-2-wide { grid-template-columns: 1fr 1fr; }
}


/* Schmale Bildschirme: Scoreboard zweizeilig (Name links, Spielstand rechts) statt drei Spalten. */
@media (max-width: 559px) {
  .sb-main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "home h" "away g"; gap: .35rem .8rem; }
  .sb-home { grid-area: home; }
  .sb-away { grid-area: away; text-align: left; }
  .sb-score { display: contents; }
  .sb-score .sep { display: none; }
  .sb-h { grid-area: h; }
  .sb-g { grid-area: g; }
  .sb-h, .sb-g { font-size: 1.9rem; line-height: 1.1; text-align: right; color: var(--muted); }
  .sb-h.lead, .sb-g.lead { color: var(--accent); }
  body.tv .sb-h, body.tv .sb-g { font-size: clamp(2.2rem, 11vw, 3rem); }
  body.tv .sb-team { font-size: clamp(1.15rem, 5.5vw, 1.6rem); }
}

/* ---------- TV-Modus (Vollbild für Beamer/Fernseher) ---------- */
body.tv .topbar, body.tv .grant-bar, body.tv .flash, body.tv .live-actions .btn:not(#tv-toggle), body.tv .status-bar { display: none; }
body.tv .game.can-enter { cursor: default; }
body.tv .container { max-width: none; }
body.tv .scoreboard { top: 0; }
body.tv .sb-score { font-size: clamp(2.6rem, 7vw, 5.5rem); }
body.tv .sb-team { font-size: clamp(1.15rem, 2.4vw + .5rem, 2.6rem); }
body.tv .game { font-size: 1.15rem; }
@media (min-width: 1400px) { body.tv .game-grid { grid-template-columns: repeat(4, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .subnav, .tabs, .live-actions { display: none; }
  body { background: #fff; color: #000; }
  .card, .game, .scoreboard { background: #fff; border-color: #999; box-shadow: none; position: static; }
}

/* Doppel: optionale Felder */
.optional { color: var(--muted); font-weight: 400; font-size: .8rem; }
.hint { margin: 0; padding: .5rem .7rem; border-radius: 10px; background: rgba(56, 189, 248, .1); border: 1px solid #1e4f66; font-size: .9rem; }

/* Leg-Marker in den Spielkarten */
.leg-dots { display: flex; gap: .2rem; }
.leg-dot {
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 800; line-height: 1;
}
.leg-dot.open { border: 2px solid var(--muted); opacity: .6; }
.leg-dot.won-H { background: var(--accent); color: #04120a; }
.leg-dot.won-G { background: var(--blue); color: #04121a; }
.code-input { text-align: center; font-size: 1.4rem; letter-spacing: .12em; font-family: ui-monospace, monospace; text-transform: uppercase; }
.token-new { border: 1px solid var(--accent); background: rgba(34, 197, 94, .1); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
.token-code { font: 700 1.8rem ui-monospace, monospace; letter-spacing: .12em; text-align: center; margin: .4rem 0; user-select: all; }
.token-new a { overflow-wrap: anywhere; }
.list-item.token-expired, .list-item.token-revoked { opacity: .55; }
.game-picks { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .game-picks { grid-template-columns: repeat(2, 1fr); } }
.grant-bar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between; padding: .5rem .9rem; background: rgba(245, 158, 11, .12); border-bottom: 1px solid #6b4a10; font-size: .9rem; }
.game-legs { display: flex; justify-content: flex-end; margin-top: .2rem; }

/* ---------- Specials ---------- */
.game-specials { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.sp { display: inline-flex; align-items: baseline; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); background: var(--bg-2); }
.sp-180 { border-color: #7f1d1d; background: rgba(239, 68, 68, .15); }
.sp-171 { border-color: #6b4a10; background: rgba(245, 158, 11, .14); }
.sp-hf { border-color: #1d5133; background: rgba(34, 197, 94, .14); }
.sp-note { border-radius: 10px; }
.sp-who { color: var(--muted); }
.specials-card .section-title { margin-top: 0; }
.specials-sum li, .specials-notes li { padding: .15rem 0; }
.sp-team { font-weight: 700; margin-right: .4rem; }
.editor-tabs { margin: 0 0 .8rem; }
.sub-form select { width: 100%; }

/* ---------- Vordruck Ergebnisplan (bericht.php) ---------- */
.rp-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.report {
  background: #fff; color: #111; border-radius: 6px; padding: 1.2rem; max-width: 1100px; margin: 0 auto;
  font-size: .82rem; line-height: 1.3; color-scheme: light;
}
.report h1 { font-size: 1.4rem; margin: 0; }
.report h2 { font-size: .95rem; margin: .8rem 0 .35rem; text-transform: uppercase; letter-spacing: .05em; }
.report h3 { font-size: .85rem; margin: 0 0 .3rem; }
.rp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; border-bottom: 2px solid #111; padding-bottom: .4rem; margin-bottom: .6rem; }
.rp-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.report table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.report th, .report td { border: 1px solid #555; padding: .18rem .35rem; text-align: left; color: #111; white-space: normal; height: 1.45em; }
.report th { background: #eee; font-weight: 700; }
.report .rp-sub th { background: #f6f6f6; font-weight: 600; font-size: .75rem; }
.rp-lineups { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.rp-lineup .rp-slot, .rp-game .rp-slot { width: 3.6em; white-space: nowrap; font-weight: 700; }
.rp-lineup tr.rp-sep td { border-bottom: 2px solid #111; }
.rp-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.rp-game-block { break-inside: avoid; }
.rp-game-number { font-weight: 700; margin-bottom: .15rem; }
.rp-game { margin-bottom: .45rem; }
.rp-game td { text-align: center; min-width: 2em; }
.rp-game td.rp-leg { width: 2em; color: #666; }
.rp-game th, .rp-game td { padding-left: .25rem; padding-right: .25rem; }
.report .rp-game td.rp-leg-won { background: #dcfce7; color: #14532d; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-game .rp-name { font-weight: 600; }
.rp-game tfoot td { text-align: left; background: #fafafa; }
.rp-game-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .35rem; font-size: .72rem; }
.rp-game-summary > span { white-space: nowrap; }
.rp-game-summary .rp-fill { min-width: 2.3em; margin: 0 0 0 .15rem; }
.rp-game-summary .rp-standing { margin-left: auto; }
.rp-fill { display: inline-block; min-width: 3.2em; border-bottom: 1px solid #111; text-align: center; margin: 0 .6rem 0 .2rem; }
.rp-muted { color: #666; }
.rp-roundsum { margin: .2rem 0 0; font-weight: 600; }
@media screen and (max-width: 759px) {
  .rp-round-list { display: flex; flex-direction: column; }
  .rp-round-list .rp-rounds, .rp-round-list .rp-grid { display: contents; }
  .rp-round-1 { order: 1; }
  .rp-round-2 { order: 2; }
  .rp-round-3 { order: 3; }
  .rp-round-4 { order: 4; }
  .rp-round-5 { order: 5; }
  .rp-round-6 { order: 6; }
  .rp-round-7 { order: 7; }
  .rp-round-8 { order: 8; }
  .rp-round-9 { order: 9; }
  .rp-round-10 { order: 10; }
}
.rp-total { margin-top: .8rem; }
.rp-total th, .rp-total td { text-align: center; font-size: 1rem; height: 1.8em; }
.rp-extra { display: grid; gap: .8rem; grid-template-columns: 1fr; margin-top: .8rem; }
.rp-extra ul { margin: 0; padding-left: 1.1rem; }
.rp-lines { height: 4.5em; background: repeating-linear-gradient(transparent 0 1.45em, #999 1.45em calc(1.45em + 1px)); }
.rp-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.2rem; }
.rp-sign div { border-top: 1px solid #111; padding-top: .2rem; font-size: .75rem; }
@media (min-width: 760px) {
  .rp-lineups, .rp-grid, .rp-extra { grid-template-columns: 1fr 1fr; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.page-report { background: #fff; }
  .page-report .container { padding: 0; max-width: none; }
  .no-print, .grant-bar, .flash { display: none !important; }
  .report { padding: 0; font-size: 8.5pt; max-width: none; }
  .rp-lineups, .rp-grid, .rp-extra { grid-template-columns: 1fr 1fr; gap: 4mm; }
  .rp-game, .rp-round h2 { break-inside: avoid; }
  .rp-rounds { break-inside: avoid; }
  .rp-rounds + .rp-rounds { break-before: page; }  /* Seite 1: bis Runde 1/3, Seite 2: Runde 2/4 + Endstand */
  .report th, .report td { padding: .05rem .25rem; height: 1.25em; }
  .report h2 { margin: 2.5mm 0 1mm; }
  .rp-head { margin-bottom: 2mm; padding-bottom: 1mm; }
  .rp-game { margin-bottom: 1.5mm; }
  .rp-lineup th, .rp-lineup td { height: 1.15em; }
  .report th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Vermerke in derselben Zeile, feste Spalten, lange Namen gekürzt -> bleibt bei 2 Seiten */
  .report .rp-out { display: inline !important; margin-left: .3em; font-size: 6.5pt; }
  .rp-lineup { table-layout: fixed; }
  .rp-lineup col.c-slot { width: 11mm; }
  .rp-lineup col.c-pass { width: 16mm; }
  .rp-lineup td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Auswechslungen: Zellen behalten die normale Hintergrundfarbe, nur die Platz-/Namens-Markierungen
   sind gefärbt (Platz durchgestrichen rot, Name grün "rein" / rot "raus"). */
.report s { color: #b91c1c; text-decoration-thickness: 2px; }
.report .rp-out { display: block; font-size: .72rem; font-weight: 400; color: #7f1d1d; }
.report .rp-in, .report .rp-out-name, .report .rp-out-note { padding: 0 2px; border-radius: 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report .rp-in { background: #dcfce7; color: #14532d; }
.report .rp-out-name, .report .rp-out-note { background: #fecaca; color: #7f1d1d; }

.sr-specials { grid-area: sp; }
.actions-center { justify-content: center; }

/* ---------- Turniere ---------- */
.t-head .t-title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.t-head h1 { margin: 0; font-size: 1.35rem; }
.seed-list { columns: 2; margin: .5rem 0 0; padding-left: 1.4rem; }
.bracket { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .6rem; scroll-snap-type: x proximity; }
.bracket-col { flex: 0 0 min(78vw, 250px); scroll-snap-align: start; display: flex; flex-direction: column; gap: .5rem; }
.bracket-col .section-title { margin: .2rem 0; }
.tm { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: .45rem .6rem; }
.tm-click { cursor: pointer; }
.tm-click:hover { border-color: var(--blue); }
.tm.is-running { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.tm-ready { border-left: 3px solid var(--blue); }
.tm-bye, .tm-pending { opacity: .6; }
.tm-bye .tm-row, .tm-pending .tm-row { font-size: .9rem; }
.tm-head { display: flex; justify-content: space-between; gap: .3rem; font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.tm-row { display: flex; justify-content: space-between; gap: .4rem; padding: .1rem 0; }
.tm-row.won { color: var(--accent); font-weight: 700; }
.tm-row.lost { color: var(--muted); }
.tm-name { overflow-wrap: anywhere; }
.tm-legs { font-weight: 800; font-variant-numeric: tabular-nums; }
.tm-src { color: var(--muted); font-style: italic; font-size: .8rem; }
.tm-bye { color: var(--muted); font-style: italic; }
.tm-place { font-size: .72rem; color: var(--amber); margin-top: .2rem; }
.finals-grid { display: grid; gap: .8rem; }
.finals-grid > div:first-child { display: grid; gap: .5rem; align-content: start; }
.placements td:first-child { width: 4em; font-weight: 700; }
.placements tr.gold td { color: var(--amber); font-weight: 800; }
@media (min-width: 760px) { .finals-grid { grid-template-columns: 1fr 1fr; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.4rem 0 .6rem; }
.section-head .section-title { margin: 0; }
.event-group > h2.section-title { color: var(--text); font-size: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: .35rem; }
.event-group > h3.section-title { margin-top: .9rem; }
.tile-title { font-weight: 700; font-size: 1.1rem; margin: .4rem 0; }
/* Schmale Handys: Kopfzeile kompakt, Markenname nicht umbrechen */
.brand { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar { padding-left: .6rem; padding-right: .6rem; }
  .brand { font-size: 1rem; gap: .35rem; }
  .mainnav { gap: .25rem; }
  .mainnav a, .linkbtn { padding: .5rem .45rem; font-size: .92rem; }
}
/* Radio-Gruppe im Stil der Segment-Buttons (ohne JS) */
.seg-static label { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: .4rem .6rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-weight: 600; cursor: pointer; text-align: center; }
.seg-static input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg-static label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #04120a; }
.seg-static label:has(input:focus-visible) { outline: 2px solid var(--blue); }

/* ---------- Scorer (freie Spiele) ---------- */
.sc-head h1 { font-size: 1.3rem; margin: 0; }
.sc-head p { margin: .2rem 0 .8rem; }
.sc-sides { display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: .8rem; }
.sc-sides.sc-n1 { grid-template-columns: 1fr; }
.sc-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }
.sc-side.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.sc-side.is-winner { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber) inset; }
.sc-name { font-weight: 700; overflow-wrap: anywhere; }
.sc-members { font-size: .8rem; color: var(--muted); }
.sc-members .throwing { color: var(--accent); font-weight: 700; }
.sc-rest { font-size: 2.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sc-foot { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .8rem; color: var(--muted); }
.legs-pips { display: inline-flex; gap: 3px; }
.leg-pip { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.leg-pip.on { background: var(--accent); border-color: var(--accent); }
.badge-finish { color: #04120a; background: var(--accent); border-color: var(--accent); }
.sc-input { display: grid; gap: .6rem; }
.sc-display { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.sc-value { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-left: auto; }
.sc-value.bad { color: var(--red); }
.sc-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.sc-quick button, .sc-keys button { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2);
  color: var(--text); font: inherit; font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.sc-quick button { min-height: 42px; font-size: 1rem; background: var(--bg-2); }
.sc-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.sc-keys button:active, .sc-quick button:active { transform: scale(.96); }
.sc-keys .sc-ok { background: var(--accent); border-color: var(--accent); color: #04120a; }
.sc-question { font-size: 1.1rem; margin: 0; }
.sc-history ol li { padding: .2rem 0; border-bottom: 1px solid var(--line); }
.sc-history li.bust b { color: var(--red); text-decoration: line-through; }
.sc-history li.checkout b { color: var(--accent); }
.sc-member td { color: var(--muted); font-size: .8rem; }
.sc-finished { text-align: center; }
@media (min-width: 640px) {
  .sc-sides.sc-n3 { grid-template-columns: repeat(3, 1fr); }
  .sc-sides.sc-n4 { grid-template-columns: repeat(4, 1fr); }
  .sc-quick { grid-template-columns: repeat(9, 1fr); }
  .sc-keys { max-width: 420px; }
}
body.tv .sc-rest { font-size: 5rem; }
.list-link { color: var(--text); text-decoration: none; }
.list-link:hover { border-color: var(--blue); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
/* Communication: local dialogs, readable plain text and narrow mobile screens. */
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation { margin-block: 1rem; }
.chat-dialog { width: min(36rem, calc(100vw - 1rem)); height: min(44rem, calc(100dvh - 1rem)); padding: .75rem; border: 1px solid #526171; border-radius: .75rem; background: #0f1720; color: #e5edf5; }
.chat-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.chat-dialog::backdrop { background: rgb(0 0 0 / .55); }
.chat-dialog-heading { display: flex; flex: none; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.chat-frame { display: block; flex: 1; min-height: 0; width: 100%; border: 0; }
.chat-embedded .topbar, .chat-embedded .grant-bar, .chat-embedded .notepad { display: none; }
.chat-embedded .container { padding: .5rem; }
.chat-embedded .page-title { display: none; }
.page-chat .conversation { max-height: 55dvh; overflow-y: auto; }
.chat-embedded { height: 100dvh; overflow: hidden; }
.chat-embedded .container { display: flex; flex-direction: column; min-height: 0; height: 100dvh; width: 100%; }
.chat-embedded .conversation { flex: 1; min-height: 0; max-height: none; margin-block: .5rem; }
.chat-embedded .community-tabs, .chat-embedded .channel-options { flex: none; }
.chat-embedded #chat-status { flex: none; margin-block: .25rem; }
.chat-embedded .community-compose { flex: none; margin: 0; padding: .5rem; gap: .35rem; }
.chat-embedded .community-compose textarea { min-height: 2.75rem; height: 3.5rem; resize: none; }
.chat-embedded .community-compose label { font-size: .85rem; }
.chat-message { max-width: 95%; padding: .6rem .75rem; margin-bottom: .5rem; }
.chat-message p { margin-block: .3rem; }
.chat-message.is-mine { margin-left: auto; background: var(--card-2); border-color: var(--accent); }
.chat-embedded .flash { padding: .5rem; margin-block: .25rem; }
.rest-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.round-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.leg-form input[type="range"] { width: 100%; min-height: 44px; padding: 0; accent-color: var(--accent); cursor: pointer; }
.rest-slider-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: .5rem; align-items: center; }
.rest-slider-row button { min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.dart-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; margin-block: .75rem; }
.sc-mode-picker .seg button { white-space: nowrap; padding-inline: .35rem; }
/* Legbasierte Erfassung: Anwurf/Gewinner-Auswahl (bis 8 Seiten) und optionale Details. */
.sc-leg-seg { display: grid; gap: .35rem; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.sc-leg-seg button { min-height: 46px; padding: .35rem .5rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.sc-leg-seg button.on { background: var(--accent); border-color: var(--accent); color: #04120a; }
.sc-leg-details { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sc-leg-details label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.chat-widget { position: fixed; right: calc(max(.75rem, env(safe-area-inset-right)) + 8.25rem); bottom: max(.75rem, env(safe-area-inset-bottom)); z-index: 74; box-shadow: var(--shadow); }
.community-tabs { margin-block: .75rem 1rem; }
.community-tabs .btn[aria-current="page"] { background: var(--accent); color: #04120a; border-color: var(--accent); font-weight: 700; }
.page-community article > details { margin-block: .75rem; }
.page-community article > form { margin-top: .75rem; }
/* Moderation: Bearbeitungen/Löschung einzelner Beiträge (chat.admin / forum.admin). */
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.post-edit { margin: 0; }
.post-edit summary { font-size: .8rem; color: var(--muted); }
.post-edit .form { display: grid; gap: .4rem; margin-top: .4rem; }
.forum-approve { margin-top: .5rem; }
.page-community .channel-picker { margin-top: .75rem; }
.token-community { margin-top: 1rem; }
/* Codeübersicht: Gruppenüberschriften und aufklappbare Code-Karten. */
.token-group { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.token-card { margin-bottom: .5rem; }
.token-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.token-summary-label { font-weight: 600; }
.token-summary .muted { flex: 1 1 auto; }
.token-card > p { margin-top: .6rem; }
.token-card > form, .token-card > .token-community { margin-top: .6rem; }
.token-retarget-actions { margin-top: .8rem; }
.container > .actions:not(.community-tabs) { margin-block: .75rem; }
.chat-embedded .channel-picker { padding: .5rem; gap: .4rem; }
.chat-embedded .channel-picker { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: .5rem; }
.channel-picker label { min-width: 0; }
.chat-embedded .community-tabs { margin-block: .25rem .5rem; }
@media print { .chat-widget { display: none !important; } }
@media print { .chat-dialog, .community-compose { display: none !important; } }
