:root {
  color-scheme: light;
  --ink: #101013;
  --muted: #6c6f7a;
  --cream: #f4efe6;
  --sand: #e7dfd2;
  --frost: #f9f7f2;
  --accent: #f05a28;
  --accent-dark: #b83a12;
  --mint: #1b998b;
  --shadow: 0 24px 60px rgba(21, 23, 28, 0.15);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f1ede6;
}

.ambient {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 231, 183, 0.8), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(241, 175, 124, 0.6), transparent 40%),
    radial-gradient(circle at 75% 80%, rgba(171, 222, 214, 0.5), transparent 55%),
    linear-gradient(125deg, #efe6d8 0%, #f8f4ec 100%);
  padding: 32px 20px 80px;
}

.shell {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  animation: rise 0.7s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.topbar h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  margin: 8px 0 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}

.env {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.6);
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.env input {
  border: 1px solid rgba(16, 16, 19, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
  background: var(--frost);
}

.env span {
  font-size: 0.75rem;
  color: var(--muted);
}

.auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.6);
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.auth-meta .label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.panel {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: floatIn 0.6s ease-out;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filters {
  grid-column: span 4;
}

.results {
  grid-column: span 8;
}

.games {
  grid-column: span 4;
}

.props {
  grid-column: span 8;
}

.lines {
  grid-column: span 8;
}

.odds-filters {
  grid-column: span 12;
}

.odds-board {
  grid-column: span 12;
}

.odds-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.odds-table th,
.odds-table td {
  vertical-align: top;
}

.odds-book-cell {
  cursor: pointer;
}

.odds-book-cell:hover {
  background: rgba(241, 212, 190, 0.25);
}

.odds-cell {
  display: grid;
  gap: 4px;
}

.odds-cell .line {
  font-weight: 600;
}

.odds-cell .line.best-line {
  border: 1px solid rgba(16, 16, 19, 0.35);
  border-radius: 8px;
  padding: 2px 6px;
  display: inline-block;
}

.odds-cell .line.secondary {
  font-weight: 500;
  color: var(--muted);
}

.odds-board .table-wrap {
  max-height: 70vh;
  overflow: auto;
}

.odds-table thead th {
  position: sticky;
  top: 0;
  background: rgba(249, 247, 242, 0.95);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.meta {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.fields {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  border: 1px solid rgba(16, 16, 19, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--frost);
}

.field select {
  width: 100%;
  border: 1px solid rgba(16, 16, 19, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--frost);
}

.mode-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  border: 1px solid rgba(16, 16, 19, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
}

.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(240, 90, 40, 0.3);
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  border: 1px solid rgba(16, 16, 19, 0.2);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}

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

.books {
  margin-top: 16px;
}

.books .label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid rgba(16, 16, 19, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  background: rgba(240, 90, 40, 0.12);
}

.chip.selected {
  background: rgba(27, 153, 139, 0.18);
  border-color: rgba(27, 153, 139, 0.6);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding-bottom: 10px;
}

td {
  padding: 10px 0;
  border-top: 1px solid rgba(16, 16, 19, 0.08);
}

.ev-value {
  font-weight: 600;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(241, 212, 190, 0.25);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(27, 153, 139, 0.15);
  color: var(--mint);
  font-weight: 600;
}

.list {
  display: grid;
  gap: 10px;
}

.card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 16, 19, 0.1);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(17, 18, 22, 0.12);
}

.card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.card p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.debug {
  margin-top: 20px;
}

.debug pre {
  background: #0f1115;
  color: #f2f4f7;
  padding: 16px;
  border-radius: 14px;
  max-height: 240px;
  overflow: auto;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 14, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal-content {
  width: min(1100px, 95vw);
  height: min(92vh, 980px);
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-content.login {
  width: min(420px, 90vw);
  height: auto;
  gap: 10px;
}

.login-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--accent-dark);
}

.modal .table-wrap {
  flex: 1;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}

.history-controls .field {
  min-width: 160px;
}

.history-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.history-controls .primary[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

canvas {
  width: 100%;
  height: 220px;
  margin: 16px 0;
  background: #f7f2ea;
  border-radius: 16px;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .filters,
  .results,
  .games,
  .props,
  .lines {
    grid-column: span 1;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
.odds-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

.odds-toggle .mode {
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(16, 16, 19, 0.25);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}
