/* ============================================================
   Tournament Manager – Light Theme CSS
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f4f6fb;
  --bg-card:      #ffffff;
  --bg-card2:     #f0f3fa;
  --bg-input:     #ffffff;
  --border:       #dde2ef;
  --border-light: #c8d0e8;
  --text:         #1a1f36;
  --text-muted:   #7a8299;
  --text-dim:     #4a5270;
  --primary:      #4f6ef7;
  --primary-h:    #3d5ce5;
  --accent:       #f76c4f;
  --accent-h:     #e05a3e;
  --success:      #18a85a;
  --warning:      #d97706;
  --danger:       #dc2626;
  --live:         #dc2626;
  --gold:         #d97706;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 2px 12px rgba(79,110,247,0.08);
  --shadow-md:    0 4px 24px rgba(79,110,247,0.12);
  --transition:   0.18s ease;
}

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 780px;
}

.main-content {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* ---- Header ---- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.site-logo svg { color: var(--primary); flex-shrink: 0; }
.site-logo:hover { text-decoration: none; color: var(--primary); }
.admin-label {
  font-size: 0.7rem;
  background: var(--primary);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-user {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Footer ---- */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  vertical-align: middle;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary  { background: var(--primary);  color: white; }
.btn-primary:hover  { background: var(--primary-h); }
.btn-accent   { background: var(--accent);   color: white; }
.btn-accent:hover   { background: var(--accent-h); }
.btn-secondary { background: var(--bg-card2); color: var(--text); border-color: var(--border-light); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost    { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover    { color: var(--text); border-color: var(--border-light); }
.btn-danger   { background: var(--danger);   color: white; }
.btn-danger:hover   { background: #b91c1c; }
.btn-warning  { background: var(--warning);  color: white; }
.btn-warning:hover  { background: #b45309; }

.btn-sm  { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn-xs  { padding: 0.2rem 0.55rem; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-type      { background: #eff6ff; color: #2563eb; }
.badge-status    { background: var(--bg-card2); color: var(--text-muted); }
.badge-draft     { background: #f0f3fa; color: var(--text-muted); }
.badge-active    { background: #f0fdf4; color: var(--success); }
.badge-completed { background: #f0f3fa; color: var(--text-muted); }
.badge-live      { background: #fff5f5; color: var(--live); animation: pulse-badge 2s infinite; }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ---- Flash messages ---- */
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.flash-success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.flash-error   { background: #fff5f5; border-color: #fca5a5; color: #b91c1c; }
.flash-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.flash-info    { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.flash ul { padding-left: 1.2rem; list-style: disc; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }
.card-image { overflow: hidden; max-height: 180px; }
.card-image img { width: 100%; height: 180px; object-fit: cover; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.card-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-desc { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.75rem; line-height: 1.5; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
}
.card-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---- Tournament Grid ---- */
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tournament-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.tournament-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tournament-card.is-live { border-color: rgba(220,38,38,0.5); }

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.8rem; font-weight: 800; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.header-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---- Filter tabs ---- */
.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-tab {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- Tab navigation ---- */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.7rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Tournament header ---- */
.tournament-header { margin-bottom: 1.5rem; }
.tournament-hero-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}
.tournament-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.tournament-title-block { }
.tournament-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.tournament-title-block h1 { font-size: 2rem; font-weight: 900; }
.tournament-desc { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }

/* ---- Bracket ---- */
.bracket-section { margin-bottom: 2.5rem; }
.bracket-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bracket-container {
  overflow-x: auto;
  padding-bottom: 1rem;
}

.bracket-rounds {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  min-width: max-content;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 200px;
}

.round-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

.bracket-matches {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-around;
  height: 100%;
}

.bracket-match {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
  min-width: 200px;
}
.bracket-match:hover { border-color: var(--border-light); }
.bracket-match.is-live { border-color: var(--live); }
.bracket-match.is-completed { border-color: var(--border); opacity: 0.85; }

.bracket-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  position: relative;
  font-size: 0.88rem;
  transition: background var(--transition);
}
.bracket-team + .bracket-team { border-top: 1px solid var(--border); }
.bracket-team.is-winner {
  background: rgba(79,110,247,0.07);
  color: #2d4aaa;
  font-weight: 700;
}
.bracket-team.is-loser { opacity: 0.55; }

.bracket-team .team-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-team .team-score {
  font-weight: 700;
  font-size: 1rem;
  min-width: 1.5rem;
  text-align: right;
  color: var(--text);
}
.bracket-team.is-winner .team-score { color: var(--primary); }

.bracket-vs {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.15rem 0.75rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.bracket-match-meta {
  padding: 0.3rem 0.75rem;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.75rem;
  background: rgba(220,38,38,0.06);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--live);
  letter-spacing: 0.06em;
}

.tbd { color: var(--text-muted); font-style: italic; }

/* ---- Standings table ---- */
.standings-table-wrap { overflow-x: auto; }

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.standings-table th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.standings-table th:first-child,
.standings-table th:nth-child(2) { text-align: left; }
.standings-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.standings-table td:nth-child(2) { text-align: left; }
.standings-table tbody tr:hover { background: var(--bg-card2); }
.standings-table .top-position { background: rgba(79,110,247,0.04); }
.standings-table .advances { background: rgba(24,168,90,0.04); }
.standings-table .points { font-weight: 700; color: var(--primary); }

.standings-table-compact th, .standings-table-compact td { padding: 0.45rem 0.6rem; font-size: 0.82rem; }

/* ---- Groups grid ---- */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.group-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.group-block h3 {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--bg-card2);
}

/* ---- Match list (public) ---- */
.match-round-block { margin-bottom: 2rem; }
.round-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.match-list { display: flex; flex-direction: column; gap: 0.6rem; }
.match-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition);
}
.match-row.is-live { border-color: var(--live); }
.match-team { flex: 1; font-size: 0.9rem; }
.match-team-left { text-align: right; }
.match-team-right { text-align: left; }
.match-score-block {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 80px;
  justify-content: center;
}
.score {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
}
.score-win  { color: var(--success); }
.score-lose { color: var(--text-muted); }
.score-sep  { color: var(--text-muted); font-size: 1rem; }
.score-vs   { color: var(--text-muted); font-size: 0.85rem; }

/* ---- Teams grid (public) ---- */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  transition: border-color var(--transition);
}
.team-card:hover { border-color: var(--border-light); }
.team-card-img { width: 100%; height: 120px; object-fit: cover; }
.team-card-placeholder {
  width: 100%; height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card2); color: var(--text-muted);
}
.team-card-body { padding: 0.85rem; }
.team-card-body h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; }
.team-card-body p  { font-size: 0.8rem; color: var(--text-muted); }
.seed-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  background: rgba(217,119,6,0.1);
  color: var(--gold);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.team-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.team-thumb-placeholder {
  width: 28px; height: 28px;
  background: var(--bg-card2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--text-muted);
  flex-shrink: 0;
}

/* ---- Forms ---- */
.admin-form { }
.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.form-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.form-check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}
input[type="file"] {
  background: #fff;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  width: 100%;
  cursor: pointer;
  font-size: 0.85rem;
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
textarea { resize: vertical; min-height: 80px; }
small { font-size: 0.78rem; color: var(--text-muted); display: block; margin-top: 0.3rem; }
.required { color: var(--accent); }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: center;
}

.image-preview {
  max-width: 200px;
  max-height: 150px;
  margin-top: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.image-preview.hidden { display: none; }
.current-image { margin-bottom: 0.5rem; }
.current-image img { border-radius: var(--radius); }

/* ---- Admin table ---- */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-card2); }
.admin-table .actions-cell { white-space: nowrap; }
.admin-table .current-user-row { background: rgba(79,110,247,0.04); }
.table-tournament-name { font-weight: 600; }

/* ---- Progress bar ---- */
.progress-bar {
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
  width: 120px;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ---- Two-col layout ---- */
.two-col-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .two-col-layout { grid-template-columns: 1fr; }
}

/* ---- Team list (admin teams page) ---- */
.team-list { }
.team-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.team-list-item:last-child { border-bottom: none; }
.team-list-item:hover { background: var(--bg-card2); }
.team-list-item.sortable-ghost { opacity: 0.4; background: var(--bg-card2); }

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1.1rem;
  user-select: none;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.team-list-info { flex: 1; min-width: 0; }
.team-list-info strong { font-size: 0.9rem; display: block; }
.team-list-info small { color: var(--text-muted); font-size: 0.78rem; }
.team-list-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* ---- Results page ---- */
.results-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.results-section {
  margin-bottom: 2rem;
}
.results-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.result-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color var(--transition);
}
.result-row.is-live { border-color: var(--live); }
.result-row.is-completed { border-color: var(--border); opacity: 0.8; }

.result-match-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.match-num { color: var(--text-muted); }

.result-teams {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.result-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}
.result-team .team-name {
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-team .team-name.is-winner { color: var(--success); }

/* Score controls */
.score-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
}

.score-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.score-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.score-btn:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: white; }
.score-btn:active:not(:disabled) { transform: scale(0.92); }
.score-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.score-btn.score-dec:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); }

.score-display {
  font-size: 1.6rem;
  font-weight: 900;
  min-width: 2rem;
  text-align: center;
  color: var(--text);
  line-height: 1;
}

.score-sep {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0.25rem;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.result-notes {
  padding: 0.5rem 1rem 0.75rem;
}
.match-notes {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  resize: none;
  min-height: 36px;
  font-family: inherit;
}
.match-notes:focus { outline: none; border-color: var(--primary); color: var(--text); }

/* ---- Quick links ---- */
.quick-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ---- Bracket controls ---- */
.bracket-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ---- Group assign ---- */
.groups-assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.group-assign-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}
.group-team-list { }
.group-team-member {
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.group-team-list li:last-child { border-bottom: none; }

/* ---- Danger zone ---- */
.danger-zone {
  margin-top: 2rem;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: #fff5f5;
}
.danger-zone h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--danger);
  margin-bottom: 0.85rem;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state.small { padding: 2rem; }
.empty-state svg { margin: 0 auto 1rem; color: var(--border-light); }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1rem; }

