/* Turnierseite und Verwaltung: Farben und Schrift aus brand.css */
:root { --red: var(--p-action); --line: #e3e0d8; --soft: var(--p-surface); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; color: var(--p-ink); font: 16px/1.5 var(--font-text); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0 0 8px; font-weight: 400; }
h2 { font-size: 24px; margin: 40px 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; }
.muted { color: var(--p-muted); }
.wrap-app { max-width: 1100px; margin: 0 auto; padding: 32px 16px 96px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.topbar a, .topbar button { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.topbar img { width: 32px; height: 32px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; font-weight: 500; color: var(--p-muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* public tournament */
.live-badge { display: inline-block; background: var(--red); color: #fff; font-size: 13px; font-weight: 500; padding: 2px 8px; border-radius: 4px; }
.match { display: grid; grid-template-columns: 64px 1fr auto 1fr; gap: 12px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.match .home { text-align: right; } .match .res { font-variant-numeric: tabular-nums; font-weight: 500; min-width: 56px; text-align: center; }
.match.is-live { background: #fff5f5; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; }

/* buttons and forms */
button, .btn-a { font: inherit; font-weight: 500; min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--p-ink); cursor: pointer; }
button:hover { border-color: var(--p-ink); }
button.primary { background: var(--red); border-color: var(--red); color: #fff; }
button.danger { color: var(--red); }
button.small { min-height: 36px; padding: 0 10px; font-size: 14px; }
input, select, textarea { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1px solid #c9c5bb; border-radius: 6px; background: #fff; color: var(--p-ink); width: 100%; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; } label.check input { width: 22px; min-height: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; margin: 16px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* admin layout */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 57px); }
.side { border-right: 1px solid var(--line); padding: 16px; display: grid; align-content: start; gap: 4px; }
.side a { padding: 10px 12px; border-radius: 6px; text-decoration: none; font-weight: 500; }
.side a[aria-current="page"] { background: var(--soft); color: var(--red); }
.main { padding: 24px; min-width: 0; }
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; overflow-x: auto; padding: 8px; }
  .main { padding: 16px; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--p-ink); color: #fff; padding: 12px 16px; border-radius: 8px; z-index: 20; }
.login { max-width: 380px; margin: 64px auto; padding: 0 16px; display: grid; gap: 12px; }

/* live mode: big buttons for the hall */
.live { display: grid; gap: 16px; max-width: 640px; }
.live__score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; }
.live__score b { font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; font-weight: 500; }
.live__team { display: grid; gap: 8px; }
.live__team button { min-height: 64px; font-size: 20px; }
.live__status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.live__status button[aria-pressed="true"] { background: var(--p-ink); color: #fff; }

/* captain, knockout and team details */
.cap { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--p-ink); color: #fff; font-size: 12px; font-weight: 600; vertical-align: 1px; }
.match .stage { grid-column: 2 / -1; font-size: 13px; color: var(--p-muted); margin-top: -6px; }
.ko { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ko__round h3 { font-size: 15px; color: var(--p-muted); font-weight: 500; }
.ko__match { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.ko__match b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-variant-numeric: tabular-nums; }
.ko__match .muted { font-size: 13px; }
.ko__match.is-live { border-color: var(--red); background: #fff5f5; }
.teams { display: grid; gap: 12px; }
.teams summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.teams h3 { margin-top: 16px; font-size: 15px; color: var(--p-muted); }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* scroll reveal (reveal.js) */
.rv { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease-out, transform 600ms cubic-bezier(.22, 1, .36, 1); }
.rv.rv-in { opacity: 1; transform: none; }
