:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --bg-panel: #1a222c;
  --bg-elevated: #232d3a;
  --border: #2e3a4a;
  --text: #e8eef4;
  --text-muted: #8b9aab;
  --accent: #c9a227;
  --accent-dim: #8a7020;
  --good: #3d9a6a;
  --warn: #c9893a;
  --bad: #c94a4a;
  --link: #6db3f2;
  --glow-gold: rgba(201, 162, 39, 0.12);
  --glow-green: rgba(61, 154, 106, 0.06);
  --shadow-soft: rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

/* Light mode — warm paper + ink, same gold accent language */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-panel: #fffcf7;
  --bg-elevated: #efe9df;
  --border: #d4cbbd;
  --text: #1c2430;
  --text-muted: #5c6b7a;
  --accent: #a8841a;
  --accent-dim: #8a6e14;
  --good: #2a7a52;
  --warn: #b86a1e;
  --bad: #b83a3a;
  --link: #2a6fad;
  --glow-gold: rgba(168, 132, 26, 0.1);
  --glow-green: rgba(42, 122, 82, 0.06);
  --shadow-soft: rgba(28, 36, 48, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--glow-gold), transparent),
    radial-gradient(ellipse 40% 30% at 100% 100%, var(--glow-green), transparent);
}

#app {
  max-width: min(1280px, 100%);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Desktop: text labels; mobile media query flips to emoji-only */
.chrome-emoji {
  display: none;
}

