:root {
  color-scheme: dark;
  --bg: #001e28;
  --surface: #062a35;
  --surface-raised: #0a3440;
  --surface-soft: #0d3d4d;
  --line: #1c4f5f;
  --line-soft: #103846;
  --text: #edf9fc;
  --muted: #9bb9c1;
  --muted-low: #71929b;
  --accent: #16a6c9;
  --accent-strong: #53d7f2;
  --blue: #4cb9e6;
  --blue-soft: #062f40;
  --danger: #df5b57;
  --danger-soft: #3a2020;
  --warn: #d89b2b;
  --shadow: 0 18px 48px rgba(0, 0, 0, .26);
}

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

html { min-height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-header {
  background: rgba(0, 30, 40, .96);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid #125164;
  border-radius: 8px;
  background: #062f40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-header h1 {
  font-size: 1.18rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.badge {
  background: #06394a;
  border: 1px solid #1686a3;
  color: var(--accent-strong);
  font-size: .72rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.live { background: var(--danger-soft); border-color: #76302f; color: #ff8a82; }

main { width: 100%; }

.toolbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}

.mode-group,
.date-range,
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-group,
.date-range {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 4px;
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #07566b;
  color: #f3fbfd;
  border: 1px solid #1686a3;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: .84rem;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
  white-space: nowrap;
}
.btn:hover { background: #0a6d86; border-color: #22a7c9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--surface-soft); border-color: var(--line); color: var(--muted-low); cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-soft); border-color: var(--line); color: var(--text); }
.btn.active { background: #06394a; border-color: var(--accent); color: var(--accent-strong); }
.btn.compact { min-height: 34px; padding: 6px 10px; font-size: .78rem; }
.icon-btn { width: 38px; padding: 0; flex: 0 0 auto; }

.btn:focus-visible,
input:focus-visible,
.card:focus-visible,
.tab:focus-visible,
.c-star:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.date-range label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  padding-left: 4px;
}

input[type="text"],
input[type="date"] {
  background: #111713;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 7px;
  font-size: .84rem;
  outline: none;
  min-height: 36px;
}
input[type="text"] { width: min(320px, 100%); }
input[type="date"] { color-scheme: dark; }
input[type="text"]::placeholder { color: var(--muted-low); }
input[type="text"]:focus,
input[type="date"]:focus { border-color: var(--blue); background: #131b17; }

.search-wrap { margin-left: auto; min-width: min(100%, 280px); }
.search-wrap input { flex: 1 1 260px; }

#status {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px 0;
  font-size: .8rem;
  color: var(--muted);
  min-height: 30px;
}
#status.error { color: #ff8a82; }

/* ── Status tabs (Match / Finished / Canceled / Other) ─────────────── */
.status-tabs {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.stab:hover { background: var(--surface-soft); color: var(--text); border-color: var(--line); }
.stab.active { background: #06394a; color: var(--accent-strong); border-color: var(--accent); }
.stab-count {
  font-size: .68rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: inherit;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.stab.active .stab-count { background: rgba(22,166,201,.2); }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.league-group { margin-bottom: 28px; }
.league-header {
  min-height: 34px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 8px 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.league-count {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 700;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.card:hover {
  background: var(--surface-raised);
  border-color: #1ca7c8;
  box-shadow: 0 0 0 1px rgba(83, 215, 242, .12), var(--shadow);
  transform: translateY(-1px);
}
.card-top {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.card .c-time {
  color: var(--muted);
  font-size: .78rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .c-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  flex: 1;
}
.card .c-star {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #121814;
  color: var(--muted-low);
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.card .c-star:hover,
.card .c-star[aria-pressed="true"] { color: var(--warn); border-color: #6a5524; background: #211d12; }
.card .c-team {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.card .c-logo,
.card .c-logo-empty {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.card .c-logo { background: #f8faf7; border: 1px solid #dbe5dc; }
.card .c-logo img { width: 52px; height: 52px; object-fit: contain; }
.card .c-logo-empty { background: #202821; border: 1px solid var(--line-soft); color: var(--muted-low); font-size: 1.35rem; }
.card .c-name {
  min-height: 34px;
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
}
.card .c-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 76px;
}
.card .c-score {
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  white-space: nowrap;
}
.card .c-dash { font-size: 1.55rem; line-height: 1; color: var(--muted); font-weight: 400; }

.card .st,
.st {
  font-size: .6rem;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: box-shadow .2s;
}

/* LIVE — pulsing dot + red glow */
.st-live {
  background: rgba(210,45,45,.16);
  color: #ff6868;
  border: 1px solid rgba(210,45,45,.38);
  box-shadow: 0 0 9px rgba(210,45,45,.18);
}
.st-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4444;
  flex: 0 0 auto;
  animation: st-pulse 1.5s ease-in-out infinite;
}
@keyframes st-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255,68,68,.55); }
  50%       { opacity: .8; transform: scale(.9); box-shadow: 0 0 0 4px rgba(255,68,68,0); }
}

/* FT / AET / PEN — clean "finished" slate */
.st-ft {
  background: rgba(90,115,135,.14);
  color: #8fafc0;
  border: 1px solid rgba(90,115,135,.28);
}

/* NS / Scheduled — teal "upcoming" */
.st-ns {
  background: rgba(22,166,201,.1);
  color: #3ecce9;
  border: 1px solid rgba(22,166,201,.24);
}

/* HT / TBD / Other — amber "paused" */
.st-other {
  background: rgba(216,155,43,.12);
  color: #d89b2b;
  border: 1px solid rgba(216,155,43,.28);
}

#detail {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.det-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.det-meta {
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.det-time { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 12px; }
.det-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin: 18px 0;
}
.det-team { min-width: 0; text-align: center; }
.det-team .name { font-weight: 800; font-size: .95rem; line-height: 1.25; margin-top: 8px; overflow-wrap: anywhere; }
.det-logo,
.det-logo-empty {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
}
.det-logo { background: #f8faf7; border: 1px solid #dbe5dc; }
.det-logo img { width: 48px; height: 48px; object-fit: contain; }
.det-logo-empty { background: #202821; border: 1px solid var(--line-soft); color: var(--muted-low); font-size: 1.45rem; }
.big-score {
  min-width: 104px;
  text-align: center;
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 850;
  color: #fff;
  letter-spacing: 0;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 12px;
  cursor: pointer;
  font-size: .82rem;
  border-radius: 7px 7px 0 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-soft); }
.tab.active { color: #8ec8f7; background: var(--blue-soft); border-color: #285273; border-bottom-color: var(--blue); }
.tab-content { padding: 16px 0 0; min-height: 92px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.incidents-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0, 30, 40, .34);
}
.incidents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.incidents-head span:last-child {
  text-align: right;
  color: var(--muted-low);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}
.events-list {
  list-style: none;
}
.incident-row {
  display: grid;
  grid-template-columns: 48px 36px minmax(0, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.incident-row:last-child {
  border-bottom: 0;
}
.incident-minute {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}
.incident-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: .9rem;
  font-weight: 900;
}
.incident-icon.is-goal {
  background: #e8fff3;
  color: #145b35;
  box-shadow: inset 0 0 0 1px #b7efd0;
}
.incident-icon.is-sub {
  background: #edf1ff;
  color: #3b57b7;
  box-shadow: inset 0 0 0 1px #cdd8ff;
}
.incident-icon.is-card {
  width: 13px;
  height: 19px;
  border-radius: 3px;
  background: #f5cd19;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}
.incident-icon.is-card.is-red {
  background: #e24a4a;
}
.incident-icon.is-card.is-second-yellow {
  background: linear-gradient(90deg, #f5cd19 0 48%, #e24a4a 52% 100%);
}
.incident-icon.is-var,
.incident-icon.is-pen,
.incident-icon.is-other {
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .64rem;
}
.incident-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.incident-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.25;
}
.incident-detail {
  min-width: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.incident-sub-out {
  color: #ef8d92;
  font-weight: 900;
}
.incident-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 7px;
  background: #0e1728;
  color: #fff;
  font-size: .86rem;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.incident-team {
  min-width: 0;
  color: var(--muted);
  font-size: .72rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .84rem;
}
.stat-home { text-align: right; font-weight: 800; }
.stat-label { text-align: center; color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.stat-away { text-align: left; font-weight: 800; }
.stats-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 28px;
  align-items: start;
}
.stat-section {
  min-width: 0;
}
.stat-section h4 {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
  margin: 0 0 8px;
  font-size: .72rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.split-stat-list {
  display: grid;
  gap: 1px;
}
.split-stat-row {
  display: grid;
  grid-template-columns: minmax(58px, 92px) minmax(120px, 1fr) minmax(58px, 92px);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 4px 0;
  color: var(--muted);
  font-size: .84rem;
}
.split-stat-label {
  min-width: 0;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}
.stat-value {
  justify-self: center;
  min-width: 34px;
  max-width: 92px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.stat-value.winner-on {
  background: #0e1728;
  border: 1px solid #1e3152;
  border-radius: 8px;
  color: #f8fbff;
  padding: 5px 8px;
  font-weight: 850;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.stat-pct {
  color: var(--muted);
  font-size: .73rem;
  font-weight: 750;
}
.lineup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.lineup-panel {
  min-width: 0;
  background: #022734;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
}
.lineup-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.lineup-team {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lineup-team-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #083a4a;
  border: 1px solid #15566a;
  color: var(--accent-strong);
  font-size: .8rem;
  font-weight: 850;
}
.lineup-team h4 {
  min-width: 0;
  color: var(--text);
  font-size: .98rem;
  line-height: 1.2;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.lineup-badges {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.lineup-badge {
  background: #082f40;
  border: 1px solid #164f62;
  color: #9bdcf1;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: .7rem;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}
.lineup-badge.is-predicted {
  background: #423819;
  border-color: #6a5722;
  color: #ffe18a;
}
.lineup-badge.is-conf {
  background: #092f56;
  border-color: #164d8c;
  color: #9fcaff;
}
.lineup-kicker {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.lineup-kicker.is-sub {
  margin-top: 18px;
}
.lineup-list {
  display: grid;
}
.lineup-player {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.lineup-player:last-child {
  border-bottom: 0;
}
.lineup-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #e7eef1;
  border: 1px solid #174e60;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #12313a;
  font-size: .72rem;
  font-weight: 850;
}
.lineup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lineup-avatar.is-empty {
  background: #0c3a49;
  color: #a7dced;
}
.lineup-player-main {
  min-width: 0;
}
.lineup-player-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.25;
}
.lineup-player-name > span:not(.lineup-number):not(.lineup-tag) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup-number {
  color: var(--muted);
  font-weight: 800;
  min-width: 18px;
}
.lineup-meta {
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.35;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lineup-tag {
  background: #423819;
  border: 1px solid #6a5722;
  color: #ffe18a;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: .66rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}
.lineup-score {
  min-width: 46px;
  border-radius: 8px;
  padding: 7px 8px;
  text-align: center;
  color: #fff;
  font-size: .86rem;
  line-height: 1;
  font-weight: 900;
}
.lineup-score.is-high { background: #13a764; }
.lineup-score.is-mid { background: #1976df; }
.lineup-score.is-low,
.lineup-score.is-empty { background: #7f91a8; }
.lineup-list.is-subs .lineup-player {
  min-height: 56px;
}
.h2h-item { background: #111713; border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; margin-bottom: 8px; font-size: .82rem; }
.h2h-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.h2h-teams span:first-child { text-align: left; overflow-wrap: anywhere; }
.h2h-teams span:last-child { text-align: right; overflow-wrap: anywhere; }
.h2h-score { font-weight: 850; font-size: 1rem; white-space: nowrap; }
.h2h-meta { font-size: .72rem; color: var(--muted); margin-top: 6px; }
pre.raw {
  background: #111713;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  font-size: .73rem;
  color: var(--muted);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.loader,
.empty {
  text-align: center;
  color: var(--muted);
}
.loader { padding: 42px 20px; }
.empty { padding: 48px 20px; }
.analyze-picker {
  background: #022734;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
}
.analyze-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.analyze-picker h4,
.analyze-result-head h4 {
  color: var(--text);
  font-size: .95rem;
  line-height: 1.2;
  font-weight: 850;
}
.analyze-picker p {
  color: var(--muted);
  font-size: .8rem;
  margin-top: 4px;
}
.analyze-choice-row,
.analyze-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.analyze-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}
.analyze-results {
  display: grid;
  gap: 14px;
}
.analyze-results.is-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.analyze-result-panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #022734;
  padding: 14px;
}
.analyze-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.analyze-result-head span:not(.st) {
  color: var(--muted);
  font-size: .72rem;
}
.analyze-error {
  color: #ff8a82;
  padding: 24px;
  display: grid;
  justify-items: center;
  gap: 14px;
  overflow-wrap: anywhere;
}
.analyze-retry {
  color: var(--text);
}
.analysis {
  display: grid;
  gap: 12px;
  max-width: 640px;
}
.analysis-card {
  background: #031f2a;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}
.analysis-main {
  text-align: center;
  padding: 16px;
}
.analysis-verdict {
  font-size: 1.02rem;
  line-height: 1.2;
  font-weight: 900;
  margin-bottom: 8px;
}
.analysis-verdict.is-home { color: #28b36f; }
.analysis-verdict.is-away { color: #e15a58; }
.analysis-verdict.is-draw { color: #d89b2b; }
.analysis-verdict.is-neutral { color: var(--muted); }
.analysis-bar-fill.is-home,
.analysis-bar-fill.is-positive { background: #28b36f; }
.analysis-bar-fill.is-away,
.analysis-bar-fill.is-negative { background: #e15a58; }
.analysis-bar-fill.is-draw,
.analysis-bar-fill.is-over { background: #d89b2b; }
.analysis-bar-fill.is-btts { background: #7da7ff; }
.analysis-bar-fill.is-blue { background: #4cb9e6; }
.analysis-bar-fill.is-neutral { background: var(--muted-low); }
.analysis-score {
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}
.analysis-ht-score {
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.analysis-caption {
  color: var(--muted);
  font-size: .72rem;
  margin-top: 6px;
}
.analysis-confidence {
  color: var(--muted);
  font-size: .78rem;
  margin-top: 10px;
}
.analysis-confidence strong { color: #e7b84a; }
.analysis-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.analysis-meta span {
  color: #b8cdd3;
  background: #052b38;
  border: 1px solid #134657;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: .7rem;
  line-height: 1;
  font-weight: 750;
}
.analysis-section-title {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .68rem;
  font-weight: 850;
  margin-bottom: 10px;
}
.analysis-copy {
  color: var(--text);
  font-size: .86rem;
  line-height: 1.6;
}
.analysis-bar {
  display: grid;
  gap: 5px;
  margin-bottom: 11px;
}
.analysis-bar:last-child { margin-bottom: 0; }
.analysis-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
}
.analysis-bar-head strong {
  color: var(--text);
  font-weight: 850;
}
.analysis-bar-track {
  background: #062a35;
  border: 1px solid #113d4b;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}
.analysis-bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}
.analysis-list {
  list-style: none;
  display: grid;
  gap: 0;
}
.analysis-list li {
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: .83rem;
  line-height: 1.45;
}
.analysis-list li:last-child { border-bottom: 0; }
.analysis-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-low);
  flex: 0 0 auto;
  margin-top: .5em;
}
.analysis-list.is-blue li::before { background: #4cb9e6; }
.analysis-list.is-positive li::before { background: #28b36f; }
.analysis-list.is-negative li::before { background: #e15a58; }
.analysis-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.analysis-team-kicker {
  font-size: .72rem;
  line-height: 1.2;
  font-weight: 850;
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.analysis-team-kicker:first-child { margin-top: 0; }
.analysis-team-kicker.is-positive { color: #28b36f; }
.analysis-team-kicker.is-negative { color: #e15a58; }
.analysis-value-bet {
  background: #062b2b;
  border-color: #1f766d;
}
.analysis-hk-odds {
  border-color: #27516a;
}
.hk-odds-list {
  display: grid;
  gap: 0;
}
.hk-odds-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 0;
  min-width: 0;
}
.hk-odds-row:first-child { padding-top: 0; }
.hk-odds-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.hk-odds-market {
  color: #9eb8c0;
  font-size: .74rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hk-odds-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.hk-odds-main strong {
  color: var(--text);
  font-size: .9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.hk-odds-main span,
.hk-odds-main em {
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.35;
  font-style: normal;
}
.hk-odds-price {
  justify-self: end;
  min-width: 58px;
  border: 1px solid #1c637a;
  background: #052b38;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.hk-odds-price span {
  display: block;
  color: #82b8c8;
  font-size: .62rem;
  line-height: 1;
  font-weight: 850;
}
.hk-odds-price strong {
  display: block;
  color: #f0fbff;
  font-size: .86rem;
  line-height: 1.2;
  margin-top: 3px;
}
.analysis-empty,
.analysis-empty-inline {
  color: var(--muted);
  font-size: .82rem;
}
.alt-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.alt-score-card {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.alt-score-card.is-simple {
  display: flex;
  align-items: center;
  justify-content: center;
}
.alt-score-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alt-score-value {
  color: var(--text);
  font-size: .95rem;
  font-weight: 900;
  white-space: nowrap;
}
.alt-score-conf {
  background: #092f56;
  border: 1px solid #164d8c;
  color: #9fcaff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: .72rem;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
}
.alt-score-reason {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
  margin-top: 7px;
}
.spin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .toolbar { align-items: stretch; }
  .search-wrap { margin-left: 0; width: 100%; }
  .search-wrap input { width: auto; min-width: 0; }
  .stats-split { grid-template-columns: 1fr; gap: 28px; }
  .analyze-results.is-split { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-header { padding: 14px 16px; }
  .app-header h1 { font-size: 1.05rem; }
  .brand-mark { width: 34px; height: 34px; }
  .toolbar { padding: 12px 16px; gap: 10px; }
  #status { padding: 8px 16px 0; }
  .container { padding: 12px 16px 40px; }
  .mode-group { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode-group .btn { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .date-range { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); }
  .date-range input { width: 100%; min-width: 0; }
  .date-range .compact { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; }
  .card { min-height: 176px; }
  .card .c-logo,
  .card .c-logo-empty { width: 56px; height: 56px; }
  .card .c-logo img { width: 46px; height: 46px; }
  #detail { padding: 16px; }
  .det-header { gap: 12px; }
  .big-score { min-width: 86px; font-size: 1.9rem; }
  .lineup-grid { grid-template-columns: 1fr; }
  .lineup-panel { padding: 14px; }
  .analysis-team-grid { grid-template-columns: 1fr; }
  .hk-odds-row {
    grid-template-columns: 82px minmax(0, 1fr) 58px;
    gap: 8px;
  }
  .incidents-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
  }
  .incidents-head span:last-child {
    text-align: left;
  }
  .incident-row {
    grid-template-columns: 42px 32px minmax(0, 1fr);
    padding: 10px 14px;
  }
  .incident-team {
    grid-column: 3;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 460px) {
  .badge { padding: 5px 8px; }
  .date-range { grid-template-columns: 1fr 1fr; }
  .date-range label { padding: 0; }
  .date-range .compact { grid-column: 1 / -1; }
  .card { padding: 12px; }
  .card-top { grid-template-columns: minmax(0, 1fr) auto; }
  .card-top .st { grid-column: 1; grid-row: 2; justify-self: start; }
  .card .c-star { grid-column: 2; grid-row: 1 / span 2; }
  .card .c-row { grid-template-columns: minmax(0, 1fr) minmax(64px, auto) minmax(0, 1fr); gap: 8px; }
  .card .c-score { font-size: 1.35rem; }
  .card .c-mid { min-width: 64px; }
  .det-topbar { grid-template-columns: 1fr auto; }
  .det-meta { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .det-logo,
  .det-logo-empty { width: 50px; height: 50px; }
  .det-logo img { width: 42px; height: 42px; }
  .big-score { min-width: 74px; font-size: 1.55rem; }
  .stat-row { grid-template-columns: minmax(0, 1fr) minmax(78px, auto) minmax(0, 1fr); gap: 7px; }
  .split-stat-row {
    grid-template-columns: minmax(46px, 68px) minmax(0, 1fr) minmax(46px, 68px);
    gap: 8px;
    min-height: 40px;
    font-size: .8rem;
  }
  .stat-value {
    max-width: 68px;
    min-width: 30px;
  }
  .stat-value.winner-on {
    padding: 4px 7px;
    border-radius: 7px;
  }
  .lineup-panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .lineup-badges {
    justify-content: flex-start;
  }
  .lineup-player {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .lineup-avatar {
    width: 32px;
    height: 32px;
  }
  .lineup-score {
    min-width: 42px;
    padding: 7px 6px;
    font-size: .8rem;
  }
  .lineup-meta {
    white-space: normal;
  }
  .incident-row {
    grid-template-columns: 36px 30px minmax(0, 1fr);
    gap: 8px;
  }
  .incident-icon {
    width: 26px;
    height: 26px;
  }
  .incident-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .incident-score {
    min-width: 50px;
  }
  .hk-odds-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .hk-odds-market {
    grid-column: 1 / -1;
  }
  .hk-odds-main {
    grid-column: 1;
  }
  .hk-odds-price {
    grid-column: 2;
    grid-row: 2;
  }
  .analyze-picker,
  .analyze-result-panel {
    padding: 12px;
  }
  .analyze-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
