/* ═══ Reset & Base ═══ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { font-size:16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #0A0E1A;
  color: #F0F2F5;
  line-height: 1.6;
  overflow-x: hidden;
}
:root {
  --bg: #0A0E1A;
  --bg2: #131829;
  --bg3: #1A2038;
  --bg4: #222B45;
  --ink: #F0F2F5;
  --muted: #8892A6;
  --muted2: #5A6478;
  --rule: #1E2538;
  --accent: #FF6B35;
  --accent2: #00D9A6;
  --accent3: #4ECDC4;
  --purple: #C77DFF;
  --red: #FF4757;
  --green: #2ED573;
  --yellow: #FFA502;
  --blue: #4A90D9;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 52px;
  --tabbar-h: 56px;
}

/* ═══ App Layout ═══ */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.header-left, .header-right { width: 32px; display:flex; align-items:center; }
.header-left svg { cursor: pointer; color: var(--ink); }
.header-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.app-content {
  flex: 1;
  padding-bottom: calc(var(--tabbar-h) + 8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ═══ Tab Bar ═══ */
.tab-bar {
  height: var(--tabbar-h);
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--rule);
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-shrink: 0;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
  -webkit-user-select: none;
  user-select: none;
}
.tab-item span { font-size: 10px; font-weight: 500; }
.tab-item.active { color: var(--accent); }
.tab-item.active svg { stroke: var(--accent); }
.tab-item svg { stroke: var(--muted); transition: stroke .2s; }
.tab-item:active { opacity: .7; }

/* ═══ Home Page ═══ */
.hero-banner {
  background: linear-gradient(135deg, #15192E 0%, #1E1530 50%, #0A0E1A 100%);
  padding: 24px 16px 20px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,107,53,.1) 0%, transparent 60%);
  pointer-events: none;
}
.hero-greeting { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.hero-title {
  font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 6px;
}
.hero-title .brand { color: var(--accent); }
.hero-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Stats Row */
.stats-row {
  display: flex;
  padding: 0 16px;
  gap: 10px;
  margin-top: -8px;
  position: relative;
  z-index: 2;
}
.stat-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-value.green { color: var(--accent2); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Section Title */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
}
.section-title h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.section-title .more { font-size: 12px; color: var(--muted); cursor: pointer; }

/* ════════════════════════════════════════
   Match Card — REDESIGNED
   ════════════════════════════════════════ */
.match-list { padding: 0 16px; }
.match-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  overflow: hidden;
}
.match-card:active {
  border-color: var(--accent);
  transform: scale(0.99);
}

/* Card top bar: time + status */
.match-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--rule);
}
.match-topbar .match-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.match-topbar .match-date .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  margin-right: 6px;
  vertical-align: middle;
}
.match-status {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.match-status.upcoming { background: rgba(0,217,166,.15); color: var(--accent2); }
.match-status.soon { background: rgba(255,165,2,.15); color: var(--yellow); }
.match-status.live { background: rgba(255,71,87,.15); color: var(--red); }
.match-status.finished { background: rgba(136,146,166,.15); color: var(--muted); }

/* Teams row */
.match-body {
  padding: 16px;
}
.match-teams-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mc-team.away { flex-direction: row; }
.mc-team.home { flex-direction: row-reverse; text-align: right; }

.mc-team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mc-team.home .mc-team-info { align-items: flex-end; }

.mc-team-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.1);
}
.mc-team-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-team-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.mc-team.home .mc-team-meta { flex-direction: row-reverse; }
.mc-team-meta .role-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.mc-team-meta .role-tag.away { background: rgba(74,144,217,.15); color: var(--blue); }
.mc-team-meta .role-tag.home { background: rgba(255,107,53,.15); color: var(--accent); }

/* Center score/vs */
.mc-center {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0 4px;
}
.mc-center .score {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  font-family: 'SF Mono', 'Menlo', monospace;
}
.mc-center .score .sep { color: var(--muted2); margin: 0 2px; }
.mc-center .vs-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--muted2);
}
.mc-center .time-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.mc-center .final-tag {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}

/* Win rate bar — bottom of card */
.match-winrate-row {
  margin: 0 16px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--rule);
}
.mwr-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}
.mwr-labels .left { color: var(--accent); font-weight: 700; }
.mwr-labels .right { color: var(--accent2); font-weight: 700; }
.mwr-labels .center { color: var(--muted); font-size: 10px; font-weight: 500; }
.mwr-bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg3);
}
.mwr-bar .fill-a { background: var(--accent); height: 100%; transition: width .3s; }
.mwr-bar .fill-b { background: var(--accent2); height: 100%; transition: width .3s; }

