/* ============================================================
   KC Live – Turnierplan Styles
   Design: Kick & Connect (kickandconnect.at)
   Font: Readex Pro · Colors: Navy #1a2540 · Coral #e05252
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg:          #1a2540;
  --nav:         #141d32;
  --surface:     #1e2d4a;
  --surface2:    #253554;
  --surface3:    #2c3e60;
  --border:      rgba(255,255,255,0.10);
  --border2:     rgba(255,255,255,0.06);
  --accent:      #e05252;
  --accent-dark: #c94545;
  --accent-glow: rgba(224,82,82,0.20);
  --text:        #ffffff;
  --muted:       rgba(255,255,255,0.55);
  --muted2:      rgba(255,255,255,0.35);
  --gold:        #f5a623;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Readex Pro', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 1.6rem;  font-weight: 700; }
h2 { font-size: 1.3rem;  font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: .95rem;  font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.text-muted  { color: var(--muted);  font-size: .875rem; }
.text-muted2 { color: var(--muted2); font-size: .8rem; }
code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: .85em; }

/* ── Layout ─────────────────────────────────────────────────── */
main { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1rem; }

.section { margin-bottom: 2.75rem; }

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Site Header (Public) ────────────────────────────────────── */
.site-header {
  background: var(--nav);
  border-bottom: 3px solid var(--accent);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .header-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-logo-img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}
.site-logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
  flex-shrink: 0;
}
.site-logo-text span { color: var(--accent); }

.site-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
}
.site-title-text {
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%       { opacity: .4; transform: scale(.65); }
}

.update-info {
  margin-left: auto;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .03em;
}

