/* ---- Cashflow D&D — parchment / tavern ledger theme ---- */

:root {
  --ink: #1e1710;
  --ink-soft: #4a3a28;
  --parchment: #f1e2b8;
  --parchment-dark: #d9c389;
  --parchment-edge: #a07b3a;
  --gold: #b8892b;
  --gold-bright: #e0b64a;
  --crimson: #7a1f1f;
  --forest: #2f5235;
  --shadow: rgba(40, 20, 5, 0.35);
  --leather: #3a2416;
  --leather-light: #5a3823;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  color: var(--ink);
  background: #2a1c10;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, #3a2818 0%, #1a1008 80%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><path d='M0 0 L80 80 M80 0 L0 80' stroke='%23000' stroke-opacity='0.04' /></svg>");
}

h1, h2, h3, h4 { font-family: 'Cinzel', serif; font-weight: 700; color: var(--ink); margin: 0 0 .4em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.98rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }

a { color: var(--crimson); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(to bottom, var(--leather-light), var(--leather));
  border-bottom: 3px solid #1a0d05;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.brand {
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold-bright);
  text-shadow: 2px 2px 0 #000, 0 0 10px rgba(224,182,74,0.25);
  margin: 0;
  display: flex; align-items: center; gap: 14px;
}
.brand .amp { color: var(--crimson); }
.brand-d20 {
  width: 44px; height: 44px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7)) drop-shadow(0 0 10px rgba(224,182,74,0.35));
  transition: transform 0.4s cubic-bezier(.3,1.5,.4,1);
  cursor: pointer;
}
.brand-d20:hover { transform: rotate(180deg) scale(1.08); }
.brand-d20.rolling { animation: d20-roll 0.8s ease-out; }
@keyframes d20-roll {
  0%   { transform: rotate(0)    scale(1); }
  30%  { transform: rotate(240deg) scale(1.15); }
  60%  { transform: rotate(520deg) scale(0.95); }
  100% { transform: rotate(720deg) scale(1); }
}
.topbar-right { display: flex; gap: 10px; align-items: center; }
.user-chip {
  color: var(--parchment); font-family: 'Cinzel';
  background: rgba(0,0,0,0.3); padding: 6px 12px;
  border: 1px solid var(--gold); border-radius: 3px;
  font-size: 0.85rem;
}

/* ---- parchment card ---- */
.parchment {
  background:
    radial-gradient(ellipse at top left, #f5e7bf 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, #e8d399 0%, transparent 60%),
    var(--parchment);
  color: var(--ink);
  border: 2px solid var(--parchment-edge);
  border-radius: 6px;
  padding: 20px 24px;
  box-shadow: 0 6px 20px var(--shadow), inset 0 0 40px rgba(160,123,58,0.12);
  position: relative;
}
.parchment::before, .parchment::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 2px solid var(--gold); border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright), var(--gold));
}
.parchment::before { top: 8px; left: 8px; }
.parchment::after { bottom: 8px; right: 8px; }

/* ---- layout ---- */
#app {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  grid-template-rows: auto auto;
  gap: 16px;
  padding: 18px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}
#app .panel { min-width: 0; }
.panel-full { grid-column: 1 / -1; }

.loading { color: var(--parchment); padding: 40px; text-align: center; font-style: italic; }

/* ---- character sheet ---- */
.char-sheet h2 { border-bottom: 2px double var(--ink-soft); padding-bottom: 8px; }
.char-name {
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-size: 1.4rem; color: var(--crimson);
}
.char-title {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 2px 0;
}
.char-prof { font-style: italic; color: var(--ink-soft); margin-bottom: 8px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px;
  margin: 10px 0;
}
.stat {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(160,123,58,0.15); padding: 4px 8px; border-radius: 3px;
  border-left: 3px solid var(--gold);
}
.stat-name { font-family: 'Cinzel'; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-val { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-mod { font-size: 0.75rem; color: var(--ink-soft); margin-left: 4px; }

.credit-box {
  margin-top: 10px; padding: 10px;
  background: linear-gradient(135deg, #d4af5a, #a07b3a);
  border: 2px solid var(--ink); border-radius: 4px;
  text-align: center; color: var(--ink);
}
.credit-score { font-size: 2rem; font-family: 'Cinzel'; font-weight: 700; }
.credit-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

.fate-box {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px dotted var(--parchment-edge);
  background: rgba(255,255,255,0.20);
  border-radius: 4px;
  font-size: 0.82rem;
}
.fate-box strong {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crimson);
}
.fate-box span { color: var(--ink-soft); }

.liquidity-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(47,82,53,0.45);
  background: rgba(47,82,53,0.08);
  border-radius: 4px;
  font-size: 0.84rem;
}
.liquidity-warning.danger {
  border-color: rgba(122,31,31,0.65);
  background: rgba(122,31,31,0.10);
}
.liquidity-warning strong {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
}
.liquidity-warning.danger strong { color: var(--crimson); }
.liquidity-warning span,
.liquidity-warning p {
  color: var(--ink-soft);
  margin: 4px 0 0;
}
.liquidity-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 4px 10px;
  margin-top: 6px;
}
.liquidity-grid b {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  overflow-wrap: anywhere;
}

