/* The Divergent Sidekick — ADHD-native preflop trainer. Move-first, big type, big tap targets. */
:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1f2630;
  --line: #2a323d;
  --text: #e6edf3;
  --muted: #93a1b1;
  --raise: #2ea043;   /* green = act */
  --raise-2: #3fb950;
  --fold: #d1495b;    /* red = fold */
  --accent: #e63946;  /* CISOM8-ish red accent for chrome */
  --pick: #1f6feb;    /* selected tap target */
  --shadow: 0 6px 24px rgba(0,0,0,.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100%;
}
#app { width: 100%; max-width: 560px; padding: 16px 16px 96px; }

/* ---- chrome ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { font-weight: 800; letter-spacing: .3px; font-size: 15px; white-space: nowrap; }
.brand span { color: var(--accent); }
.integrity-pill { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 4px 8px; border-radius: 999px; }
.backbtn { background: none; border: none; color: var(--muted); font-size: 16px; padding: 6px 4px; cursor: pointer; }

.screen { display: none; }
.screen.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* ---- home ---- */
.home-grid { display: grid; gap: 14px; margin-top: 8px; }
.bigtile {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; color: var(--text); box-shadow: var(--shadow);
}
.bigtile:active { transform: scale(.99); }
.bigtile h2 { margin: 0 0 6px; font-size: 26px; }
.bigtile p { margin: 0; color: var(--muted); font-size: 14px; }
.minirow { display: flex; gap: 10px; margin-top: 4px; }
.minilink { flex: 1; text-align: center; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; color: var(--muted); font-size: 13px; cursor: pointer; }

/* ---- result card (move-first) ---- */
.result {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; text-align: center; box-shadow: var(--shadow); margin-bottom: 18px; min-height: 150px;
  display: flex; flex-direction: column; justify-content: center;
}
.move { font-size: 64px; font-weight: 900; letter-spacing: 1px; line-height: 1; }
.move.raise { color: var(--raise-2); }
.move.fold { color: var(--fold); }
.move.idle { color: var(--muted); font-size: 22px; font-weight: 600; }
.size { font-size: 30px; font-weight: 800; opacity: .9; }
.why { color: var(--text); font-size: 16px; margin-top: 10px; }
.why .tag { color: var(--muted); }
.deeper-toggle { margin-top: 12px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--muted); padding: 8px 12px; font-size: 13px; cursor: pointer; }
.deeper { text-align: left; margin-top: 12px; padding: 12px; background: var(--bg);
  border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); }
.deeper ul { margin: 0; padding-left: 18px; }
.deeper li { margin: 4px 0; }
.deeper .flag { color: #f0b429; }

/* ---- inputs / tap targets ---- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex: 1 1 auto; min-width: 56px; min-height: 52px; padding: 12px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
}
.chip.sm { min-width: 40px; min-height: 46px; padding: 10px 6px; font-size: 15px; flex: 0 0 auto; }
.chip:active { transform: scale(.96); }
.chip.sel { background: var(--pick); border-color: var(--pick); color: #fff; }
.choices.ranks { gap: 6px; }
.suit-toggle .chip { flex: 1; }
.hand-readout { text-align: center; font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.hand-readout .ph { color: var(--muted); font-weight: 600; font-size: 16px; }

.actions-row { display: flex; gap: 10px; margin-top: 8px; }
.btn { flex: 1; min-height: 54px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:active { transform: scale(.98); }

/* ---- drill ---- */
.drill-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.timer { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--fold); }
.repcount { color: var(--muted); font-size: 14px; }
.drill-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 20px; text-align: center; box-shadow: var(--shadow); margin-bottom: 18px; }
.drill-hand { font-size: 72px; font-weight: 900; line-height: 1; }
.drill-pos { font-size: 22px; color: var(--muted); margin-top: 10px; font-weight: 700; }
.drill-q { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 18px 0 8px; }
.spot-meta { font-size: 14px; color: var(--muted); margin-top: 12px; font-weight: 600; }
.classrow { display: flex; gap: 10px; }
.classrow .chip { font-size: 22px; min-height: 60px; }
.flash { text-align: center; font-size: 20px; font-weight: 800; min-height: 26px; margin-top: 10px; }
.flash.ok { color: var(--raise-2); }
.flash.no { color: var(--fold); }
.chip.sel.ok { background: var(--raise); border-color: var(--raise); }
.chip.sel.no { background: var(--fold); border-color: var(--fold); }

/* ---- results / summary ---- */
.summary { text-align: center; padding: 24px 0; }
.summary .big { font-size: 56px; font-weight: 900; }
.summary .sub { color: var(--muted); font-size: 16px; margin-top: 6px; }
.summary .pass { color: var(--raise-2); font-weight: 800; font-size: 20px; margin-top: 14px; }
.summary .nopass { color: var(--muted); font-weight: 700; font-size: 16px; margin-top: 14px; }

