:root {
  color-scheme: dark;
  --bg: #061511;
  --surface: #0c211b;
  --surface-2: #102a22;
  --line: rgba(181, 255, 215, .12);
  --text: #f4faf7;
  --muted: #8fa9a0;
  --lime: #b8f34a;
  --mint: #65e7b0;
  --danger: #ff806f;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 4%, rgba(68, 196, 136, .14), transparent 28rem),
    linear-gradient(180deg, #081a15 0%, var(--bg) 42%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 32px 32px;
}

button, input, select { font: inherit; }

.app-shell { width: min(100%, 520px); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 11px; }
.topbar h1 { font-size: 20px; margin: 1px 0 0; letter-spacing: -.4px; }
.eyebrow { color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; margin: 0; }
.brand-mark { position: relative; flex-shrink: 0; width: 39px; height: 39px; border: 1px solid rgba(184,243,74,.32); border-radius: 13px; background: rgba(184,243,74,.08); }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; width: 18px; height: 3px; border-radius: 4px; background: var(--lime); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-28deg); }
.brand-mark::before { top: calc(50% - 6px); width: 12px; }
.brand-mark::after { top: calc(50% + 6px); width: 12px; }
.status-dot { margin-left: auto; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; padding: 7px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.status-dot span { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); display: inline-block; margin-right: 5px; box-shadow: 0 0 9px var(--mint); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.header-actions .status-dot { margin-left: 0; }
.logout-button { border: 1px solid var(--line); border-radius: 999px; padding: 7px 9px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; cursor: pointer; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px 18px; }
.login-card { width: min(100%, 420px); padding: 28px 24px; background: linear-gradient(145deg, rgba(16,42,34,.98), rgba(9,29,23,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 70px rgba(0,0,0,.28); }
.login-mark { margin-bottom: 22px; }
.login-card h1 { margin: 6px 0 10px; font-size: 25px; letter-spacing: -.6px; }
.login-copy { margin: 0 0 22px; color: #9bb1a9; font-size: 14px; line-height: 1.55; }
.login-password { margin: 16px 0 20px; }
.login-error { margin: 0 0 18px; padding: 12px 14px; color: #ffd2cc; background: rgba(83,26,22,.72); border: 1px solid rgba(255,128,111,.32); border-radius: 13px; font-size: 13px; }

.hero { padding: 34px 2px 18px; }
.hero > p:first-child { color: #bbcbc5; font-size: 16px; line-height: 1.5; margin: 0 0 22px; max-width: 410px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #05110e; border: 1px solid var(--line); border-radius: 15px; }
.mode { border: 0; border-radius: 11px; padding: 12px; color: #769087; background: transparent; font-weight: 750; cursor: pointer; }
.mode.active { color: #092016; background: var(--lime); box-shadow: 0 6px 24px rgba(184,243,74,.14); }
.mode small { font-size: 8px; text-transform: uppercase; letter-spacing: .5px; opacity: .65; margin-left: 4px; }
.live-pulse { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: #ff6b5c; border-radius: 50%; }
.mode-note { font-size: 11px; color: var(--muted); margin: 9px 4px 0 !important; }

.control-card, .results, .feedback { background: linear-gradient(145deg, rgba(16,42,34,.98), rgba(9,29,23,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 70px rgba(0,0,0,.22); }
.control-card { padding: 20px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span:first-child { color: #9bb1a9; font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: 1px; }
.league-picker { border: 0; padding: 0; margin: 0; min-width: 0; }
.league-picker legend { color: #9bb1a9; font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; }
.league-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.league-actions button { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: rgba(255,255,255,.035); color: #c9d8d2; font: inherit; font-size: 12px; cursor: pointer; }
.league-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 250px; overflow-y: auto; padding: 2px; }
.league-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); color: #dbe7e2; font-size: 12px; line-height: 1.3; cursor: pointer; }
.league-option:has(input:checked) { border-color: rgba(184,243,74,.55); background: rgba(184,243,74,.08); }
.league-option.unavailable { opacity: .38; cursor: not-allowed; }
.live-label { margin-left: 4px; color: #ff8f82; font-size: 8px; letter-spacing: .5px; }
.league-option input { width: auto; min-width: 16px; margin: 1px 0 0; padding: 0; accent-color: var(--lime); flex: 0 0 auto; }
.selection-summary { margin: 9px 2px 0; color: var(--muted); font-size: 11px; }
.selection-summary.error-text { color: #ffaca8; }
.full { width: 100%; }
input, select { width: 100%; min-width: 0; color: var(--text); border: 1px solid rgba(181,255,215,.15); background: #071914; border-radius: 13px; padding: 14px 13px; outline: none; }
select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--mint) 50%), linear-gradient(135deg, var(--mint) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus { border-color: rgba(184,243,74,.65); box-shadow: 0 0 0 3px rgba(184,243,74,.08); }
.date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.date-grid input { appearance: none; -webkit-appearance: none; max-width: 100%; min-height: 54px; }
.date-grid input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.advanced { margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced summary { list-style: none; padding: 15px 1px; color: #c5d3ce; font-size: 13px; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "+"; color: var(--lime); margin-right: 8px; font-size: 17px; }
.advanced[open] summary::before { content: "−"; }
.advanced summary span { float: right; color: var(--muted); font-size: 10px; margin-top: 4px; }
.advanced-field { padding: 0 0 16px; }
.primary-button { width: 100%; border: 0; border-radius: 14px; padding: 16px; background: var(--lime); color: #102109; font-weight: 850; cursor: pointer; box-shadow: 0 12px 35px rgba(184,243,74,.14); }
.primary-button:disabled { cursor: wait; opacity: .58; }
.refresh-icon { font-size: 20px; display: inline-block; margin-right: 7px; vertical-align: -1px; }
.loading .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.feedback { margin-top: 14px; padding: 15px 17px; color: #c6d5d0; font-size: 13px; line-height: 1.45; }
.feedback.error { color: #ffd2cc; border-color: rgba(255,128,111,.32); background: rgba(83,26,22,.72); }
.results { margin-top: 16px; padding: 19px; }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results h2 { font-size: 17px; margin: 4px 0 0; }
.signal-count { display: grid; place-items: center; min-width: 39px; height: 39px; padding: 0 8px; border-radius: 13px; color: #132409; background: var(--lime); font-weight: 900; }
.result-list { display: grid; gap: 9px; }
.match-card { padding: 14px; border-radius: 15px; background: rgba(3,14,11,.56); border: 1px solid rgba(181,255,215,.09); }
.match-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.teams { margin: 9px 0 11px; font-weight: 740; font-size: 14px; line-height: 1.4; }
.pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 9px; font-weight: 900; letter-spacing: .8px; padding: 5px 7px; border-radius: 7px; background: rgba(184,243,74,.12); color: var(--lime); }
.badge.skip { color: var(--muted); background: rgba(255,255,255,.05); }
.market { font-size: 13px; color: #dce8e3; }
.metrics { margin-left: auto; color: var(--mint); font-size: 12px; font-weight: 750; }
.reason { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 10px 0 0; }
footer { color: #567168; font-size: 10px; text-align: center; line-height: 1.5; padding: 22px 10px 0; }

@media (max-width: 480px) {
  .league-options { grid-template-columns: 1fr; max-height: 280px; }
  .date-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .status-dot { font-size: 0; }
  .status-dot span { margin: 0; }
}

.prediction-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.prediction-metrics > div { padding: 12px; background: var(--surface-2); border-radius: 12px; }
.prediction-metrics dt { font-size: 11px; color: var(--muted); }
.prediction-metrics dd { margin: 6px 0 0; color: var(--mint); font-size: 23px; font-weight: 750; }
.estimate-note { margin: 8px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.prediction-section h3, .prediction-details h3 { margin: 14px 0 8px; font-size: 12px; color: var(--text); }
.prediction-section ul, .prediction-details ul { margin: 0; padding-left: 18px; color: #b8cbc3; font-size: 12px; line-height: 1.6; }
.prediction-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.prediction-details summary { color: var(--mint); font-size: 12px; cursor: pointer; padding: 4px 0; }
.prediction-details summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.freshness { font-size: 11px; line-height: 1.5; }
.freshness dt { margin-top: 9px; color: var(--muted); }
.freshness dd { margin: 2px 0 0; }
.match-card { overflow-wrap: anywhere; }
