:root {
  --bg: #071018;
  --bg-soft: rgba(12, 24, 36, 0.72);
  --panel: rgba(10, 19, 30, 0.92);
  --panel-2: rgba(16, 28, 42, 0.96);
  --text: #edf4ff;
  --muted: #8fa5bf;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #1fdd8d;
  --primary-strong: #0fbf77;
  --secondary: #42a5ff;
  --gold: #e7c46a;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(66, 165, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(31, 221, 141, 0.12), transparent 24%),
    linear-gradient(180deg, #050b11 0%, #071018 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.page-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.glow-left {
  left: -120px;
  top: 120px;
  background: var(--secondary);
}

.glow-right {
  right: -120px;
  top: 220px;
  background: var(--primary);
}

.hero,
.main-layout,
.modal {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 48px 0 24px;
}

.hero__content {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 36px;
  background: linear-gradient(135deg, rgba(10, 19, 30, 0.95), rgba(12, 27, 35, 0.88));
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.eyebrow,
.panel__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 0.95;
}

.hero h1 span {
  color: var(--primary);
}

.hero__subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #02120c;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(31, 221, 141, 0.2);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--small {
  padding: 10px 16px;
  font-size: 0.92rem;
}

.main-layout {
  padding-bottom: 48px;
}

.top-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel__header h2 {
  margin: 8px 0 0;
  font-size: 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.badge--soft {
  background: rgba(66, 165, 255, 0.1);
  color: #a8d3ff;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card,
.opportunity-card {
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 18px;
}

.stat-card span,
.opportunity-card p,
.field span,
.game-meta,
.game-tags,
.analysis-summary,
.metric-label,
.metric-value,
.helper-text {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.9rem;
}

.opportunity-list {
  display: grid;
  gap: 12px;
}

.opportunity-card {
  position: relative;
  overflow: hidden;
}

.opportunity-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 221, 141, 0.2), transparent 70%);
}

.opportunity-card h3 {
  margin: 8px 0 8px;
  font-size: 1rem;
}

.opportunity-card strong {
  color: var(--primary);
}

.filters-panel {
  margin-top: 20px;
}

.filters-header {
  flex-wrap: wrap;
}

.ranking-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(231, 196, 106, 0.08);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 0.93rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 14px;
}

.field input:focus,
.field select:focus {
  border-color: rgba(66, 165, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(66, 165, 255, 0.12);
}

.games-wrapper {
  margin-top: 20px;
}

.feedback-message {
  margin-bottom: 14px;
  padding: 15px 18px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.15);
  color: #ffc0c0;
  border-radius: 16px;
}

.hidden {
  display: none !important;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  background: linear-gradient(180deg, rgba(12, 20, 31, 0.98), rgba(11, 18, 27, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 18px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(31, 221, 141, 0.3);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.game-card__top,
.game-card__footer,
.teams-row,
.progress-head,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sport-pill,
.tag-chip,
.confidence-badge,
.rank-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.sport-pill {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(66, 165, 255, 0.12);
  color: #9ed0ff;
}

.confidence-badge {
  padding: 10px 12px;
  background: rgba(31, 221, 141, 0.12);
  color: #9bf6cb;
}

.game-title {
  margin: 0;
  font-size: 1.15rem;
}

.game-meta {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  font-size: 0.93rem;
}

.teams-row {
  font-size: 1rem;
  font-weight: 700;
}

.teams-row .versus {
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.game-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tag-chip {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.ranking-slot {
  display: flex;
  align-items: center;
}

.rank-badge {
  padding: 8px 12px;
  background: rgba(231, 196, 106, 0.12);
  color: var(--gold);
}

.modal {
  position: fixed;
  inset: 0;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 15, 0.76);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  width: min(980px, calc(100% - 20px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  background: linear-gradient(180deg, #0b141e, #081018);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.modal__close {
  position: sticky;
  top: 0;
  float: right;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-header {
  align-items: start;
  margin-top: 8px;
  margin-bottom: 18px;
}

.modal-title-group h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.analysis-panel,
.insights-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
}

.analysis-panel h3,
.insights-panel h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

.metrics-list {
  display: grid;
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.confidence-ring {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #081018 52%, transparent 53%),
    conic-gradient(var(--primary) calc(var(--confidence) * 1%), rgba(255,255,255,0.08) 0);
  border: 1px solid var(--line);
}

.confidence-ring strong {
  font-size: 1.6rem;
}

.insights-list {
  display: grid;
  gap: 12px;
}

.insight-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 15px;
}

.insight-card strong {
  display: block;
  margin-bottom: 6px;
}

.footer-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .top-grid,
  .analysis-grid,
  .games-grid,
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero__content,
  .panel__header,
  .modal-header,
  .hero__actions,
  .summary-stats,
  .top-grid,
  .games-grid,
  .filters-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero__content {
    padding: 24px;
  }

  .summary-stats {
    display: grid;
  }

  .games-grid,
  .top-grid,
  .filters-grid {
    display: grid;
  }

  .game-card__top,
  .game-card__footer,
  .teams-row {
    flex-wrap: wrap;
  }

  .modal__content {
    padding: 20px;
  }
}