/* ---- Auth page ---- */
.auth-page { justify-content: center; align-items: center; padding: 2rem 1rem; }
.auth-container {
  width: 100%;
  max-width: 420px;
  margin: auto;
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.auth-logo svg { color: var(--primary); }
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; }
.auth-box h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.35rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-form { margin-top: 1.5rem; }
.auth-success { text-align: center; padding: 1rem 0; }
.auth-success svg { margin: 0 auto 0.75rem; color: var(--success); }
.auth-success h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.auth-success p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.3rem; }
.auth-note { font-size: 0.8rem !important; }

/* ---- Install page ---- */
.install-container { max-width: 680px; margin: 4rem auto; padding: 0 1.5rem; }
.install-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.install-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.step-num {
  width: 24px; height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.install-ok   { color: var(--success); font-weight: 600; }
.install-fail { color: var(--danger);  font-weight: 600; }
.install-warn { color: var(--warning); font-weight: 600; }
pre.code-block {
  background: #f4f6fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: monospace;
  margin: 0.5rem 0;
}

/* ---- Toast notifications ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  pointer-events: auto;
  max-width: 320px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--primary); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---- Live dot ---- */
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--live);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ---- Inline details (no-JS popover) ---- */
.inline-details { display: inline-block; position: relative; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] { z-index: 10; }
.inline-form {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.6rem;
  display: flex;
  gap: 0.4rem;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.inline-form input { flex: 1; font-size: 0.82rem; padding: 0.35rem 0.5rem; }

.tournament-assign-list {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 220px;
  box-shadow: var(--shadow-md);
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
}
.assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.assign-row:last-child { border-bottom: none; }
.assign-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---- Text utilities ---- */
.text-muted { color: var(--text-muted) !important; }
.hidden { display: none !important; }

/* ---- Team cell in tables ---- */
.team-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header-nav .nav-link { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .result-teams { flex-direction: column; }
  .result-team { width: 100%; }
  .score-controls { align-self: center; }
  .match-row { flex-direction: column; gap: 0.4rem; }
  .match-team { text-align: center !important; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th, .admin-table td { padding: 0.5rem 0.6rem; }
  .admin-body .main-content { margin-left: 0; }
}

/* ============================================================
   Admin Sidebar Layout
   ============================================================ */

.admin-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(79,110,247,0.06);
}

/* Shift main content when sidebar is present */
.admin-body .main-content {
  margin-left: 220px;
}

/* Hide old topbar in admin context */
.admin-body .site-header { display: none; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}
.sidebar-logo svg { color: var(--primary); flex-shrink: 0; }

.admin-chip {
  font-size: 0.62rem;
  background: var(--primary);
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.88rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-link:hover { background: var(--bg-card2); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: rgba(79,110,247,0.1); color: var(--primary); font-weight: 600; }
.sidebar-link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.25rem;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
  flex: 1;
}
.user-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-logout {
  color: var(--text-muted);
  padding: 0.3rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger); background: rgba(220,38,38,0.07); text-decoration: none; }

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-blue  { background: rgba(79,110,247,0.1); color: var(--primary); }
.stat-icon-green { background: rgba(24,168,90,0.1); color: var(--success); }
.stat-icon-red   { background: rgba(220,38,38,0.08); color: var(--live); }
.stat-icon-gold  { background: rgba(217,119,6,0.1); color: var(--gold); }
.stat-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.15rem;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Tournament Cards (admin dashboard) ---- */
.admin-tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.admin-t-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.admin-t-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.admin-t-card.is-live { border-color: rgba(220,38,38,0.4); }
.admin-t-card.is-active { border-color: rgba(24,168,90,0.3); }