.match-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px 12px;
}
.match-card-footer .ai-icon {
  width: 14px; height: 14px;
  color: var(--accent2);
}
.match-card-footer .ai-text {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ═══ Match Detail Page ═══ */
.detail-hero {
  background: var(--bg2);
  padding: 20px 16px;
  border-bottom: 1px solid var(--rule);
}
.detail-match-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.detail-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 8px;
}
.detail-team .mc-team-logo { width: 56px; height: 56px; font-size: 18px; }
.detail-team .team-name { font-size: 15px; font-weight: 700; }
.detail-team .team-record { font-size: 12px; color: var(--muted); }

.detail-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
}
.detail-vs .vs-text { font-size: 24px; font-weight: 900; color: var(--muted2); }
.detail-vs .match-time { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Win Rate Display */
.winrate-display {
  background: var(--bg2);
  margin: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.winrate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.winrate-header .title { font-size: 14px; font-weight: 700; color: var(--ink); }
.winrate-header .ai-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent2);
  background: rgba(0,217,166,.1);
  padding: 3px 8px;
  border-radius: 4px;
}
.winrate-body { padding: 20px 16px; }
.winrate-bar {
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin-bottom: 12px;
}
.winrate-bar .side-a {
  background: linear-gradient(90deg, var(--accent), rgba(255,107,53,.7));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.winrate-bar .side-b {
  background: linear-gradient(90deg, rgba(0,217,166,.7), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.winrate-labels {
  display: flex;
  justify-content: space-between;
}
.wr-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.wr-label .team-code { font-weight: 600; color: var(--ink); }
.wr-label .pct { font-weight: 800; }
.wr-label.a .pct { color: var(--accent); }
.wr-label.b .pct { color: var(--accent2); }

/* Dimension Tabs */
.dimension-tabs {
  display: flex;
  padding: 0 16px;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dim-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.dim-tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* Dimension Content */
.dim-content {
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.dim-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 12px;
}
.dim-item:last-child { border-bottom: none; }
.dim-item .key { font-size: 14px; color: var(--muted); flex-shrink: 0; }
.dim-item .val { font-size: 14px; color: var(--ink); text-align: right; font-weight: 600; }
.dim-item .val .highlight { color: var(--accent); font-weight: 700; }
.dim-item .val .green { color: var(--accent2); font-weight: 700; }
.dim-item .val .red { color: var(--red); font-weight: 700; }

/* Comparison Table for Record Dimension */
.dim-compare-header {
  display: flex;
  padding: 8px 16px;
  background: var(--bg3);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
.dim-compare-header .label { flex: 0 0 80px; color: var(--muted); }
.dim-compare-header .team { flex: 1; text-align: center; color: var(--ink); }
.dim-compare-header .team.away { color: var(--accent); }
.dim-compare-header .team.home { color: var(--accent2); }

.dim-compare-row {
  display: flex;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  align-items: center;
}
.dim-compare-row:last-child { border-bottom: none; }
.dim-compare-row .label { flex: 0 0 80px; color: var(--muted); font-size: 12px; }
.dim-compare-row .team-val { flex: 1; text-align: center; color: var(--ink); font-weight: 600; }

/* Weight Bar */
.weight-display {
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.weight-display .title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.weight-bar-h {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.weight-bar-h .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.weight-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.weight-legend .item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.weight-legend .dot { width: 8px; height: 8px; border-radius: 2px; }

/* Key Factors */
.key-factors {
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.key-factors .title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.factor-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.factor-item:last-child { border-bottom: none; }
.factor-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,107,53,.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.factor-text { font-size: 13px; color: var(--ink); line-height: 1.6; }
.factor-text .tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.factor-text .tag.red { background: rgba(255,71,87,.12); color: var(--red); }
.factor-text .tag.yellow { background: rgba(255,165,2,.12); color: var(--yellow); }
.factor-text .tag.green { background: rgba(46,213,115,.12); color: var(--green); }

/* Over/Under */
.ou-section {
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.ou-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.ou-stats {
  display: flex;
  gap: 12px;
}
.ou-stat {
  flex: 1;
  text-align: center;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
}
.ou-stat .val { font-size: 22px; font-weight: 800; }
.ou-stat .val.over { color: var(--accent); }
.ou-stat .val.under { color: var(--accent2); }
.ou-stat .label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ou-trend {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.ou-trend .arrow { font-weight: 700; }

/* Paywall Overlay */
.paywall-overlay {
  margin: 12px 16px;
  background: linear-gradient(135deg, rgba(255,107,53,.08), rgba(0,217,166,.06));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.paywall-overlay .lock-icon {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  background: rgba(255,107,53,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.paywall-overlay .lock-icon svg { color: var(--accent); }
.paywall-overlay .title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.paywall-overlay .desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.paywall-btn {
  display: inline-block;
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}
.paywall-btn:active { opacity: .85; }

/* ═══ Data Source Page ═══ */
.ds-banner {
  background: linear-gradient(135deg, #15192E 0%, #1A1230 50%, #0A0E1A 100%);
  padding: 24px 16px;
  text-align: center;
}
.ds-banner h2 { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.ds-banner p { font-size: 13px; color: var(--muted); }

.ds-list { padding: 12px 16px; }
.ds-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.ds-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ds-card-header .name { font-size: 15px; font-weight: 700; color: var(--ink); }
.ds-card-header .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.ds-card-header .badge.api { background: rgba(0,217,166,.12); color: var(--accent2); }
.ds-card-header .badge.crawl { background: rgba(255,165,2,.12); color: var(--yellow); }
.ds-card .url { font-size: 12px; color: var(--muted); margin-bottom: 6px; word-break: break-all; }
.ds-card .desc { font-size: 13px; color: var(--ink); line-height: 1.5; }

/* Flow Diagram */
.flow-section { padding: 16px; }
.flow-step {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 0;
  position: relative;
}
.flow-step .step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.flow-step .step-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.flow-step .step-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.flow-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  padding: 4px 0;
}

/* ═══ Mine Page ═══ */
.mine-header {
  background: linear-gradient(135deg, #15192E 0%, #1E1530 100%);
  padding: 32px 16px 24px;
  text-align: center;
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg3);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.mine-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.mine-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255,107,53,.12);
  color: var(--accent);
  font-weight: 600;
}
.mine-tag.vip { background: rgba(255,165,2,.12); color: var(--yellow); }

.mine-stats {
  display: flex;
  margin: 0 16px;
  gap: 10px;
  margin-top: -12px;
  position: relative;
  z-index: 2;
}
.mine-stat {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.mine-stat .val { font-size: 20px; font-weight: 800; color: var(--ink); }
.mine-stat .label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.mine-section { padding: 16px; }
.mine-section .title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }

.pricing-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.pricing-card.featured { border-color: var(--accent); }
.pricing-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pricing-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.pricing-price { font-size: 20px; font-weight: 800; color: var(--accent); }
.pricing-price .unit { font-size: 12px; font-weight: 400; color: var(--muted); }
.pricing-features { margin-bottom: 14px; }
.pricing-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}
.pricing-feature .check {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--accent2);
}
.pricing-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.pricing-btn.free { background: var(--bg3); color: var(--ink); }
.pricing-btn.vip { background: var(--accent); color: #fff; }
.pricing-btn:active { opacity: .85; }

.menu-list {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg3); }
.menu-item .left { display: flex; align-items: center; gap: 10px; }
.menu-item .icon { width: 20px; height: 20px; color: var(--muted); }
.menu-item .label { font-size: 14px; color: var(--ink); }
.menu-item .arrow { color: var(--muted); font-size: 14px; }

/* ═══ Modal ═══ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 32px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg2);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.modal-text { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; text-align: left; }
.modal-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}
.modal-checkbox input { accent-color: var(--accent); }
.modal-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ═══ Loading ═══ */
.loading-spin {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Empty State ═══ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: .3; }
.empty-state .text { font-size: 14px; color: var(--muted); }

/* ═══ Animations ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .3s ease-out; }

/* ═══ Responsive ═══ */
@media (max-width: 430px) {
  #app { box-shadow: none; }
}

/* ════════════════════════════════════════
   Standings Page
   ════════════════════════════════════════ */
.standings-summary {
  display: flex;
  padding: 0 16px;
  gap: 10px;
  margin-top: -8px;
  position: relative;
  z-index: 2;
}
.ss-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
}
.ss-val { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.ss-label { font-size: 11px; color: var(--muted); }

.standings-table {
  margin: 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.st-header, .st-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--rule);
}
.st-header {
  background: var(--bg3);
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.st-row:last-child { border-bottom: none; }
.st-row.playoff { border-left: 3px solid var(--accent2); }

.st-rank { flex: 0 0 28px; text-align: center; font-weight: 700; color: var(--muted); }
.st-row.playoff .st-rank { color: var(--accent2); }
.st-team { flex: 0 0 90px; display: flex; align-items: center; gap: 6px; }
.st-logo {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.st-name { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-record { flex: 0 0 56px; font-size: 12px; color: var(--ink); font-weight: 600; }
.st-pct { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.st-pct-bar { flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; min-width: 30px; }
.st-pct-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.st-pct-text { font-size: 11px; font-weight: 700; color: var(--ink); flex-shrink: 0; }
.st-streak { flex: 0 0 56px; font-size: 11px; font-weight: 600; text-align: center; }
.st-streak.win { color: var(--accent2); }
.st-streak.lose { color: var(--red); }
.st-net { flex: 0 0 48px; font-size: 12px; font-weight: 700; text-align: right; }
.st-net.positive { color: var(--accent2); }
.st-net.negative { color: var(--red); }

.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 16px 20px;
}
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--bg3); }
.legend-dot.playoff { background: var(--accent2); }

/* ════════════════════════════════════════
   Radar Chart Section
   ════════════════════════════════════════ */
.radar-section {
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.radar-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }

/* ════════════════════════════════════════
   Tracking Page (Hit Rate)
   ════════════════════════════════════════ */
.tracking-overview {
  display: flex;
  margin: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 16px;
  align-items: center;
}
.to-main { flex: 1; text-align: center; }
.to-divider { width: 1px; height: 60px; background: var(--rule); }
.to-rate { font-size: 36px; font-weight: 900; }
.to-rate.good { color: var(--accent2); }
.to-rate.ok { color: var(--yellow); }
.to-rate.low { color: var(--red); }
.to-label { font-size: 13px; color: var(--ink); font-weight: 600; margin-top: 4px; }
.to-detail { font-size: 11px; color: var(--muted); margin-top: 2px; }

.tracking-chart-container {
  margin: 0 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
}

.dim-hitrate-list {
  margin: 0 16px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.dhr-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
}
.dhr-item:last-child { border-bottom: none; }
.dhr-label { flex: 0 0 120px; display: flex; align-items: center; gap: 6px; }
.dhr-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.dhr-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.dhr-weight { font-size: 10px; color: var(--muted2); margin-left: auto; }
.dhr-bar-wrap { flex: 1; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.dhr-bar { height: 100%; border-radius: 4px; transition: width .3s; }
.dhr-pct { flex: 0 0 36px; font-size: 13px; font-weight: 800; color: var(--ink); text-align: right; }

.tracking-list {
  margin: 0 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.tr-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  gap: 10px;
}
.tr-item:last-child { border-bottom: none; }
.tr-status {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.tr-status.hit { background: rgba(46,213,115,.15); color: var(--green); }
.tr-status.miss { background: rgba(255,71,87,.15); color: var(--red); }
.tr-info { flex: 1; min-width: 0; }
.tr-match { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-date { font-size: 11px; color: var(--muted); }
.tr-prediction { text-align: right; }
.tr-pred-label { font-size: 10px; color: var(--muted2); }
.tr-pred-val { font-size: 12px; color: var(--accent); font-weight: 600; }
.tr-actual { text-align: right; }
.tr-actual-label { font-size: 10px; color: var(--muted2); }
.tr-actual-val { font-size: 12px; color: var(--ink); font-weight: 600; }

/* ════════════════════════════════════════
   Mine Page — Tracking Preview
   ════════════════════════════════════════ */
.tracking-preview {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  gap: 12px;
}
.tp-chart { flex: 1; text-align: center; }
.tp-rate { font-size: 28px; font-weight: 900; }
.tp-rate.good { color: var(--accent2); }
.tp-rate.ok { color: var(--yellow); }
.tp-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tp-arrow { font-size: 24px; color: var(--muted); }

/* ════════════════════════════════════════
   Injury Impact Scores
   ════════════════════════════════════════ */
.injury-item .key {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.injury-player { font-size: 14px; font-weight: 600; color: var(--ink); }
.injury-role { font-size: 10px; color: var(--muted2); }
.impact-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 4px;
}
.impact-badge.elite { background: rgba(255,71,87,.15); color: var(--red); }
.impact-badge.high { background: rgba(255,165,2,.15); color: var(--yellow); }
.impact-badge.medium { background: rgba(74,144,217,.15); color: var(--blue); }
.impact-badge.low { background: rgba(136,146,166,.15); color: var(--muted); }

.injury-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg3);
  border-top: 2px solid var(--rule);
}
.injury-total .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.injury-total .val { font-size: 16px; font-weight: 800; }
.injury-total .val.red { color: var(--red); }
.injury-total .val.yellow { color: var(--yellow); }
.injury-total .val.green { color: var(--green); }

/* ════════════════════════════════════════
   Fatigue Note
   ════════════════════════════════════════ */
.fatigue-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255,165,2,.06);
  border-top: 1px solid var(--rule);
}
.fn-icon { font-size: 16px; flex-shrink: 0; }
.fn-text { font-size: 12px; color: var(--yellow); line-height: 1.5; font-weight: 500; }
