/* GoalPulse AI — main.css */
:root {
  --bg: #060818;
  --panel: #0d1126;
  --panel-2: #141a36;
  --border: #1e2547;
  --text: #e7ecff;
  --muted: #7c83a8;
  --cyan: #00D9FF;
  --gold: #FFB800;
  --green: #00E29A;
  --red: #FF3B5C;
  --purple: #9B6DFF;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
  --radius: 14px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #0a1030 0%, var(--bg) 60%);
}
a { color: var(--cyan); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
img { display: block; }

/* ── Layout ── */
#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px;
  padding-bottom: 80px;
}

/* ── Loading bar ── */
#refresh-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--cyan); width: 0; z-index: 999;
  transition: width .3s linear;
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 80px;
  margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; position: sticky; top: 0;
  background: rgba(6,8,24,.9); backdrop-filter: blur(16px);
  z-index: 100; border-bottom: 1px solid var(--border);
  max-width: 520px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; padding-left: 14px;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.online {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--green); font-family: var(--mono);
}
.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity:1 } 50% { opacity:.4 } }
.topbar-right { display: flex; gap: 8px; align-items: center; padding-right: 14px; }
.icon-btn {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: .2s;
}
.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Bottom Nav ── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(6,8,24,.95); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border); z-index: 100;
  display: flex; justify-content: space-around; padding: 8px 0 10px;
  max-width: 100%;
}
.nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: var(--muted); padding: 4px 12px;
  border-radius: 10px; transition: .2s; background: none; border: none;
  font-family: var(--font); letter-spacing: .3px;
}
.nav-tab .nav-icon { font-size: 18px; line-height: 1; }
.nav-tab.active { color: var(--cyan); }
.nav-tab.active .nav-icon { filter: drop-shadow(0 0 6px var(--cyan)); }

/* ── Stats bar ── */
.stats-bar {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 14px 0;
}
.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 6px; text-align: center; transition: .2s;
}
.stat:hover { border-color: var(--cyan); }
.stat-val {
  font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--cyan);
}
.stat-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-top: 3px;
}

/* ── Section headers ── */
.section { margin: 20px 0 10px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 10px;
}
.section-title .badge {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--muted); background: var(--panel);
  padding: 3px 8px; border-radius: 8px; border: 1px solid var(--border);
}
.live-label { color: var(--red); }
.pregame-label { color: var(--gold); }
.yesterday-label { color: var(--green); }
.plans-label { color: var(--purple); }

/* ── Match Card ── */
.match-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 10px; position: relative; overflow: hidden;
  transition: .2s; cursor: pointer;
}
.match-card:hover { border-color: var(--cyan); transform: translateY(-1px); box-shadow: var(--shadow); }
.match-card.is-live::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--red); box-shadow: 0 0 10px var(--red);
}
.match-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 11px; color: var(--muted);
}
.card-league { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-flag { width: 14px; height: 10px; object-fit: cover; border-radius: 2px; }
.card-time { font-family: var(--mono); color: var(--cyan); font-size: 11px; }
.card-score { font-family: var(--mono); color: var(--gold); font-weight: 700; font-size: 13px; }

.match-card-teams {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.team-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.team-logo {
  width: 32px; height: 32px; border-radius: 6px; object-fit: contain;
  background: var(--panel-2); border: 1px solid var(--border);
}
.team-logo-placeholder {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.team-name { font-size: 13px; font-weight: 600; text-align: center; }
.vs-block { text-align: center; }
.vs { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.score-display { font-family: var(--mono); font-size: 20px; font-weight: 800; color: var(--gold); }
.minute-display { font-family: var(--mono); font-size: 11px; color: var(--red); }

.pick-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2); border-radius: 10px; padding: 8px 10px;
  margin-top: 8px; font-size: 12px;
}
.pick-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.tier-tag {
  font-family: var(--mono); font-size: 9px; padding: 3px 6px;
  border-radius: 5px; font-weight: 700; letter-spacing: .5px; white-space: nowrap;
}
.tier-basic { background: rgba(0,217,255,.12); color: var(--cyan); }
.tier-pro { background: rgba(255,184,0,.12); color: var(--gold); }
.tier-vip { background: linear-gradient(135deg,rgba(155,109,255,.2),rgba(255,184,0,.2)); color: var(--purple); }
.pick-text { flex: 1; color: var(--text); }
.pick-blurred .pick-text { filter: blur(4px); user-select: none; }
.pick-odds { font-family: var(--mono); color: var(--cyan); font-weight: 600; }
.pick-result { font-family: var(--mono); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 5px; }
.pick-won { background: rgba(0,226,154,.15); color: var(--green); }
.pick-lost { background: rgba(255,59,92,.15); color: var(--red); }

.unlock-cta {
  background: var(--panel-2); border: 1px dashed var(--border);
  border-radius: 10px; padding: 10px; text-align: center;
  font-size: 12px; color: var(--muted); margin-top: 8px;
  transition: .2s;
}
.unlock-cta:hover { border-color: var(--cyan); color: var(--cyan); }

.empty-state {
  padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13px;
  background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ── Plans ── */
.plan {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 12px; position: relative; transition: .2s;
}
.plan:hover { border-color: var(--cyan); }
.plan.featured {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255,184,0,.08), var(--panel-2));
}
.plan.featured::before {
  content: "⭐ MOST POPULAR"; position: absolute; top: -9px; right: 14px;
  background: var(--gold); color: var(--bg); padding: 3px 10px;
  font-size: 10px; font-weight: 700; border-radius: 5px;
}
.plan-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.plan-price { font-family: var(--mono); font-size: 32px; font-weight: 800; color: var(--cyan); margin: 8px 0; }
.plan-price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan-features { list-style: none; margin: 14px 0; }
.plan-features li { padding: 6px 0; font-size: 13px; display: flex; align-items: flex-start; gap: 8px; }
.plan-features li::before { content: "✓"; color: var(--green); font-weight: 700; }
.plan-btn {
  width: 100%; background: var(--cyan); color: var(--bg); border: none;
  padding: 12px; font-weight: 700; font-size: 14px; border-radius: 10px; transition: .2s;
}
.plan-btn:hover { background: var(--gold); }
.plan.featured .plan-btn { background: var(--gold); }
.plan.featured .plan-btn:hover { background: var(--cyan); }

/* ── Telegram CTA ── */
.telegram-cta {
  background: linear-gradient(135deg, #0088cc, #00d9ff); color: white;
  padding: 14px; border-radius: var(--radius); text-align: center;
  font-weight: 600; margin: 16px 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; transition: .2s;
}
.telegram-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,217,255,.3); }

