:root {
  --navy: #00243D;
  --navy-2: #0B3A5B;
  --cocoa: #5B2E12;
  --cocoa-2: #8A4B22;
  --gold: #E2B04A;
  --cream: #FBF6EE;
  --paper: #FFFFFF;
  --ink: #1E1A17;
  --muted: #6E655D;
  --line: #E7DED2;
  --ok: #2E7D4F;
  --warn: #B4581D;
  --rr: #B23A48;   /* Marke RR */
  --ds: #2F5D8A;   /* Marke DS */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0, 36, 61, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--cocoa-2); }

/* ---------- Kopfzeile ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.brand .bar {
  width: 28px; height: 18px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--cocoa) 0 8px, var(--cocoa-2) 8px 9px);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: rgba(255,255,255,.12); color: #fff;
}
.pill.light { background: #F1EADF; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa; display: inline-block; }
.dot.on { background: #4CC37E; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 560px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.hero { padding: 40px 0 24px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, select {
  width: 100%; font: inherit; padding: 11px 12px; border-radius: 10px;
  border: 1px solid #D6CBBC; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 3px solid rgba(226,176,74,.45); border-color: var(--gold); }
input.code { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; font-size: 1.3rem; text-align: center; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 44px; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px;
  padding: 11px 16px; background: var(--cocoa); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .06s ease, background .15s;
}
button:hover { background: var(--cocoa-2); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #EFE6DA; color: var(--ink); }
button.secondary:hover { background: #E5D8C6; }
button.gold { background: var(--gold); color: var(--navy); }
button.gold:hover { background: #ECC26A; }
button.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
button.sel { outline: 3px solid var(--gold); outline-offset: 1px; }
button.block { width: 100%; }
button.big { padding: 16px 20px; font-size: 1.1rem; }

.err { color: #B3261E; font-weight: 600; min-height: 1.3em; margin-top: 8px; font-size: .9rem; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; }

/* ---------- Marken ---------- */
.team-RR { --team: var(--rr); }
.team-DS { --team: var(--ds); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700;
  background: var(--team, #888); color: #fff; letter-spacing: .03em;
}

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; }
.matrix td, .matrix th { text-align: center; }
.matrix td.coop { background: #EEF6EF; font-weight: 700; }
.scroll { overflow-x: auto; }

/* ---------- Moderation ---------- */
.code-big {
  font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 800; letter-spacing: .18em; line-height: 1;
  color: var(--gold);
}
.qr { background: #fff; padding: 8px; border-radius: 10px; display: inline-block; }
.qr svg { display: block; width: 132px; height: 132px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: #F4EEE5; border-radius: 999px;
  padding: 4px 6px 4px 10px; font-size: .9rem;
}
.chip button { padding: 0 6px; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1.4; }
.chip button:hover { color: #B3261E; background: transparent; }
.groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.group { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.group .side { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 8px; }
.group .names { font-size: .88rem; color: var(--muted); }
.state { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.state.ok { color: var(--ok); }
.state.wait { color: var(--warn); }
.phase {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.phase .month { font-size: 1.6rem; font-weight: 800; }
.progress { height: 8px; background: #EFE6DA; border-radius: 99px; overflow: hidden; flex: 1; min-width: 120px; }
.progress > div { height: 100%; background: var(--gold); transition: width .3s; }

/* ---------- Spieler ---------- */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.price {
  aspect-ratio: 1 / 1; font-size: 2rem; font-weight: 800; border-radius: 16px;
  background: #fff; color: var(--ink); border: 2px solid var(--line); flex-direction: column; gap: 0;
}
.price small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.price:hover { background: #FFF8EA; border-color: var(--gold); }
.price.sel { background: var(--team); color: #fff; border-color: var(--team); outline: none; }
.price.sel small { color: rgba(255,255,255,.85); }
.result-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.result-big .box { border-radius: 12px; padding: 14px 8px; background: #F7F2EA; }
.result-big .val { font-size: 1.8rem; font-weight: 800; }
.result-big .lbl { font-size: .8rem; color: var(--muted); }
.banner {
  border-left: 5px solid var(--team, var(--gold)); background: #fff; padding: 14px 16px; border-radius: 10px;
}

@media (max-width: 560px) {
  .wrap { padding: 16px 12px 48px; }
  .card { padding: 16px; }
  .hero { padding: 16px 0 8px; }
}
