:root {
  --ground: #0E1216;
  --surface: #171D23;
  --surface-2: #1F262D;
  --line: #2B343D;
  --bar: #12171C;
  --text: #EEF1F3;
  --muted: #A3ADB7;
  --accent: #F5A524;
  --on-accent: #0E1216;
  --live: #4ADE80;
  --info-bg: #1B2530;
  --info-text: #C9D3DC;
  --info-icon: #5EB1FF;
  --danger: #C62F35;
  --display: 'Barlow Condensed', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--body); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
/*no double-tap zoom: tapping + / − (or any button) quickly would zoom the page; pinch zoom still works*/
html, button, a, input, .chip { touch-action: manipulation; }
a { color: var(--accent); }
.app { height: 100vh; height: var(--app-h, 100dvh); overflow: hidden; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

.top { padding: calc(env(safe-area-inset-top) + 20px) 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top.back { padding-left: 8px; justify-content: flex-start; gap: 4px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }

.content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--live); }
section { display: flex; flex-direction: column; gap: 8px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--surface); border-radius: 12px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--line); color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: transparent; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.card { background: var(--surface); border-radius: 14px; }
.bet { width: 100%; border: 0; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--surface); border-radius: 14px; }
.bet .main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bet .title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.bet .sub { font-size: 13px; color: var(--muted); }
.bet .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bet .when.live { color: var(--live); font-weight: 600; }
.bet .when.score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }
.bet .when.score .pts { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1; color: var(--text); }
.bet-wrap { display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; overflow: hidden; }
.bet-actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.danger { min-height: 44px; flex: 1; border: 0; border-radius: 10px; background: var(--danger); color: #fff; font-weight: 600; }
.join { min-height: 44px; flex: 1; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ghost { min-height: 44px; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-weight: 500; }

.parlay { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.parlay .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.parlay .legs { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.parlay .leg { display: flex; justify-content: space-between; gap: 12px; }
.result-win { color: var(--live); } .result-loss { color: #FF8A8F; } .result-push { color: var(--muted); }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 14px; font-size: 15px; line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 8px; }
.input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px; outline: none; width: 100%; }
.input:focus { border-color: var(--accent); }
.suggest { display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; overflow: hidden; }
.suggest button { min-height: 52px; padding: 8px 14px; border: 0; border-top: 1px solid #222A31; background: transparent; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.suggest button:first-child { border-top: 0; }
.suggest .n { font-weight: 600; font-size: 15px; } .suggest .d { font-size: 13px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stepper { display: flex; align-items: center; height: 48px; background: var(--surface); border-radius: 12px; }
.stepper button { width: 44px; height: 48px; border: 0; background: transparent; font-size: 22px; }
.stepper input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; text-align: center; font-family: var(--display); font-weight: 700; font-size: 24px; outline: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info-text); font-size: 14px; line-height: 1.4; }
.note.error { background: #2A1A1C; color: #FFC9CC; }
.note.ok { background: #16271D; color: #BFF3CF; }
.note svg { flex: none; margin-top: 1px; }

.footer { flex: none; padding: 12px 20px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #222A31; background: var(--bar); }
.primary { min-height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px; width: 100%; }
.primary[disabled] { opacity: 0.5; cursor: default; }
.link { min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 500; font-size: 15px; }

.tabs { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; padding: 8px 24px calc(env(safe-area-inset-bottom) + 10px); background: var(--bar); border-top: 1px solid #222A31; }
.tab { min-height: 48px; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 500; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }
.fab { justify-self: center; width: 60px; height: 60px; border-radius: 30px; border: 0; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

.legs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legs-list li { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; background: var(--surface); border-radius: 14px; }
.num { width: 28px; height: 28px; flex: none; border-radius: 14px; background: var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 16px; }
.add-leg { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; font-size: 15px; width: 100%; }

.signin { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 40px 28px; }
.signin p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.discord { min-height: 52px; border: 0; border-radius: 14px; background: #5865F2; color: #fff; font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.loading { padding: 40px 20px; color: var(--muted); text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.badge { flex: none; width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.badge-win { background: #1F4D2E; color: #8FF0B0; }
.badge-loss { background: #4D1F23; color: #FFB3B8; }
.badge-push { background: var(--line); color: var(--text); }

/*The app is one full-screen frame: header and bottom bar stay put and only .content scrolls,
  so iPhone's page shifts (opening a home-screen app, the keyboard) can't move the bars. The
  page itself never scrolls; --app-h is the screen height in a home-screen app (app.js).*/
html, body { height: 100%; height: var(--app-h, 100%); overflow: hidden; overscroll-behavior: none; }
.top { flex: none; }
.account { flex: none; padding: 0 20px 8px; }

.bet .when.score .pts.hit { color: var(--live); }
.bet .when.score .pts.miss { color: #FF8A8F; }
.bet .when.score .pts.good { color: var(--live); }
.bet .when.score .pts.even { color: #FACC15; }
.bet .when.score .pts.bad { color: #FF8A8F; }
/*the clock under a score stays grey, so green / yellow / red only ever mean how the bet is doing*/
.bet .when.score, .bet .when.score.live { color: var(--muted); font-weight: 500; }
