/* Hogg Street — warm, dignified, large-type, mobile-first. */

:root {
  --green-deep: #1d3b2f;
  --green-mid: #2c5744;
  --navy: #1e2a3a;
  --gold: #b98a2e;
  --gold-soft: #e9d9b4;
  --cream: #faf6ee;
  --card: #ffffff;
  --ink: #22301f;
  --ink-soft: #4a5a48;
  --gain: #1d6b3a;
  --loss: #a53232;
  --line: #d9d2c2;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(30, 42, 26, 0.10);
}

/* Text-size control: actually scales the whole UI via rem. */
html[data-textsize="normal"] { font-size: 18px; }
html[data-textsize="large"]  { font-size: 21px; }
html[data-textsize="xlarge"] { font-size: 24px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: Georgia, serif; color: var(--green-deep); line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
p { margin: 0.5em 0; }

.hidden { display: none !important; }

/* ------- Buttons: large, high-contrast, generous targets ------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 48px; padding: 0.55em 1.2em;
  font-family: inherit; font-size: 1rem; font-weight: bold;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; text-decoration: none;
  touch-action: manipulation;
}
.btn-primary { background: var(--green-deep); color: #fff; }
.btn-primary:active { background: var(--green-mid); }
.btn-secondary { background: #fff; color: var(--green-deep); border-color: var(--green-deep); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-danger { background: #fff; color: var(--loss); border-color: var(--loss); }
.btn-big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ------- Inputs ------- */
label { display: block; font-weight: bold; margin: 0.9em 0 0.25em; color: var(--green-deep); }
input, select {
  width: 100%; min-height: 52px; padding: 0.5em 0.7em;
  font-family: inherit; font-size: 1.05rem; color: var(--ink);
  border: 2px solid var(--green-mid); border-radius: var(--radius); background: #fff;
}
input:focus, select:focus, .btn:focus-visible, .tab:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.field-hint { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.2em; }
.error-msg {
  background: #fbeaea; color: var(--loss); border: 2px solid var(--loss);
  border-radius: var(--radius); padding: 0.7em 1em; margin: 0.8em 0; font-weight: bold;
}
.success-msg {
  background: #e8f3ea; color: var(--gain); border: 2px solid var(--gain);
  border-radius: var(--radius); padding: 0.7em 1em; margin: 0.8em 0; font-weight: bold;
}

/* ------- Layout shell ------- */
/* (Shell styles moved to the "Classic financial paper" section at the end.) */
#screen {
  padding: 1rem 1rem 2rem;
  max-width: 820px; margin: 0 auto;
  min-height: 60vh;
}
#screen:focus { outline: none; }