.meta-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 10px; font-size: 0.9rem;
}
.meta-row div { background: rgba(255,255,255,0.25); padding: 4px 8px; border-radius: 3px; }

.life-ad {
  border-color: var(--gold);
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.20), rgba(184,137,43,0.10)),
    var(--parchment);
}
.life-ad-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.life-kicker {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crimson);
}
.life-ad p {
  margin: 6px 0;
  max-width: 920px;
}
.life-ad ul {
  margin: 8px 0 0 18px;
  padding: 0;
}
.life-death {
  border-color: var(--crimson);
}

.build-sheet {
  max-width: 960px;
  margin: 0 auto;
}
.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 12px;
  margin: 10px 0 16px;
}
.build-grid label,
.debt-builder-row input,
.build-grid input,
.build-grid select {
  min-width: 0;
}
.build-grid label {
  display: grid;
  gap: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.build-grid input,
.build-grid select,
.debt-builder-row input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--parchment-edge);
  background: #fffbe8;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}
.debt-builder {
  display: grid;
  gap: 6px;
  margin: 10px 0 16px;
}
.debt-builder-head,
.debt-builder-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
}
.debt-builder-head {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.listing-pager,
.listing-pager-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.listing-pager-bottom {
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dotted rgba(74,58,40,0.3);
}

/* ---- buttons ---- */
.btn {
  font-family: 'Cinzel', serif; font-weight: 600;
  background: linear-gradient(to bottom, #c9a85a, #8a6d2e);
  color: #1b1200; border: 1px solid #5c4510;
  padding: 8px 16px; border-radius: 4px;
  cursor: pointer; font-size: 0.9rem;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  box-shadow: 0 2px 0 #5c4510, 0 4px 8px rgba(0,0,0,0.3);
  transition: transform 0.05s, box-shadow 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #5c4510, 0 2px 4px rgba(0,0,0,0.3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-primary {
  background: linear-gradient(to bottom, #4a8850, #2f5235);
  color: #fffbe8; border-color: #1b3820;
  box-shadow: 0 2px 0 #1b3820, 0 4px 8px rgba(0,0,0,0.3);
}
.btn-danger {
  background: linear-gradient(to bottom, #a23a3a, #7a1f1f);
  color: #fffbe8; border-color: #3d0e0e;
  box-shadow: 0 2px 0 #3d0e0e, 0 4px 8px rgba(0,0,0,0.3);
}
.btn-ghost {
  background: transparent; color: var(--parchment); border: 1px solid var(--parchment-edge);
  box-shadow: none; text-shadow: none;
}

/* ---- opportunity / offer cards ---- */
.opp-card {
  border: 2px solid var(--parchment-edge);
  background: linear-gradient(to bottom, #f5e7bf, #e2cf94);
  border-radius: 5px; padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
  box-shadow: inset 0 0 20px rgba(160,123,58,0.15);
}
.opp-card.cat-trap   { background: linear-gradient(to bottom, #e8c4a8, #d6a27a); border-color: #7a1f1f; }

.opp-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.opp-title { font-family: 'Cinzel'; font-weight: 700; font-size: 1.05rem; }
.opp-label-badge {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(0,0,0,0.25); color: var(--parchment);
}
.opp-cat { font-size: 0.75rem; color: var(--ink-soft); font-style: italic; }
.opp-body { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }
.opp-body dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0; }
.opp-body dt { color: var(--ink-soft); }
.opp-body dd { margin: 0; font-weight: 600; }
.opp-pitch { font-style: italic; color: var(--crimson); margin-top: 6px; border-top: 1px dashed var(--ink-soft); padding-top: 6px; }
.opp-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.opp-actions input[type=number] {
  width: 110px; padding: 4px 6px; font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--parchment-edge); background: #fffbe8; border-radius: 3px;
}

.market-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(47,82,53,0.35);
  background: rgba(47,82,53,0.08);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 8px 0 10px;
}
.market-status.shock {
  border-color: rgba(122,31,31,0.55);
  background: rgba(122,31,31,0.10);
}
.market-status.boom {
  border-color: rgba(184,137,43,0.55);
  background: rgba(184,137,43,0.12);
}
.market-status strong {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.market-status span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}
.market-chart-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--parchment-edge);
  border-radius: 4px;
  background: rgba(255,251,232,0.55);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
}
.mini-candles {
  display: block;
  width: 120px;
  height: 36px;
}
.asset-candles {
  margin-top: 4px;
}
.asset-detail {
  display: grid;
  gap: 4px;
}
.asset-market-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.72rem;
}
.asset-market-meta .pos { color: #1a5c20; }
.asset-market-meta .neg { color: #7a1f1f; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--crimson);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.trade-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.trade-order label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.trade-order input {
  width: 82px;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid var(--parchment-edge);
  background: #fffbe8;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}
.chart-modal {
  max-width: 860px;
}
#large-market-chart {
  width: 100%;
  height: 330px;
  background: rgba(255,251,232,0.5);
  border: 1px solid rgba(154,123,56,0.45);
  border-radius: 4px;
}
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.chart-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chart-footnote {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-style: italic;
}

.portfolio-list {
  display: grid;
  gap: 12px;
}
.portfolio-card {
  border: 1px solid var(--parchment-edge);
  border-radius: 5px;
  background: rgba(255,251,232,0.32);
  padding: 12px;
}
.portfolio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.portfolio-head h4 {
  margin: 0 0 2px;
  color: var(--crimson);
}
.portfolio-head strong {
  display: block;
  font-family: 'Cinzel', serif;
}
.portfolio-head span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 6px 10px;
  margin: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
.portfolio-grid span {
  color: var(--ink-soft);
}
.portfolio-grid b {
  overflow-wrap: anywhere;
}
.portfolio-grid .pos { color: #1a5c20; }
.portfolio-grid .neg { color: #7a1f1f; }
.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.portfolio-actions label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}
.portfolio-actions input {
  width: 120px;
  padding: 4px 5px;
  border: 1px solid var(--parchment-edge);
  background: #fffbe8;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
}
.trade-order.prominent {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dotted rgba(74,58,40,0.35);
}
.order-state {
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
}

/* ---- ledger ---- */
.ledger {
  max-height: 340px; overflow-y: auto;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
}
.ledger-row {
  display: grid; grid-template-columns: 48px 1fr 90px;
  gap: 6px; padding: 3px 4px;
  border-bottom: 1px dotted rgba(74,58,40,0.3);
}
.ledger-row.pos .amt { color: #1a5c20; }
.ledger-row.neg .amt { color: #7a1f1f; }
.ledger-row .turn { color: var(--ink-soft); }
.ledger-row .amt { text-align: right; font-weight: 600; }
.ledger-row.event { background: rgba(184,137,43,0.15); }

.leaderboard-chart-btn {
  border: 1px solid var(--parchment-edge);
  background: #fffbe8;
  border-radius: 4px;
  padding: 2px 4px;
  cursor: pointer;
}
.sparkline {
  display: block;
  width: 96px;
  height: 28px;
}
.sparkline-empty {
  display: inline-block;
  min-width: 42px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}
.leaderboard-chart {
  margin-top: 10px;
  border-top: 1px dotted rgba(74,58,40,0.35);
  padding-top: 8px;
}
.leaderboard-chart-head,
.leaderboard-chart-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}
.leaderboard-chart-head span,
.leaderboard-chart-foot span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.growth-chart {
  width: 100%;
  height: 150px;
  margin-top: 6px;
  background: rgba(255,251,232,0.45);
  border: 1px solid rgba(154,123,56,0.45);
  border-radius: 4px;
}
.growth-chart line {
  stroke: rgba(74,58,40,0.35);
  stroke-width: 1;
}

#leaderboard {
  overflow: hidden;
}
#leaderboard .bs-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.72rem;
}
#leaderboard .bs-table th,
#leaderboard .bs-table td {
  padding: 4px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#leaderboard .bs-table th:nth-child(1),
#leaderboard .bs-table td:nth-child(1) {
  width: 24px;
}
#leaderboard .bs-table th:nth-child(2),
#leaderboard .bs-table td:nth-child(2) {
  width: 58px;
}
#leaderboard .bs-table th:nth-child(3),
#leaderboard .bs-table td:nth-child(3) {
  width: 112px;
}
#leaderboard .bs-table th:nth-child(4),
#leaderboard .bs-table td:nth-child(4) {
  width: 98px;
}
#leaderboard .bs-table th:nth-child(5),
#leaderboard .bs-table td:nth-child(5) {
  width: 76px;
}
#leaderboard .bs-table th:nth-child(6),
#leaderboard .bs-table td:nth-child(6) {
  width: 32px;
}
#leaderboard .sparkline {
  width: 82px;
  height: 26px;
}
#leaderboard .leaderboard-chart-btn {
  max-width: 90px;
}

