/* ═══════════════════════════════════════════════════════
   WM Tippspiel 2026 — Stylesheet
   Design entspricht dem Original Next.js/Tailwind-Projekt
═══════════════════════════════════════════════════════ */

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

/* ── Farb-Variablen ────────────────────────────────── */
:root {
  /* Akzentfarbe: Amber (wie Original) */
  --accent:        #f59e0b;
  --accent-hover:  #d97706;
  --accent-subtle: rgba(245,158,11,.12);
  --accent-border: rgba(245,158,11,.30);

  /* Helles Theme (Standard) */
  --bg:         #f8fafc;
  --bg-card:    #ffffff;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --text-on-accent: #0f172a;

  --hover-bg:   #f1f5f9;
  --divider:    #e2e8f0;

  --emerald:    #10b981;
  --rose:       #f43f5e;
  --blue:       #3b82f6;
}

/* ── Dunkles Theme ─────────────────────────────────── */
html.dark {
  --bg:         #0f172a;
  --bg-card:    #1e293b;
  --border:     #334155;
  --text:       #f8fafc;
  --text-muted: #cbd5e1;
  --text-faint: #94a3b8;
  --hover-bg:   #253047;
  --divider:    #2d3f55;
}

/* ── Alternative Akzentfarben ──────────────────────── */
html.accent-blue {
  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-subtle: rgba(59,130,246,.12);
  --accent-border: rgba(59,130,246,.30);
  --text-on-accent: #ffffff;
}
html.accent-green {
  --accent:        #22c55e;
  --accent-hover:  #16a34a;
  --accent-subtle: rgba(34,197,94,.12);
  --accent-border: rgba(34,197,94,.30);
  --text-on-accent: #0f172a;
}

/* ── Basis ─────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .2s, color .2s;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Navigation ────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
html.dark .navbar { background: rgba(15,23,42,.95); }

.navbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
  text-decoration: none;
}
.navbar-brand .logo { font-size: 1.5rem; line-height: 1; }
.navbar-brand .brand-text { display: none; }
@media (min-width: 640px) { .navbar-brand .brand-text { display: block; } }

.nav-links {
  display: flex;
  align-items: center;
  gap: .125rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  padding: .375rem .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--hover-bg); }
.nav-link.active { background: var(--accent); color: var(--text-on-accent); }

.navbar-end {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.nav-user {
  font-size: .875rem;
  color: var(--text-faint);
  display: none;
}
@media (min-width: 640px) { .nav-user { display: block; } }

/* ── Hamburger-Button ──────────────────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: .375rem;
  cursor: pointer;
  padding: .25rem .5rem;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  transition: background .15s;
}
.hamburger-btn:hover { background: var(--hover-bg); }

/* ── Mobile-Menü ───────────────────────────────────── */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: .5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  gap: .25rem;
}
.mobile-menu.open { display: flex; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.mobile-nav-link:hover { background: var(--hover-bg); color: var(--text); }
.mobile-nav-link.active {
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 600;
}
.mobile-nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; flex-shrink: 0; }

.mobile-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 1rem;
  margin-top: .25rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive Breakpoint ─────────────────────────── */
@media (max-width: 767px) {
  .hamburger-btn { display: flex; align-items: center; }
  .nav-links     { display: none !important; }
  .logout-form-desktop { display: none; }
  .nav-user      { display: none !important; }
}

