body {
  font-family: Inter, Arial, sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #111827 100%);
  color: #f8fafc;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  color: #38bdf8;
  margin: 0 0 6px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.subtitle {
  color: #cbd5e1;
  margin: 0;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.controls select {
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 10px 12px;
  background: #0f172a;
  color: white;
}

.btn.secondary {
  align-self: end;
  background: #334155;
}

.summary-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 16px;
}

.summary-label {
  display: block;
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.summary-card strong {
  font-size: 1.35rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.active-alerts-shell {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
}

.active-alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.active-alerts-header h3 {
  margin: 0 0 4px;
}

.active-alerts-header p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.active-alerts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.active-alert-card {
  border: 1px solid #0f766e;
  border-radius: 14px;
  background: rgba(12, 25, 40, 0.95);
  padding: 14px;
}

.active-alert-card-total-games {
  border-color: #9a3412;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.2);
}

.active-alert-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.active-alert-match {
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
}

.active-alert-meta {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-top: 4px;
}

.active-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.active-alert-grid div {
  background: #0f172a;
  border-radius: 10px;
  padding: 10px;
}

.active-alert-grid span {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.active-alert-grid strong {
  color: #e2e8f0;
}

.card {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.meta {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #334155;
  color: #e2e8f0;
  font-size: 0.8rem;
  white-space: nowrap;
}

.pill.active {
  background: #16a34a;
  color: white;
}

.pill.pill-winner {
  background: #166534;
  color: #dcfce7;
  border: 1px solid #22c55e;
}

.pill.pill-total-games {
  background: #7c2d12;
  color: #ffedd5;
  border: 1px solid #fb923c;
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
}

.confidence-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  border-radius: inherit;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: #cbd5e1;
}

.stats.compact {
  margin-top: 10px;
}

.stats div {
  background: #0f172a;
  border-radius: 10px;
  padding: 10px;
}

.rank-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #1d4ed8;
  color: white;
  font-size: 0.75rem;
  vertical-align: middle;
}

.reason-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #cbd5e1;
}

.reason-box strong {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
}

.details-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  background: #1d4ed8;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 10px;
}

.details-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid #334155;
}

.details-header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.player-card {
  flex: 1;
  text-align: center;
}

.player-card h4 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #38bdf8;
}

.player-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.player-info div {
  background: #111827;
  padding: 8px;
  border-radius: 6px;
}

.h2h {
  grid-column: 1 / -1;
  background: #1e293b;
  padding: 8px;
  border-radius: 6px;
  color: #fbbf24;
  font-weight: 600;
}

.vs-divider {
  font-weight: bold;
  color: #38bdf8;
  font-size: 1.2rem;
  align-self: flex-start;
  padding-top: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: #111827;
  border-radius: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #334155;
  font-size: 0.9rem;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #94a3b8;
  font-weight: 500;
}

.stat-value {
  color: #38bdf8;
  font-weight: 600;
  text-align: right;
}