/* ---- statements ---- */
.statement-section {
  margin: 12px 0;
}
.statement-section h3 {
  border-bottom: 1px solid var(--ink-soft);
  padding-bottom: 3px; margin-bottom: 6px;
}
.statement-row {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 0.84rem;
  padding: 2px 0;
}
.statement-row.sub { padding-left: 14px; color: var(--ink-soft); }
.statement-row.total {
  border-top: 1px solid var(--ink);
  font-weight: 700; padding-top: 4px; margin-top: 3px;
}
.statement-row .amt.pos { color: #1a5c20; }
.statement-row .amt.neg { color: #7a1f1f; }

.cashflow-box {
  margin-top: 14px; padding: 12px;
  background: linear-gradient(135deg, #3d6044, #2f5235);
  color: #fffbe8; border-radius: 4px;
  text-align: center;
}
.cashflow-box.negative { background: linear-gradient(135deg, #8a2e2e, #5e1818); }
.cashflow-num {
  font-family: 'Cinzel'; font-size: 1.7rem; font-weight: 700;
}
.cashflow-label {
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
}

/* ---- tabs ---- */
.tabs {
  display: flex; gap: 2px; border-bottom: 2px solid var(--parchment-edge);
  margin-bottom: 12px;
}
.tab {
  background: rgba(160,123,58,0.2); border: none; padding: 8px 14px;
  font-family: 'Cinzel'; font-size: 0.85rem; cursor: pointer;
  border-top-left-radius: 4px; border-top-right-radius: 4px;
  color: var(--ink-soft);
}
.tab.active { background: var(--parchment); color: var(--ink); font-weight: 700; border: 2px solid var(--parchment-edge); border-bottom: 2px solid var(--parchment); margin-bottom: -2px; }

/* ---- shop grid ---- */
.shop-controls {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.cat-btn {
  background: rgba(160,123,58,0.3); border: 1px solid var(--parchment-edge);
  color: var(--ink); padding: 6px 12px; border-radius: 3px; cursor: pointer;
  font-family: 'Cinzel'; font-size: 0.78rem; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cat-btn:hover { background: var(--parchment-dark); }

/* ---- balance sheet table ---- */
.bs-table {
  width: 100%; border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
}
.bs-table th, .bs-table td { padding: 4px 6px; text-align: left; }
.bs-table th { border-bottom: 2px solid var(--ink); font-family: 'Cinzel'; font-size: 0.75rem; letter-spacing: 0.08em; }
.bs-table tr { border-bottom: 1px dotted rgba(74,58,40,0.3); }
.bs-table .amt { text-align: right; }
.bs-row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ---- auth page ---- */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(30,18,8,0.65), rgba(30,18,8,0.85)),
    url("https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1600&q=70");
  background-size: cover; background-position: center;
}
.auth-wrap { width: 100%; max-width: 460px; padding: 20px; }
.auth-card .title {
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  color: var(--crimson); text-align: center; font-size: 2.2rem; margin-top: 6px;
}
.auth-card .subtitle { text-align: center; font-style: italic; color: var(--ink-soft); margin-bottom: 20px; }
.auth-form label { display: block; margin-bottom: 12px; font-family: 'Cinzel'; font-size: 0.85rem; }
.auth-form input {
  display: block; width: 100%; padding: 8px 10px; margin-top: 4px;
  font-family: 'EB Garamond', serif; font-size: 1rem;
  background: #fffbe8; border: 1px solid var(--parchment-edge); border-radius: 3px;
}
.auth-buttons { display: flex; gap: 10px; justify-content: space-between; margin-top: 14px; }
.err, .info { padding: 8px 12px; border-radius: 3px; margin-bottom: 12px; font-size: 0.9rem; }
.err { background: rgba(122,31,31,0.15); border: 1px solid var(--crimson); color: var(--crimson); }
.info { background: rgba(47,82,53,0.15); border: 1px solid var(--forest); color: var(--forest); }
.footnote { font-size: 0.75rem; color: var(--ink-soft); text-align: center; margin-top: 18px; font-style: italic; }

/* ---- toast ---- */
#toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--leather); color: var(--parchment);
  padding: 12px 20px; border: 2px solid var(--gold);
  border-radius: 4px; font-family: 'Cinzel'; font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(20px); transition: all 0.2s;
  pointer-events: none; z-index: 1000; max-width: 360px;
}
#toast.show { opacity: 1; transform: translateY(0); }

.centered { text-align: center; padding: 40px; }

/* small responsive tweak */
@media (max-width: 1100px) {
  #app { grid-template-columns: 1fr; }
}

/* cash prominence */
.cash-display {
  font-family: 'Cinzel'; font-size: 1.4rem; font-weight: 700;
  color: var(--forest); text-align: center;
  background: rgba(255,255,255,0.4); padding: 8px; border-radius: 4px;
  margin: 10px 0;
}
.turn-badge {
  display: inline-block; background: var(--crimson); color: #fffbe8;
  padding: 3px 10px; border-radius: 10px; font-family: 'Cinzel';
  font-size: 0.8rem;
}

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.modal { max-width: 560px; width: 90%; max-height: 85vh; overflow-y: auto; }
.modal .close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