.admin-t-card-img {
  height: 90px;
  overflow: hidden;
  position: relative;
}
.admin-t-card-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-t-card-img-placeholder {
  height: 90px;
  background: linear-gradient(135deg, var(--bg-card2) 0%, #e4e9f8 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--border-light);
}

.admin-t-card-body {
  padding: 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-t-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-t-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.meta-sep { opacity: 0.4; }

.admin-t-card-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.admin-t-card-actions {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card2);
  flex-wrap: wrap;
}

/* ---- Sidebar mobile toggle ---- */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-body .main-content { margin-left: 0; }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0.75rem; left: 0.75rem;
    z-index: 201;
    width: 38px; height: 38px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
  }
  .admin-body .main-content { padding-top: 3.5rem; }
}
@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
}

/* ================================================================
   SPIELSTEUERUNG
   ================================================================ */

/* ---- Basis-Layout ---- */
.game-control-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Header ---- */
.gc-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.gc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}
.gc-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.gc-tournament-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gc-match-num {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---- Haupt-Content ---- */
.gc-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 0.75rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---- Score-Block ---- */
.game-score-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
}

.gc-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.gc-team-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.gc-team-name {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.gc-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.gc-score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gc-score-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.score-huge {
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 1.2ch;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 20px rgba(79,110,247,0.15);
}

.score-sep-big {
  font-size: 4rem;
  font-weight: 300;
  color: var(--border-light);
  line-height: 1;
}

/* ---- Tor-Buttons ---- */
.goal-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  font-size: 2.5rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s;
  touch-action: manipulation;
  line-height: 1;
  flex-shrink: 0;
}
.goal-btn-team1 {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px rgba(79,110,247,0.3);
}
.goal-btn-team2 {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(247,108,79,0.3);
}
.goal-btn:hover:not(:disabled) { opacity: 0.9; box-shadow: 0 6px 28px rgba(0,0,0,0.15); }
.goal-btn:active:not(:disabled) { transform: scale(0.9); }
.goal-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- Inline-Tor-Formular ---- */
.goal-inline-form {
  width: 100%;
  max-width: 320px;
}
.goal-form-inner {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.goal-form-inner h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dim);
  margin: 0;
}
.goal-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---- Spielzustand ---- */
.game-state-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.gc-state-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.half-badge {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-card2);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.game-timer {
  font-size: 2.5rem;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-card2);
  border-radius: var(--radius-lg);
  padding: 0.25rem 0.75rem;
  letter-spacing: 0.05em;
  line-height: 1;
}
.game-timer.timer-warning { color: var(--warning); }
.game-timer.timer-expired { color: var(--danger); animation: pulse-red 1s infinite; }

