:root {
  --bg: #0b0b12;
  --surface: #13131e;
  --surface2: #1c1c2e;
  --surface3: #252538;
  --border: #2e2e45;
  --text: #e8e8f0;
  --text2: #a0a0b8;
  --muted: #666680;
  --accent: #00e676;
  --accent-dim: #00c864;
  --red: #ff5252;
  --yellow: #ffc107;
  --blue: #448aff;
  --orange: #ff9100;
  --r: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
header { padding: 28px 0 12px; text-align: center; }
h1 { font-size: 1.6rem; font-weight: 700; }
h1 .accent { color: var(--accent); }
.subtitle { color: var(--muted); font-size: 0.75rem; margin-top: 2px; letter-spacing: 0.5px; }

/* Tabs */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  background: none; border: none; color: var(--muted); padding: 10px 16px;
  font-size: 0.85rem; font-family: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; transition: 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; margin-bottom: 14px;
}
.cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }

h2 { font-size: 1.1rem; margin-bottom: 14px; }
h3 { font-size: 0.9rem; margin-bottom: 10px; color: var(--accent); font-weight: 600; }

/* Match Selector */
.match-selector {
  display: flex; align-items: end; gap: 12px; margin-bottom: 16px;
}
.team-select { flex: 1; }
.team-select label {
  display: block; font-size: 0.7rem; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; margin-bottom: 6px;
}
.team-select select {
  width: 100%; padding: 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-family: inherit; font-size: 1rem;
  font-weight: 600; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300e676' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.team-select select:focus { outline: none; border-color: var(--accent); }

.vs-badge {
  font-weight: 800; color: var(--muted); font-size: 0.85rem; padding-bottom: 14px;
}

/* Odds */
.odds-section { margin-bottom: 16px; }
.odds-label { font-size: 0.8rem; color: var(--text2); margin-bottom: 8px; }
.optional { color: var(--muted); font-size: 0.7rem; }
.odds-inputs { display: flex; gap: 10px; }
.odds-group { flex: 1; position: relative; }
.odds-tag {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-weight: 800; font-size: 0.8rem; color: var(--accent); z-index: 1;
  font-family: 'JetBrains Mono', monospace;
}
.odds-group input {
  width: 100%; padding: 10px 10px 10px 32px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 0.95rem;
}
.odds-group input:focus { outline: none; border-color: var(--accent); }
.odds-group input::placeholder { color: var(--muted); font-family: 'Inter', sans-serif; font-size: 0.8rem; }

/* Button */
.btn-primary {
  width: 100%; background: var(--accent); color: #000; border: none;
  padding: 14px; border-radius: 8px; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: 0.15s; letter-spacing: 0.5px;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-small {
  background: var(--surface3); color: var(--accent); border: 1px solid var(--accent);
  padding: 6px 14px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: 0.15s; font-family: inherit;
}
.btn-small:hover { background: var(--accent); color: #000; }
.btn-small:disabled { opacity: 0.4; cursor: not-allowed; }

.error-msg { color: var(--red); font-size: 0.85rem; margin-top: 8px; text-align: center; }

/* Match Header Card */
.match-header-card {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  text-align: center; padding: 24px;
}
.match-team { font-size: 1.1rem; font-weight: 700; flex: 1; }
.match-team.home { text-align: right; }
.match-team.away { text-align: left; }
.match-score-pred { text-align: center; }
.big-score {
  font-family: 'JetBrains Mono', monospace; font-size: 2.8rem; font-weight: 800;
  color: var(--accent); line-height: 1;
}
.score-label { font-size: 0.7rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

/* Prob Bars */
.prob-row { display: flex; align-items: center; margin-bottom: 6px; gap: 6px; }
.prob-label { width: 55px; font-size: 0.75rem; font-weight: 600; color: var(--text2); text-align: right; }
.prob-bar-wrap { flex: 1; background: var(--surface3); border-radius: 4px; height: 26px; overflow: hidden; }
.prob-bar {
  height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px;
  font-size: 0.75rem; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  color: #000; transition: width 0.4s ease;
}
.prob-bar.h { background: var(--accent); }
.prob-bar.d { background: var(--yellow); }
.prob-bar.a { background: var(--blue); }

.predicted-result {
  text-align: center; padding: 10px; background: var(--surface2);
  border-radius: 8px; margin-top: 10px;
}
.pred-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pred-value { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
.pred-conf { font-size: 0.75rem; color: var(--accent); font-family: 'JetBrains Mono', monospace; }

/* O/U */
.ou-boxes { display: flex; gap: 8px; }
.ou-box {
  flex: 1; text-align: center; padding: 14px 8px; border-radius: 8px;
  background: var(--surface2); border: 2px solid transparent; transition: 0.2s;
}
.ou-box.active { border-color: var(--accent); background: var(--surface3); }
.ou-name { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.ou-pct {
  font-size: 1.6rem; font-weight: 800; font-family: 'JetBrains Mono', monospace;
  margin-top: 4px; color: var(--text2);
}
.ou-box.active .ou-pct { color: var(--accent); }

.goals-expected {
  text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
}

/* Top Scores */
.score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 6px; margin-bottom: 4px;
}
.score-row:nth-child(1) { background: var(--surface3); }
.score-row .s-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.1rem; }
.score-row:nth-child(1) .s-val { color: var(--accent); font-size: 1.3rem; }
.score-row .s-pct { font-family: 'JetBrains Mono', monospace; color: var(--muted); font-size: 0.85rem; }

/* Value Bets */
.vb-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; background: var(--surface2); border-radius: 8px;
  margin-bottom: 8px; border-left: 3px solid var(--accent);
}
.vb-match { font-size: 0.85rem; color: var(--text2); margin-bottom: 2px; }
.vb-bet { font-weight: 700; font-size: 0.95rem; }
.vb-detail { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.vb-right { text-align: right; }
.vb-odds { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.vb-edge { color: var(--accent); font-weight: 800; font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; }

/* Upcoming match */
.up-match {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  background: var(--surface2); border-radius: 8px; padding: 14px; margin-bottom: 8px;
}
.up-home { text-align: right; font-weight: 600; }
.up-away { text-align: left; font-weight: 600; }
.up-center { text-align: center; }
.up-score { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.up-result { font-size: 0.7rem; color: var(--muted); }
.up-date { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }

/* History */
.hist-row {
  display: grid; grid-template-columns: 80px 1fr auto 1fr 40px; gap: 8px;
  align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.hist-row:last-child { border: none; }
.hist-date { color: var(--muted); font-size: 0.8rem; }
.hist-home { text-align: right; font-weight: 500; }
.hist-away { text-align: left; font-weight: 500; }
.hist-score { text-align: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent); }
.hist-goals { text-align: center; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: var(--surface2); border-radius: 8px; padding: 16px; text-align: center; }
.stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-val { font-size: 2rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--accent); margin-top: 4px; }

/* Utils */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.desc { font-size: 0.85rem; margin-bottom: 14px; }

footer { text-align: center; padding: 24px 0; color: var(--muted); font-size: 0.75rem; }

/* Mobile */
@media (max-width: 700px) {
  .match-selector { flex-direction: column; }
  .vs-badge { text-align: center; padding: 0; }
  .cards-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .match-header-card { flex-direction: column; gap: 8px; }
  .match-team { text-align: center !important; }
  .up-match { grid-template-columns: 1fr; text-align: center; }
  .up-home, .up-away { text-align: center; }
  .hist-row { grid-template-columns: 60px 1fr auto 1fr; }
  .hist-goals { display: none; }
  h1 { font-size: 1.3rem; }
}
