/* PortfolioGame — dark game UI (original layout, scaled up for easy reading).
   Color roles from the validated dark-mode reference palette. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222221;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --ink-muted: #898781;
  --grid: #2c2c2a;
  --border: rgba(255,255,255,0.10);
  --up: #0ca30c;
  --down: #e66767;
  --accent: #3987e5;      /* slot 1 blue — also "you" */
  --bot: #d95926;         /* slot 8 orange — robot */
  --idle: #898781;        /* muted — cash-only line */
  --gold: #c98500;
  --lock: #55544f;
}
* { margin:0; padding:0; box-sizing:border-box; }

/* ---------- loading overlay ---------- */
#loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--page);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; text-align: center; padding: 0 24px;
}
.load-mark {
  font-family: var(--display); font-weight: 700; font-size: 56px;
  letter-spacing: -0.03em; line-height: 1; color: var(--ink);
}
.load-mark span {
  background: linear-gradient(100deg, #3987e5 10%, #6fc0ff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.load-bar {
  width: 240px; height: 6px; border-radius: 3px;
  background: var(--grid); overflow: hidden; position: relative;
}
.load-bar i {
  position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  border-radius: 3px; background: linear-gradient(90deg, #2a6fc4, #6fc0ff);
  animation: loadslide 1.1s ease-in-out infinite;
}
@keyframes loadslide {
  from { transform: translateX(-110%); }
  to   { transform: translateX(360%); }
}
.load-msg { color: var(--ink-muted); font-size: 14px; line-height: 1.6; max-width: 460px; }
.load-msg code { font-family: var(--mono); color: var(--ink-2); font-size: 12.5px; }
html, body { height:100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
.screen { height: 100vh; overflow: auto; scroll-behavior: smooth; }

/* ---------- friendly scrolling everywhere ---------- */
* { scrollbar-width: thin; scrollbar-color: #3f3f3c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f3c; border-radius: 5px; border: 2px solid var(--page); }
::-webkit-scrollbar-thumb:hover { background: #55544f; }
#asset-list, #right-rail, #center, .modal-card, .casino-card, .screen {
  overscroll-behavior: contain;   /* a rail hitting its end never scrolls the page behind it */
}

/* ---------- start & end screens ---------- */
#screen-start, #screen-end {
  background:
    radial-gradient(1000px 560px at 12% -12%, rgba(57,135,229,.22) 0%, transparent 60%),
    radial-gradient(800px 480px at 92% 112%, rgba(12,163,12,.10) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.028) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(255,255,255,.028) 47px 48px),
    var(--page);
}
#screen-start { display: block; overflow-y: auto; }
#screen-end { display: flex; padding: 30px 0; }
.end-card {
  max-width: 780px; width: 92%;
  margin: auto;   /* flex auto-margins center without clipping when taller than the screen */
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 38px 44px; text-align: center;
}

/* scrolling ticker tape — pinned to the top while the page scrolls */
.tape {
  width: 100%; overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,.88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 13px;
  padding: 9px 0; position: sticky; top: 0; z-index: 10;
}
.tape-inner { display: inline-block; white-space: nowrap; animation: tape 40s linear infinite; }
.tape-inner span { margin-right: 42px; color: var(--ink-2); letter-spacing: .04em; }
.tape-inner b.up { color: var(--up); font-weight: 400; }
.tape-inner b.down { color: var(--down); font-weight: 400; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* hero fills the first screenful (minus the tape) with the wordmark dead center;
   features + leaderboard live below the fold */
.start-hero {
  position: relative;
  min-height: calc(100vh - 34px);
  max-width: 720px; width: 94%; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 0 70px;
}
.scroll-hint {
  position: absolute; bottom: 20px; left: 50%;
  color: var(--ink-muted); font-size: 13px; letter-spacing: .03em; white-space: nowrap;
  animation: bob 1.9s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}
.start-below { max-width: 900px; width: 94%; margin: 0 auto; text-align: center; padding: 6px 0 70px; }
.wordmark {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 8.5vw, 76px);
  letter-spacing: -0.03em; line-height: 1; color: var(--ink); white-space: nowrap;
}
.wordmark span {
  background: linear-gradient(100deg, #3987e5 10%, #6fc0ff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--ink-2); margin: 16px 0 30px; font-size: 18px; line-height: 1.5; }
.tagline strong { color: var(--ink); }

.feature-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  margin: 0 auto 28px; max-width: 900px; text-align: left;
}
.feat {
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px;
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center;
}
.feat .fi { grid-row: 1 / 3; font-size: 24px; }
.feat b { font-family: var(--display); font-size: 15px; letter-spacing: .01em; }
.feat small { color: var(--ink-muted); font-size: 12.5px; line-height: 1.35; }

.launch-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; }
.launch-row input[type=text], .launch-row select {
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px;
  font-size: 15px; font-family: inherit;
}
.launch-row input[type=text] { width: 170px; }
.launch-row input[type=text]:focus, .launch-row select:focus { outline: none; border-color: var(--accent); }

.btn-primary {
  background: linear-gradient(100deg, #2a6fc4, #3987e5); color: #fff; border: none; border-radius: 10px;
  padding: 12px 26px; font-weight: 700; font-family: var(--display);
  box-shadow: 0 4px 22px rgba(57,135,229,.35);
}
.btn-primary.big { font-size: 18px; padding: 13px 30px; }
.btn-primary:hover { filter: brightness(1.12); }
.fineprint { color: var(--ink-muted); font-size: 12px; margin-top: 16px; }

/* ---------- top bar ---------- */
#screen-game { display: flex; flex-direction: column; }
#topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 14px 22px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.brand { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.clock { flex: 1 1 auto; max-width: 380px; }
#clock-label { color: var(--ink-2); font-size: 15px; margin-bottom: 5px; font-weight: 600; }
.progress { height: 8px; background: var(--grid); border-radius: 4px; }
#clock-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; }
.stat-label { color: var(--ink-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-family: var(--mono); font-size: 21px; font-weight: 700; }
.stat-value.big { font-size: 32px; }
.stat-sub { font-size: 12px; color: var(--ink-muted); }
.speed { margin-left: auto; display: flex; gap: 6px; }
.speed button {
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 16px; font-size: 15px;
}
.speed button.active { background: var(--accent); color: #fff; border-color: transparent; }
#btn-sound {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; font-size: 15px; margin-left: 6px;
}

/* ---------- layout ---------- */
#layout { flex: 1 1 auto; display: grid; grid-template-columns: 290px 1fr 330px;
  gap: 14px; padding: 14px; min-height: 0; }
#asset-list, #right-rail { overflow-y: auto; min-height: 0; }

/* ---------- asset cards ---------- */
.asset-card {
  display: grid; grid-template-columns: 1fr 74px; grid-template-rows: auto auto;
  gap: 3px 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; cursor: pointer;
}
.asset-card { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.asset-card:hover { background: var(--surface-2); transform: translateY(-1px); }
.asset-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 4px 18px rgba(57,135,229,.25); }
.asset-card .nm { font-weight: 700; font-size: 13.5px; line-height: 1.25; display: flex; align-items: center; gap: 7px; }
.asset-card .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.asset-card .spark { grid-row: 1 / 3; width: 74px; height: 36px; }
.asset-card .px { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); display: flex; gap: 7px; flex-wrap: wrap; }
.asset-card .chg.up { color: var(--up); }
.asset-card .chg.down { color: var(--down); }
.asset-card .held { font-size: 11px; background: rgba(57,135,229,.18); color: #86b6ef;
  border-radius: 5px; padding: 2px 7px; }
.asset-card.locked { opacity: .45; cursor: default; }
.asset-card.locked .nm { color: var(--lock); }
.asset-card .lockmsg { font-size: 12px; color: var(--ink-muted); }
.list-sep { color: var(--ink-muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .6px; margin: 12px 4px 8px; }

/* ---------- center / chart ---------- */
#center { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; }
#chart-head { display: flex; align-items: center; gap: 20px; padding: 2px 4px 10px; }
#chart-title { font-family: var(--display); font-size: 23px; font-weight: 700; }
#chart-sub { color: var(--ink-muted); font-size: 13px; }
#chart-price-box { margin-left: auto; text-align: right; }
#chart-price { font-family: var(--mono); font-size: 21px; font-weight: 700; }
#chart-change { font-size: 13px; }
#chart-change.up { color: var(--up); } #chart-change.down { color: var(--down); }
#chart-yield { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-top: 2px; white-space: nowrap; }
.ranges button {
  background: none; border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 8px; padding: 6px 13px; margin-left: 5px; font-size: 13px;
}
.ranges button.active { background: var(--surface-2); color: var(--ink); }
#main-chart-wrap { position: relative; flex: 1 1 auto; min-height: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
#main-chart { width: 100%; height: 100%; display: block; }
#chart-tip {
  position: absolute; pointer-events: none; background: #262624;
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  font-size: 13px; color: var(--ink); white-space: nowrap; z-index: 5;
}
#chart-tip .tip-date { color: var(--ink-muted); font-size: 11px; }
#chart-tip .tip-y10 { color: var(--gold); font-size: 12px; }

/* ---------- trade panel ---------- */
#trade-panel { display: grid; grid-template-columns: 1.5fr 1fr 1.1fr; gap: 14px;
  margin-top: 12px; flex: 0 0 auto; }
.trade-col { background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px; }
.trade-head { font-family: var(--display); font-weight: 700; margin-bottom: 10px; font-size: 16px; }
.trade-head span { color: var(--ink-2); font-weight: 500; }
.amt-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.amt-row button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600;
}
.amt-row button, .ranges button, .speed button, .pm-btns button, .custom-row button {
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .06s ease;
}
.amt-row button:hover { color: var(--ink); border-color: var(--ink-muted); }
.amt-row button.active { background: var(--accent); color: #fff; border-color: transparent; }
.amt-row button:active, .pm-btns button:active, .custom-row button:active, .bs-row button:active { transform: scale(.96); }
.amt-row input {
  flex: 1 1 90px; min-width: 90px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 14px;
}
.amt-row input:focus { outline: none; border-color: var(--accent); }
.custom-row { display: flex; gap: 8px; }
.custom-row input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 15px;
}
.bs-row { display: flex; gap: 10px; margin-bottom: 9px; }
.bs-row button { flex: 1 1 0; transition: filter .12s ease, transform .06s ease; }
.btn-buy { background: var(--up); color: #fff; border: none; border-radius: 10px; padding: 13px 22px; font-weight: 700; font-size: 16px; font-family: var(--display); }
.btn-sell { background: var(--down); color: #1a1a19; border: none; border-radius: 10px; padding: 13px 22px; font-weight: 700; font-size: 16px; font-family: var(--display); }
.btn-buy:hover, .btn-sell:hover { filter: brightness(1.12); }
.btn-buy:disabled, .btn-sell:disabled { opacity: .4; cursor: default; filter: none; }
.own-line { font-size: 13px; color: var(--ink-muted); }
.own-line b { color: var(--ink-2); font-family: var(--mono); font-weight: 600; }
.btn-short { background: #b0522a; color: #fff; border: none; border-radius: 8px;
  padding: 9px 22px; font-weight: 700; font-size: 15px; }
.bear-tag { font-size: 11px; font-weight: 400; color: var(--ink-muted); white-space: nowrap; }
#short-stat { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin: 4px 0 10px; line-height: 1.5; }
#short-stat .up { color: var(--up); } #short-stat .down { color: var(--down); }
.trade-note { font-size: 12px; color: var(--ink-muted); min-height: 15px; margin-top: 7px; }
#asset-blurb { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

/* ---------- desk bar (options + businesses) ---------- */
#desk-bar { display: flex; gap: 14px; margin-top: 12px; flex: 0 0 auto; }
#desk-bar button {
  flex: 1 1 0; display: flex; align-items: center; gap: 14px; text-align: left;
  background: linear-gradient(120deg, rgba(57,135,229,.10), rgba(255,255,255,.02) 55%), var(--surface);
  border: 1px solid #2d4d7c; border-radius: 12px; padding: 10px 16px; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
#desk-bar button:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(57,135,229,.2);
}
.desk-icon { font-size: 26px; }
.desk-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.desk-txt b { font-family: var(--display); font-size: 15.5px; }
.desk-txt small { color: var(--ink-muted); font-size: 12px; }
.desk-val { font-family: var(--mono); font-size: 13px; font-weight: 700; color: #86b6ef; white-space: nowrap; }

/* ---------- right rail ---------- */
.panel { background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.panel-head { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.pf-row { display: flex; align-items: center; gap: 9px; padding: 7px 0;
  border-bottom: 1px solid var(--grid); font-size: 13px; }
.pf-row:last-child { border-bottom: none; }
.pf-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pf-row .pf-name { flex: 1 1 auto; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-row .pf-val { font-family: var(--mono); font-weight: 700; }
.pf-row .pf-pl { min-width: 70px; text-align: right; font-family: var(--mono);
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.pf-pl small { font-size: 10.5px; opacity: .75; }
.pf-pl.up { color: var(--up); } .pf-pl.down { color: var(--down); }
.pf-empty { color: var(--ink-muted); font-size: 13px; }
.news-item { font-size: 13px; color: var(--ink-2); padding: 7px 0;
  border-bottom: 1px solid var(--grid); line-height: 1.45; }
.news-item:last-child { border-bottom: none; }
.news-item .nd { color: var(--ink-muted); font-size: 11px; }
.news-item.wire { border-left: 3px solid var(--gold); padding-left: 9px; }
.news-item.econ { border-left: 3px solid var(--accent); padding-left: 9px; }
.wire-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: .8px;
  color: var(--gold); border: 1px solid rgba(201,133,0,.45); border-radius: 4px;
  padding: 1px 5px; margin-right: 4px; vertical-align: 1px;
}

/* ---------- economy panel ---------- */
.panel-hint { font-size: 11px; font-weight: 400; color: var(--ink-muted); float: right; margin-top: 3px; }
#econ-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.econ-stat { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 10px; text-align: center; }
.econ-label { font-size: 11px; color: var(--ink-muted); margin-bottom: 3px; white-space: nowrap; }
.econ-val { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.econ-val.good { color: var(--up); }
.econ-val.bad  { color: var(--down); }
.econ-sub { font-size: 10px; color: var(--ink-muted); margin-top: 2px; }

#btn-econ-hist { background: none; border: none; font-size: 14px; float: right; padding: 0 2px; }
#econ-strip { cursor: pointer; }
#econ-strip:hover .econ-stat { border-color: var(--ink-muted); }

/* ---------- economy history modal ---------- */
.ec-block {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px 8px; margin-bottom: 12px; text-align: left;
}
.ec-head { font-family: var(--display); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.ec-block canvas { width: 100%; height: 150px; display: block; }
.ec-legend { float: right; font-weight: 400; font-size: 11px; color: var(--ink-2); }
.ec-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin: 0 4px 0 10px; vertical-align: -1px; }

/* ---------- leaderboard ---------- */
.lb-panel { margin-top: 22px; text-align: left; }
.start-opts input[type=text] {
  margin: 0 18px 0 8px; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  font-size: 15px; width: 150px;
}
.lb-row {
  display: grid; grid-template-columns: 26px 1fr auto auto auto;
  gap: 12px; align-items: center; padding: 8px 6px;
  border-bottom: 1px solid var(--grid); font-size: 14px;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.you { background: rgba(57,135,229,.12); border-radius: 8px; }
.lb-row.you .lb-name { color: #86b6ef; font-weight: 700; }
.lb-rank { color: var(--ink-muted); font-weight: 700; text-align: right; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-era { color: var(--ink-muted); font-size: 12px; }
.lb-final { font-family: var(--mono); font-weight: 700; }
.lb-score { font-family: var(--mono); font-size: 12.5px; width: 104px; text-align: right; }
.lb-score.up { color: var(--up); } .lb-score.down { color: var(--down); }
.rank-note { color: var(--ink-2); font-weight: 400; font-size: 13px; }

/* ---------- power moves ---------- */
.pm-block { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.pm-block:last-child { border-bottom: none; padding-bottom: 2px; }
.pm-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 14px; }
.pm-val { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.pm-sub { font-size: 12px; color: var(--ink-muted); margin: 3px 0 8px; line-height: 1.4; }
.pm-btns { display: flex; gap: 8px; }
.pm-btns button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.pm-btns button:hover { color: var(--ink); border-color: var(--ink-muted); }
#btn-news-mute { background: none; border: none; font-size: 15px; float: right; }

/* ---------- casino ---------- */
#casino-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center;
}
.casino-card {
  background: radial-gradient(500px 300px at 50% -20%, #3a1424 0%, #1d0e14 70%);
  border: 1px solid #7c2d4c; border-radius: 18px;
  padding: 30px 38px; max-width: 520px; width: 92%; text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,.7); max-height: 92vh; overflow-y: auto;
}
.casino-card h2 { font-family: var(--display); font-size: 26px; margin-bottom: 6px; }
.casino-sub { color: #c9a4b3; font-size: 13px; margin-bottom: 18px; line-height: 1.45; }
.bet-chips { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.bet-chips button {
  font-family: var(--mono); background: rgba(255,255,255,.06); color: var(--ink-2);
  border: 1.5px dashed #7c2d4c; border-radius: 999px; padding: 8px 18px; font-weight: 700;
}
.bet-chips button.active { background: #e8c15a; color: #2a1420; border-color: #e8c15a; }
#wheel {
  font-family: var(--mono); font-size: 44px; font-weight: 800; height: 62px;
  line-height: 62px; margin-bottom: 6px; color: var(--ink);
}
#wheel.wc-red { color: #ff6b6b; } #wheel.wc-black { color: #d5d5d5; } #wheel.wc-green { color: #4cd964; }
#casino-result { min-height: 22px; font-size: 14px; color: var(--ink-2); margin-bottom: 16px; }
.cw { color: #4cd964; font-weight: 700; } .cl { color: #ff6b6b; font-weight: 700; }
.bet-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.bet-btns button {
  border: none; border-radius: 10px; padding: 10px 4px; font-weight: 800; color: #fff;
  font-family: var(--display); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bet-btns button small { font-weight: 400; font-size: 10.5px; opacity: .85; font-family: var(--mono); }
.cb-red { background: #b3382f; } .cb-black { background: #2b2b2e; border: 1px solid #555 !important; }
.cb-green { background: #1d7a34; } .cb-seven { background: #7c4dbf; }
.bet-btns button:hover { filter: brightness(1.15); }
.casino-stats { font-size: 13px; color: #c9a4b3; margin-bottom: 16px; font-family: var(--mono); }

/* ---------- advice & report ---------- */
.advice-tag { color: #86b6ef; font-weight: 700; }
.toast.advice { border-color: var(--accent); }
.toast.warn { border-color: var(--down); background: #2a1a18; }
.rep-row { display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--grid); font-size: 14px; }
.rep-row:last-child { border-bottom: none; }
.rep-row .up { color: var(--up); font-family: var(--mono); }
.rep-row .down { color: var(--down); font-family: var(--mono); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; }
.toast {
  background: #262624; border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; padding: 12px 22px; font-size: 15px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  animation: pop .25s ease-out, fadeaway .35s ease-in 3.1s forwards;
}
.toast.pay { border-color: var(--up); }
.toast.unlock { border-color: var(--gold); }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeaway { to { transform: translateY(6px); opacity: 0; } }
.news-item { animation: newsin .3s ease-out; }
@keyframes newsin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- options & business overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: radial-gradient(560px 320px at 50% -20%, #14243a 0%, #0e1420 70%);
  border: 1px solid #2d4d7c; border-radius: 18px;
  padding: 28px 34px; max-width: 560px; width: 92%; text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,.7); max-height: 92vh; overflow-y: auto;
}
.modal-card.wide { max-width: 760px; }
.modal-card h2 { font-family: var(--display); font-size: 26px; margin-bottom: 6px; }
.modal-sub { color: #9db4d4; font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.modal-stats { font-size: 13px; color: #9db4d4; margin: 14px 0 10px; font-family: var(--mono); }
.term-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.term-tabs button {
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-weight: 600;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.term-tabs button:hover { color: var(--ink); border-color: var(--ink-muted); }
.term-tabs button.active { background: var(--accent); color: #fff; border-color: transparent; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.opt-side { background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; }
.opt-side .amt-row { justify-content: center; margin-bottom: 0; }
.opt-head { font-family: var(--display); font-weight: 700; margin-bottom: 5px; }
.opt-head.up { color: var(--up); } .opt-head.down { color: var(--down); }
.opt-info { font-size: 12px; color: var(--ink-muted); min-height: 32px; margin-bottom: 9px; line-height: 1.45; }
.opt-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center;
  padding: 7px 4px; border-bottom: 1px solid var(--grid); font-size: 13px; font-family: var(--mono);
  text-align: left;
}
.opt-row:last-child { border-bottom: none; }
.opt-row .up { color: var(--up); } .opt-row .down { color: var(--down); }
.opt-row button { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  border-radius: 7px; padding: 4px 12px; font-size: 12px; }
#biz-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 6px; }
#prop-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 6px; }
#prop-market {
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 16px; margin-bottom: 14px; text-align: left;
}
.prop-row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 13px; color: var(--ink-2); }
.prop-row:last-child { border-bottom: none; }
.prop-row b { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.prop-row b.up { color: var(--up); } .prop-row b.down { color: var(--down); }
#btn-house-buy:disabled { opacity: .45; cursor: default; }
.biz-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 8px;
}
.biz-card.owned { border-color: #2d7c4d; }
.biz-card.paused { border-color: var(--down); opacity: .85; }
.biz-head { font-family: var(--display); font-weight: 700; font-size: 15px; }
.biz-lvl { font-family: var(--mono); font-size: 11px; background: rgba(12,163,12,.18);
  color: #58c258; border-radius: 5px; padding: 2px 7px; margin-left: 4px; }
.biz-sub { font-size: 12px; color: var(--ink-muted); line-height: 1.45; flex: 1 1 auto; }
.biz-stats { font-size: 12px; color: var(--ink-2); font-family: var(--mono); line-height: 1.6; }
.biz-stats .up { color: var(--up); } .biz-stats .down { color: var(--down); }
.biz-btns { display: flex; gap: 7px; }
.biz-card button {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; width: 100%;
}
.biz-card button:disabled { opacity: .4; cursor: default; }
.biz-card .btn-primary { border: none; }

/* ---------- unlock info screen ---------- */
.unlock-card {
  background: radial-gradient(560px 320px at 50% -20%, #2c2410 0%, #17130a 70%);
  border: 1px solid var(--gold); border-radius: 18px;
  padding: 32px 40px 28px; max-width: 500px; width: 92%; text-align: center;
  box-shadow: 0 20px 80px rgba(0,0,0,.7);
  max-height: 92vh; overflow-y: auto;
  animation: unlockpop .45s cubic-bezier(.2, 1.4, .4, 1), unlockring 1.1s ease-out;
}
@keyframes unlockpop { from { transform: scale(.72); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes unlockring {
  from { box-shadow: 0 0 0 0 rgba(201,133,0,.55), 0 20px 80px rgba(0,0,0,.7); }
  to   { box-shadow: 0 0 0 30px rgba(201,133,0,0), 0 20px 80px rgba(0,0,0,.7); }
}
#unlock-icon { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.unlock-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.unlock-card h2 { font-family: var(--display); font-size: 30px; margin-bottom: 2px; }
.unlock-sub { color: var(--ink-muted); font-size: 13px; margin-bottom: 14px; }
.unlock-blurb { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.unlock-extra { color: #e8c15a; font-size: 13px; line-height: 1.5; margin-bottom: 8px; min-height: 0; }
#btn-unlock-continue { margin-top: 10px; }

/* ---------- end screen ---------- */
.end-card { max-width: 780px; }
.end-grade { font-family: var(--display); font-size: 68px; font-weight: 700; color: var(--gold); line-height: 1; }
.reveal { color: var(--ink-2); margin: 10px 0 18px; font-size: 16px; line-height: 1.5; }
.reveal strong { color: var(--ink); }
.end-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 18px; }
.end-stat { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 22px; min-width: 180px; }
#end-chart-wrap { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 16px; text-align: left; }
#end-chart { width: 100%; height: 200px; display: block; }
.legend { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 10px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin: 0 4px 0 10px; vertical-align: -1px; }
.sw.you { background: var(--accent); } .sw.bot { background: var(--bot); } .sw.idle { background: var(--idle); }
#end-names { text-align: left; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
#end-names .real { color: var(--ink); font-weight: 700; }
.lesson { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin: 14px auto 20px; max-width: 580px; }