/* ── Admin Header ────────────────────────────────────────────── */
.admin-header {
  background: var(--nav);
  border-bottom: 3px solid var(--accent);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.admin-header .header-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.header-title {
  font-size: .9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.admin-main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: 'Readex Pro', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-live   { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-sm    { padding: .38rem .85rem; font-size: .75rem; }
.btn-full  { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.form-group label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.flex-grow { flex: 1; min-width: 0; }

input[type=text],
input[type=password],
input[type=number],
select,
textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Readex Pro', sans-serif;
  font-size: .9rem;
  padding: .6rem .9rem;
  width: 100%;
  transition: border-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface3);
}
textarea { resize: vertical; }
select option { background: var(--surface2); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .9rem; }
.card p  { color: var(--muted); margin-bottom: .5rem; font-size: .9rem; }
.card-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

/* ── Admin Dashboard ─────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.admin-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.admin-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-glow);
  text-decoration: none;
}
.card-highlight { border-color: var(--accent) !important; }
.card-icon      { font-size: 1.75rem; }
.card-title     { font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.card-desc      { font-size: .8rem; color: var(--muted); }
.card-count     { font-size: .8rem; color: var(--accent); font-weight: 600; margin-top: auto; }

/* ── Status Bar ──────────────────────────────────────────────── */
.status-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}
.status-item   { display: flex; align-items: center; gap: .5rem; }
.status-label  { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-league   { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.badge-knockout { background: rgba(245,166,35,.15); border-color: var(--gold); color: var(--gold); }
.badge-setup    { background: var(--surface2); color: var(--muted); }
.badge-done     { background: rgba(255,255,255,.08); color: var(--muted); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-weight: 600;
  font-size: .9rem;
}
.alert-success { background: rgba(34,197,94,.12); border: 1.5px solid #22c55e; color: #4ade80; }
.alert-error   { background: rgba(224,82,82,.12); border: 1.5px solid var(--accent); color: var(--accent); }

/* ── Tables (Admin) ──────────────────────────────────────────── */
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  background: var(--surface3);
  padding: .65rem .8rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.data-table.compact th,
.data-table.compact td { padding: .4rem .65rem; font-size: .82rem; }
.vs { text-align: center; color: var(--muted2); }

/* ── Standings Table (Public) ────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.standings-table thead tr {
  background: var(--surface3);
}
.standings-table th {
  padding: .65rem .7rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  border-bottom: 2px solid var(--accent);
  text-align: center;
  white-space: nowrap;
}
.standings-table th.col-team { text-align: left; }
.standings-table td {
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--border2);
  text-align: center;
}
.standings-table td.col-team { text-align: left; }
.standings-table tr:last-child td { border-bottom: none; }

/* Qualify rows */
.standings-table tr.qualify td { background: rgba(224,82,82,.06); }
.standings-table tr.qualify:hover td { background: rgba(224,82,82,.12); }
.standings-table tr.top1 td { background: rgba(245,166,35,.07); }
.standings-table tr:not(.qualify):hover td { background: var(--surface2); }

.col-pos  { width: 42px; }
.col-num  { width: 44px; }
.col-pts  { width: 52px; }
.col-team { min-width: 140px; }

/* Position badges */
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 800;
}
.pos-badge.gold  { background: var(--gold); color: #000; }
.pos-badge.red   { background: var(--accent); color: #fff; }
.pos-badge.blue  { background: #3b82f6; color: #fff; }

.col-num.pos { color: #4ade80; }
.col-num.neg { color: var(--accent); }

.table-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--muted);
}
.qualify-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.qualify-dot.red  { background: var(--accent); }

.team-name-short { display: none; }

/* ── Round Navigation ────────────────────────────────────────── */
.round-tabs, .round-nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.round-tab, .round-btn {
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: 'Readex Pro', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.round-tab:hover, .round-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.round-tab.active, .round-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}
.round-progress {
  font-size: .68rem;
  background: var(--surface3);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--muted);
}

/* ── Round Panels ────────────────────────────────────────────── */
.round-panel        { display: none; }
.round-panel.active { display: block; }

/* ── Match Grid (Public) ─────────────────────────────────────── */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: .8rem;
}
.match-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  position: relative;
  transition: border-color .2s;
}
.match-card.status-live     { border-color: var(--accent); background: rgba(224,82,82,.06); }
.match-card.status-finished { opacity: .8; }
.match-card.status-finished:hover { opacity: 1; }

.match-teams { display: flex; align-items: center; gap: .5rem; }
.match-team  { flex: 1; font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-team.right  { text-align: right; }
.match-team.winner { font-weight: 800; color: var(--accent); }

.match-score {
  display: flex;
  align-items: center;
  gap: .2rem;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
  min-width: 58px;
  justify-content: center;
}
.score-div     { color: var(--muted2); font-size: .85rem; }
.score-pending { color: var(--muted2); font-size: .9rem; }

.match-live-badge {
  position: absolute;
  top: .45rem; right: .6rem;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .3rem;
}
.match-live-badge .live-dot { background: var(--accent); }

/* ── Score Entry (Admin) ─────────────────────────────────────── */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.score-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  transition: border-color .2s;
}
.score-card.done { border-color: var(--accent); }
.score-card.live { border-color: var(--accent); background: rgba(224,82,82,.06); box-shadow: 0 0 0 1px var(--accent); }

.score-teams    { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.team-name      { flex: 1; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-right     { text-align: right; }
.score-display  { min-width: 62px; text-align: center; font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.score-placeholder { color: var(--muted2); font-size: .9rem; }

.score-input-area { border-top: 1px solid var(--border2); padding-top: .8rem; }
.score-inputs     { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: .75rem; }
.score-stepper    { display: flex; align-items: center; gap: .3rem; }

.score-inp {
  width: 58px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  padding: .45rem .2rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.score-inp:focus { border-color: var(--accent); outline: none; }

.score-colon { font-size: 1.5rem; font-weight: 800; color: var(--muted); }

.step-btn {
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .1s;
  font-family: 'Readex Pro', sans-serif;
}
.step-btn:hover  { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.step-btn:active { transform: scale(.9); }

.score-actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; }

/* ── K.O. Section ────────────────────────────────────────────── */
.ko-section        { margin-bottom: 2rem; }
.ko-stage-title    { color: var(--accent); margin-bottom: .8rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.ko-matches        { display: flex; flex-wrap: wrap; gap: .8rem; }

.ko-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  min-width: 220px;
  flex: 1;
  max-width: 300px;
  position: relative;
}
.ko-card.status-live     { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ko-card.status-finished .ko-row.winner .ko-team { color: var(--accent); font-weight: 800; }
.ko-card.status-finished .ko-row.winner .ko-num  { color: var(--accent); }

.ko-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border2);
}
.ko-row:last-of-type { border-bottom: none; }
.ko-team { font-size: .88rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ko-num  { font-size: 1.1rem; font-weight: 800; min-width: 26px; text-align: right; }
.ko-pen  { font-size: .72rem; color: var(--muted); text-align: center; margin-top: .35rem; }

/* K.O. Admin */
.ko-match-row { padding: .9rem 0; border-bottom: 1px solid var(--border2); }
.ko-match-row:last-child { border-bottom: none; }
.ko-teams { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.ko-score { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 800; }
.ko-score small { color: var(--muted); font-size: .7rem; }
details.ko-score-form summary { cursor: pointer; color: var(--accent); font-size: .82rem; font-weight: 700; margin-top: .4rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Qualify highlight for K.O. admin ───────────────────────── */
.qualify-row td { background: rgba(224,82,82,.06) !important; }

/* ── Setup Screen ────────────────────────────────────────────── */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1.1rem;
}
.setup-icon     { font-size: 4.5rem; }
.setup-screen h2 { font-size: 2rem; font-weight: 800; }
.setup-screen p  { color: var(--muted); font-size: 1rem; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}
.login-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
  color: var(--accent);
  margin-bottom: .5rem;
}
.login-box h2 {
  text-align: center;
  margin-bottom: 1.75rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ============================================================
   KC Live – Tournify-Style Public View
   ============================================================ */

/* ── Hero Header ─────────────────────────────────────────────── */
.kc-hero {
  background: linear-gradient(180deg, #0c1525 0%, var(--nav) 100%);
  padding: .9rem 1.5rem .7rem;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}
.kc-hero-logo {
  height: 38px;
  width: auto;
  margin-bottom: .45rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.kc-hero-title {
  font-size: 1.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.15;
  margin-bottom: .5rem;
}
.kc-hero-sub {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.kc-live-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
}

/* ── Sticky Tab Navigation ───────────────────────────────────── */
.kc-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.kc-tabs::-webkit-scrollbar { display: none; }
.kc-tab {
  flex: 1;
  min-width: 90px;
  padding: .9rem .6rem;
  border: none;
  background: none;
  color: var(--muted);
  font-family: 'Readex Pro', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.kc-tab:hover { color: var(--text); }
.kc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.kc-tab svg { flex-shrink: 0; }

/* ── Main Content + Panels ───────────────────────────────────── */
.kc-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.kc-panel { display: none; }
.kc-panel.active { display: block; }

.kc-section-title {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

/* ── Legend ──────────────────────────────────────────────────── */
.kc-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
  font-size: .75rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.kc-legend span { display: flex; align-items: center; gap: .35rem; }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.legend-dot.gold { background: var(--gold); }
.legend-dot.red  { background: var(--accent); }
.legend-dot.blue { background: #3b82f6; }

/* pos-plain: rank number without badge (positions 9+) */
.pos-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  font-size: .82rem;
  color: var(--muted);
}

/* ── Match Cards (mc) ────────────────────────────────────────── */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}
.mc {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.mc:hover  { border-color: var(--accent); }
.mc.live   { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(224,82,82,.18); }

.mc-head {
  background: var(--surface2);
  padding: .3rem .6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.mc-live-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--accent);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .1em;
}
.mc-live-pill .live-dot { background: var(--accent); width: 5px; height: 5px; }
.mc-time { color: var(--muted); font-size: .65rem; font-weight: 700; }

.mc-row {
  padding: .38rem .6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
}
.mc-row + .mc-row { border-top: 1px solid var(--border2); }
.mc-team {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .8rem;
}
.mc-score {
  min-width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  flex-shrink: 0;
}
.mc-score.win     { background: #16a34a; color: #fff; }
.mc-score.draw    { background: #d97706; color: #fff; }
.mc-score.loss    { background: var(--accent); color: #fff; }
.mc-score.pending { background: var(--surface3); color: var(--muted2); font-size: .72rem; }
.mc-time-badge {
  font-size: .68rem;
  color: var(--muted);
  background: var(--surface3);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}
/* Platzhalter-Teamname (noch nicht feststehend) */
.mc-placeholder {
  color: var(--muted);
  font-style: italic;
  font-weight: 400 !important;
}

/* Zeit + Feld oben auf Score-Karte im Admin */
.score-card-meta {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .25rem .75rem 0;
  font-size: .7rem;
  color: var(--muted);
}
.score-time { font-weight: 700; color: var(--text); }
.score-field {
  background: var(--surface3);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

.mc-pen {
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  padding: .25rem .6rem .35rem;
  border-top: 1px solid var(--border2);
}

/* ── Accordion ───────────────────────────────────────────────── */
.accordion {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: .65rem;
  overflow: hidden;
}
.accordion-head {
  background: var(--surface2);
  padding: .7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.accordion-head:hover { background: var(--surface3); }
.acc-label {
  font-size: .82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.acc-live-dot {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .65rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
}
.acc-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.acc-progress {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 400;
}
.accordion-chevron {
  font-size: .6rem;
  color: var(--muted);
  transition: transform .2s;
}
.accordion-head.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body { padding: .75rem; border-top: 1px solid var(--border); }
.accordion-body.hidden { display: none; }

/* ── Search ──────────────────────────────────────────────────── */
.kc-search-bar {
  margin-bottom: 1rem;
  position: relative;
}
.kc-search-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Readex Pro', sans-serif;
  font-size: .9rem;
  padding: .6rem .9rem;
  transition: border-color .15s;
}
.kc-search-input::placeholder { color: var(--muted2); }
.kc-search-input:focus { outline: none; border-color: var(--accent); background: var(--surface3); }

/* ── Team Grid ───────────────────────────────────────────────── */
.kc-team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}
.kc-team-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .65rem;
  text-align: left;
  font-family: 'Readex Pro', sans-serif;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.kc-team-card:hover { border-color: var(--accent); background: var(--surface2); }
.kc-team-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 900;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: .02em;
}
.kc-team-card-name {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Team Detail ─────────────────────────────────────────────── */
.kc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Readex Pro', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .4rem .85rem;
  cursor: pointer;
  margin-bottom: 1.1rem;
  transition: color .15s, border-color .15s;
}
.kc-back-btn:hover { color: var(--text); border-color: var(--accent); }
.kc-team-detail-name {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 1.25rem;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-title-text { display: none; }
  .match-grid  { grid-template-columns: 1fr; }
  .scores-grid { grid-template-columns: 1fr; }
  .admin-grid  { grid-template-columns: repeat(2, 1fr); }
  .ko-matches  { flex-direction: column; }
  .ko-card     { max-width: 100%; }
}

@media (max-width: 900px) {
  .mc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .team-name-full  { display: none; }
  .team-name-short { display: inline !important; }
  /* Turnier-Tabelle (10 Spalten): auf Mobile T+ T- ausblenden */
  #standings-table .col-num:nth-child(7),
  #standings-table .col-num:nth-child(8) { display: none; }
  /* Kompakt-Tabelle (8 Spalten): S U N ausblenden, nur TD + Pkt */
  #standings-compact th:nth-child(4),
  #standings-compact td:nth-child(4),
  #standings-compact th:nth-child(5),
  #standings-compact td:nth-child(5),
  #standings-compact th:nth-child(6),
  #standings-compact td:nth-child(6) { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .mc-grid { grid-template-columns: 1fr; }
  .kc-team-grid { grid-template-columns: 1fr; }
  .kc-tab { font-size: .65rem; padding: .8rem .4rem; gap: .3rem; }
}
