/* Futbol Tahmin — "matchday morning" design system.
   Token-based: [data-theme] on <html> switches the whole palette.
   Dark is the default; light inverts surfaces/backgrounds, same accents. */

[data-theme="dark"] {
  --bg-1: #1a1f3a;
  --bg-2: #2d1b4e;
  --surface: #232a4a;
  --surface-2: #2b3358;
  --border: rgba(165, 180, 252, .14);
  --text: #f1f5f9;
  --muted: #a5b4fc;
  --heading: #c7d2fe;
  --shadow: 0 8px 22px rgba(8, 10, 30, .45);
  --shadow-soft: 0 3px 10px rgba(8, 10, 30, .35);
  --home: #2dd4bf;
  --draw: #fbbf24;
  --away: #fb7185;
  --high: #fb7185;
  --medium: #fbbf24;
  --low: #a3e635;
}

[data-theme="light"] {
  --bg-1: #eef1fb;
  --bg-2: #f8f3ff;
  --surface: #ffffff;
  --surface-2: #eef1fc;
  --border: rgba(30, 36, 64, .10);
  --text: #232946;
  --muted: #5b6b9e;
  --heading: #3b4a8c;
  --shadow: 0 8px 22px rgba(70, 80, 150, .16);
  --shadow-soft: 0 3px 10px rgba(70, 80, 150, .12);
  --home: #0d9488;
  --draw: #d97706;
  --away: #e11d48;
  --high: #e11d48;
  --medium: #d97706;
  --low: #65a30d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2)) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  transition: background .25s ease, color .25s ease;
}

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-1) 88%, transparent), transparent);
  backdrop-filter: blur(6px);
}
.app-header h1 {
  font-size: 1.3rem; font-weight: 650; letter-spacing: .03em;
  margin: 0; color: var(--heading);
}
.header-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--home); box-shadow: 0 0 8px var(--home); }

#theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; width: 38px; height: 38px; font-size: 1.05rem; cursor: pointer;
  box-shadow: var(--shadow-soft);
}

/* ---------- cards ---------- */
.card-list { display: flex; flex-direction: column; gap: 14px; padding: 12px; max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }

.match-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 14px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease;
}
/* colored left border = favorite outcome (set via --fav from JS) */
.match-card::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 4px; border-radius: 4px;
  background: var(--fav, var(--muted));
  box-shadow: 0 0 10px var(--fav, transparent);
}
.match-card:active { transform: scale(.985); }

.match-card .meta { display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
  font-size: .74rem; color: var(--muted); background: var(--surface-2); }
.badge.live { color: var(--home); border-color: var(--home); box-shadow: 0 0 8px color-mix(in srgb, var(--home) 55%, transparent); }
.badge.uncovered { color: var(--draw); border-color: var(--draw); }
.badge.partial { color: var(--away); border-color: var(--away); }
.badge.goals-only { color: var(--home); border-color: var(--home); }
.league-header { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 14px 4px 6px; font-weight: 650; }
.standings-strip { font-size: .8rem; color: var(--muted); margin: 2px 4px;
  padding: 4px 10px; background: var(--surface-2); border-radius: 8px; display: inline-block; }
.news-hint { font-size: .74rem; color: var(--draw); margin-top: 6px; }
.news-row { opacity: .85; }
.tile-sub { font-size: .68rem; color: var(--home); margin-top: 1px; }
details.collapsible summary { cursor: pointer; font-weight: 650; font-size: .95rem;
  list-style: none; color: var(--muted); }
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible[open] summary { color: var(--text); margin-bottom: 6px; }

.teams { display: flex; justify-content: space-between; align-items: center;
  font-size: 1.1rem; font-weight: 650; margin-bottom: 12px; letter-spacing: .01em; }
.teams .kickoff { color: var(--muted); font-weight: 550; font-size: .85rem; }

/* glowing 1X2 bar */
.probbar { display: flex; height: 12px; border-radius: 8px; overflow: hidden;
  background: var(--surface-2); margin-bottom: 6px; box-shadow: inset 0 1px 3px rgba(0,0,0,.25); }
.probbar span { display: block; height: 100%; }
.probbar .home { background: linear-gradient(180deg, color-mix(in srgb, var(--home) 80%, #fff), var(--home)); box-shadow: 0 0 10px color-mix(in srgb, var(--home) 70%, transparent); }
.probbar .draw { background: linear-gradient(180deg, color-mix(in srgb, var(--draw) 80%, #fff), var(--draw)); box-shadow: 0 0 10px color-mix(in srgb, var(--draw) 60%, transparent); }
.probbar .away { background: linear-gradient(180deg, color-mix(in srgb, var(--away) 80%, #fff), var(--away)); box-shadow: 0 0 10px color-mix(in srgb, var(--away) 70%, transparent); }
.prob-legend { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 700;
  color: var(--text); margin-bottom: 10px; }

.subline { display: flex; flex-wrap: wrap; gap: 8px; font-size: .84rem; color: var(--muted); }
.subline .ico { margin-right: 3px; }

.eksikler-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.eksik-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; }
.sev-high { color: var(--high); }
.sev-medium { color: var(--medium); }
.sev-low { color: var(--low); }
.sev-unknown { color: var(--muted); }

/* ---------- detail ---------- */
.back-btn { margin: 12px; background: none; border: none; color: var(--home);
  font-size: 1rem; cursor: pointer; padding: 4px; font-weight: 600; }

.detail-section { margin: 0 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; box-shadow: var(--shadow); max-width: 560px; }
@media (min-width: 600px) { .detail-section { margin-left: auto; margin-right: auto; } }
.detail-section h2 { font-size: 1.02rem; font-weight: 650; letter-spacing: .02em;
  margin: 0 0 12px; color: var(--home); }
.detail-section h3 { font-size: .88rem; margin: 14px 0 8px; color: var(--muted); font-weight: 600; }
.scoreline-row { display: flex; justify-content: space-between; padding: 5px 0;
  font-size: .95rem; border-bottom: 1px dashed var(--border); }
.scoreline-row:last-child { border-bottom: none; }
.scoreline-row span:last-child { font-weight: 700; }

/* expectation tiles: colored top stripe + icon */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .9rem; }
.stat-grid .stat { position: relative; overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 10px;
  padding-top: 14px; }
.stat-grid .stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--stripe, var(--muted)); opacity: .9; }
.stat-grid .stat .v { font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; }
.stat-grid .stat .v.glow {
  background: linear-gradient(90deg, #34d399, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="light"] .stat-grid .stat .v.glow {
  background: linear-gradient(90deg, #059669, #0d9488);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-grid .stat .k { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.stat-grid .stat .ico { margin-right: 4px; }

.form-badge { display: inline-block; width: 24px; height: 24px; line-height: 24px;
  text-align: center; border-radius: 7px; font-size: .82rem; font-weight: 800;
  margin-right: 5px; background: var(--surface-2); border: 1px solid var(--border); }
.form-G { color: var(--home); } .form-B { color: var(--draw); } .form-M { color: var(--away); }

.commentary p { font-size: .96rem; line-height: 1.6; margin: 0 0 12px; }
.commentary h1 { font-size: 1.25rem; margin: 0 0 14px; color: var(--heading); font-weight: 700; }
.commentary h2 { font-size: 1.02rem; color: var(--home); margin: 18px 0 10px; font-weight: 650; }
