/* ══════════════════════════════════════════════════════════════════════
   BuLi Tipp-Duell – gemeinsames Stylesheet für alle Seiten.
   Teil 1 stammt unverändert aus der ursprünglichen index.html.
   Teil 2 ab "Neue Komponenten" kam mit Login, Tipperfassung und Archiv dazu.
   ══════════════════════════════════════════════════════════════════════ */

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

/* ── Tokens ─────────────────────────────── */
:root {
  --sidebar-w: 300px;
  --moritz: #3B9EFF;
  --papa: #FFAA00;
  --trophy: #FFD060;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'Lato', 'Helvetica Neue', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

/* dark (default) */
[data-theme="dark"] {
  --sidebar-bg: #06070D;
  --bg:         #0F1018;
  --surface:    #171825;
  --surface-2:  #1E2030;
  --text:       #EEEEF5;
  --muted:      #7A7D90;
  --border:     #252738;
  --tab-active-bg: #EEEEF5;
  --tab-active-txt: #0F1018;
  --row-hover: rgba(255,255,255,0.04);
}

/* light */
[data-theme="light"] {
  --sidebar-bg: #0F1018;
  --bg:         #F0F2F9;
  --surface:    #FFFFFF;
  --surface-2:  #E8EBF4;
  --text:       #13141C;
  --muted:      #666880;
  --border:     #DDE0EE;
  --tab-active-bg: #13141C;
  --tab-active-txt: #FFFFFF;
  --row-hover: rgba(0,0,0,0.03);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

/* ── App Shell ─────────────────────────── */
#app-shell { display: flex; flex-direction: column; height: 100dvh; }
#body-row  { display: flex; flex: 1; min-height: 0; }

/* ── Mobile header ─────────────────────── */
#mobile-header {
  display: none; flex-direction: column;
  background: var(--sidebar-bg); flex-shrink: 0;
}
.mh-brand {
  padding: 0.9rem 1.25rem 0.6rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.mh-brand-trophy { color: var(--trophy); width: 22px; height: 22px; }
.mh-title  { font-family: var(--font-display); font-size: 1.55rem; color: #fff; letter-spacing: 0.06em; }
.mh-season { font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.14em; margin-left: auto; }

.mh-scores { display: grid; grid-template-columns: 1fr auto 1fr; border-top: 1px solid rgba(255,255,255,0.06); }
.mh-player { padding: 0.9rem 1.25rem 1rem; }
.mh-player:last-child { text-align: right; }
.mh-player-name { font-size: 0.58rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255,255,255,0.38); margin-bottom: 0.2rem; }
.mh-score { font-family: var(--font-display); font-size: 4rem; line-height: 0.85; letter-spacing: 0.02em; }
.mh-score-label { font-size: 0.58rem; font-weight: 700; color: rgba(255,255,255,0.2); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.3rem; }
.mh-vs { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.4rem; color: rgba(255,255,255,0.15); letter-spacing: 0.08em; padding: 0 0.5rem; }
.mh-badge { display: none; align-items: center; gap: 0.25rem; font-size: 0.58rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.35rem; }
.mh-badge.visible { display: flex; }
.mh-player:last-child .mh-badge { justify-content: flex-end; }
.mh-badge svg { width: 10px; height: 10px; }

/* ── Sidebar ───────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}

/* Brand */
.sidebar-brand {
  padding: 1.6rem 1.5rem 1.4rem;
  display: flex; align-items: flex-start; gap: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.brand-trophy-wrap {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: rgba(255,208,96,0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.brand-trophy-wrap svg { width: 22px; height: 22px; color: var(--trophy); stroke: var(--trophy); }
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.65rem; font-weight: 400;
  color: #fff; line-height: 0.95;
  letter-spacing: 0.05em;
}
.brand-text p {
  font-size: 0.58rem; font-weight: 700;
  color: rgba(255,255,255,0.25);
  margin-top: 0.45rem;
  text-transform: uppercase; letter-spacing: 0.15em;
}

/* VS Matchup card */
.vs-card {
  margin: 1rem 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.vs-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 1.1rem 1rem 0.9rem;
}
.vs-player { display: flex; flex-direction: column; }
.vs-player.right { align-items: flex-end; text-align: right; }
.vs-name {
  font-size: 0.6rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.15rem;
}
.vs-score {
  font-family: var(--font-display);
  font-size: 4.8rem; line-height: 0.85;
  letter-spacing: 0.02em;
}
.vs-sub {
  font-size: 0.57rem; font-weight: 700;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.3rem;
}
.vs-badge {
  display: none; align-items: center; gap: 0.25rem;
  font-size: 0.58rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 0.4rem;
}
.vs-badge.visible { display: flex; }
.vs-player.right .vs-badge { flex-direction: row-reverse; }
.vs-badge svg { width: 11px; height: 11px; }

.vs-divider {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 0.75rem;
}
.vs-label {
  font-family: var(--font-display); font-size: 1.2rem;
  color: rgba(255,255,255,0.12); letter-spacing: 0.1em;
}

/* Matchday bar */
.vs-md-bar {
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.6rem; font-weight: 700;
  color: rgba(255,255,255,0.22);
  text-transform: uppercase; letter-spacing: 0.1em;
  display: flex; align-items: center; justify-content: space-between;
}
.vs-md-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

/* Player detail sections */
.player-section {
  padding: 1rem 1.1rem 0.9rem;
  border-left: none;
}
.player-section + .player-section {
  border-top: 1px solid rgba(255,255,255,0.05);
}
.player-section-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.player-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.player-label {
  font-size: 0.62rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: rgba(255,255,255,0.4);
}

/* Trend card */
.trend-card {
  display: flex; align-items: center; gap: 0.6rem;
  border-radius: var(--radius-sm); padding: 0.6rem 0.8rem;
}
.trend-card.neutral { background: rgba(255,255,255,0.05); }
.trend-card.better  { background: rgba(74,222,128,0.09); }
.trend-card.worse   { background: rgba(248,113,113,0.09); }
.trend-card.first   { background: rgba(255,255,255,0.04); }

.trend-icon {
  flex-shrink: 0; width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.trend-card.neutral .trend-icon { background: rgba(255,255,255,0.07); }
.trend-card.better  .trend-icon { background: rgba(74,222,128,0.18); }
.trend-card.worse   .trend-icon { background: rgba(248,113,113,0.18); }
.trend-card.first   .trend-icon { background: rgba(255,255,255,0.05); }
.trend-icon svg { width: 14px; height: 14px; }
.trend-card.better  .trend-icon svg { stroke: #4ade80; }
.trend-card.worse   .trend-icon svg { stroke: #f87171; }
.trend-card.neutral .trend-icon svg { stroke: rgba(255,255,255,0.4); }
.trend-card.first   .trend-icon svg { stroke: rgba(255,255,255,0.25); }

.trend-value { display: block; font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.trend-card.better  .trend-value { color: #4ade80; }
.trend-card.worse   .trend-value { color: #f87171; }
.trend-card.neutral .trend-value { color: rgba(255,255,255,0.55); }
.trend-card.first   .trend-value { color: rgba(255,255,255,0.3); }
.trend-label { display: block; font-size: 0.62rem; color: rgba(255,255,255,0.25); margin-top: 0.1rem; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto; padding: 0.9rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.58rem; font-weight: 700;
  color: rgba(255,255,255,0.18);
  line-height: 1.9; text-transform: uppercase; letter-spacing: 0.1em;
}

/* ── Main Panel ────────────────────────── */
#main-panel {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
  transition: background 0.25s;
}

/* Tab bar */
.panel-header {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}

.tab-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.48rem 1.05rem;
  border-radius: 9px; border: none;
  background: transparent;
  font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 700; color: var(--muted);
  cursor: pointer; letter-spacing: 0.02em;
  transition: background 0.14s, color 0.14s;
}
.tab-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab-btn.active { background: var(--tab-active-bg); color: var(--tab-active-txt); }
.tab-btn.active svg { stroke: var(--tab-active-txt); }
.tab-btn:hover:not(.active) { background: var(--surface-2); color: var(--text); }

.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.btn-toggle {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: 7px; border: 1.5px solid var(--border);
  background: transparent;
  font-family: var(--font-body); font-size: 0.74rem;
  font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all 0.14s; letter-spacing: 0.02em;
}
.btn-toggle svg { width: 13px; height: 13px; }
.btn-toggle.on { border-color: var(--text); color: var(--text); }

/* Tab content */
.tab-content { display: none; flex: 1; min-height: 0; overflow: hidden; }
.tab-content.active { display: flex; flex-direction: column; }

/* Chart */
#tab-verlauf { padding: 1.1rem 1.25rem 0.9rem; }
.chart-wrap {
  flex: 1; min-height: 0; position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  transition: background 0.25s, border-color 0.25s;
}

/* Table */
#tab-tipps { overflow-y: auto; padding: 1rem 1.25rem; }
#tab-tipps.active { display: block; }
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0.7rem 1rem;
  font-family: var(--font-body); font-size: 0.62rem;
  font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); text-align: left;
  transition: background 0.25s;
}
thead th.num { text-align: center; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
tbody td { padding: 0.55rem 1rem; font-size: 0.88rem; vertical-align: middle; color: var(--text); }
tbody td.num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

.team-cell { display: flex; align-items: center; gap: 0.7rem; }
.team-logo { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.team-pos {
  font-family: var(--font-display); font-size: 1.05rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0;
  transition: background 0.25s;
}

[data-theme="dark"] td.cell-great { background: rgba(74,222,128,0.12); color: #6EE7A0; font-weight: 800; }
[data-theme="dark"] td.cell-ok    { background: rgba(251,191,36,0.10); color: #FBD676; }
[data-theme="dark"] td.cell-bad   { background: rgba(248,113,113,0.12); color: #FCA5A5; font-weight: 800; }
[data-theme="light"] td.cell-great { background: #D1FAE5; color: #065F46; font-weight: 800; }
[data-theme="light"] td.cell-ok    { background: #FEF3C7; color: #92400E; }
[data-theme="light"] td.cell-bad   { background: #FEE2E2; color: #991B1B; font-weight: 800; }

.guess-cell { display: flex; flex-direction: column; align-items: center; gap: 0.08rem; line-height: 1; }
.guess-num  { font-size: 0.9rem; font-weight: 700; }
.guess-delta { font-size: 0.63rem; font-weight: 700; opacity: 0.6; letter-spacing: 0.02em; }

[data-theme="dark"]  tr.sep-cl  td { border-top: 2px solid rgba(59,158,255,0.3); }
[data-theme="dark"]  tr.sep-rel td { border-top: 2px solid rgba(255,170,0,0.3); }
[data-theme="light"] tr.sep-cl  td { border-top: 2px solid rgba(0,114,178,0.28); }
[data-theme="light"] tr.sep-rel td { border-top: 2px solid rgba(213,94,0,0.28); }

/* ── Loading ───────────────────────────── */
#loading-state {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #06070D; z-index: 100;
}
.loading-trophy {
  width: 52px; height: 52px;
  background: rgba(255,208,96,0.08);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--trophy); stroke: var(--trophy);
}
.loading-trophy svg { width: 26px; height: 26px; }
.loading-wordmark {
  font-family: var(--font-display);
  font-size: 2rem; color: rgba(255,255,255,0.15);
  letter-spacing: 0.08em; margin-bottom: 2rem;
}
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid rgba(255,255,255,0.07);
  border-top-color: var(--moritz);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 0.8rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-state p {
  color: rgba(255,255,255,0.22); font-size: 0.7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
}

/* ── Error ─────────────────────────────── */
#error-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 200;
  align-items: center; justify-content: center;
}
#error-overlay.visible { display: flex; }
.error-box {
  background: var(--surface);
  border-radius: 16px; border: 1px solid var(--border);
  padding: 2.25rem 2rem 2rem;
  max-width: 340px; width: 90%; text-align: center;
}
.error-box h2 {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 400; color: #f87171;
  margin-bottom: 0.5rem; letter-spacing: 0.04em;
}
.error-box p { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.2rem; line-height: 1.5; }
.btn-retry {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--text); color: var(--bg); border: none;
  border-radius: 9px; padding: 0.65rem 1.4rem;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.btn-retry svg { width: 14px; height: 14px; }

/* ── Tweaks Panel ──────────────────────── */
#tweaks-panel {
  display: none;
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem 1.1rem;
  z-index: 150;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  transition: background 0.25s, border-color 0.25s;
}
#tweaks-panel h3 {
  font-size: 0.65rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 0.9rem;
}
.tweak-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.tweak-row:last-child { margin-bottom: 0; }
.tweak-label { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.tweak-seg {
  display: flex; border-radius: 8px;
  background: var(--surface-2); padding: 2px; gap: 2px;
}
.tweak-seg button {
  padding: 0.3rem 0.65rem;
  border-radius: 6px; border: none;
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
  cursor: pointer; background: transparent; color: var(--muted);
  transition: background 0.14s, color 0.14s;
}
.tweak-seg button.active {
  background: var(--tab-active-bg); color: var(--tab-active-txt);
}

/* ── Mobile ────────────────────────────── */
.panel-footer {
  flex-shrink: 0;
  padding: 0.55rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transition: border-color 0.25s;
}
.panel-footer a {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); text-decoration: none;
  transition: color 0.14s;
}
.panel-footer a:hover { color: var(--text); }

@media (max-width: 768px) {
  html, body { overflow: auto; }
  #app-shell  { height: auto; overflow: auto; }
  #body-row   { flex-direction: column; }
  #sidebar    { display: none; }
  #mobile-header { display: flex; }
  #main-panel { height: auto; overflow: visible; }
  .tab-content { overflow: visible; height: auto; }
  .tab-content.active { display: flex; }
  #tab-verlauf { min-height: 320px; padding: 0.85rem 0.85rem 0.75rem; }
  .chart-wrap  { height: 280px; }
  #tab-tipps   { max-height: none; overflow: visible; padding: 0.75rem 0.85rem; }
  #tab-tipps .table-card { overflow-x: auto; }
  .panel-header { flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem 0.85rem; }
  #tweaks-panel { right: 0.75rem; bottom: 0.75rem; }
}

/* ── Print Modal ───────────────────────────── */
#print-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 300;
  align-items: center; justify-content: center;
}
.print-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem 1.5rem 1.4rem;
  max-width: 320px; width: 90%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.print-modal-box h3 {
  font-size: 0.65rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 1rem;
}
.print-choice-btn {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.85rem 1rem; margin-bottom: 0.5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 700;
  color: var(--text); text-align: left;
  transition: border-color 0.14s, background 0.14s;
}
.print-choice-btn:last-of-type { margin-bottom: 0; }
.print-choice-btn:hover { border-color: var(--text); }
.print-choice-btn svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted); stroke: var(--muted); }
.print-cancel-btn {
  display: block; width: 100%; margin-top: 0.85rem;
  padding: 0.5rem; background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: color 0.14s;
}
.print-cancel-btn:hover { color: var(--text); }

/* ── Print Area ────────────────────────────── */
#print-area { display: none; }

@media print {
  #loading-state, #error-overlay, #print-modal, #tweaks-panel, #app-shell { display: none !important; }
  #print-area {
    display: block !important;
    font-family: 'Lato', 'Helvetica Neue', sans-serif;
    color: #111; background: #fff;
  }
  .print-doc { padding: 1.2cm 1.5cm; }
  .print-doc-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    border-bottom: 2px solid #111; padding-bottom: 0.6rem; margin-bottom: 1.25rem;
  }
  .print-doc-title {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 2.2rem; letter-spacing: 0.05em; line-height: 1;
  }
  .print-doc-subtitle {
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #666; margin-top: 0.2rem;
  }
  .print-doc-meta {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #888;
  }
  .print-scores {
    display: flex; gap: 2.5rem; margin-bottom: 1.25rem;
    padding: 0.7rem 1rem; background: #f4f4f4; border-radius: 8px;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .print-score-name {
    font-size: 0.62rem; font-weight: 900; text-transform: uppercase;
    letter-spacing: 0.12em; color: #555;
  }
  .print-score-val {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 2rem; line-height: 1.05; display: block;
    color: #000 !important;
  }
  .print-chart-img {
    width: 100%; max-height: 17cm; object-fit: contain; display: block;
    filter: grayscale(1) contrast(1.4);
  }
  .print-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  .print-table thead th {
    background: #e8e8e8 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact;
    padding: 0.45rem 0.7rem; font-size: 0.62rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: 0.08em; color: #000 !important;
    border-bottom: 2px solid #000; text-align: left;
  }
  .print-table thead th.num { text-align: center; }
  .print-table tbody td { padding: 0.4rem 0.7rem; border-bottom: 1px solid #ddd; vertical-align: middle; }
  .print-table tbody td.num { text-align: center; font-weight: 700; }
  .print-table tbody tr.sep-cl  td { border-top: 2px solid #000; }
  .print-table tbody tr.sep-rel td { border-top: 2px dashed #000; }
  /* B&W cell coding: white = good, mid-gray = ok, black+white = bad */
  .print-table td.cell-great {
    background: #fff !important; color: #000 !important; font-weight: 800;
    border-left: 3px solid #000 !important;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .print-table td.cell-ok {
    background: #cacaca !important; color: #000 !important;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .print-table td.cell-bad {
    background: #111 !important; color: #fff !important; font-weight: 800;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .print-table .team-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 0.45rem; filter: grayscale(1); }
  .print-table .team-cell { display: flex; align-items: center; gap: 0.45rem; }
  .print-table .team-pos {
    font-size: 0.85rem; font-weight: 700; width: 22px; height: 22px;
    border-radius: 50%; background: #e8e8e8; border: 1px solid #aaa; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .print-table .guess-cell { display: flex; flex-direction: column; align-items: center; line-height: 1; }
  .print-table .guess-num  { font-size: 0.88rem; font-weight: 700; }
  .print-table .guess-delta { font-size: 0.6rem; opacity: 0.6; }
  .print-legend {
    margin-top: 0.9rem; display: flex; gap: 1.5rem; flex-wrap: wrap;
    font-size: 0.68rem; font-weight: 700; color: #333;
  }
  .print-legend-item { display: flex; align-items: center; gap: 0.4rem; }
  .print-legend-swatch {
    width: 11px; height: 11px; border-radius: 2px; border: 1px solid #999;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  /* ── Color mode overrides ── */
  #print-area.color .print-chart-img { filter: none; }
  #print-area.color .print-table .team-logo { filter: none; }
  #print-area.color .print-table tbody tr.sep-cl  td { border-top: 2px solid #3B9EFF; }
  #print-area.color .print-table tbody tr.sep-rel td { border-top: 2px solid #FFAA00; border-top-style: solid; }
  #print-area.color .print-table td.cell-great {
    background: #D1FAE5 !important; color: #065F46 !important;
    border-left: none !important; font-weight: 800;
  }
  #print-area.color .print-table td.cell-ok {
    background: #FEF3C7 !important; color: #92400E !important;
  }
  #print-area.color .print-table td.cell-bad {
    background: #FEE2E2 !important; color: #991B1B !important; font-weight: 800;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Neue Komponenten: Login, Tipperfassung, Archiv
   ══════════════════════════════════════════════════════════════════════ */

/* Grundgröße für die inline eingesetzten SVG-Symbole. Bewusst nur eine Klasse
   (Spezifität 0,1,0), damit jede vorhandene Regel wie `.btn svg` oder
   `.trend-icon svg` (0,1,1) weiterhin gewinnt. Ohne diese Zeile läuft ein
   Symbol ohne eigene Größenangabe auf die volle Kastenbreite auf. */
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* Das Dashboard ist eine feste App-Fläche, die anderen Seiten scrollen. */
body.page-scroll, html:has(body.page-scroll) { overflow: auto; height: auto; }
body.page-scroll { min-height: 100dvh; display: flex; flex-direction: column; }

/* ── Kopfleiste ─────────────────────────── */
.topbar {
  background: var(--sidebar-bg);
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  flex-shrink: 0;
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: inherit;
}
.topbar-brand svg { width: 22px; height: 22px; color: var(--trophy); stroke: var(--trophy); }
.topbar-title {
  font-family: var(--font-display); font-size: 1.5rem;
  color: #fff; letter-spacing: 0.06em; line-height: 1;
}
.topbar-season {
  font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.32);
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 0.2rem 0.5rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 20px;
}
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }
.topbar-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  color: rgba(255,255,255,0.55); text-decoration: none;
  transition: background 0.14s, color 0.14s;
}
.topbar-link svg { width: 14px; height: 14px; }
.topbar-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.topbar-link.active { background: #fff; color: var(--sidebar-bg); }
.topbar-link.active svg { stroke: var(--sidebar-bg); }
.topbar-user {
  display: flex; align-items: center; gap: 0.5rem;
  padding-left: 0.9rem; margin-left: 0.3rem;
  border-left: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,0.75);
}

/* ── Seitenrahmen ───────────────────────── */
.page-main { flex: 1; padding: 2rem 1.5rem 3rem; }
.page-wrap { max-width: 1120px; margin: 0 auto; }
.page-wrap.narrow { max-width: 460px; }
.page-head { margin-bottom: 1.6rem; }
.page-head h1 {
  font-family: var(--font-display); font-size: 2.6rem;
  letter-spacing: 0.04em; line-height: 1; color: var(--text); font-weight: 400;
}
.page-head p { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; line-height: 1.5; }

.page-footer {
  flex-shrink: 0; padding: 1rem 1.5rem; text-align: center;
  border-top: 1px solid var(--border);
}
.page-footer a {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); text-decoration: none;
}
.page-footer a:hover { color: var(--text); }

/* ── Knöpfe ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: 10px;
  border: 1.5px solid transparent;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s, opacity 0.14s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-lg { padding: 0.95rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Hinweise ───────────────────────────── */
.notice {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; line-height: 1.5;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); margin-bottom: 1.25rem;
}
.notice svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 0.1rem; }
.notice strong { display: block; margin-bottom: 0.15rem; }
.notice-info    { border-color: rgba(59,158,255,0.4);  background: rgba(59,158,255,0.08); }
.notice-warn    { border-color: rgba(255,170,0,0.45);   background: rgba(255,170,0,0.09); }
.notice-success { border-color: rgba(74,222,128,0.45);  background: rgba(74,222,128,0.09); }
.notice-error   { border-color: rgba(248,113,113,0.5);  background: rgba(248,113,113,0.1); }
.notice-info svg    { stroke: var(--moritz); }
.notice-warn svg    { stroke: var(--papa); }
.notice-success svg { stroke: #4ade80; }
.notice-error svg   { stroke: #f87171; }
.notice[hidden] { display: none; }

/* ── Login ──────────────────────────────── */
.login-shell {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem 4rem;
}
.login-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 2.25rem 2rem 2rem;
}
.login-card h1 {
  font-family: var(--font-display); font-size: 2rem; font-weight: 400;
  letter-spacing: 0.04em; color: var(--text); line-height: 1;
}
.login-card > p { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 1.6rem; line-height: 1.5; }
.field-label {
  display: block; font-size: 0.62rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 0.6rem;
}

/* Zwei große Namensknöpfe statt eines Eingabefeldes: nichts zu tippen, nichts
   falsch zu schreiben. */
.who-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
.who-btn {
  padding: 1.4rem 1rem; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface-2);
  font-family: var(--font-display); font-size: 1.7rem; letter-spacing: 0.05em;
  color: var(--text); cursor: pointer; line-height: 1;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
}
.who-btn:hover { border-color: var(--muted); }
.who-btn:active { transform: scale(0.98); }
.who-btn.selected { border-color: currentColor; }
.who-btn[data-player="moritz"].selected { color: var(--moritz); background: rgba(59,158,255,0.1); }
.who-btn[data-player="papa"].selected   { color: var(--papa);   background: rgba(255,170,0,0.1); }

.input-text {
  width: 100%; padding: 0.85rem 1rem;
  border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1rem;
  transition: border-color 0.14s;
}
.input-text:focus { outline: none; border-color: var(--text); }
.input-text::placeholder { color: var(--muted); }

/* ── Tipperfassung ──────────────────────── */
.tip-deadline {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.85rem; border-radius: 20px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.75rem; font-weight: 700;
  margin-top: 0.85rem;
}
.tip-deadline svg { width: 13px; height: 13px; }

.tip-layout {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.25rem;
  align-items: start;
}
.tip-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.tip-col-head {
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.tip-col-title {
  font-size: 0.65rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--muted);
}
.tip-col-count {
  font-size: 0.7rem; font-weight: 900; color: var(--text);
  background: var(--surface-2); padding: 0.2rem 0.6rem; border-radius: 20px;
}

/* Linke Spalte: noch nicht einsortierte Teams */
.tip-pool { padding: 0.7rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tip-pool.empty { display: block; padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: 0.88rem; }

.team-chip {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface-2);
  cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font-body); font-size: 0.86rem; font-weight: 700; color: var(--text);
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.team-chip:hover { border-color: var(--text); }
.team-chip:active { transform: scale(0.97); }
.team-chip img { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.team-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rechte Spalte: die entstehende Tabelle */
.tip-slots { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.slot {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.4rem 0.5rem 0.4rem 0.4rem; border-radius: 9px;
  border: 1.5px solid transparent; min-height: 46px;
}
.slot.filled { background: var(--surface-2); border-color: var(--border); }
.slot.empty  { border-style: dashed; border-color: var(--border); }
.slot-pos {
  font-family: var(--font-display); font-size: 1.05rem;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); color: var(--muted);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.slot.filled .slot-pos { color: var(--text); }
.slot-team {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem;
  background: none; border: none; padding: 0.25rem; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  color: var(--text); text-align: left; border-radius: 6px;
}
.slot-team:hover { background: var(--row-hover); }
.slot-team img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.slot-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-hint { color: var(--muted); font-size: 0.84rem; font-weight: 400; padding-left: 0.25rem; }
.slot-actions { display: flex; gap: 0.15rem; flex-shrink: 0; }
.slot-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, color 0.12s;
}
.slot-btn svg { width: 13px; height: 13px; }
.slot-btn:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
.slot-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* Sortierbereiche: Meister oben, Absteiger unten */
.slot[data-zone="champion"] .slot-pos { background: rgba(255,208,96,0.18); color: var(--trophy); }
.slot[data-zone="relegation"] .slot-pos { background: rgba(248,113,113,0.15); color: #f87171; }

.tip-actionbar {
  position: sticky; bottom: 0; margin-top: 1.25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}
.tip-status { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.tip-status small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.tip-actionbar .btn { margin-left: auto; }

/* ── Archiv ─────────────────────────────── */
.archive-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}
.season-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1.4rem 1.2rem;
  text-decoration: none; color: inherit; display: block;
  transition: border-color 0.14s, transform 0.12s;
}
.season-card:hover { border-color: var(--text); transform: translateY(-2px); }
.season-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1.1rem;
}
.season-card-title {
  font-family: var(--font-display); font-size: 2rem;
  letter-spacing: 0.04em; line-height: 1; color: var(--text);
}
.season-card-champion {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
}
.season-card-champion img { width: 20px; height: 20px; object-fit: contain; }

.season-scores { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.season-score { display: flex; flex-direction: column; gap: 0.15rem; }
.season-score.right { align-items: flex-end; }
.season-score-name {
  font-size: 0.58rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--muted);
}
.season-score-val { font-family: var(--font-display); font-size: 2.6rem; line-height: 0.85; }
.season-vs { font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); opacity: 0.5; }
.season-winner {
  display: inline-flex; align-items: center; gap: 0.28rem;
  font-size: 0.58rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.1em; margin-top: 0.3rem;
}
.season-winner svg { width: 11px; height: 11px; }

.empty-state {
  text-align: center; padding: 4rem 1.5rem;
  color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; line-height: 1.6; }

/* ── Saisonwahl im Dashboard ────────────── */
.season-select {
  padding: 0.38rem 0.7rem; border-radius: 7px;
  border: 1.5px solid var(--border); background: transparent;
  font-family: var(--font-body); font-size: 0.74rem; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.season-select:focus { outline: none; border-color: var(--text); color: var(--text); }

/* Hinweisstreifen über dem Dashboard, z. B. "Tipp noch nicht abgegeben" */
.dash-banner {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.9rem 1.25rem 0; padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 700;
  border: 1px solid rgba(255,170,0,0.45); background: rgba(255,170,0,0.09);
  color: var(--text);
}
.dash-banner svg { width: 17px; height: 17px; stroke: var(--papa); flex-shrink: 0; }
.dash-banner .btn { margin-left: auto; padding: 0.5rem 1rem; font-size: 0.82rem; }
.dash-banner[hidden] { display: none; }

@media (max-width: 900px) {
  .tip-layout { grid-template-columns: 1fr; }
  .tip-pool { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; padding: 0.7rem 0.9rem; gap: 0.6rem; }
  .topbar-nav { width: 100%; margin-left: 0; overflow-x: auto; }
  .page-main { padding: 1.25rem 0.9rem 2.5rem; }
  .page-head h1 { font-size: 2rem; }
  .tip-pool { grid-template-columns: 1fr 1fr; }
  .who-buttons { grid-template-columns: 1fr; }
  .tip-actionbar { flex-direction: column; align-items: stretch; }
  .tip-actionbar .btn { margin-left: 0; }
}

@media print {
  .topbar, .page-footer, .tip-actionbar { display: none !important; }
}

/* ── Ziehen und Ablegen in der Tipperfassung ─────────────────────────────
   Ergänzt die Klickbedienung, ersetzt sie nicht: Pfeile und Herausnehmen
   bleiben der zuverlässige Weg, das Ziehen ist die schnelle Abkürzung.
   Auf Touchgeräten greift HTML5-Drag&Drop nicht – dort bleiben die Pfeile. */

.slot-grip {
  display: flex; align-items: center; justify-content: center;
  width: 16px; flex-shrink: 0;
  color: var(--border);
  cursor: grab;
  transition: color 0.14s;
}
.slot-grip svg { width: 14px; height: 14px; }
.slot.filled:hover .slot-grip { color: var(--muted); }
.slot-grip:active { cursor: grabbing; }

.slot.dragging { opacity: 0.4; }

/* Während des Ziehens gleiten die Zeilen an ihre neue Stelle, statt zu springen. */
.tip-slots .slot { transition: transform 0.12s ease; }
.tip-slots.drag-active .slot.empty { border-color: var(--muted); }

.tip-pool.drop-target {
  outline: 2px dashed var(--muted);
  outline-offset: -3px;
  border-radius: var(--radius);
}
.tip-pool.empty.drop-target { outline-offset: -6px; }

@media (prefers-reduced-motion: reduce) {
  .tip-slots .slot { transition: none; }
}

/* Symbol im Fließtext auf die Schriftlinie ziehen. */
.slot-hint .icon { width: 14px; height: 14px; vertical-align: -3px; opacity: 0.7; }