.stat-vs {
  color: #64748b;
  text-align: center;
  font-size: 0.8rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.details-grid div {
  background: #111827;
  border-radius: 10px;
  padding: 10px;
}

.details-grid span {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.stats span {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.loading {
  color: #94a3b8;
  text-align: center;
}

/* Tab Controls */
.tab-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid #334155;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #cbd5e1;
}

.tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

.tab-content {
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Results Section */
.results-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.results-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.accuracy-card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.accuracy-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: #38bdf8;
  margin-bottom: 8px;
}

.accuracy-label {
  color: #94a3b8;
  font-size: 0.9rem;
}

.accuracy-card.compact {
  padding: 16px;
}

.accuracy-card.compact .accuracy-value {
  font-size: 1.8rem;
}

.accuracy-card.compact small {
  display: block;
  margin-top: 6px;
  color: #64748b;
}

.record-form {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.results-controls {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.results-count-summary {
  color: #94a3b8;
  font-size: 0.92rem;
}

.results-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.results-controls select {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
}

.record-form h3 {
  margin-top: 0;
  color: #38bdf8;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.form-row input,
.form-row select {
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.form-row input::placeholder {
  color: #64748b;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #38bdf8;
  background: #1a2844;
}

/* Results List */
.results-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

.result-item {
  background: #111827;
  border: 2px solid #334155;
  border-radius: 12px;
  transition: all 0.2s;
  overflow: hidden;
}

.result-item.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.result-item.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.result-header::-webkit-details-marker {
  display: none;
}

.result-number {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.result-matchline {
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
}

.result-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-status {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.result-item.correct .result-status,
.badge-correct {
  background: #10b981;
  color: white;
}

.result-item.incorrect .result-status,
.badge-incorrect {
  background: #ef4444;
  color: white;
}

.badge-pending {
  background: #f59e0b;
  color: #111827;
}

.result-expand {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-item[open] .result-expand {
  color: #38bdf8;
}

.result-item[open] .result-header {
  border-bottom: 1px solid #334155;
}

.result-details {
  padding: 14px 16px 16px;
  color: #cbd5e1;
  display: grid;
  gap: 8px;
}

.result-details {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.result-details div {
  color: #cbd5e1;
}

.result-details strong {
  color: #94a3b8;
}

.no-results {
  text-align: center;
  color: #64748b;
  padding: 40px 20px;
  font-size: 1.1rem;
}

.alerts-history {
  margin-top: 28px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px;
}

.alerts-history-header {
  margin-bottom: 14px;
}

.alerts-history-header h3 {
  margin: 0 0 4px;
  color: #38bdf8;
}

.alerts-history-header small {
  color: #94a3b8;
}

.polymarket-autobet-meta {
  margin: 8px 0 12px;
  color: #cbd5e1;
}

.alerts-history-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.alerts-history-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.alerts-history-controls select {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 9px 10px;
  background: #0f172a;
  color: #cbd5e1;
}

.alerts-history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.alert-history-item {
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f172a;
  padding: 12px;
}

.alert-history-item-total-games {
  border-color: #9a3412;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.2);
}

.alert-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.alert-history-match {
  font-weight: 600;
  color: #e2e8f0;
}

.alert-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alert-history-grid div {
  background: #111827;
  border-radius: 8px;
  padding: 9px;
}

.alert-history-grid span {
  display: block;
  color: #94a3b8;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.alert-history-grid strong {
  color: #f8fafc;
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-bar, .grid, .stats, .controls, .details-grid {
    grid-template-columns: 1fr;
  }

  .results-header {
    grid-template-columns: 1fr;
  }

  .results-breakdown {
    grid-template-columns: 1fr;
  }

  .results-list {
    grid-template-columns: 1fr;
  }

  .active-alerts-header,
  .active-alert-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .alerts-history-controls,
  .alert-history-grid {
    grid-template-columns: 1fr;
  }
}

/* Live Predictions Styles */
.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px;
}

.live-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #f8fafc;
}

.live-count-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
}

.polymarket-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.polymarket-test-status {
  color: #94a3b8;
  font-size: 0.82rem;
  max-width: 320px;
}

.live-card {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid #475569;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.live-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.live-card.alert-level {
  border-color: #f97316;
  background: rgba(40, 25, 15, 0.9);
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-market-title {
  font-weight: 600;
  color: #e2e8f0;
}

.live-source {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.live-status {
  font-size: 0.75rem;
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.live-card.alert-level .live-status {
  background: #f97316;
}

.live-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.live-player {
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
}

.live-prob-source {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-player.live-favorite {
  border: 2px solid #38bdf8;
}

.live-player.live-underdog {
  border: 1px solid #64748b;
}

.live-name {
  font-size: 0.9rem;
  color: #f8fafc;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-prob {
  font-size: 1.4rem;
  font-weight: 700;
  color: #38bdf8;
}

.live-player.live-underdog .live-prob {
  color: #cbd5e1;
}

.live-divider {
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
}

.live-prob-bar {
  display: block;
  height: 8px;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  border-radius: 4px;
  margin: 12px 0;
  min-width: 2%;
}

.live-score-info {
  background: rgba(15, 23, 42, 0.8);
  border-left: 3px solid #10b981;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 6px;
}

.live-score-info .score {
  font-size: 1.2rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 4px;
}

.live-score-info .current-set {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.live-alert-banner {
  background: rgba(249, 115, 22, 0.2);
  border-left: 4px solid #f97316;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  color: #fed7aa;
  font-size: 0.9rem;
  font-weight: 600;
}

.live-meta {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 8px;
}

.alerts-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #334155;
}

.alerts-section h4 {
  margin: 0 0 16px;
  color: #fed7aa;
  font-size: 1.1rem;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  gap: 12px;
  background: rgba(40, 25, 15, 0.6);
  border-left: 4px solid #f97316;
  padding: 12px;
  border-radius: 8px;
  align-items: flex-start;
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-match {
  color: #fbbf24;
  margin-bottom: 4px;
}

.alert-text {
  color: #f8fafc;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-tournament {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 4px;
}
