:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #17181c;
  --ink-muted: #5b5e68;
  --border: #e3e0d6;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);

  --love-primary: #203731;
  --love-accent: #ffb612;
  --caleb-primary: #0b162a;
  --caleb-accent: #c83803;

  --good: #1e7a4c;
  --odds-leading: #1e7a4c;
  --odds-trailing: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #191b20;
    --ink: #f2f1ec;
    --ink-muted: #a7a9b3;
    --border: #2a2c33;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --odds-leading: #2fa968;
    --odds-trailing: #e5534b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-block: 32px;
  overflow-x: hidden;
}

.bg-photo {
  position: fixed;
  top: 0;
  bottom: 0;
  width: clamp(180px, 32vw, 420px);
  background-size: cover;
  opacity: 0.22;
  filter: grayscale(0.35) contrast(1.05);
  pointer-events: none;
  z-index: -1;
}

.bg-photo.left {
  left: 0;
  background-image: url("assets/bg-love.png");
  background-position: 85% center;
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.bg-photo.right {
  right: 0;
  background-image: url("assets/bg-williams.png");
  background-position: center center;
  -webkit-mask-image: linear-gradient(to left, black 85%, transparent 100%);
  mask-image: linear-gradient(to left, black 85%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
  .bg-photo { opacity: 0.28; filter: grayscale(0.35) contrast(1.05) brightness(0.9); }
}

@media (max-width: 600px) {
  .bg-photo { width: 34vw; }
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 20px;
  position: relative;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(28px, 6vw, 44px);
  margin: 0;
  line-height: 1.1;
}

.nm-love { color: var(--love-accent); -webkit-text-stroke: 0.5px var(--love-primary); }
.nm-caleb { color: var(--caleb-accent); }
.vs {
  font-size: 0.55em;
  font-weight: 400;
  color: var(--ink-muted);
  vertical-align: middle;
}

.sub {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--ink-muted);
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

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

@media (max-width: 480px) {
  .card { padding: 14px; }
}

.card {
  background: linear-gradient(165deg, var(--card-wash) 0%, var(--surface) 55%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-primary), var(--card-accent));
}

.card.love {
  --card-color: var(--love-accent);
  --card-primary: var(--love-primary);
  --card-accent: var(--love-accent);
  --card-wash: rgba(32, 55, 49, 0.08);
}

.card.caleb {
  --card-color: var(--caleb-accent);
  --card-primary: var(--caleb-primary);
  --card-accent: var(--caleb-accent);
  --card-wash: rgba(11, 22, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
  .card.love { --card-wash: rgba(255, 182, 18, 0.07); }
  .card.caleb { --card-wash: rgba(200, 56, 3, 0.09); }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

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

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card-primary, var(--card-color));
  box-shadow: 0 0 0 2px var(--card-accent, transparent);
  flex-shrink: 0;
}

.card h2 { margin: 0; font-size: 17px; }
.card .team { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-muted); }
.card .bettor { margin: 2px 0 0; font-size: 11.5px; font-weight: 600; color: var(--card-primary, var(--ink-muted)); }

.crown { font-size: 20px; }

.yards {
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 800;
  margin: 14px 0 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.yards-unit {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--ink-muted);
  margin-left: 6px;
}

.meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  min-height: 16px;
}

.next-game {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.next-label {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.next-proj {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.next-proj-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.next-proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.next-opp {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vs-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.opp-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.vbar-compare {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.section-title.center { text-align: center; }

.vbar-group {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
}

.vbar-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 130px;
  margin-bottom: 30px;
  padding-right: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.vbar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 26px;
}

.vbar-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vbar-track {
  width: 52px;
  height: 130px;
  background:
    repeating-linear-gradient(
      to top,
      var(--border) 0,
      var(--border) 1px,
      transparent 1px,
      transparent calc(100% / 6)
    ),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.vbar-fill {
  width: 100%;
  height: 0%;
  border-radius: 10px 10px 0 0;
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.vbar-fill.love { background: var(--love-primary); }
.vbar-fill.caleb { background: var(--caleb-accent); }

.vbar-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

@media (max-width: 360px) {
  .vbar-group { gap: 10px; }
  .vbar-axis { height: 110px; margin-bottom: 28px; font-size: 10px; }
  .vbar-box { padding: 10px 14px; }
  .vbar-track { width: 42px; height: 110px; }
}

.odds-compare {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.odds-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.odds-bar {
  display: flex;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.odds-segment {
  height: 100%;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
  background: var(--ink-muted);
}

.odds-segment.leading { background: var(--odds-leading); }
.odds-segment.trailing { background: var(--odds-trailing); }

.odds-pct {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.odds-note {
  margin: 0;
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

#refresh-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

#refresh-btn:hover { border-color: var(--ink-muted); }
#refresh-btn:disabled { opacity: 0.5; cursor: default; }

.error {
  background: #fdeceb;
  color: #8a2a20;
  border: 1px solid #f3c6c0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

@media (prefers-color-scheme: dark) {
  .error { background: #2a1512; color: #ff9c8f; border-color: #4a2620; }
}

footer {
  margin-top: 24px;
  text-align: center;
}

footer p {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}