@keyframes pulse-red {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.gc-state-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.gc-action-btn {
  min-width: 220px;
  padding: 0.9rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  touch-action: manipulation;
}

.gc-completed-msg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}
.winner-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
}

.gc-win-hint, .gc-duration-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Tor-Liste ---- */
.game-goals-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.gc-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
}
.gc-no-goals {
  color: var(--border-light);
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

.goal-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  border-radius: 0;
}
.goal-list-item:last-child { border-bottom: none; }

.goal-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.goal-half-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-card2);
  color: var(--text-dim);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.goal-minute {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.goal-team {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.badge-own-goal {
  font-size: 0.7rem;
  background: rgba(220,38,38,0.08);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.goal-player-wrap { flex-shrink: 0; }

.inline-player-edit {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  width: 130px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.inline-player-edit:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-goal-delete {
  background: none;
  border: none;
  color: var(--border-light);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.btn-goal-delete:hover { color: var(--danger); background: rgba(220,38,38,0.06); }

/* ---- Toast ---- */
.gc-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.gc-toast-error { border-color: #fca5a5; color: var(--danger); }
.gc-toast-success { border-color: #86efac; color: var(--success); }

/* ---- Responsive Spielsteuerung ---- */
@media (max-width: 600px) {
  .score-huge { font-size: 4rem; }
  .score-sep-big { font-size: 2.5rem; }
  .goal-btn { width: 72px; height: 72px; font-size: 2rem; }
  .gc-action-btn { min-width: 180px; font-size: 1rem; }
  .game-timer { font-size: 2rem; }
  .inline-player-edit { width: 100px; }
}
@media (max-width: 380px) {
  .score-huge { font-size: 3rem; }
  .goal-btn { width: 60px; height: 60px; font-size: 1.7rem; }
  .gc-team-name { font-size: 0.85rem; }
}

/* ================================================================
   SPIEL-ÜBERSICHT (overview.php)
   ================================================================ */

.game-overview-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.go-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.go-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.go-live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--live);
}

.go-main {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.go-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.go-hint {
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.go-hint code {
  background: var(--bg-card2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.game-overview-grid {
  display: grid;
  gap: 1rem;
}
.game-overview-grid-1 { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
.game-overview-grid-2 { grid-template-columns: repeat(2, 1fr); }
.game-overview-grid-3 { grid-template-columns: repeat(2, 1fr); }
.game-overview-grid-4 { grid-template-columns: repeat(2, 1fr); }

.game-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 180px;
  box-shadow: var(--shadow);
}

.gt-tournament {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gt-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.gt-team {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  line-height: 1.2;
  min-width: 0;
  word-break: break-word;
}
.gt-team:last-child { text-align: right; }

.gt-score {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.gt-score-num {
  font-size: 2.5rem;
  font-weight: 900;
  min-width: 1.2ch;
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gt-score-sep {
  font-size: 1.8rem;
  color: var(--border-light);
  line-height: 1;
}

.gt-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gt-half {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}
.gt-timer {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.gt-timer.timer-warning { color: var(--warning); }
.gt-timer.timer-expired { color: var(--danger); }

@media (max-width: 600px) {
  .game-overview-grid-2,
  .game-overview-grid-3,
  .game-overview-grid-4 {
    grid-template-columns: 1fr;
  }
  .gt-score-num { font-size: 2rem; }
}

/* ---- Radio-Gruppe Spieleinstellungen ---- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ================================================================
   KARTEN-BUTTONS (Spielsteuerung)
   ================================================================ */

.card-btns {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.card-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, opacity 0.15s;
  touch-action: manipulation;
  flex-shrink: 0;
}
.card-btn:hover  { opacity: 0.88; transform: scale(1.08); }
.card-btn:active { transform: scale(0.92); }

.card-btn-yellow { background: #f59e0b; color: white; }
.card-btn-red    { background: #dc2626; color: white; }
.card-btn-yr {
  background: linear-gradient(135deg, #f59e0b 50%, #dc2626 50%);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ================================================================
   SOFORT-TOR DETAIL-PANEL
   ================================================================ */

.goal-detail-panel {
  width: 100%;
  max-width: 360px;
  overflow: hidden;
}
.goal-detail-panel.hidden { display: none; }

.goal-detail-inner {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.goal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.goal-detail-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
}
.goal-detail-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.goal-detail-close:hover { color: var(--danger); background: rgba(220,38,38,0.07); }

.goal-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.goal-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.goal-detail-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

.goal-detail-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ================================================================
   EREIGNIS-LISTE (vereinheitlicht)
   ================================================================ */

.event-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background 0.3s;
}
.event-list-item:last-child { border-bottom: none; }

.event-list-item-new {
  background: rgba(79,110,247,0.06);
}

.event-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
  line-height: 1;
}
.event-icon-goal   { }
.event-icon-yellow { color: #f59e0b; }
.event-icon-red    { color: #dc2626; }
.event-icon-yr     { font-size: 0.65rem; font-weight: 800; color: #92400e; }

.event-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.event-badge-eigentor {
  font-size: 0.68rem;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
}

.event-comment-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-gelbrot {
  font-size: 0.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b 50%, #dc2626 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================================
   EREIGNIS HINZUFÜGEN FORMULAR
   ================================================================ */

.add-event-form {
  margin-top: 0.75rem;
  overflow: hidden;
}
.add-event-form.hidden { display: none; }

.add-event-inner {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

/* ================================================================
   QR-CODE MODAL
   ================================================================ */

.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.qr-modal-box {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.qr-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.qr-modal-close:hover { color: var(--danger); background: rgba(220,38,38,0.07); }

/* ================================================================
   ÜBERSICHTSSEITE (overview.php) – Erweiterungen
   ================================================================ */

/* Live-Sektion mit pulsierendem Rahmen */
.live-section {
  border: 2px solid #dc2626;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: #dc2626; }
  50%       { border-color: #fca5a5; }
}

.ov-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ov-section-header {
  margin-bottom: 1rem;
}
.ov-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ov-tournament-heading {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Live-Kacheln */
.live-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.live-tile {
  background: white;
  border-radius: 10px;
  padding: 1.1rem;
  box-shadow: 0 2px 12px rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.15);
}

.live-teams-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.live-team-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.live-score-big {
  font-size: 3.5rem;
  font-weight: 900;
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.live-last-events {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.live-event-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Nächste Spiele / Ergebnisse */
.upcoming-list { display: flex; flex-direction: column; }

.upcoming-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.upcoming-row:last-child { border-bottom: none; }

.upcoming-round {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-card2);
  color: var(--text-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.upcoming-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.upcoming-vs {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Torschützen */
.scorers-list { display: flex; flex-direction: column; gap: 0; }

.top-scorer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.top-scorer-row:last-child { border-bottom: none; }

.scorer-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1.5rem;
}
.scorer-name {
  flex: 1;
  font-weight: 600;
}
.scorer-team {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.scorer-goals {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.scorer-goal-count {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

/* Spielplan-Toggle */
.ov-bracket-toggle {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.ov-bracket-body {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.ov-bracket-body.hidden { display: none; }

/* Live-Timer in Übersichtsseite */
.live-timer {
  font-family: 'Courier New', monospace;
  font-weight: 700;
}
.live-timer.timer-warning { color: var(--warning); }
.live-timer.timer-expired { color: var(--danger); }