/* ---- flags list ---- */
.flags-note { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.flags-group h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text); }
.flag-item { font-size: 12.5px; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); }
.flag-item b { color: #f0b429; font-weight: 700; }

/* ---- modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-back.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; max-width: 440px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 10px; font-size: 22px; }
.modal p { color: var(--muted); font-size: 15px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.spacer { height: 8px; }

/* ---- history (read side; no streak-shaming) ---- */
.hist-item { font-size: 13px; color: var(--muted); padding: 9px 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.hist-dot { font-weight: 900; font-size: 15px; }
.hist-pass .hist-dot { color: var(--raise-2); }
.hist-neutral .hist-dot { color: var(--muted); }
.hist-bank .hist-dot { color: #f0b429; }
.hist-when { margin-left: auto; opacity: .7; font-size: 12px; white-space: nowrap; }

/* ---- fatigue guard banner ---- */
.fatigue-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px;
  width: calc(100% - 32px); max-width: 528px; background: var(--panel-2);
  border: 1px solid #6b5618; border-radius: 14px; padding: 14px; box-shadow: var(--shadow);
  display: none; z-index: 40; }
.fatigue-banner.show { display: block; animation: fade .18s ease; }
.fb-text { font-weight: 800; color: #f0b429; margin-bottom: 10px; text-align: center; }
.fb-actions { display: flex; gap: 8px; }
.fb-actions .btn { min-height: 46px; font-size: 14px; }
.install-hint { border-color: var(--line); }
.install-hint .fb-text { color: var(--text); }

/* ---- tilt reset (guided routine; no score) ---- */
.reset-stage { display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 320px; margin-bottom: 8px; }
.breath-orb { width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--panel-2), var(--panel));
  border: 2px solid var(--pick); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 20px; font-weight: 800; letter-spacing: .5px;
  transform: scale(.7); transition: transform 4s ease-in-out, border-color .6s ease, color .6s ease; }
.breath-orb.expand { transform: scale(1.12); border-color: var(--raise); color: var(--raise-2); }
.breath-orb.contract { transform: scale(.7); border-color: var(--pick); color: var(--muted); }
.reset-count { margin-top: 26px; color: var(--muted); font-size: 14px; font-weight: 600; }
.btn.ready { background: var(--accent); border-color: var(--accent); color: #fff;
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }

/* ---- level 2 / boss / hook ---- */
.boss-badge { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 999px;
  background: #2e2508; border: 1px solid #6b5618; color: #f0b429; font-weight: 800;
  font-size: 13px; letter-spacing: 1px; }
.sidekick-hook { display: block; margin: 12px auto 0; background: none; border: none;
  color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.chip.locked { opacity: .45; }

/* ---- flop module: move colours (BET = act / green, CHECK = passive / blue) ---- */
.move.bet { color: var(--raise-2); }
.move.check { color: #58a6ff; }
.move.continue, .move.call { color: var(--raise-2); }
.chip.sel.bet, .chip.sel.continue { background: var(--raise); border-color: var(--raise); }
.chip.sel.check { background: #1f6feb; border-color: #1f6feb; }
.raise-hint { display:block; margin-top:8px; font-size:13px; color:#f0b429; font-weight:700; }

/* ---- paid gating: tile badge + upgrade screen ---- */
.tile-head { display: flex; align-items: center; gap: 10px; }
.paid-badge { font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 3px 8px;
  border-radius: 999px; background: #2e2508; border: 1px solid #6b5618; color: #f0b429; }
.paid-badge.owned { background: #0f2e1a; border-color: #1c5c34; color: var(--raise-2); }
.bigtile.locked-tile { opacity: .92; }
.bigtile.locked-tile h2::after { content: " 🔒"; font-size: 18px; opacity: .8; }

.upgrade-hero { text-align: center; padding: 8px 0 4px; }
.upgrade-hero .price { font-size: 40px; font-weight: 900; }
.upgrade-hero .price .strike { color: var(--muted); text-decoration: line-through; font-size: 22px; font-weight: 700; }
.upgrade-hero .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.upgrade-list { margin: 14px 0; padding: 14px; background: var(--bg); border: 1px dashed var(--line);
  border-radius: 12px; font-size: 14px; color: var(--muted); }
.upgrade-list li { margin: 6px 0; }
.preview-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; opacity: .85; }

/* ---- flop scope banner ---- */
.spot-banner { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 12.5px; color: var(--muted); text-align: center; margin-bottom: 14px; }
.spot-banner b { color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ==== merged from sidekick-backend client (facing UI + Phase D account) ==== */
.move.call { color: #58a6ff; }
.opener-wrap { margin-top: 8px; }
.sublabel { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.approx-tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
  color: #f0b429; background: rgba(240,180,41,.12); border: 1px solid rgba(240,180,41,.35); }
.why .tag { color: var(--muted); }

/* ---- Phase D: paid lock card + account modal ---- */
.lockcard { margin-top: 10px; }
.lock-head { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.lock-sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.lock-ctas { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.lock-cta { width: 100%; }
.acct-input {
  width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  margin-bottom: 12px;
}
.acct-msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.acct-freenote { margin: 8px 0 4px; font-size: 12px; color: var(--muted); text-align: center; }
#accountBody h2 { margin: 0 0 8px; font-size: 22px; }
#accountBody p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }

