:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #132238;
  --muted: #64748b;
  --border: #dce5f0;
  --primary: #315efb;
  --danger: #b42318;
  --success: #087a55;
  --shadow: 0 18px 50px rgba(25, 45, 75, 0.09);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
.shell { width: min(1320px, calc(100% - 24px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.brand { font-weight: 850; letter-spacing: -0.03em; font-size: 1.15rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
h1, h2, h3 { margin-top: 0; letter-spacing: -0.035em; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 8px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-weight: 700; font-size: 0.9rem; }
input, select, button { font: inherit; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid rgba(49, 94, 251, 0.18); border-color: var(--primary); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { background: #eaf0ff; color: #2447bd; }
button.danger { background: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hidden { display: none !important; }
.status { padding: 11px 13px; border-radius: 10px; background: #eef3f8; color: var(--muted); white-space: pre-wrap; }
.status.success { background: #e8f7f0; color: var(--success); }
.status.error { background: #fff0ef; color: var(--danger); }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #edf2ff; color: #2b4dbb; font-size: .8rem; font-weight: 800; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: center; vertical-align: middle; }
th { background: #f7f9fc; color: #51627a; font-size: .82rem; }
td.left, th.left { text-align: left; }
.score-input { min-width: 68px; text-align: center; }
.team-row td { background: #eef3fb; font-weight: 850; text-align: left; }
.pairing { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.notice { border-left: 4px solid #f59e0b; background: #fffbeb; padding: 12px 14px; border-radius: 10px; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.kpi { padding: 8px 11px; border-radius: 10px; background: #f0f4fa; font-weight: 750; }
.result-section { margin-top: 22px; }
@media (max-width: 780px) {
  .grid.two, .grid.four { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .shell { width: min(100% - 12px, 1320px); padding-top: 10px; }
  .panel { padding: 14px; border-radius: 14px; }
}
.season-actions { min-width: min(100%, 420px); }
.season-actions select { min-width: 230px; }
.setup-table { min-width: 620px; }
.player-setup-table { min-width: 980px; }
.checkbox { width: 20px; height: 20px; margin: 0 auto; accent-color: var(--primary); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; background: #fff; color: var(--text); font: inherit; }
textarea:focus { outline: 2px solid rgba(49, 94, 251, 0.18); border-color: var(--primary); }
.history-table { min-width: 920px; }
.history-table td.note-cell { max-width: 360px; text-align: left; white-space: normal; }
.history-table .current-version td { background: #e8f7f0; }
.mode-correction { border-left-color: var(--danger); background: #fff0ef; }
.mode-blocked { border-left-color: var(--danger); background: #fff0ef; color: var(--danger); }
.mode-advance { border-left-color: var(--primary); background: #eef3ff; }

/* Saisonspielplan */
.schedule-editor { display: grid; gap: 14px; }
.schedule-day { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #fbfcff; }
.schedule-day-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.schedule-day-head h3 { margin: 0; }
.schedule-day-head label { width: min(220px, 100%); }
.schedule-pairings { display: grid; gap: 9px; }
.schedule-pairing, .pairing-with-lane { display: grid; grid-template-columns: 100px minmax(160px, 1fr) auto minmax(160px, 1fr); gap: 10px; align-items: center; }
.lane-badge { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; padding: 7px 10px; border-radius: 10px; background: #eaf0ff; color: #2447bd; font-weight: 850; white-space: nowrap; }
.schedule-public-shell { max-width: 1180px; }
.schedule-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.lane-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.lane-legend span { padding: 7px 10px; border-radius: 999px; background: #eef3fb; font-size: .82rem; font-weight: 800; }
.public-schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.public-schedule-day { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.public-schedule-day header { display: flex; justify-content: space-between; align-items: start; gap: 14px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.public-schedule-day h2 { margin: 4px 0 0; }
.public-schedule-day time { color: var(--muted); font-weight: 750; text-align: right; }
.schedule-state { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 850; }
.public-schedule-day.is-next { border-color: var(--primary); box-shadow: 0 18px 50px rgba(49, 94, 251, .15); }
.public-schedule-day.is-next .schedule-state { color: var(--primary); }
.public-schedule-day.is-played { opacity: .72; }
.public-pairing-list { display: grid; gap: 8px; }
.public-pairing { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px; border-radius: 11px; background: #f7f9fc; }
.public-pairing strong:last-child { text-align: right; }
.versus { color: var(--muted); font-size: .82rem; }
@media (max-width: 900px) {
  .public-schedule-grid { grid-template-columns: 1fr; }
  .schedule-hero { align-items: flex-start; flex-direction: column; }
  .lane-legend { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .schedule-day-head { align-items: stretch; flex-direction: column; }
  .schedule-day-head label { width: 100%; }
  .schedule-pairing, .pairing-with-lane { grid-template-columns: 82px 1fr; }
  .schedule-pairing strong, .pairing-with-lane strong { display: none; }
  .schedule-pairing .schedule-away, .pairing-with-lane .away-team { grid-column: 2; }
  .public-pairing { grid-template-columns: 74px 1fr; }
  .public-pairing .versus { display: none; }
  .public-pairing strong:last-child { grid-column: 2; text-align: left; }
}

/* Phase 6: öffentliches Saisonarchiv und Systemprüfung */
.archive-hero { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.archive-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.archive-card { padding:20px; border-radius:22px; background:rgba(255,255,255,.9); border:1px solid rgba(122,146,182,.14); box-shadow:0 14px 34px rgba(35,58,100,.08); }
.archive-card.is-active { box-shadow:inset 0 0 0 2px rgba(91,124,255,.22),0 18px 40px rgba(35,58,100,.12); }
.archive-card header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.archive-card h2 { margin:6px 0 0; }
.archive-progress { height:9px; margin:14px 0 18px; overflow:hidden; border-radius:999px; background:rgba(91,124,255,.10); }
.archive-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#5b7cff,#ff5c9f); }
.integrity-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:10px; margin:14px 0; }
.integrity-stat { padding:12px; border-radius:14px; background:rgba(246,250,255,.9); border:1px solid rgba(122,146,182,.10); }
.integrity-stat strong { display:block; font-size:1.25rem; }
.integrity-list { display:grid; gap:8px; margin-top:12px; }
.integrity-item { padding:11px 13px; border-radius:12px; border:1px solid rgba(122,146,182,.12); background:rgba(255,255,255,.82); }
.integrity-item.error { border-color:rgba(210,60,90,.24); background:rgba(255,92,120,.08); }
.integrity-item.warning { border-color:rgba(220,150,30,.24); background:rgba(255,184,77,.10); }
.integrity-item.success { border-color:rgba(55,201,151,.24); background:rgba(55,201,151,.10); }
@media (max-width:700px) { .archive-card header { flex-direction:column; } }


/* Phase 8.1: einheitliche schwebende Navigation */
.back-fab,.refresh-fab{position:fixed;bottom:16px;z-index:9999;width:50px;height:50px;border:1px solid rgba(240,200,121,.55);border-radius:50%;display:grid;place-items:center;cursor:pointer;color:#f7e8c5;background:radial-gradient(circle at 35% 28%,rgba(64,244,239,.22),transparent 30%),linear-gradient(145deg,#4b2d1b,#130d08 72%);box-shadow:inset 0 0 0 3px rgba(0,0,0,.45),0 10px 26px rgba(0,0,0,.48);font-size:16px}.back-fab{left:16px}.refresh-fab{right:16px}.back-fab i{animation:phase81Back 1.7s ease-in-out infinite}.refresh-fab i{animation:phase81Spin 2.6s linear infinite}@keyframes phase81Spin{to{transform:rotate(360deg)}}@keyframes phase81Back{0%,100%{transform:translateX(0)}50%{transform:translateX(-4px)}}@media(max-width:700px){.back-fab,.refresh-fab{width:48px;height:48px;bottom:12px}.back-fab{left:12px}.refresh-fab{right:12px}}@media(prefers-reduced-motion:reduce){.back-fab i,.refresh-fab i{animation:none!important}}