/* ── Layout ────────────────────────────────────────── */
.page-content {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.space-y > * + * { margin-top: 1.5rem; }
.space-y-sm > * + * { margin-top: .75rem; }

/* ── Karte ─────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1.5rem;
}

/* ── Formulare ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .375rem; }

label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.input::placeholder { color: var(--text-faint); }

/* Zahl-Input ohne Pfeile */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

.input-number {
  width: 4rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.125rem;
  padding: .5rem .25rem;
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(239,68,68,.4);
  color: #ef4444;
  font-size: .75rem;
  padding: .25rem .625rem;
}
.btn-danger:hover { background: rgba(239,68,68,.08); }

.btn-sm { padding: .375rem .75rem; font-size: .75rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Logout-Button */
.logout-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: .75rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: .375rem;
  transition: all .15s;
  font-family: inherit;
}
.logout-btn:hover { color: var(--text); background: var(--hover-bg); }

/* ── Meldungen ─────────────────────────────────────── */
.alert {
  padding: .875rem 1rem;
  border-radius: .625rem;
  font-size: .875rem;
  border: 1px solid;
  line-height: 1.5;
}
.alert-error   { background: rgba(239,68,68,.08);   border-color: rgba(239,68,68,.25);   color: #ef4444; }
.alert-success { background: rgba(16,185,129,.08);  border-color: rgba(16,185,129,.25);  color: #10b981; }
.alert-info    { background: var(--accent-subtle);  border-color: var(--accent-border);  color: var(--accent); }

/* ── Auth-Seiten ───────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .emoji { font-size: 3rem; display: block; margin-bottom: .5rem; line-height: 1; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.auth-logo p  { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }

.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--accent); font-weight: 500; }
.auth-footer a:hover { opacity: .8; }

/* ── Stat-Karten ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1rem;
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-value.accent { color: var(--accent); }
.stat-value.danger { color: var(--rose); }
.stat-value.green  { color: var(--emerald); }
.stat-label { font-size: .75rem; color: var(--text-faint); margin-top: .125rem; }

/* ── Tabelle ───────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: left;
}
th.center, td.center { text-align: center; }
tbody tr { border-bottom: 1px solid var(--divider); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--hover-bg); }
tbody tr.me { background: var(--accent-subtle); }
td { padding: .75rem 1rem; font-size: .875rem; }

/* ── Badge / Pill ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-accent  { background: var(--accent-subtle);          color: var(--accent);   border: 1px solid var(--accent-border); }
.badge-green   { background: rgba(16,185,129,.1);           color: var(--emerald);  border: 1px solid rgba(16,185,129,.25); }
.badge-blue    { background: rgba(59,130,246,.1);           color: var(--blue);     border: 1px solid rgba(59,130,246,.25); }
.badge-slate   { background: var(--hover-bg);               color: var(--text-muted); border: 1px solid var(--border); }
.badge-rose    { background: rgba(244,63,94,.1);            color: var(--rose);     border: 1px solid rgba(244,63,94,.25); }

/* ── Banner / Hinweis-Links ────────────────────────── */
.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: .75rem;
  border: 1px solid;
  transition: opacity .15s;
  text-decoration: none;
}
.banner:hover { opacity: .85; }
.banner-accent { background: var(--accent-subtle); border-color: var(--accent-border); }
.banner-icon { font-size: 1.75rem; flex-shrink: 0; }
.banner-arrow { margin-left: auto; color: var(--accent); transition: transform .15s; flex-shrink: 0; }
.banner:hover .banner-arrow { transform: translateX(3px); }

/* ── Match-Karte (Tippen) ──────────────────────────── */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1rem;
  transition: border-color .15s;
}
.match-card.tipped    { border-color: rgba(16,185,129,.4); }
.match-card.untipped  { border-color: rgba(244,63,94,.4); }
.match-card.finished  { opacity: .8; }

.match-teams {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.team { flex: 1; }
.team.right { text-align: right; }
.team-name { font-weight: 600; font-size: .95rem; }

.score-display {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  min-width: 4rem;
  flex-shrink: 0;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
}

/* ── Gruppen-Tabs ──────────────────────────────────── */
.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.tab {
  padding: .375rem 1rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }

/* ── Theme-Button ──────────────────────────────────── */
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: .5rem;
  padding: .375rem .5rem;
  font-size: .875rem;
  display: flex;
  align-items: center;
  transition: all .15s;
  font-family: inherit;
  line-height: 1;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Countdown ─────────────────────────────────────── */
.countdown {
  font-size: .75rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.countdown.urgent { color: var(--rose); font-weight: 600; }

/* ── Hilfsklassen ──────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1        { flex: 1; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem;  }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem;   }
.gap-6 { gap: 1.5rem; }
.ml-auto { margin-left: auto; }
.mt-1  { margin-top: .25rem; }
.mt-2  { margin-top: .5rem; }
.mt-3  { margin-top: .75rem; }
.mb-3  { margin-bottom: .75rem; }
.p-4   { padding: 1rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .75rem; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.font-mono     { font-family: ui-monospace, monospace; }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-faint    { color: var(--text-faint); }
.text-green    { color: var(--emerald); }
.text-rose     { color: var(--rose); }
.opacity-70    { opacity: .7; }
.hidden        { display: none; }
@media (min-width: 640px) { .sm-block { display: block; } }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Collapse-Block (details/summary) ───────────────── */
.collapse-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.collapse-block > summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-weight: 600;
  font-size: .9rem;
}
.collapse-block > summary::-webkit-details-marker { display: none; }
.collapse-block > summary::marker { content: ''; }
.collapse-block[open] > summary {
  border-bottom: 1px solid var(--border);
}
.collapse-meta {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: auto;
}
.collapse-chevron {
  font-size: .7rem;
  color: var(--text-faint);
  transition: transform .2s;
  flex-shrink: 0;
}
.collapse-block[open] > summary .collapse-chevron {
  transform: rotate(180deg);
}
.collapse-body {
  padding: .875rem 1rem 1rem;
}

/* ── Wettquoten ─────────────────────────────────────── */
.odds-row {
  margin-top: .35rem;
  text-align: center;
}
.odds-btn {
  background: none;
  border: none;
  font-size: .68rem;
  color: var(--text-faint);
  cursor: pointer;
  padding: .1rem .4rem;
  border-radius: .25rem;
  font-family: inherit;
  transition: color .15s, background .15s;
  letter-spacing: .04em;
}
.odds-btn:hover  { color: var(--accent); }
.odds-btn.active { color: var(--accent); }
.odds-panel {
  margin-top: .35rem;
  display: none;
}
.odds-panel.open { display: block; }
.odds-chips {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: center;
}
.odds-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: .35rem;
  padding: .2rem .5rem;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.odds-lbl {
  font-weight: 700;
  color: var(--accent);
  font-size: .65rem;
  min-width: .8rem;
  text-align: center;
}
.odds-val {
  font-weight: 600;
  color: var(--text);
}
.odds-source {
  font-size: .6rem;
  color: var(--text-faint);
  display: block;
  margin-top: .3rem;
}
.odds-na {
  font-size: .68rem;
  color: var(--text-faint);
  font-style: italic;
}
.odds-prob-rows {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  margin: .45rem auto 0;
  width: 100%;
  max-width: 260px;
}
.odds-prob-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .68rem;
}
.odds-prob-lbl {
  font-weight: 700;
  color: var(--accent);
  min-width: .85rem;
  text-align: center;
}
.odds-prob-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.odds-prob-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.odds-prob-pct {
  color: var(--text-muted);
  min-width: 2.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.odds-prob-fav {
  font-size: .58rem;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: .05rem .3rem;
  border-radius: .2rem;
  font-weight: 700;
  min-width: 3rem;
  text-align: center;
}
.odds-prob-fav:empty { visibility: hidden; }