/* ── Modal ── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px); display: none; align-items: center;
  justify-content: center; z-index: 300; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; max-width: 380px;
  width: 100%; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; background: transparent;
  border: none; color: var(--muted); font-size: 22px;
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.form-input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; font-size: 14px; color: var(--text);
  font-family: var(--font); margin-bottom: 12px; outline: none;
}
.form-input:focus { border-color: var(--cyan); }
.btn-primary {
  width: 100%; background: var(--cyan); color: var(--bg); border: none;
  padding: 12px; font-weight: 700; border-radius: 10px; font-size: 14px; margin-top: 6px;
  transition: .2s;
}
.btn-primary:hover { background: var(--gold); }
.btn-secondary {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); padding: 12px; font-weight: 600;
  border-radius: 10px; font-size: 14px; transition: .2s;
}
.btn-secondary:hover { border-color: var(--cyan); }
.btn-google {
  width: 100%; background: #fff; color: #222; border: none; padding: 12px;
  font-weight: 600; border-radius: 10px; font-size: 14px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: .2s;
}
.btn-google:hover { background: #f5f5f5; }
.divider {
  display: flex; align-items: center; gap: 10px; margin: 16px 0;
  color: var(--muted); font-size: 11px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.modal-footer { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }
.form-error { color: var(--red); font-size: 12px; margin-top: -8px; margin-bottom: 10px; }

/* ── Match Hub ── */
.hub-view {
  position: fixed; inset: 0; background: var(--bg); z-index: 200;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.hub-header {
  position: sticky; top: 0; background: rgba(6,8,24,.95);
  backdrop-filter: blur(16px); z-index: 10;
  border-bottom: 1px solid var(--border);
}
.hub-back-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; max-width: 520px; margin: 0 auto;
}
.hub-back-btn {
  background: none; border: none; color: var(--cyan); font-size: 22px;
  padding: 0; line-height: 1;
}
.hub-back-title { font-weight: 700; font-size: 15px; }
.hub-back-league { font-size: 11px; color: var(--muted); }
.hub-score-block {
  padding: 16px 14px 14px; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hub-team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hub-team-logo {
  width: 48px; height: 48px; object-fit: contain;
  background: var(--panel-2); border-radius: 10px; border: 1px solid var(--border);
}
.hub-team-name { font-size: 14px; font-weight: 700; text-align: center; line-height: 1.2; }
.hub-center { text-align: center; }
.hub-score {
  font-family: var(--mono); font-size: 30px; font-weight: 900; color: var(--gold);
}
.hub-minute { font-family: var(--mono); font-size: 12px; color: var(--red); margin-top: 4px; }
.hub-status { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }

.hub-body { max-width: 520px; margin: 0 auto; padding: 14px 14px 80px; }
.hub-section { margin-bottom: 24px; }
.hub-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.hub-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Prediction panel */
.pred-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pred-cell {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 8px; text-align: center;
}
.pred-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.pred-val { font-family: var(--mono); font-size: 20px; font-weight: 800; color: var(--cyan); }
.pred-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

.prob-bar { display: flex; border-radius: 8px; overflow: hidden; height: 28px; margin-bottom: 8px; }
.prob-seg { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 700; transition: .3s; }
.prob-seg.home { background: rgba(0,217,255,.3); color: var(--cyan); }
.prob-seg.draw { background: rgba(124,131,168,.2); color: var(--muted); }
.prob-seg.away { background: rgba(155,109,255,.3); color: var(--purple); }

/* DNA stats grid */
.dna-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dna-cell {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.dna-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.dna-val { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text); }
.dna-val.text-gold { color: var(--gold); }
.dna-val.text-cyan { color: var(--cyan); }
.dna-val.text-green { color: var(--green); }

/* H2H */
.h2h-summary { display: flex; justify-content: space-around; margin-bottom: 12px; }
.h2h-stat { text-align: center; }
.h2h-num { font-family: var(--mono); font-size: 22px; font-weight: 800; }
.h2h-txt { font-size: 10px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.h2h-match {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--panel); border-radius: 8px; margin-bottom: 6px; font-size: 12px;
}
.h2h-teams { flex: 1; }
.h2h-home { font-weight: 600; }
.h2h-away { color: var(--muted); }
.h2h-score { font-family: var(--mono); font-weight: 700; color: var(--gold); font-size: 13px; }
.h2h-date { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* Form */
.form-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.form-chip {
  width: 26px; height: 26px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.form-w { background: rgba(0,226,154,.2); color: var(--green); border: 1px solid rgba(0,226,154,.3); }
.form-d { background: rgba(124,131,168,.2); color: var(--muted); border: 1px solid rgba(124,131,168,.3); }
.form-l { background: rgba(255,59,92,.2); color: var(--red); border: 1px solid rgba(255,59,92,.3); }

/* Verdict */
.verdict-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  background: var(--panel);
}
.verdict-play { border-color: var(--green); background: rgba(0,226,154,.05); }
.verdict-avoid { border-color: var(--red); background: rgba(255,59,92,.05); }
.verdict-wait { border-color: var(--gold); background: rgba(255,184,0,.05); }
.verdict-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.verdict-pick { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.verdict-odds { font-family: var(--mono); color: var(--cyan); font-size: 14px; font-weight: 700; }
.verdict-summary { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* Shadow alerts */
.alert-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.alert-card.severity-high { border-left: 3px solid var(--red); }
.alert-card.severity-medium { border-left: 3px solid var(--gold); }
.alert-card.severity-low { border-left: 3px solid var(--muted); }
.alert-headline { font-size: 13px; line-height: 1.4; }
.alert-meta { font-size: 10px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

/* Integrity */
.integrity-score-ring {
  width: 70px; height: 70px; border-radius: 50%;
  border: 3px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; margin: 0 auto 12px;
}
.integrity-score-ring.clean { border-color: var(--green); }
.integrity-score-ring.warning { border-color: var(--gold); }
.integrity-score-ring.danger { border-color: var(--red); }
.int-score { font-family: var(--mono); font-size: 22px; font-weight: 800; }
.int-label { font-size: 9px; color: var(--muted); text-transform: uppercase; }

/* Momentum chart placeholder */
.momentum-chart {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
canvas#momentumCanvas { width: 100%; height: 80px; }

/* VIP lock */
.vip-lock {
  background: var(--panel); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.vip-lock-icon { font-size: 28px; margin-bottom: 8px; }
.vip-lock-text { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.vip-unlock-btn {
  background: linear-gradient(135deg, var(--gold), var(--purple));
  color: var(--bg); border: none; padding: 10px 20px;
  font-weight: 700; border-radius: 10px; font-size: 13px;
}

/* Profile */
.profile-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: var(--bg); margin: 0 auto 12px;
}
.profile-email { text-align: center; font-size: 14px; margin-bottom: 6px; }
.tier-badge {
  display: inline-block; padding: 4px 12px; border-radius: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.tier-free { background: rgba(124,131,168,.15); color: var(--muted); }
.tier-basic { background: rgba(0,217,255,.15); color: var(--cyan); }
.tier-pro { background: rgba(255,184,0,.15); color: var(--gold); }
.tier-vip { background: linear-gradient(135deg,rgba(155,109,255,.25),rgba(255,184,0,.25)); color: var(--purple); border: 1px solid rgba(155,109,255,.3); }
.profile-stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.profile-stat-row:last-child { border-bottom: none; }
.profile-stat-label { color: var(--muted); }
.profile-stat-val { font-family: var(--mono); font-weight: 600; }

/* Misc */
.footer {
  text-align: center; padding: 22px 0; color: var(--muted);
  font-size: 11px; font-family: var(--mono);
}

/* Error state */
.error-state {
  padding: 24px; text-align: center; color: var(--red); font-size: 13px;
  background: rgba(255,59,92,.05); border: 1px solid rgba(255,59,92,.2);
  border-radius: var(--radius); margin: 12px 0;
}

/* Page view transitions */
.view-enter { animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: translateY(0) } }
