:root {
  --bg: #0F1A24;
  --card: #18263A;
  --card-2: #1F3049;
  --line: #2A3D57;
  --text: #EDE8DF;
  --muted: #9AA7B8;
  --gold: #E0A53C;
  --gold-dark: #B8842A;
  --win: #5FA77A;
  --loss: #C86464;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* Kopfzeile */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1rem; background: rgba(15, 26, 36, .95); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: "Rockwell", "Roboto Slab", Georgia, serif; font-weight: 800; letter-spacing: .04em;
  color: var(--bg); background: var(--gold); border-radius: 6px; padding: .1rem .45rem; font-size: .9rem;
}
.brand-name { font-family: "Rockwell", "Roboto Slab", Georgia, serif; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: .95rem; }
.top-link { font-size: .9rem; }

.wrap { max-width: 720px; margin: 0 auto; padding: 1rem; }

/* Karten */
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; color: var(--text); }
a.card:hover { text-decoration: none; border-color: var(--gold-dark); }
.hero h1 { margin-top: 0; }
.row { display: flex; gap: .5rem; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.h-event { margin: 0; }
.back { display: inline-block; margin-bottom: .5rem; font-size: .9rem; }

/* Status-Pillen */
.pill { font-size: .75rem; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.pill-registration { color: var(--gold); border-color: var(--gold-dark); }
.pill-running { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem;
}
.btn:hover { border-color: var(--gold-dark); text-decoration: none; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1206; }
.btn-gold:hover { background: #ebb352; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--loss); border-color: #5a3434; }
.btn-sm { font-size: .82rem; padding: .4rem .7rem; }
.btn-win { background: var(--win); border-color: var(--win); color: #0c1a12; }
.btn-loss { background: transparent; border-color: var(--loss); color: var(--loss); }
.btn.full, .full .btn { width: 100%; }
.btn-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 .3rem; }
.btn-x:hover { color: var(--loss); }
form.inline { display: inline; margin: 0; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
input, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .7rem; width: 100%;
}
input[type=checkbox] { width: auto; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.inline-form { flex-direction: row; flex-wrap: wrap; margin-top: .8rem; }
.inline-form select, .inline-form input { flex: 1 1 180px; width: auto; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.flash { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; background: #1d3a2a; border: 1px solid #2f6146; }
.flash-err { background: #3a1f22; border-color: #6a3338; }

details > summary { cursor: pointer; }
.admin-box { border-color: var(--gold-dark); }
.admin-box summary { color: var(--gold); font-weight: 600; margin-bottom: .6rem; }

/* Matches */
.matches { display: flex; flex-direction: column; gap: .5rem; }
.match {
  display: grid; grid-template-columns: 44px 1fr auto; gap: .2rem .7rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem;
}
.match.mine { border-color: var(--gold); }
.table-no { font-weight: 700; color: var(--gold); text-align: center; }
.players { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: baseline; }
.players .vs { color: var(--muted); font-size: .8rem; }
.players .win { color: var(--win); font-weight: 700; }
.players .loss { color: var(--muted); }
.players .draw { color: var(--text); }
.res { text-align: right; }
.report { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.report.big { flex-direction: column; }
.report.big .btn { width: 100%; padding: .9rem; font-size: 1.05rem; }
.report.big form { display: block; }

/* Mein Match */
.bigmatch { text-align: center; padding: 1.4rem 1rem; }
.bigmatch .tableno { font-size: 2.6rem; font-weight: 800; color: var(--gold); line-height: 1.1; margin-top: .6rem; }
.bigmatch .opp { font-size: 1.6rem; font-weight: 700; margin: .4rem 0 1rem; display: flex; flex-direction: column; }
.result-done { font-weight: 700; font-size: 1.1rem; }
.empty p { margin-top: 0; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.podium td:first-child { color: var(--gold); font-weight: 800; }
.tbl tr.podium td { background: rgba(224, 165, 60, .06); }
.tbl tr.me td { box-shadow: inset 3px 0 0 var(--gold); }
.tbl tr.dim, .plist .dim { opacity: .5; }

/* Turnierbaum */
.bracket { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.bracket-col { display: flex; flex-direction: column; justify-content: space-around; gap: .6rem; min-width: 150px; }
.bracket-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bmatch { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bslot { padding: .35rem .6rem; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bslot + .bslot { border-top: 1px solid var(--line); }
.bslot.win { color: var(--gold); font-weight: 700; }

/* Listen & Chips */
.plist { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.plist li { padding: .55rem .8rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.plist li:last-child { border-bottom: 0; }
.plist li form { margin-left: auto; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chip { padding: .3rem .8rem; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.chip.on { border-color: var(--gold); color: var(--gold); }

/* Untere Navigation */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  background: rgba(15, 26, 36, .97); border-top: 1px solid var(--line);
  padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; color: var(--muted); font-size: .72rem; padding: .25rem .8rem; }
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a.on { color: var(--gold); }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