.chrome-text-short {
  display: none;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: 100%;
  min-width: 0;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

/* Always-visible End Year — avoid scrolling to the bottom of Play */
.btn-end-year-header {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.btn-theme-toggle {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn-theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.save-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-save-ctrl {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.btn-save-ctrl:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.btn-save-ctrl.hidden {
  display: none;
}

/* Deliberately low-emphasis and far from End Year */
.btn-new-game {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: rgba(139, 154, 171, 0.45);
}

.btn-new-game:hover {
  color: var(--bad);
  text-decoration-color: var(--bad);
  border-color: rgba(201, 74, 74, 0.25);
  background: rgba(201, 74, 74, 0.06);
}

.view-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.tab-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--border);
}

.view-panel.hidden {
  display: none;
}

.tree-panel {
  min-height: 420px;
}

.tree-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
}

.tree-sub {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tree-detail {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  min-height: 3.2rem;
}

.family-tree {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.25rem 0 1rem;
}

.tree-gen {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tree-gen-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

.tree-gen-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.tree-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  min-width: 140px;
  max-width: 200px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tree-card:hover {
  border-color: var(--accent-dim);
}

.tree-card.you {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.tree-card.dead {
  opacity: 0.55;
}

.tree-card.selected-card {
  border-color: var(--link);
}

.tree-card .tc-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.tree-card .tc-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.tree-card .tc-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.tree-card .tc-trust {
  font-weight: 600;
  color: var(--text);
}

.tree-card .tc-trust.muted {
  font-weight: 500;
  color: var(--text-muted);
}

.tree-actions {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* ---- Money / Finances tab ---- */
.money-panel {
  min-height: 420px;
}

.money-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.money-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
}

.money-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  font-weight: 700;
}

.money-card p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.money-card .lead {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.15rem 0 0.5rem;
}

.money-alloc-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
  margin: 0.55rem 0 0.45rem;
}

.money-alloc-bar span {
  display: block;
  height: 100%;
}

.money-alloc-bar .seg-cash { background: #6db3f2; }
.money-alloc-bar .seg-bank { background: #3d9a6a; }
.money-alloc-bar .seg-stocks { background: #c9a227; }
.money-alloc-bar .seg-crypto { background: #c94a4a; }
.money-alloc-bar .seg-business { background: #9b6dff; }

.money-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.money-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.money-legend .dot-cash { background: #6db3f2; }
.money-legend .dot-bank { background: #3d9a6a; }
.money-legend .dot-stocks { background: #c9a227; }
.money-legend .dot-crypto { background: #c94a4a; }
.money-legend .dot-business { background: #9b6dff; }

.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.strategy-btn {
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.strategy-btn:hover {
  border-color: var(--accent-dim);
}

.strategy-btn.active {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.1);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.strategy-btn:disabled,
.strategy-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.strategy-btn:disabled:hover,
.strategy-btn.disabled:hover {
  border-color: var(--border);
}

.strategy-btn .st-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.strategy-btn .st-risk {
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.4rem;
}

.strategy-btn .st-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.money-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.money-actions .btn,
.money-mini-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.money-mini-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.money-mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.money-mini-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
}

/* Politics tab — election calendar */
.politics-proto-card {
  border-color: var(--accent-dim, #6ea8fe);
}

.election-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.election-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.election-row-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.election-row-held {
  border-color: rgba(61, 154, 106, 0.55);
}

.election-row-open {
  border-color: rgba(201, 162, 39, 0.55);
}

.election-kind {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.election-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.election-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.election-when {
  font-weight: 600;
  color: var(--text);
}

.election-when-now {
  color: var(--accent);
}

.election-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.election-main {
  flex: 1 1 180px;
  min-width: 0;
}

.campaign-advice {
  margin: 0.65rem 0 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.08);
}

.campaign-advice-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.campaign-advice p {
  margin: 0.2rem 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}

.campaign-advice p.muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.campaign-rec-btn {
  box-shadow: 0 0 0 1px var(--accent-dim);
}

/* Polymarket-style personal race odds (active campaign only) */
.polymarket-odds {
  margin: 0.55rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.polymarket-odds.polymarket-good {
  border-color: rgba(61, 154, 106, 0.45);
  background: rgba(61, 154, 106, 0.08);
}

.polymarket-odds.polymarket-bad {
  border-color: rgba(201, 74, 74, 0.4);
  background: rgba(201, 74, 74, 0.07);
}

.polymarket-odds.polymarket-mid {
  border-color: rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.07);
}

.polymarket-prices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
}

.polymarket-side {
  flex: 1 1 0;
  min-width: 0;
}

.polymarket-side.polymarket-opp {
  text-align: right;
}

.polymarket-who {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polymarket-price {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.polymarket-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.polymarket-vs {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.polymarket-bar {
  margin: 0.15rem 0 0.4rem;
  height: 10px;
}

.polymarket-tip {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Multiparty (3-way) ranked results + bars */
.multiparty-rank {
  list-style: none;
  margin: 0.35rem 0 0.45rem;
  padding: 0;
}

.multiparty-rank-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.2rem 0;
  font-size: 0.92rem;
}

.multiparty-place {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1.25rem;
}

.multiparty-who {
  flex: 1 1 auto;
  min-width: 0;
}

.multiparty-pct {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vote-bar.multiparty-bar,
.vote-bar .vote-seg {
  display: flex;
}

.vote-bar .vote-seg {
  height: 100%;
  min-width: 0;
}

.vote-bar.multiparty-bar {
  height: 12px;
  margin: 0.25rem 0 0.15rem;
}

.council-rank .council-elected .multiparty-who {
  font-weight: 600;
}

.council-rank .council-you {
  background: rgba(201, 162, 39, 0.1);
  border-radius: 4px;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.council-preview-list {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.82rem;
  max-height: 14rem;
  overflow-y: auto;
}

.council-preview-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 0.35rem;
  padding: 0.15rem 0.2rem;
  color: var(--text-muted);
}

.council-preview-row.council-elected {
  color: var(--text);
}

.council-preview-row.council-you {
  background: rgba(201, 162, 39, 0.12);
  border-radius: 4px;
  font-weight: 600;
  color: var(--text);
}

html[data-theme="light"] .polymarket-odds.polymarket-good {
  border-color: rgba(42, 122, 82, 0.4);
  background: rgba(42, 122, 82, 0.07);
}

html[data-theme="light"] .polymarket-odds.polymarket-bad {
  border-color: rgba(184, 58, 58, 0.4);
  background: rgba(184, 58, 58, 0.06);
}

/* Election night results + post-mortem */
.election-result {
  margin: 0.5rem 0 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.election-result.good {
  border-color: rgba(61, 154, 106, 0.55);
  background: rgba(61, 154, 106, 0.08);
}

.election-result.bad {
  border-color: rgba(201, 74, 74, 0.5);
  background: rgba(201, 74, 74, 0.07);
}

.election-result-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.election-result.good .election-result-title {
  color: var(--good, #5dba7a);
}

.election-result.bad .election-result-title {
  color: var(--bad, #e07070);
}

.election-result-office {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.92rem;
}

.election-result-votes {
  margin: 0.4rem 0 0.55rem;
}

.vote-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.vote-side {
  flex: 1 1 40%;
  min-width: 0;
}

.vote-side-you {
  text-align: left;
}

.vote-side-opp {
  text-align: right;
}

.vote-who {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.95;
}

.vote-pct {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
  letter-spacing: -0.02em;
}

.ballot-text-red,
.ballot-text-red .vote-pct {
  color: #d45a5a;
}

.ballot-text-blue,
.ballot-text-blue .vote-pct {
  color: #5b8fd9;
}

.ballot-text-orange,
.ballot-text-orange .vote-pct {
  color: #f58220;
}

/* Canada party brand colors */
.ballot-text-ca_lib,
.ballot-text-ca_lib .vote-pct {
  color: #d71920;
}

.ballot-text-ca_ndp,
.ballot-text-ca_ndp .vote-pct {
  color: #f58220;
}

.ballot-text-ca_con,
.ballot-text-ca_con .vote-pct {
  color: #003f72;
}

.ballot-text-neutral,
.ballot-text-neutral .vote-pct {
  color: var(--text);
}

.vote-bar {
  display: flex;
  height: 14px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  margin: 0.35rem 0 0.2rem;
  direction: ltr;
}

.vote-bar .vote-you,
.vote-bar .vote-opp,
.vote-bar .vote-other {
  display: block;
  height: 100%;
  min-width: 0;
}

.vote-bar .ballot-red {
  background: #c94a4a;
}

.vote-bar .ballot-blue {
  background: #4a7fd4;
}

.vote-bar .ballot-orange {
  background: #f58220;
}

.vote-bar .ballot-ca_lib {
  background: #d71920;
}

.vote-bar .ballot-ca_ndp {
  background: #f58220;
}

.vote-bar .ballot-ca_con {
  background: #003f72;
}

.vote-bar .ballot-neutral {
  background: #8a8f98;
}

.vote-bar .vote-other {
  background: #6a6f78;
}

.vote-others-note {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 0.15rem;
}

.election-result-model {
  font-size: 0.8rem;
  margin: 0.35rem 0;
}

.election-result-headline {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.45rem 0 0.55rem;
  color: var(--text);
}

.election-pm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem 1rem;
  margin-top: 0.35rem;
}

.election-pm h4 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.election-pm ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.election-pm li {
  margin-bottom: 0.35rem;
}

.election-pm li strong {
  color: var(--text);
}

/* Inside money-grid cards */
.money-grid > .election-result {
  grid-column: 1 / -1;
}

.narrative .election-result {
  max-width: 100%;
}

/* Politics yearly choices (campaign day / office situation) */
.politics-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.politics-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.politics-choice-btn:hover:not(:disabled):not(.disabled) {
  border-color: var(--accent-dim);
  background: rgba(201, 162, 39, 0.06);
}

.politics-choice-btn.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
  background: rgba(201, 162, 39, 0.1);
}

.politics-choice-btn:disabled,
.politics-choice-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.politics-choice-btn .pc-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
}

.politics-choice-btn .pc-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.politics-choice-btn .pc-rec {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-left: 0.35rem;
}

.politics-choice-btn .pc-cost {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 0.35rem;
  white-space: nowrap;
}

.office-scenario {
  margin: 0.55rem 0 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.office-scenario-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--text);
}

.office-scenario p {
  margin: 0.3rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Party favorability polling */
.politics-poll-card .poll-row {
  margin: 0.65rem 0 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.politics-poll-card .poll-row:first-of-type {
  border-top: none;
  padding-top: 0.25rem;
}

.poll-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.poll-party {
  font-size: 0.88rem;
  min-width: 0;
}

.poll-net {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  white-space: nowrap;
}

.poll-net-pos {
  color: var(--good, #5dba7a);
}

.poll-net-neg {
  color: var(--bad, #e07070);
}

.poll-net-flat {
  color: var(--text-muted);
}

.poll-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}

.poll-bar-half {
  flex: 1 1 50%;
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 100%;
}

.poll-bar-left {
  justify-content: flex-end;
  border-right: 1px solid var(--border);
}

.poll-bar-right {
  justify-content: flex-start;
}

.poll-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
}

.poll-fill-red {
  background: #c94a4a;
}

.poll-fill-blue {
  background: #4a7fd4;
}

.poll-fill-neutral {
  background: #8a8f98;
}

.poll-meta {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.politics-gov-card .status-row .value {
  text-align: right;
  font-size: 0.85rem;
}

.leadership-result {
  margin-bottom: 0.75rem;
}

.election-result.background-result {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.election-result.background-result .election-result-title {
  color: var(--text);
}

/* Government outcome block on election results */
.gov-outcome-block {
  margin: 0.75rem 0 0.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--accent-dim, rgba(201, 162, 39, 0.45));
  background: rgba(201, 162, 39, 0.08);
}

.gov-outcome-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.gov-outcome-row {
  margin: 0.55rem 0 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.gov-outcome-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.gov-outcome-primary {
  padding: 0.45rem 0.5rem;
  margin-left: -0.35rem;
  margin-right: -0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.gov-outcome-tier {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.gov-outcome-headline {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.gov-mini-votes {
  margin-bottom: 0.2rem;
}

.gov-seat-rank {
  margin: 0.25rem 0 0.4rem;
  padding-left: 1.15rem;
}

.gov-seat-rank .gov-seat-winner .multiparty-who {
  font-weight: 700;
}

.gov-seat-bar {
  margin-top: 0.25rem;
  height: 0.65rem;
}

.gov-seat-meta {
  line-height: 1.35;
}

.gov-two-party-row {
  margin: 0.45rem 0;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
}

.gov-two-party-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.gov-two-party-tier {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.gov-two-party-line {
  font-size: 0.92rem;
  line-height: 1.4;
}

.politics-riding-card .riding-rep-row {
  margin: 0.55rem 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.politics-riding-card .riding-rep-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.riding-rep-tier {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.riding-rep-line {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.money-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.money-table th,
.money-table td {
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.money-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.money-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.money-history-table {
  font-size: 0.92rem;
}

.money-history-table th,
.money-history-table td {
  padding: 0.45rem 0.55rem;
}

.money-history-table td.num {
  font-size: 0.92rem;
}

.money-flash {
  font-size: 0.88rem;
  color: var(--good);
  min-height: 1.2em;
  margin: 0 0 0.55rem;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--good) 35%, var(--border));
  background: color-mix(in srgb, var(--good) 10%, var(--bg-panel));
}

.money-flash.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  background: color-mix(in srgb, var(--warn) 10%, var(--bg-panel));
}

.money-flash.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, var(--border));
  background: color-mix(in srgb, var(--bad) 10%, var(--bg-panel));
}

.money-flash .decision-effect {
  white-space: nowrap;
}

.milestone .decision-effect {
  white-space: nowrap;
}

.money-cashflow .lead.surplus-pos,
.money-cashflow .surplus-pos {
  color: var(--good);
}

.money-cashflow .lead.surplus-neg,
.money-cashflow .surplus-neg {
  color: var(--bad);
}

.money-cashflow .lead.surplus-flat {
  color: var(--text);
}

.money-cashflow-note {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.gift-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.gift-row:last-child {
  border-bottom: none;
}

.gift-row .gift-name {
  font-weight: 600;
}

.event-banner {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.brand h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.year-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr minmax(200px, 260px);
  gap: 1rem;
  flex: 1;
  align-items: start;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .log-panel {
    max-height: 280px;
  }
}

/* Phone / narrow: emoji chrome, no horizontal overflow */
@media (max-width: 640px) {
  #app {
    padding: 0.65rem 0.7rem 1.5rem;
    gap: 0.75rem;
  }

  .brand h1 {
    font-size: 1.05rem;
    margin: 0;
  }

  .tagline {
    display: none;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .top-right {
    align-items: stretch;
    width: 100%;
    gap: 0.45rem;
  }

  .view-tabs {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
    gap: 0.15rem;
    flex-wrap: nowrap;
  }

  .tab-btn {
    flex: 1 1 0;
    padding: 0.45rem 0.2rem;
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .tab-btn .chrome-text {
    display: none;
  }

  .tab-btn .chrome-emoji {
    display: inline;
  }

  .top-meta {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
    row-gap: 0.4rem;
  }

  .year-badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    flex: 1 1 auto;
    min-width: 0;
  }

  .btn-end-year-header {
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
    flex: 0 0 auto;
  }

  .btn-end-year-header .chrome-text {
    display: none;
  }

  .btn-end-year-header .chrome-emoji {
    display: inline;
    margin-right: 0.2rem;
  }

  .btn-end-year-header .chrome-text-short {
    display: inline;
  }

  .save-controls {
    gap: 0.2rem;
  }

  .btn-save-ctrl,
  .btn-theme-toggle,
  .btn-new-game {
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0.35rem 0.4rem;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-save-ctrl .chrome-text,
  .btn-theme-toggle .chrome-text,
  .btn-new-game .chrome-text {
    display: none;
  }

  .btn-save-ctrl .chrome-emoji,
  .btn-theme-toggle .chrome-emoji,
  .btn-new-game .chrome-emoji {
    display: inline;
  }

  .btn-new-game {
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .turn-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
  }

  .turn-bar .btn.primary,
  .turn-bar .btn {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .tree-actions {
    max-width: 100%;
  }

  .panel {
    padding: 0.85rem 0.8rem;
    max-width: 100%;
    min-width: 0;
  }

  .main-panel,
  .money-panel,
  .status-panel,
  .log-panel {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.status-panel section + section {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.panel h2 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.status-block {
  font-size: 0.92rem;
}

.status-block.muted,
.muted {
  color: var(--text-muted);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.2rem 0;
}

.status-row .label {
  color: var(--text-muted);
}

.status-row .value {
  font-weight: 600;
  text-align: right;
}

.stat-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.15rem 0 0.45rem;
}

.stat-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 3px;
  transition: width 0.25s ease;
}

.stat-bar.trust > span {
  background: linear-gradient(90deg, #2a6a9a, #6db3f2);
}

.stat-bar.health > span {
  background: linear-gradient(90deg, #2a6a4a, var(--good));
}

.traits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trait-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.trait-chip.positive {
  border-color: rgba(61, 154, 106, 0.45);
  color: #8fd4b0;
}

.trait-chip.negative {
  border-color: rgba(201, 74, 74, 0.45);
  color: #e8a0a0;
}

.trait-chip.neutral {
  border-color: rgba(201, 162, 39, 0.35);
  color: #e0c96a;
}

/* Congenital chips slightly more solid; personality more outline */
.traits-list .trait-chip[title^="Intelligence"],
.traits-list .trait-chip[title^="Constitution"],
.traits-list .trait-chip[title^="Attractiveness"] {
  font-weight: 600;
}

.child-card,
.parent-card {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.parent-card .name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.family-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.4;
}

.support-good {
  color: #8fd4b0;
}

.support-mid {
  color: #e0c96a;
}

.support-low {
  color: #e8a0a0;
}

.child-card:last-child {
  margin-bottom: 0;
}

.child-card .name {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.main-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.scene-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* Major life-event banner (center column) */
.major-notice {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.65);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.22), rgba(35, 45, 58, 0.95));
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.15), 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: notice-in 0.35s ease-out;
}

.major-notice.hidden {
  display: none;
}

.major-notice.mn-succession {
  padding: 1.15rem 1.2rem 1.1rem;
  border-width: 2px;
  border-color: rgba(201, 74, 74, 0.75);
  background: linear-gradient(135deg, rgba(201, 74, 74, 0.28), rgba(35, 45, 58, 0.98));
  box-shadow: 0 0 0 1px rgba(201, 74, 74, 0.2), 0 12px 32px rgba(0, 0, 0, 0.45);
}

.major-notice.mn-succession .mn-title {
  font-size: 0.85rem;
  color: #e88a8a;
  letter-spacing: 0.12em;
}

.major-notice.mn-succession .mn-body {
  font-size: 1.15rem;
  font-weight: 700;
}

.major-notice .mn-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.major-notice .mn-body {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin: 0 0 0.65rem;
}

.major-notice .mn-dismiss {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.major-notice.mn-succession .mn-dismiss {
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  color: var(--text);
  border-color: rgba(201, 74, 74, 0.55);
  background: rgba(201, 74, 74, 0.15);
}

.major-notice .mn-dismiss:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.narrative {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.narrative p {
  margin: 0 0 0.75rem;
}

.narrative .event {
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
  margin: 0.5rem 0;
}

.narrative .milestone {
  color: var(--accent);
  font-weight: 600;
}

.narrative .good {
  color: #8fd4b0;
}

.narrative .bad {
  color: #e8a0a0;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  /* No inner scroll — areas expand/collapse instead */
  overflow: visible;
}

.domain-guide {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.domain-section {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.domain-section.has-pick {
  border-color: rgba(61, 154, 106, 0.45);
}

.domain-section.is-empty {
  opacity: 0.55;
}

.politics-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.politics-action-btn {
  text-align: left;
  width: 100%;
}

.domain-section.is-locked {
  opacity: 0.9;
  border-color: rgba(201, 137, 58, 0.4);
}

.domain-slot.locked-slot {
  color: var(--warn);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.domain-lock-note {
  font-size: 0.82rem;
  color: var(--warn);
  background: rgba(201, 137, 58, 0.08);
  border: 1px dashed rgba(201, 137, 58, 0.35);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  line-height: 1.4;
}

.domain-header {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  align-items: center;
  gap: 0.45rem 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.domain-section.is-open .domain-header {
  border-bottom-color: var(--border);
}

.domain-header:hover:not(:disabled) {
  background: #2a3544;
}

.domain-header:disabled {
  cursor: default;
}

.domain-chevron {
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1;
}

.domain-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent);
}

.domain-meta {
  min-width: 0;
  text-align: right;
}

.domain-slot {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-slot.picked {
  color: #8fd4b0;
  font-weight: 600;
}

.domain-slot.muted-slot {
  font-style: italic;
}

.domain-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.7rem;
}

.domain-body[hidden] {
  display: none;
}

.domain-blurb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.choice-btn.clear-pick {
  border-style: dashed;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
}

.choice-btn {
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: inherit;
  line-height: 1.4;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: #2a3544;
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.995);
}

.choice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-btn .hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.choice-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

/* Personal advice coloring */
.choice-btn.advice-good {
  background: rgba(61, 154, 106, 0.12);
  border-color: rgba(61, 154, 106, 0.55);
}

.choice-btn.advice-good:hover:not(:disabled) {
  background: rgba(61, 154, 106, 0.2);
  border-color: var(--good);
}

.choice-btn.advice-good.selected {
  border-color: var(--good);
  box-shadow: 0 0 0 1px rgba(61, 154, 106, 0.5);
}

.choice-btn.advice-bad {
  background: rgba(201, 74, 74, 0.1);
  border-color: rgba(201, 74, 74, 0.45);
}

.choice-btn.advice-bad:hover:not(:disabled) {
  background: rgba(201, 74, 74, 0.16);
  border-color: var(--bad);
}

.choice-btn.advice-bad.selected {
  border-color: var(--bad);
  box-shadow: 0 0 0 1px rgba(201, 74, 74, 0.45);
}

.choice-btn.advice-mid {
  background: rgba(201, 137, 58, 0.1);
  border-color: rgba(201, 137, 58, 0.45);
}

.choice-btn.advice-mid:hover:not(:disabled) {
  background: rgba(201, 137, 58, 0.16);
  border-color: var(--warn);
}

.choice-btn.advice-mid.selected {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px rgba(201, 137, 58, 0.45);
}

.choice-btn .advice-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.choice-btn .advice-badge.good {
  background: rgba(61, 154, 106, 0.25);
  color: #8fd4b0;
}

.choice-btn .advice-badge.bad {
  background: rgba(201, 74, 74, 0.22);
  color: #e8a0a0;
}

.choice-btn .advice-badge.mid {
  background: rgba(201, 137, 58, 0.28);
  color: #e0b57a;
}

.choice-btn.advice-good .hint {
  color: #9bcbb0;
}

.choice-btn.advice-bad .hint {
  color: #c9a0a0;
}

.choice-btn.advice-mid .hint {
  color: #d4b48a;
}

.narrative .warn {
  color: var(--warn);
  font-weight: 600;
}

.turn-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, #d4b03a, #a8841c);
  border-color: #8a7020;
  color: #1a1408;
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #e0c04a, #b89422);
}

.btn.ghost:hover:not(:disabled) {
  border-color: var(--text-muted);
}

.log-panel {
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
}

.chronicle {
  overflow-y: auto;
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
  line-height: 1.45;
}

.chronicle .entry {
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(46, 58, 74, 0.6);
}

.chronicle .entry .yr {
  color: var(--accent-dim);
  font-weight: 600;
}

.chronicle .entry.highlight {
  color: var(--text);
}

.footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.25rem;
}

/* Light-mode tweaks for colors that were tuned for dark panels */
html[data-theme="light"] .btn-end-year-header {
  box-shadow: 0 0 0 1px rgba(168, 132, 26, 0.35);
}

html[data-theme="light"] .advice-badge.good,
html[data-theme="light"] .trait.good {
  color: #1f6b45;
}

html[data-theme="light"] .advice-badge.bad,
html[data-theme="light"] .trait.bad {
  color: #a03030;
}

html[data-theme="light"] .advice-badge.mid {
  color: #8a6a12;
}

html[data-theme="light"] .major-notice {
  box-shadow: 0 0 0 1px rgba(168, 132, 26, 0.2), 0 8px 24px var(--shadow-soft);
}

html[data-theme="light"] .panel,
html[data-theme="light"] .money-card,
html[data-theme="light"] .domain-section {
  box-shadow: 0 1px 2px var(--shadow-soft);
}

/* Intro / modal-like blocks inside narrative */
.intro-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.intro-block h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1rem;
}
