/* OCHE – Darts-Turnierplattform. Keine externen Schriften oder Dateien, damit alles auch ohne Internet läuft. */
:root {
  --bg: #0F1412;
  --surface: #171E1B;
  --surface2: #1D2622;
  --line: #2A3430;
  --line2: #3A4540;
  --text: #F2EEE3;
  --muted: #A9B3AD;
  --red: #C8301F;
  --red-text: #FF7A6B;
  --green: #3DCB87;
  --amber: #FFB454;
  --cream: #E9DFC4;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--red-text); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(30px, 4.5vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0; }
button { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.page { padding-top: 40px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 700; }
.accent { color: var(--red-text); }
.lead { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 560px; }
.title-block .lead { max-width: none; }
.push { margin-left: auto; }
.grow { flex: 1 1 0; min-width: 0; }
.full { width: 100%; }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap-s { flex-wrap: wrap; align-items: flex-end; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }

/* Kopfzeile */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; letter-spacing: 3px; color: var(--text); }
.nav { display: flex; gap: 4px 24px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.nav a { padding: 12px 0; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--red-text); border-bottom-color: var(--red-text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; text-align: center; color: var(--text); background: transparent; transition: background .12s, border-color .12s, opacity .12s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #A82618; color: #fff; }
.btn-ghost { border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red-text); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 28px; }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn:disabled, .opt:disabled, .key:disabled { opacity: .45; cursor: not-allowed; }

/* Chips und Abzeichen */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.chip.ok { color: var(--green); }
.chip.warn { color: var(--amber); }
.chip.live { color: #fff; background: var(--red); border-color: var(--red); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-t { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.badge-t.live { color: #fff; background: var(--red); padding: 3px 8px; border-radius: 6px; }
.badge-t.ok { color: var(--green); }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.card h2 { font-size: 22px; }
.sec { gap: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.tcard { gap: 14px; }
.tcard h3 { font-size: 26px; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.section-head.sub { margin-top: 48px; }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 4px; }
.empty { padding: 48px 0; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; color: var(--muted); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 64px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.foot a { color: var(--muted); padding: 8px 0; }

/* Startseite */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 56px; padding-bottom: 72px; }
.hero-text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.hero h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em; }
.hero .row { flex-wrap: wrap; }
.hero-art { flex: 1 1 320px; min-width: 0; display: flex; justify-content: center; }
.board-svg { width: 100%; max-width: 440px; height: auto; }
main > section.wrap { margin-bottom: 72px; }
.live-card { gap: 18px; }
.live-score { display: flex; align-items: center; gap: 16px; }
.ls-player { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ls-player strong { font-size: 44px; line-height: 1; }
.ls-player span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-player.right { text-align: right; }
.ls-sep { font-weight: 800; color: var(--muted); font-size: 20px; }

/* Turnierseite */
.title-block { display: flex; flex-direction: column; gap: 12px; }
.back { align-self: flex-start; background: none; border: 0; padding: 8px 0; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; }
.back:hover { color: var(--text); }
.champion { display: flex; flex-direction: column; gap: 4px; padding: 28px; border-radius: 16px; background: var(--surface); border: 2px solid var(--amber); }
.champion strong { font-size: clamp(32px, 5vw, 56px); color: var(--amber); line-height: 1.05; }
.notice { gap: 6px; }
.reg { gap: 20px; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .card { flex: 1 1 380px; min-width: 0; }
.plist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.plist li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.plist li:first-child { border-top: 0; }
.rank { flex: 0 0 28px; font-weight: 800; color: var(--muted); }
.rule-list { display: flex; flex-direction: column; }
.rule-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rule-row:first-child { border-top: 0; }
.display-links { margin-top: 20px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
label, .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time] { width: 100%; min-height: 48px; padding: 0 16px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; color: var(--text); font-family: inherit; font-size: 16px; color-scheme: dark; }
input::placeholder { color: #6E7A74; }
input:disabled { opacity: .5; }
input.num { width: 110px; text-align: center; }
input.dart { width: 80px; min-height: 44px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--text); }
.opt.on { background: var(--red); border-color: var(--red); color: #fff; }
.opt-row.big .opt { flex: 1 1 140px; min-height: 56px; font-size: 18px; }
.seedcards { display: flex; flex-wrap: wrap; gap: 16px; }
.seedcard { flex: 1 1 280px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 20px; border-radius: 14px; background: var(--bg); border: 2px solid var(--line); color: var(--text); cursor: pointer; font-size: 15px; line-height: 1.5; }
.seedcard strong { font-size: 20px; }
.seedcard.on { border-color: var(--green); }
.seedcard:disabled { cursor: not-allowed; opacity: .6; }
.rules-ed { display: flex; flex-direction: column; gap: 12px; }
.rr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 32px; padding: 16px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.rr-name { flex: 1 1 160px; font-weight: 800; font-size: 18px; padding-top: 18px; }
.rr-group { display: flex; flex-direction: column; gap: 6px; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 2 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.stats { display: flex; gap: 12px; }
.stats > div { flex: 1; padding: 16px; background: var(--bg); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.stats strong { font-size: 36px; line-height: 1; }
.stats span { color: var(--muted); font-size: 13px; }
.linkbox { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px dashed var(--line2); border-radius: 12px; }
.url { color: var(--green); word-break: break-all; font-size: 17px; }
.prow-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.prow-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.prow-list li:first-child { border-top: 0; }
.login { max-width: 460px; margin: 40px auto 0; gap: 20px; }
.table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; padding: 14px 16px; font-size: 13px; color: var(--muted); }
.table td { padding: 8px 16px; border-top: 1px solid var(--line); }

/* Spielbaum */
.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: flex; gap: 32px; align-items: stretch; min-width: calc(var(--cols, 3) * 272px); }
.round { flex: 1 0 240px; display: flex; flex-direction: column; gap: 16px; }
.round-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.round-head strong { font-size: 20px; }
.round-head span { font-size: 13px; color: var(--muted); }
.round-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.match { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.match.live { border-color: var(--red); }
.match.ready { border-color: var(--green); }
.match.pick { cursor: pointer; }
.mhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.mhead .badge-t.live { color: #fff; }
.match.ready .badge-t { color: var(--green); }
.mboard { color: var(--muted); font-weight: 500; letter-spacing: 0; font-size: 12px; }
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.mrow.win { font-weight: 800; }
.mrow.lose { color: var(--muted); }
.mrow.tbd { color: var(--muted); font-style: italic; }
.mname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlegs { font-weight: 800; font-size: 18px; }
.mrest { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Hinweisfenster */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line2); font-weight: 600; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.4); transition: opacity .6s; }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
.toast.out { opacity: 0; }

/* Referee */
body.referee { -webkit-tap-highlight-color: transparent; }
body.referee .nav { display: none; }
.ref-wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 12px; }
.ref-wrap h1 { font-size: 28px; }
.ref-title { margin: 8px 0; }
.ref-list { display: flex; flex-direction: column; gap: 10px; }
.ref-match { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; background: var(--bg); border: 2px solid var(--line); }
.ref-match.live { border-color: var(--red); }
.ref-match.ready { border-color: var(--green); }
.ref-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 20px; }
.ref-vs { font-size: 28px; line-height: 1.2; }
.ref-vs span { font-weight: 500; font-size: 20px; }
.ref-h { font-size: 20px; }
.rp-row { display: flex; gap: 12px; }
.rp { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 3px solid var(--line); border-radius: 14px; }
.rp.active { border-color: var(--green); }
.rp strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-rem { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.rp-hint { min-height: 20px; font-size: 14px; font-weight: 700; color: var(--amber); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; flex: 0 0 10px; }
.dot.on { background: var(--green); }
.pip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--green); }
.pip.full { background: var(--green); }
.msg { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 15px; }
.inputbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 64px; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; }
.inputbox strong { font-size: 44px; line-height: 1; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qk { min-height: 46px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--cream); font-weight: 700; font-size: 17px; cursor: pointer; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key { min-height: 62px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); color: var(--text); font-weight: 700; font-size: 24px; cursor: pointer; }
.key:active, .qk:active { background: var(--surface2); }
.key.small-k { font-size: 16px; }
.key.ok { background: var(--green); border-color: var(--green); color: #0F1412; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.prompt { width: 100%; max-width: 420px; }
.done { align-items: flex-start; gap: 6px; }
.ref-win { font-size: 28px; line-height: 1.15; color: var(--amber); }

/* Vollbild-Anzeige (alles in vmin, passt sich jedem Bildschirm an) */
body.display { height: 100vh; overflow: hidden; background: var(--bg); }
body.display.idle { cursor: none; }
body.display.idle .fs-btn { opacity: 0; pointer-events: none; }
#screen { height: 100vh; display: flex; flex-direction: column; gap: 2.4vmin; padding: 3vmin 4vmin; }
.fs-btn { position: fixed; right: 2vmin; bottom: 2vmin; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); font-weight: 700; cursor: pointer; transition: opacity .4s; }
body:not(.display) .fs-btn { display: none; }
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 3vmin; }
.d-title { display: flex; align-items: center; gap: 2vmin; min-width: 0; }
.d-title svg { width: 5.2vmin; height: 5.2vmin; flex: 0 0 auto; }
.d-title h1 { font-size: 4vmin; }
.d-title p { font-size: 2.6vmin; color: var(--muted); }
.d-board { padding: 1.2vmin 2.6vmin; background: var(--surface); border: 2px solid var(--line); border-radius: 1.6vmin; font-weight: 800; font-size: 3.6vmin; white-space: nowrap; }
.d-main { flex: 1; display: flex; gap: 3vmin; min-height: 0; }
.dpanel { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 1vmin; padding: 3vmin 3.6vmin; background: var(--surface); border: 0.6vmin solid var(--line); border-radius: 3vmin; }
.dpanel.active { border-color: var(--green); }
.dp-top { display: flex; align-items: center; justify-content: space-between; gap: 2vmin; }
.dp-name { font-size: 6.4vmin; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-turn { padding: 1vmin 2.2vmin; background: var(--green); color: #0F1412; border-radius: 99vmin; font-weight: 800; font-size: 2.6vmin; letter-spacing: 0.2vmin; white-space: nowrap; }
.dp-rem { text-align: center; font-size: 31vmin; font-weight: 800; line-height: 0.95; letter-spacing: -0.03em; }
.dp-bottom { display: flex; flex-direction: column; gap: 1.6vmin; }
.dp-meta { display: flex; align-items: center; justify-content: space-between; font-size: 3vmin; }
.pips { display: flex; align-items: center; gap: 1.2vmin; }
.pips span:first-child { color: var(--muted); }
.d-main .pip { width: 2.6vmin; height: 2.6vmin; border-width: 0.4vmin; }
.dp-hint { display: flex; justify-content: space-between; align-items: center; padding: 1.4vmin 2.2vmin; background: var(--bg); border-radius: 1.6vmin; font-size: 3.2vmin; }
.dp-hint span { color: var(--muted); }
.dp-hint strong { color: var(--amber); }
.dp-hint.none strong { color: var(--muted); }
.dp-last { font-size: 2.6vmin; color: var(--muted); }
.d-foot { display: flex; justify-content: space-between; gap: 3vmin; font-size: 2.6vmin; color: var(--muted); padding-right: 14vmin; }
.d-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vmin; text-align: center; font-size: 3vmin; }
.d-big { font-size: 9vmin; line-height: 1.05; }
.d-next { display: flex; flex-direction: column; gap: 1.4vmin; font-size: 3.4vmin; }
.d-next-row { display: flex; gap: 2vmin; justify-content: center; flex-wrap: wrap; }
.banner { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 3vmin 6vmin; border-radius: 3vmin; background: var(--surface2); border: 0.6vmin solid var(--green); font-size: 9vmin; font-weight: 800; text-align: center; z-index: 60; box-shadow: 0 2vmin 8vmin rgba(0,0,0,.6); animation: pop .35s ease-out; max-width: 92vw; }
.banner.bust { border-color: var(--red); }
.banner.match { border-color: var(--amber); color: var(--amber); }
.banner[class~="180"] { border-color: var(--amber); color: var(--amber); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.8); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

@media (orientation: portrait) {
  .d-main { flex-direction: column; }
  .dp-rem { font-size: 20vmin; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .page { padding-top: 24px; }
  .card { padding: 20px; }
  .hero { padding-top: 32px; padding-bottom: 40px; gap: 32px; }
  .rr-name { padding-top: 0; }
  .btn-lg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Konten, Referee-Code, Teilnehmerzahl ---------- */
.acct { display: flex; gap: 8px; align-items: center; }
.btn.on { border-color: var(--red-text); color: var(--red-text); }
.field .small { display: block; margin-top: 4px; }
.count-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.count-big strong { font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.codebox { padding: 14px 16px; background: var(--bg); border: 1px dashed var(--line2); border-radius: 12px; text-align: center; }
.code { font-size: 32px; letter-spacing: 0.25em; font-variant-numeric: tabular-nums; color: var(--green); }
.code-input { text-transform: uppercase; letter-spacing: 0.25em; font-size: 24px; text-align: center; }
.prow-list .pname { font-weight: 600; }
.prow-list li.prow { flex-wrap: wrap; }
@media (max-width: 560px) { .topbar-in { gap: 4px 12px; } .acct .btn { padding: 6px 10px; } }
.small-code { font-size: 20px; letter-spacing: 0.08em; word-break: break-all; }
.card.notice .code { display: block; margin: 8px 0; }
.table td { vertical-align: top; }
.table td, .table th { white-space: nowrap; }
.table td:first-child, .table td:nth-child(2) { white-space: normal; }
.card.sec .codebox { max-width: 420px; }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--green); }
