/* static/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #FF8200;
  --bg: #111111;
  --card: #1e1e1e;
  --border: #58595B;
  --text: #FFFFFF;
  --muted: #9a9b9d;
  font-size: 18px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────── */
header {
  background: #0a0a0a;
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo { width: 36px; height: 36px; }
.header-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tab-bar {
  background: #141414;
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 14px 20px;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ── Card ────────────────────────────────────────────────────────────── */
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
  flex: 1;
}
.sport-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hidden { display: none !important; }

/* ── Record ──────────────────────────────────────────────────────────── */
.record-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--orange);
}
.tn-rank {
  font-size: 1.4rem;
  opacity: 0.85;
}

/* ── Game-day Banner ─────────────────────────────────────────────────── */
.gameday-banner {
  background: #1a2a10;
  border: 1px solid #4a8a2a;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gameday-icon { font-size: 1.4rem; line-height: 1; }
.gameday-text { display: flex; flex-direction: column; gap: 2px; }
.gameday-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7cbc4a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gameday-detail { font-size: 0.92rem; color: var(--text); }

/* ── Live ────────────────────────────────────────────────────────────── */
.live-section {
  background: #2a1a00;
  border: 1px solid var(--orange);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.live-dot {
  width: 10px; height: 10px;
  background: var(--orange);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}
.live-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: var(--orange);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.live-score {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  gap: 10px;
  align-items: center;
}
.live-tn { color: var(--orange); }
.live-sep { color: var(--muted); }
.live-period { color: var(--muted); font-size: 0.9rem; width: 100%; }

/* ── Info Rows ───────────────────────────────────────────────────────── */
.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.row-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.row-value { font-size: 1rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.muted { color: var(--muted); font-size: 0.9rem; }
.location { font-size: 0.85rem; color: var(--muted); width: 100%; margin-top: 2px; }

.result-chip {
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 8px;
}
.result-chip.win { background: #1a4a1a; color: #4caf50; }
.result-chip.loss { background: #4a1a1a; color: #f44336; }

.tv-badge {
  background: #333;
  border-radius: 4px;
  font-size: 0.8rem;
  padding: 2px 8px;
  color: var(--text);
}

/* ── Prefs Password Modal ────────────────────────────────────────────── */
.prefs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.prefs-modal {
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prefs-modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}
.prefs-modal-sub { font-size: 0.83rem; color: var(--muted); }
.prefs-modal-input {
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.prefs-modal-input:focus { border-color: var(--orange); }
.prefs-modal-error { font-size: 0.82rem; color: #f44336; }
.prefs-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.prefs-modal-btn {
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  transition: background 0.15s;
}
.prefs-modal-btn-cancel { background: #333; color: var(--muted); }
.prefs-modal-btn-cancel:hover { background: #444; color: var(--text); }
.prefs-modal-btn-submit { background: var(--orange); color: #fff; }
.prefs-modal-btn-submit:hover { background: var(--vol-orange-dark, #d96e00); }

/* ── Schedule ────────────────────────────────────────────────────────── */
.schedule-section { gap: 12px; }
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 4px;
}
.schedule-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 6px 10px;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.schedule-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #2a2a2a;
  vertical-align: middle;
}
.schedule-table tbody tr:last-child td { border-bottom: none; }
.schedule-table tbody tr:hover { background: #252525; }
.schedule-row-next { background: #1f1500; }
.schedule-row-next:hover { background: #261900 !important; }
.sched-date { color: var(--muted); white-space: nowrap; min-width: 60px; }
.sched-opp { font-weight: 500; }
.sched-at {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 3px;
}
.sched-time { color: var(--muted); white-space: nowrap; font-size: 0.83rem; }
.sched-odds { font-size: 0.72rem; color: #9a7a4a; margin-top: 2px; white-space: nowrap; }
.sched-tv { white-space: nowrap; }
.schedule-row-result td { opacity: 0.7; }
.schedule-row-result:hover td { opacity: 1; }
.schedule-divider-row td { border-bottom: 1px solid var(--orange); padding: 0; height: 0; }

.sec-badge {
  border: 1px solid var(--orange);
  border-radius: 3px;
  color: var(--orange);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 4px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 3px;
}
.opp-record {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 2px;
}
.opp-rank {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 2px;
}

/* ── AI Sport Summary ────────────────────────────────────────────────── */
.sport-summary {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  font-style: italic;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  font-size: 0.8rem;
  gap: 16px;
  justify-content: center;
  padding: 12px 16px;
}

/* ── Notification Preferences ────────────────────────────────────────── */
.prefs-table-wrap { overflow-x: auto; }
.prefs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 16px;
}
.prefs-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.prefs-table td { padding: 8px 12px; border-top: 1px solid var(--border); }
.prefs-sport-label { color: var(--text); font-size: 0.9rem; white-space: nowrap; }
.prefs-toggle-cell { text-align: center; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: #444; border-radius: 20px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute;
  width: 14px; height: 14px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--orange); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.prefs-status { font-size: 0.8rem; color: var(--muted); min-height: 1.2em; }
.prefs-status.ok { color: #4caf50; }
.prefs-status.err { color: #f44336; }

/* ── Mobile App Setup ────────────────────────────────────────────────── */
.setup-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0;
}
.setup-summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
}
.setup-summary::-webkit-details-marker { display: none; }
.setup-summary:hover { color: var(--text); }
.setup-summary-sub {
  font-weight: 400;
  margin-left: 4px;
  font-size: 0.8rem;
}
.prefs-lock-btn {
  margin-left: auto;
  background: #2a2a2a;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.prefs-lock-btn:hover { background: #333; color: var(--text); }
.prefs-lock-btn.unlocked { border-color: var(--orange); color: var(--orange); }
.prefs-lock-btn.unlocked:hover { background: #2a1500; }
.setup-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.setup-topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
}
.setup-topic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.setup-topic-label {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 160px;
}
.copy-inline {
  background: #2a2a2a;
  border-radius: 4px;
  color: var(--orange);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px 8px;
  transition: background 0.15s;
}
.copy-inline:hover { background: #333; }
.setup-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.setup-platform-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.setup-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.setup-steps a { color: var(--orange); }
.setup-steps strong { color: var(--text); }
.setup-test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.setup-select {
  background: #2a2a2a;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 6px 10px;
}
.btn-send-test {
  background: var(--orange);
  border: none;
  border-radius: 4px;
  color: #000;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  transition: opacity 0.15s;
}
.btn-send-test:hover { opacity: 0.85; }
.btn-send-test:disabled { opacity: 0.5; cursor: default; }
.setup-test-result { font-size: 0.85rem; }
.setup-test-result.ok { color: #4caf50; }
.setup-test-result.err { color: #f44336; }

/* ── Listen Live Widget ───────────────────────────────────────────────── */
.listen-live-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
  background: var(--orange);
  border-radius: 6px;
  padding: 8px 14px 8px 10px;
  text-decoration: none;
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 12px rgba(255,130,0,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.listen-live-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.listen-live-link:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 20px rgba(255,130,0,0.45);
}
.listen-live-link:active { transform: translateY(0) scale(0.99); }

/* Tooltip */
.listen-live-link::after {
  content: 'Listen to Vol Network Radio';
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #111;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  border-left: 3px solid var(--orange);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
.listen-live-link:hover::after { opacity: 1; }

.listen-live-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.listen-live-divider {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.listen-live-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.listen-live-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.listen-live-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.listen-live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.22);
  border-radius: 12px;
  padding: 3px 8px 3px 6px;
  flex-shrink: 0;
}
.radio-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b3b;
  flex-shrink: 0;
  animation: radio-pulse 1.4s ease-in-out infinite;
}
@keyframes radio-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255,59,59,0.7); }
  50%       { opacity: 0.85; transform: scale(1.25); box-shadow: 0 0 0 4px rgba(255,59,59,0); }
}
.listen-live-badge-text {
  font-family: 'Oswald', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.listen-live-arrow {
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.listen-live-link:hover .listen-live-arrow {
  transform: translateX(3px);
  color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-title { font-size: 1.2rem; }
  .tab-btn { padding: 12px 14px; font-size: 0.85rem; }
  .record-badge { font-size: 1.5rem; }
  .setup-columns { grid-template-columns: 1fr; }

  /* Collapse listen-live to icon + text pill */
  .listen-live-logo,
  .listen-live-divider,
  .listen-live-text,
  .listen-live-arrow { display: none; }
  .listen-live-link {
    padding: 7px 12px;
    gap: 6px;
    border-radius: 20px;
  }
  .listen-live-badge {
    background: transparent;
    padding: 0;
    gap: 5px;
  }
  .radio-live-dot { width: 8px; height: 8px; }
  .listen-live-badge-text { font-size: 0.78rem; letter-spacing: 0.06em; }
}