/* ------- Cards & common pieces ------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem; margin: 0.8rem 0;
}
.card h2 { margin-top: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.center { text-align: center; }

.money-big { font-size: 1.9rem; font-weight: bold; color: var(--green-deep); }
.gain { color: var(--gain); font-weight: bold; }
.loss { color: var(--loss); font-weight: bold; }

.delay-chip {
  display: inline-block; background: var(--gold-soft); color: var(--navy);
  border-radius: 999px; padding: 0.15em 0.8em; font-size: 0.8rem; font-weight: bold;
  margin: 0.2em 0;
}
.demo-chip { background: #dfe7f5; }

.banner-warning {
  background: #fdf3e0; border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 0.8em 1em; margin: 0.8rem 0; font-weight: bold; color: var(--navy);
}

/* ------- Lists (stocks, holdings, transactions, leaderboard) ------- */
.rowlist { margin: 0; padding: 0; list-style: none; }
.rowlist li { border-bottom: 1px solid var(--line); }
.rowlist li:last-child { border-bottom: none; }
.rowbtn {
  display: flex; align-items: center; gap: 0.7em; width: 100%;
  background: none; border: none; font: inherit; color: inherit;
  padding: 0.8em 0.2em; min-height: 56px; cursor: pointer; text-align: left;
  touch-action: manipulation;
}
.rowbtn:active { background: var(--gold-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: bold; color: var(--green-deep); }
.row-sub { font-size: 0.88rem; color: var(--ink-soft); }
.row-right { text-align: right; white-space: nowrap; }

/* ------- Trophy case ------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.8rem; }
.badge-card {
  background: #fff; border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 0.8rem 0.6rem; text-align: center;
}
.badge-card.locked { border-color: var(--line); opacity: 0.65; filter: grayscale(0.8); }
.badge-icon { font-size: 2.2rem; line-height: 1.2; }
.badge-name { font-weight: bold; color: var(--green-deep); }
.badge-how { font-size: 0.82rem; color: var(--ink-soft); }

.progress-track {
  background: var(--gold-soft); border-radius: 999px; height: 18px; overflow: hidden; margin: 0.4em 0;
}
.progress-fill { background: var(--gold); height: 100%; border-radius: 999px; transition: width 0.6s ease; }

/* ------- Sub-tabs (pill switchers) ------- */
.pills { display: flex; gap: 0.5em; margin: 0.6rem 0; flex-wrap: wrap; }
.pill {
  flex: 1; min-height: 48px; padding: 0.4em 0.9em; border-radius: 999px;
  border: 2px solid var(--green-deep); background: #fff; color: var(--green-deep);
  font: inherit; font-weight: bold; cursor: pointer; touch-action: manipulation;
  white-space: nowrap;
}
.pill.active { background: var(--green-deep); color: #fff; }

/* ------- Modals ------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(20, 30, 20, 0.55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 1.2rem 1.2rem 1rem;
}
.modal-actions { display: flex; flex-direction: column; gap: 0.6em; margin-top: 1rem; }

/* Badge celebration — dignified, brief */
.celebrate { text-align: center; }
.celebrate .badge-icon { font-size: 3.5rem; animation: pop 0.7s ease; display: inline-block; }
@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ------- Disclaimer gate ------- */
.gate {
  position: fixed; inset: 0; z-index: 100; background: var(--green-deep);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
  overflow-y: auto;
}
.gate-card {
  background: var(--cream); border-radius: var(--radius); padding: 1.5rem;
  max-width: 480px; text-align: center;
}
.gate-card h1 { font-size: 1.4rem; }
.gate-card p { font-size: 1.05rem; text-align: left; }

/* ------- Mascot ------- */
.mascot-small, .mascot-big {
  display: inline-block; background: url('pig.svg') no-repeat center / contain;
}
.mascot-small { width: 34px; height: 34px; }
.mascot-big { width: 90px; height: 90px; margin: 0 auto 0.4rem; }

/* ------- Auth ------- */
#auth { max-width: 480px; margin: 0 auto; padding: 1.2rem; }
.auth-header { text-align: center; margin-top: 1.5rem; }

/* ------- Charts ------- */
.chart-wrap { position: relative; height: 220px; margin: 0.6rem 0; }
@media (min-width: 700px) { .chart-wrap { height: 300px; } }

/* ------- Compare table (game tips) ------- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cmp-table th, .cmp-table td { padding: 0.5em 0.4em; border-bottom: 1px solid var(--line); text-align: right; }
.cmp-table th:first-child, .cmp-table td:first-child { text-align: left; }
.cmp-table th { color: var(--green-deep); }

.stars { color: var(--gold); font-size: 1.05rem; letter-spacing: 0.1em; }

/* Wider screens: comfortable two-column feel for cards */
@media (min-width: 700px) {
  #screen { padding: 1.4rem; }
  .gate-card { padding: 2rem; }
}

/* ======= Research, stop-loss, strategies, groups (added Nov 2026) ======= */
.tab span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-wrap.short { height: 160px; }
@media (min-width: 700px) { .chart-wrap.short { height: 200px; } }
h3 { font-size: 1.1rem; margin: 1.1em 0 0.4em; }

.linkbtn {
  background: none; border: none; padding: 0.3em 0; min-height: 40px; cursor: pointer;
  color: var(--green-mid); font: inherit; font-weight: bold; text-decoration: underline;
}
.verdict { display: inline-block; border-radius: 10px; padding: 0.25em 0.7em; font-weight: bold; border: 2px solid; }
.v-buy { color: var(--gain); border-color: var(--gain); background: #e8f3ea; }
.v-wait { color: #7a5a12; border-color: var(--gold); background: #fdf3e0; }
.v-avoid { color: var(--loss); border-color: var(--loss); background: #fbeaea; }

.points { padding-left: 1.2em; margin: 0.3em 0; }
.points li { margin: 0.45em 0; }
.points.for li::marker { content: '▲  '; color: var(--gain); }
.points.against li::marker { content: '▼  '; color: var(--loss); }
.points.watch li::marker { content: '👁  '; }

.sig { border-top: 1px solid var(--line); padding: 0.7em 0; }
.lean { font-weight: bold; font-size: 0.88rem; }
.lean-up { color: var(--gain); }
.lean-down { color: var(--loss); }
.lean-flat { color: var(--ink-soft); }

.stop-box { border: 2px solid var(--gold); border-radius: var(--radius); padding: 0.6em 0.9em; margin: 0.8em 0; background: #fffbf2; }
.notice { border-left: 5px solid var(--gold); padding: 0.2em 0 0.2em 0.9em; margin: 0.6em 0; }
.notice h3 { margin-top: 0.2em; }

.bar3 { display: flex; border-radius: 10px; overflow: hidden; font-weight: bold; font-size: 0.9rem; min-height: 40px; }
.bar3 > div { display: flex; align-items: center; justify-content: center; color: #fff; white-space: nowrap; padding: 0 0.3em; min-width: 3.5em; }
.b-buy { background: var(--gain); } .b-hold { background: #8a7a4a; } .b-sell { background: var(--loss); }

.code { font-family: 'Courier New', monospace; letter-spacing: 0.15em; font-weight: bold; color: var(--navy); }

.risk { font-weight: bold; }
.risk-low { color: var(--gain); } .risk-med { color: #7a5a12; } .risk-medhigh { color: #a0521c; } .risk-high { color: var(--loss); }

.stepper { display: flex; gap: 0.5em; align-items: stretch; }
.stepper input { flex: 1; text-align: center; font-size: 1.2rem; }
.stepper .btn { min-width: 56px; font-size: 1.5rem; padding: 0 0.6em; }
textarea { width: 100%; font: inherit; font-size: 1.05rem; border: 2px solid var(--green-mid); border-radius: var(--radius); padding: 0.6em; box-sizing: border-box; }

.rate-row { display: flex; gap: 0.3em; }
.rate-btn { font-size: 2rem; min-width: 52px; min-height: 52px; background: #fff; border: 2px solid var(--line); border-radius: 12px; color: #c9c2b0; cursor: pointer; }
.rate-btn.on { color: var(--gold); border-color: var(--gold); }

.grade-box { display: flex; gap: 1em; align-items: center; border-radius: var(--radius); padding: 0.8em 1em; margin: 0.6em 0 1em; border: 2px solid; }
.grade-letter { font-size: 3rem; font-weight: bold; font-family: Georgia, serif; line-height: 1; }
.grade-a, .grade-b { border-color: var(--gain); background: #e8f3ea; color: var(--gain); }
.grade-c { border-color: var(--gold); background: #fdf3e0; color: #7a5a12; }
.grade-d, .grade-f { border-color: var(--loss); background: #fbeaea; color: var(--loss); }
.grade-box > div:last-child { color: var(--ink); }
details summary { min-height: 48px; display: flex; align-items: center; font-weight: bold; color: var(--green-deep); cursor: pointer; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 0.5em; margin: 0.4em 0 0.6em; }
.idx-toggle {
  display: flex; align-items: center; gap: 0.5em; min-height: 48px; padding: 0.3em 0.9em;
  border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  font: inherit; font-size: 0.95rem; font-weight: bold; cursor: pointer; touch-action: manipulation;
}
.idx-toggle.on { border-color: var(--green-deep); background: #eef5f0; color: var(--green-deep); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; flex: none; }

/* Badge medallions (SVG art in public/badges, matching the red hog) */
.bimg { width: 1.5em; height: 1.5em; vertical-align: middle; display: inline-block; }
.badge-icon .bimg { width: 76px; height: 76px; }
.celebrate .badge-icon .bimg { width: 120px; height: 120px; }
.badge-card .badge-icon { margin-bottom: 0.3em; }


/* =====================================================================
   "Classic financial paper" look (chosen Nov 30, 2026)
   Masthead, disclaimer and menu at the TOP; flat newspaper sections.
   ===================================================================== */
:root {
  --paper: #fbf8f1;
  --paper-2: #f3eee2;
  --rule: #cfc6b3;
  --ink: #1f2a1c;
}
body { background: var(--paper); color: var(--ink); }

/* Masthead (scrolls away) */
#masthead {
  text-align: center; padding: 0.7rem 0.8rem 0.45rem;
  padding-top: max(0.7rem, env(safe-area-inset-top));
  border-bottom: 4px double var(--ink); background: var(--paper);
}
.mast-title { display: flex; align-items: center; justify-content: center; gap: 0.45em; }
#masthead .brand { font-size: 1.55rem; font-weight: bold; color: var(--ink); letter-spacing: 0.01em; }
#masthead .mascot-small { width: 40px; height: 40px; }
.mast-sub { font-size: 0.85rem; font-style: italic; color: var(--ink-soft); margin-top: 0.1em; }
.top-note { margin: 0; font-size: inherit; opacity: 1; }

/* Disclaimer + menu stay pinned to the top while scrolling */
#topsticky { position: sticky; top: 0; z-index: 30; background: var(--paper); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
#disclaimer-bar {
  background: var(--ink); color: var(--paper); text-align: center;
  font-size: 0.85rem; padding: 0.3em 0.8em; line-height: 1.35;
}
#tabbar { display: flex; border-bottom: 1px solid var(--ink); background: var(--paper); }
.tab {
  flex: 1; min-height: 52px; min-width: 0; border: none; border-right: 1px solid var(--rule);
  background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation;
  font-family: Georgia, serif; font-size: 0.95rem; font-weight: bold; font-variant: small-caps; letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: center; gap: 0.35em; padding: 0 0.3em;
}
.tab:last-child { border-right: none; }
.tab-icon { font-size: 1.1rem; line-height: 1; }
.tab.active { background: var(--ink); color: var(--paper); }
.tab span:last-child { white-space: nowrap; overflow: visible; text-overflow: clip; }
/* Phones: two rows of three so the words stay big enough to read */
@media (max-width: 620px) {
  #tabbar { flex-wrap: wrap; }
  .tab { flex: 1 0 33.333%; border-bottom: 1px solid var(--rule); min-height: 50px; font-size: 1rem; }
  .tab:nth-child(3n) { border-right: none; }
  .tab:nth-child(n+4) { border-bottom: none; }
}

/* Ticker strip of the day's biggest movers (no animation — easy to read) */
#ticker {
  display: flex; gap: 0.2em; align-items: center; overflow-x: auto; white-space: nowrap;
  background: var(--paper-2); border-bottom: 1px solid var(--rule); padding: 0.15em 0.5em;
  scrollbar-width: thin;
}
#ticker:empty { display: none; }
.ticker-label { font-variant: small-caps; font-weight: bold; color: var(--ink-soft); font-size: 0.85rem; padding-right: 0.4em; }
.tick {
  background: none; border: none; font: inherit; font-size: 0.92rem; color: var(--ink);
  min-height: 44px; padding: 0 0.6em; cursor: pointer; border-right: 1px solid var(--rule);
}
.tick:last-child { border-right: none; }

/* Headings & sections like a financial page */
h1 { font-size: 1.7rem; font-variant: small-caps; letter-spacing: 0.02em; color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: 0.15em; }
h2, h3 { color: var(--ink); }
.card {
  background: #fff; box-shadow: none; border: 1px solid var(--rule); border-top: 3px solid var(--ink);
  border-radius: 4px;
}
.card h2 { font-variant: small-caps; letter-spacing: 0.02em; }
.money-big { color: var(--ink); font-size: 2.1rem; }
.btn { border-radius: 6px; }
.btn-primary { background: var(--ink); }
.pill { border-radius: 6px; border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); color: var(--paper); }
input, select { border-radius: 6px; border-color: var(--ink-soft); }
.delay-chip { border-radius: 4px; background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink); font-size: 0.85rem; }
.demo-chip { background: #e6ecf7; border-color: #9fb2d6; }

/* Invest: stock rows */
.section-head {
  font-variant: small-caps; font-size: 1.3rem; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--ink); margin: 1.4rem 0 0; padding-bottom: 0.15em;
}
.stocklist { list-style: none; margin: 0; padding: 0; }
.stocklist li { border-bottom: 1px solid var(--rule); }
.stockrow {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; color: inherit; padding: 0.8em 0.2em 0.9em; cursor: pointer; touch-action: manipulation;
}
.stockrow:active, .stockrow:hover { background: var(--paper-2); }
.sr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6em; flex-wrap: wrap; }
.sr-name { font-weight: bold; font-size: 1.12rem; }
.sr-sym { font-weight: normal; color: var(--ink-soft); }
.sr-price { white-space: nowrap; }
.sr-blurb { font-style: italic; color: var(--ink-soft); margin: 0.15em 0 0.5em; font-size: 0.95rem; }
.sr-detail { display: flex; align-items: center; gap: 0.8em; flex-wrap: wrap; }
.spark { display: block; flex: none; }
.spark-empty { width: 132px; height: 52px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--rule); }
.sr-facts { border-collapse: collapse; font-size: 0.95rem; flex: 0 1 auto; }
.sr-facts th { text-align: left; font-weight: normal; color: var(--ink-soft); padding: 0.05em 0.6em 0.05em 0; white-space: nowrap; }
.sr-facts td { padding: 0.05em 0; white-space: nowrap; }
.stamp {
  display: inline-block; font-weight: bold; font-size: 0.9rem; letter-spacing: 0.05em;
  border: 2px solid currentColor; border-radius: 3px; padding: 0.15em 0.55em; transform: rotate(-3deg);
  background: #fff; margin-left: auto; margin-right: 0.3em;
}
.stamp-buy { color: var(--gain); }
.stamp-wait { color: #7a5a12; }
.stamp-avoid { color: #5d5d5d; }

/* Lists elsewhere get newspaper rules too */
.rowlist li { border-bottom-color: var(--rule); }
.rowbtn:active { background: var(--paper-2); }
