/* WSBanBets — Bloomberg terminal meets Reddit dark mode meets a casino floor at 3 AM. */

:root {
  --bg: #06080a;            /* deep terminal black */
  --bg-raised: #0d1116;     /* panels */
  --bg-inset: #141a20;      /* inputs, wells */
  --border: #273039;        /* crisper hairline for sharp terminal edges */
  --border-hot: #3a4451;
  --text: #d6dde6;
  --text-dim: #7d8894;
  --text-faint: #4d5761;
  --green: #26d962;         /* gains */
  --green-dim: #14512b;
  --red: #ff4d3d;           /* the usual */
  --red-dim: #58201b;
  --gold: #f2b01e;          /* bananas, tendies */
  --reddit: #ff4500;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", monospace;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  /* Keep iOS/Reddit-webview from auto-inflating text; pinch-zoom still works. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Numbers always read like a terminal. */
.num, .ticker { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.gain { color: var(--green); }
.loss { color: var(--red); }

a { color: var(--text); }
a:hover { color: var(--green); }

/* ── Top nav ─────────────────────────────────────────────────────────────── */

.topnav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  height: 54px;
  background: linear-gradient(180deg, #10151b 0%, #0a0e12 100%);
  border-bottom: 1px solid var(--border);
  /* thin green scanline + drop shadow = terminal marquee feel */
  box-shadow: 0 1px 0 rgba(38, 217, 98, 0.10), 0 8px 22px rgba(0, 0, 0, 0.45);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand .ban { color: var(--red); }
.brand svg { display: block; }

.topnav nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.topnav nav a {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
}
.topnav nav a:hover { color: var(--text); background: var(--bg-inset); }
.topnav nav a.active { color: var(--green); background: var(--bg-inset); }

.nav-guide-btn {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.nav-guide-btn:hover { color: var(--gold); border-color: var(--gold); }
.nav-icon-btn { padding: 0.28rem 0.5rem; font-size: 0.95rem; line-height: 1; }

.nav-balance {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav-balance .num { color: var(--green); font-weight: 700; text-transform: none; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;                 /* sharper terminal corners */
  padding: 1.25rem;
  /* faint top edge highlight = subtle "screen" depth */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

h1 { font-size: 1.4rem; margin-bottom: 0.75rem; }

/* Page header — the cinematic title line above a page's content. */
.page-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--mono);
  letter-spacing: -0.5px;
  margin: 0;
}
.page-head .page-sub { color: var(--text-dim); font-size: 0.9rem; }
h2 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0.9rem 0 0.3rem;
  font-weight: 600;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
}
input:focus { outline: none; border-color: var(--green); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--border-hot);
  border-radius: 7px;
  background: var(--bg-inset);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: filter 120ms;
}
.btn:hover { filter: brightness(1.15); color: var(--text); }
.btn:active { filter: brightness(0.9); }
.btn-block { display: flex; width: 100%; }

.btn-green { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.btn-red { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.btn-reddit { background: #3d1503; border-color: var(--reddit); color: #ff6a33; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled:hover { filter: none; }

/* Reddit "coming soon" login state */
.reddit-soon { position: relative; }
.soon-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.35rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  text-transform: uppercase;
}
.reddit-soon-note {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.5;
  text-align: center;
}

.form-error {
  display: none;
  margin-top: 0.9rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--red);
  border-radius: 7px;
  background: var(--red-dim);
  color: #ffb3ac;
  font-size: 0.88rem;
}
.form-error.show { display: block; }

/* ── Login page ──────────────────────────────────────────────────────────── */

.login-wrap {
  max-width: 420px;
  margin: 8vh auto 0;
  padding: 0 1.25rem;
}

.login-hero { text-align: center; margin-bottom: 1.75rem; }
.login-hero .brand { justify-content: center; font-size: 1.6rem; margin-bottom: 0.4rem; }
.login-hero p { color: var(--text-dim); font-size: 0.95rem; }
.login-hero .loan { color: var(--gold); font-family: var(--mono); }

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.shame-note {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

.auth-toggle { margin-top: 1rem; text-align: center; font-size: 0.88rem; color: var(--text-dim); }
.auth-toggle a { color: var(--green); cursor: pointer; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.25rem 1.4rem;
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}
footer a { color: var(--text-dim); }

/* ── Utility ─────────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-email { background: var(--red-dim); color: #ff8d82; border: 1px solid var(--red); }
.tag-reddit { background: #3d1503; color: #ff6a33; border: 1px solid var(--reddit); }

.muted { color: var(--text-dim); }
.small { font-size: 0.85rem; }

.btn-small { padding: 0.3rem 0.8rem; font-size: 0.82rem; }

/* ── Trade page ──────────────────────────────────────────────────────────── */

.market-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red { background: var(--red); }

.trade-cols {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.72fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 980px) {
  .trade-cols { grid-template-columns: 1.2fr 1fr; }
  .trade-sidecar { grid-column: 1 / -1; flex-direction: row; }
  .trade-sidecar > section { flex: 1; }
}

.picker-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; }
.tab {
  flex: 1;
  padding: 0.45rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
}
.tab.active { color: var(--green); border-color: var(--green); }

.asset-list {
  margin-top: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto auto;
  gap: 0.6rem;
  align-items: baseline;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}
.asset-row:hover { background: var(--bg-inset); }
.asset-row.selected { background: var(--bg-inset); border-color: var(--green); }
.asset-row .asset-name {
  color: var(--text-dim);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-controls { display: flex; gap: 0.5rem; }
.picker-controls input { flex: 1; }

.ticket-empty { padding: 3rem 1rem; text-align: center; }
.quote-age { color: var(--text-faint); margin: -0.6rem 0 0.5rem; }

/* ── Price chart + technicals ─────────────────────────────────────────────── */

.chart-wrap { margin-bottom: 0.9rem; }
.chart-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.chart-types { display: flex; gap: 0.3rem; }
.chart-type {
  padding: 0.2rem 0.55rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.chart-type.active { color: var(--green); border-color: var(--green); }
.chart-legend { display: flex; gap: 0.6rem; font-size: 0.68rem; color: var(--text-dim); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.chart-legend .lg::before {
  content: "";
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.lg-sma10 { color: #f2b01e; }
.lg-sma20 { color: #5b9bd5; }
.lg-vol { color: var(--text-faint); }
#tk-spark {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.ta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.ta-row:empty { display: none; }
.ta-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.35rem 0.5rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.ta-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.ta-val { font-size: 0.8rem; font-weight: 700; }

.mode-toggle { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.mode {
  flex: 1;
  padding: 0.4rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.mode.active { color: var(--gold); border-color: var(--gold); }

.chain-controls { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.chain-controls select {
  flex: 1;
  padding: 0.45rem 0.5rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.cp-toggle { display: flex; gap: 0.3rem; }
.cp {
  padding: 0.45rem 0.8rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.cp.active-call { color: var(--green); border-color: var(--green); }
.cp.active-put { color: var(--red); border-color: var(--red); }

.chain-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
}
.chain-row {
  display: grid;
  grid-template-columns: 4.5rem 4.5rem 1fr auto auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
}
.chain-row:last-child { border-bottom: none; }
.chain-row:hover { background: var(--bg-inset); }
.chain-row.selected { background: var(--green-dim); }
.chain-row.atm .strike { color: var(--gold); }

.size-btns { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.size-btns .btn { flex: 1; }
.ticket-head { display: flex; align-items: baseline; gap: 0.6rem; }
.ticket-head .ticker { font-size: 1.3rem; font-weight: 700; }
.ticket-price { margin: 0.4rem 0 1rem; display: flex; align-items: baseline; gap: 0.6rem; }
.ticket-price > .num:first-child { font-size: 1.6rem; }

.direction-toggle { display: flex; gap: 0.5rem; }
.dir {
  flex: 1;
  padding: 0.6rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}
.dir.active-long { color: var(--green); border-color: var(--green); background: var(--green-dim); }
.dir.active-short { color: var(--red); border-color: var(--red); background: var(--red-dim); }

.amount-row { display: flex; gap: 0.5rem; }
.amount-row input { flex: 1; }

.strategies-link {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 0.82rem;
  text-decoration: underline dotted;
  cursor: pointer;
}
.strategies-link:hover { color: var(--gold); }

.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal { max-width: 420px; width: 100%; }
.strategies-text { margin: 0.5rem 0 1.2rem; font-size: 1.05rem; line-height: 1.6; }

/* ── How-to-play guide ───────────────────────────────────────────────────── */

.guide-modal {
  max-width: 620px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.guide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.guide-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}
.guide-body h3 {
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
  margin: 1.1rem 0 0.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}
.guide-body h3:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.guide-body p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.65; }
.guide-body b { color: var(--text); }

/* ── Invite / share ──────────────────────────────────────────────────────── */

.share-modal { max-width: 460px; }
.share-preview {
  margin: 0.4rem 0 0.9rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.share-link { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.share-link input { flex: 1; font-size: 0.82rem; }
.share-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 0.5rem;
}
.share-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.4rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.share-target:hover { border-color: var(--border-hot); color: var(--text); background: var(--bg-raised); }
.share-target span { font-size: 1.4rem; line-height: 1; }

/* ── Portfolio ───────────────────────────────────────────────────────────── */

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-label { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 1.35rem; font-weight: 700; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
tr:last-child td { border-bottom: none; }
th.r, td.r { text-align: right; }

.side {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.05em;
}
.side-long { color: var(--green); background: var(--green-dim); }
.side-short { color: var(--red); background: var(--red-dim); }

/* ── Order type / holding hint / feed ────────────────────────────────────── */

.order-type { display: flex; gap: 0.4rem; margin: 0.75rem 0 0.25rem; }
.ot {
  flex: 1;
  padding: 0.35rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.ot.active { color: var(--text); border-color: var(--border-hot); background: var(--bg-raised); }

.trade-sidecar { display: flex; flex-direction: column; gap: 1rem; }

.stat-stack { display: flex; flex-direction: column; gap: 0.45rem; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.9rem; }

.damage { margin-top: 0.5rem; }
.damage-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.damage-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  overflow: hidden;
}
.damage-fill { height: 100%; transition: width 150ms; }
.damage-fill.gain { background: var(--green); }
.damage-fill.warn { background: var(--gold); }
.damage-fill.loss { background: var(--red); }
.warn { color: var(--gold); }

.tag-gold { background: rgba(242, 176, 30, 0.12); color: var(--gold); border: 1px solid var(--gold); }
.tag-green { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.tag-red { background: var(--red-dim); color: #ff8d82; border: 1px solid var(--red); }

.holding-hint {
  margin: 0.3rem 0 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px dashed var(--border-hot);
  border-radius: 7px;
  color: var(--text-dim);
}

.feed-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.feed-row:last-child { border-bottom: none; }
.feed-time { margin-left: auto; }

/* ── GUH overlay ─────────────────────────────────────────────────────────── */

#guh-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(6, 8, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.guh-inner { max-width: 440px; width: 100%; text-align: center; }
.guh-word {
  font-family: var(--mono);
  font-size: 5.5rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -4px;
  text-shadow: 0 0 40px rgba(255, 77, 61, 0.4);
  animation: guh-drop 500ms cubic-bezier(0.22, 1.4, 0.36, 1);
}
@keyframes guh-drop {
  from { transform: translateY(-40px) scale(1.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.guh-sub { color: var(--text-dim); margin: 0.5rem 0 1.5rem; }
.guh-stats { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1.5rem; }
.guh-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

.loan-banner {
  position: sticky;
  top: 0;
  z-index: 300;
  text-align: center;
  padding: 0.55rem;
  background: var(--green-dim);
  color: var(--green);
  border-bottom: 1px solid var(--green);
  font-weight: 700;
  font-size: 0.9rem;
}
.loan-banner.err {
  background: var(--red-dim);
  color: #ffb3ac;
  border-bottom-color: var(--red);
}

#guest-banner {
  position: sticky;
  top: 0;
  z-index: 300;
  text-align: center;
  padding: 0.45rem 0.75rem;
  background: rgba(242, 176, 30, 0.12);
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
}
#guest-banner a { color: var(--gold); text-decoration: underline; }

/* ── Profile ─────────────────────────────────────────────────────────────── */

.profile-head { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.profile-id h1 { margin-bottom: 0.2rem; }
.profile-numbers { display: flex; gap: 1.75rem; margin-left: auto; }
.profile-numbers > div { display: flex; flex-direction: column; }

.lifetime-row {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.lifetime-row:last-child { border-bottom: none; }

.stat-row-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Profile top: dominant calendar + compact identity card ──────────────── */

.profile-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.profile-card { display: flex; flex-direction: column; gap: 0.9rem; }
.pc-head { display: flex; align-items: center; gap: 0.8rem; }
.pc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: radial-gradient(ellipse at 40% 30%, rgba(38, 217, 98, 0.16), var(--bg-inset));
  border: 1px solid var(--border-hot);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.pc-name { font-size: 1.2rem; font-weight: 700; font-family: var(--mono); word-break: break-word; line-height: 1.2; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; align-items: center; }
.pc-meta { color: var(--text-dim); font-size: 0.82rem; }
.pc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.pc-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.pc-stat .stat-value { font-size: 1.15rem; }

.connect-reddit {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.connect-note { font-size: 0.74rem; color: var(--text-faint); line-height: 1.45; }

/* ── P&L calendar ────────────────────────────────────────────────────────── */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-nav { display: flex; align-items: center; gap: 0.6rem; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-labels {
  margin-bottom: 4px;
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.05em;
}
.cal-cell {
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 4px;                 /* sharper */
  padding: 0.3rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-inset);
}
.cal-empty { border: none; background: none; }
.cal-date { font-size: 0.7rem; color: var(--text-faint); font-family: var(--mono); }
.cal-pnl { font-size: 0.85rem; font-weight: 800; letter-spacing: -0.3px; }
.cal-trades { font-size: 0.66rem; color: var(--text-dim); font-family: var(--mono); }
/* Stronger, glowing green/red days — the whole point of the calendar. */
.cal-green {
  background: rgba(38, 217, 98, 0.17);
  border-color: rgba(38, 217, 98, 0.55);
  box-shadow: inset 0 0 12px rgba(38, 217, 98, 0.10);
}
.cal-green .cal-pnl { color: var(--green); text-shadow: 0 0 9px rgba(38, 217, 98, 0.45); }
.cal-red {
  background: rgba(255, 77, 61, 0.16);
  border-color: rgba(255, 77, 61, 0.5);
  box-shadow: inset 0 0 12px rgba(255, 77, 61, 0.10);
}
.cal-red .cal-pnl { color: var(--red); text-shadow: 0 0 9px rgba(255, 77, 61, 0.4); }
.cal-live { border-style: dashed; border-color: var(--gold); }

/* ── Loss porn / comments / legal ────────────────────────────────────────── */

.lossporn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.lossporn-card {
  border: 1px solid var(--red-dim);
  background: linear-gradient(160deg, var(--bg-inset), rgba(255, 77, 61, 0.06));
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.lp-head { display: flex; justify-content: space-between; align-items: baseline; }
.lp-pct { font-size: 1.2rem; font-weight: 800; }
.lp-msg { font-style: italic; margin-top: 0.3rem; }
.lp-big { font-size: 1.05rem; }

.comment-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.comment-form input { flex: 1; }
.comment {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.comment:last-child { border-bottom: none; }
.comment-author { font-weight: 700; text-decoration: none; }
.comment p { margin-top: 0.2rem; }
.comment-delete {
  float: right;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.9rem;
}
.comment-delete:hover { color: var(--red); }

.legal h2 { margin-top: 1.2rem; }
.legal p { margin: 0.4rem 0 0.8rem; color: var(--text-dim); }

/* ── The Pit (blackjack) ─────────────────────────────────────────────────── */

.pit-cols {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 1rem;
  align-items: start;
}

.bj-table {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(38, 217, 98, 0.06), transparent 70%),
    var(--bg-raised);
}
.bj-seat { margin: 0.5rem 0; }
.bj-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.bj-cards { display: flex; gap: 0.5rem; min-height: 74px; margin-top: 0.4rem; flex-wrap: wrap; }
.bj-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 72px;
  border-radius: 8px;
  background: #e9edf2;
  color: #14181d;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.bj-card.bj-red { color: #c0201a; }
.bj-card.bj-back {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 2rem;
}
.bj-outcome {
  min-height: 1.6rem;
  margin: 0.4rem 0;
  font-weight: 800;
  font-size: 1.05rem;
  opacity: 0;
  transition: opacity 200ms;
}
.bj-outcome.show { opacity: 1; }
.bj-action-row { display: flex; gap: 0.5rem; }
.bj-action-row .btn { flex: 1; padding: 0.8rem; font-size: 1rem; }

.slot-reels {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.5rem 0;
}
.slot-reel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  font-size: 1.8rem;
  background: var(--bg-inset);
  border: 1px solid var(--border-hot);
  border-radius: 8px;
}

.loan-desk {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.loan-desk .btn { border-color: var(--gold); color: var(--gold); }

/* ── Coffee widget ───────────────────────────────────────────────────────── */

#bmac-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-hot);
  border-radius: 999px;
  background: var(--bg-raised);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  opacity: 0.75;
  transition: opacity 150ms, gap 150ms;
}
#bmac-widget:hover { opacity: 1; gap: 0.45rem; border-color: var(--gold); }
.bmac-cup { font-size: 1.1rem; line-height: 1; }
.bmac-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  transition: max-width 200ms;
}
#bmac-widget:hover .bmac-label { max-width: 140px; }

/* ── Insider link / profile badge icons ──────────────────────────────────── */

.insider-link {
  display: block;
  margin: 0.35rem auto 0;
  background: none;
  border: none;
  color: var(--bg-inset);          /* nearly invisible against the panel */
  font-size: 0.7rem;
  cursor: pointer;
}
.insider-link:hover { color: var(--gold); text-decoration: underline dotted; }

.badge-icon { font-size: 1rem; margin-left: 0.35rem; cursor: help; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

/* Momentum scrolling inside inner scroll regions on touch devices. */
.asset-list, .chain-list { -webkit-overflow-scrolling: touch; }

/* Tablet / narrow desktop: collapse the profile two-column, card on top. */
@media (max-width: 860px) {
  .profile-top { grid-template-columns: 1fr; }
  .profile-top .profile-card { order: -1; }
}

@media (max-width: 640px) {
  .topnav { gap: 0.75rem; padding: 0 0.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topnav nav { gap: 0; }
  .topnav nav a { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
  .nav-balance { display: none; }
  main { padding: 1rem 0.75rem 2.5rem; }
  .login-wrap { margin-top: 4vh; }
  .trade-cols { grid-template-columns: 1fr; }
  .trade-sidecar { flex-direction: column; }
  .pit-cols { grid-template-columns: 1fr; }
  .asset-list { max-height: 40vh; }
  .stat-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .stat-row-4 { grid-template-columns: 1fr 1fr; }
  .profile-numbers { margin-left: 0; gap: 1.1rem; flex-wrap: wrap; }
  .cal-cell { min-height: 52px; padding: 0.2rem 0.25rem; }
  .cal-pnl { font-size: 0.66rem; }
  .cal-trades { display: none; }
  .cal-grid { gap: 3px; }
  .guh-word { font-size: 3.5rem; }
  /* 16px inputs stop iOS/Reddit-webview from auto-zooming on focus. */
  input[type="text"], input[type="email"], input[type="password"], input[type="number"],
  .chain-controls select { font-size: 16px; }
  /* Comfortable tap targets. */
  .btn { padding: 0.7rem 1.2rem; }
  .tab, .mode, .dir, .cp, .ot { padding-top: 0.6rem; padding-bottom: 0.6rem; }
}
