/* Theme: dark industrial iron with gold. Colours live here as tokens. */
:root {
  --bg: #121014;
  --bg-2: #1a171c;
  --panel: #1f1b21;
  --panel-2: #29242b;
  --line: #3a3236;
  --text: #ece4d6;
  --muted: #9d9189;
  --gold: #e8b54a;
  --gold-2: #ffd77a;
  --gold-deep: #8a5d17;
  --good: #7fc77a;
  --bad: #d06a5a;
  --radius: 12px;
  --display: 'Cinzel', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 20% -10%, #2a2018 0%, transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 22px, rgba(255,255,255,.012) 22px 23px),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--body);
  -webkit-tap-highlight-color: transparent;
}
h1, h2 { font-family: var(--display); letter-spacing: .04em; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* the crown-coin glyph used next to every price */
.coin {
  display: inline-block; width: .9em; height: .9em; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-deep));
  box-shadow: inset 0 0 0 1.5px rgba(90,60,12,.6);
  vertical-align: -.08em;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(#1c181d, #151216);
}
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--gold); text-transform: uppercase; }
.wordmark-crown {
  width: 22px; height: 16px; background: var(--gold);
  clip-path: polygon(0 100%, 6% 20%, 30% 55%, 50% 0, 70% 55%, 94% 20%, 100% 100%);
}
.back-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--gold); }

/* treasury */
.currency-amount {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 800 clamp(30px, 6vw, 46px)/1.1 var(--display); color: var(--gold-2);
  text-shadow: 0 2px 0 #000, 0 0 24px rgba(232,181,74,.25);
  font-variant-numeric: tabular-nums;
}
.currency-label { text-align: center; color: var(--muted); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; }
.rates { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.rates p {
  display: flex; flex-direction: column; align-items: center; min-width: 120px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.rates span { white-space: nowrap; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.rates b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }

/* the Mint */
.mint {
  position: relative; width: min(300px, 70vw, 34vh); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; touch-action: manipulation; user-select: none;
  filter: drop-shadow(0 12px 22px rgba(0,0,0,.55)) drop-shadow(0 0 30px rgba(232,181,74,.18));
  transition: transform .08s ease-out, filter .2s;
}
.mint svg { width: 100%; height: 100%; display: block; }
.mint:hover { transform: scale(1.03); filter: drop-shadow(0 14px 26px rgba(0,0,0,.6)) drop-shadow(0 0 40px rgba(232,181,74,.3)); }
.mint:active { transform: scale(.96); }
.mint-hint { color: var(--muted); font-size: 13px; text-align: center; max-width: 34ch; margin: 0 auto; }

/* shop */
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.panel-head h2 { font-size: 18px; color: var(--gold); }
.panel-note { color: var(--muted); font-size: 12px; padding: 0 16px 10px; }

/* buy-mode selector */
.buy-modes { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.buy-mode {
  min-width: 46px; padding: 5px 9px; border: 0; border-radius: 7px; background: none; cursor: pointer;
  color: var(--muted); font-weight: 700; font-size: 13px; transition: background .15s, color .15s;
}
.buy-mode:hover { color: var(--text); }
.buy-mode.active { background: linear-gradient(var(--gold-2), var(--gold)); color: #2a1c05; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset; }

.building {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; text-align: left; cursor: pointer;
  background: linear-gradient(var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, background .15s, opacity .15s, transform .08s;
}
.building:hover { border-color: #5a4c3a; }
.building:active { transform: translateY(1px); }
.building.affordable { border-color: rgba(232,181,74,.55); }
.building.affordable .b-cost { color: var(--gold-2); }
.building.unaffordable { opacity: .72; cursor: not-allowed; }
.building.unaffordable .b-cost { color: var(--bad); }
.building.unaffordable .b-qty { color: var(--bad); opacity: .8; }

/* how close the treasury is to the quoted price */
.b-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.04); }
.b-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .25s linear; }
.building.affordable .b-progress span { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.b-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px;
  background: radial-gradient(circle at 30% 25%, #3d3326, #211c18); color: var(--gold); border: 1px solid #4a3d2b;
}
.b-icon svg { width: 28px; height: 28px; }
.b-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.b-name { font-weight: 700; font-size: 15px; }
.b-desc { color: var(--muted); font-size: 12px; }
.b-rate { color: var(--good); font-size: 12px; font-variant-numeric: tabular-nums; }
.b-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.b-owned { font: 800 24px/1 var(--display); color: var(--text); opacity: .85; font-variant-numeric: tabular-nums; }
.b-qty { color: var(--muted); font-size: 12px; font-weight: 600; margin-right: 2px; }
.b-cost { display: flex; align-items: center; gap: 5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* floating "+1" numbers */
.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.floater {
  position: absolute; transform: translate(-50%, -50%);
  font: 800 20px var(--display); color: var(--gold-2); text-shadow: 0 2px 0 #000, 0 0 10px rgba(0,0,0,.6);
  white-space: nowrap;
}
.floater-buy { font-size: 16px; color: var(--good); }

/* upgrades */
.panel-count { color: var(--muted); font-size: 12px; }
.upgrade {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px 11px; text-align: left; cursor: pointer;
  background: linear-gradient(var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, opacity .15s, transform .08s;
}
.upgrade:hover { border-color: #5a4c3a; }
.upgrade:active { transform: translateY(1px); }
.upgrade.affordable { border-color: rgba(232,181,74,.55); }
.upgrade.affordable .u-cost { color: var(--gold-2); }
.upgrade.unaffordable { opacity: .72; cursor: not-allowed; }
.upgrade.unaffordable .u-cost { color: var(--bad); }
.u-icon {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px;
  background: radial-gradient(circle at 30% 25%, #3d3326, #211c18); color: var(--gold); border: 1px solid #4a3d2b;
}
.u-icon svg { width: 22px; height: 22px; }
.upgrade-click .u-icon { color: #f2d6a0; background: radial-gradient(circle at 30% 25%, #4a3424, #24170f); }
.upgrade-global .u-icon { color: var(--good); background: radial-gradient(circle at 30% 25%, #26372a, #141c16); border-color: #33503a; }
.upgrade-synergy .u-icon { color: #9cc4e8; background: radial-gradient(circle at 30% 25%, #26313d, #141a20); border-color: #34475a; }
.upgrade-repeat .u-icon { color: #d9a5e0; background: radial-gradient(circle at 30% 25%, #3a2840, #1d1420); border-color: #523a5a; }
.u-tier {
  position: absolute; right: -5px; bottom: -5px; min-width: 18px; padding: 0 3px; border-radius: 6px;
  background: var(--gold); color: #2a1c05; font: 800 10px/16px var(--display); text-align: center;
}
.u-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.u-name { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; }
.u-level { color: #d9a5e0; font-size: 11px; font-weight: 600; }
.u-desc { color: var(--muted); font-size: 12px; }
.u-effect { color: var(--good); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.u-cost { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-note { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 12px; border: 1px dashed var(--line); border-radius: 10px; }

.owned-upgrades { margin: 0 12px 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.owned-upgrades summary { cursor: pointer; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.owned-upgrades summary span { color: var(--gold); }
.owned-list { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; max-height: 140px; overflow-y: auto; }
.owned-chip { padding: 2px 8px; border-radius: 999px; border: 1px solid #4a3d2b; background: #221d18; color: var(--text); font-size: 12px; }
.floater-spend { font-size: 15px; color: var(--bad); }

/* building kinds, the locked "coming next" card */
.b-name { display: flex; align-items: baseline; gap: 6px; }
.b-kind {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  padding: 0 5px; border: 1px solid var(--line); border-radius: 5px;
}
.locked-building { cursor: default; opacity: .8; border-style: dashed; background: var(--bg); }
.locked-building:hover { border-color: var(--line); }
.locked-building:active { transform: none; }
.locked-building .b-icon { color: #4a4040; background: #1a1719; border-color: var(--line); }
.locked-building .b-title { color: var(--muted); }
.locked-building .b-kind { color: var(--gold); border-color: #4a3d2b; }
.b-req { color: var(--gold); font-size: 12px; }
.b-lock { font-size: 18px; opacity: .6; }
.more-note { color: var(--muted); font-size: 12px; text-align: center; padding: 2px 0 4px; }
.more-note:empty { display: none; }

/* empire rank */
.rank { width: min(360px, 100%); text-align: center; }
.rank-line { font-size: 13px; color: var(--muted); }
.rank-label { text-transform: uppercase; letter-spacing: .15em; font-size: 11px; }
.rank-line b { font-family: var(--display); color: var(--gold-2); font-size: 16px; letter-spacing: .03em; }
.rank-bonus { color: var(--good); font-size: 12px; }
.rank-bar { height: 4px; margin: 6px 0 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.rank-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); transition: width .4s ease-out; }
.rank-next { color: var(--muted); font-size: 11px; }

/* skyline */
.skyline { width: 100%; }
.skyline svg { display: block; width: 100%; height: auto; max-height: 120px; }
.skyline .smoke { fill: #8a8078; opacity: 0; }

/* notifications */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(340px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: linear-gradient(#2c262c, #201b20); border: 1px solid #4a3d2b; border-left: 3px solid var(--gold);
  border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.toast-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #1a1612; color: var(--gold); }
.toast-icon svg { width: 20px; height: 20px; }
.toast-text { display: flex; flex-direction: column; min-width: 0; }
.toast-text strong { font-size: 14px; }
.toast-text span { color: var(--muted); font-size: 12px; }
.toast-rank { border-left-color: var(--gold-2); }
.toast-rank .toast-icon { color: #2a1c05; background: linear-gradient(var(--gold-2), var(--gold)); }
.toast-milestone { border-left-color: var(--good); }
.toast-milestone .toast-icon { color: var(--good); }
.toast-upgrade { border-left-color: #9cc4e8; }
.toast-upgrade .toast-icon { color: #9cc4e8; }

/* top bar actions */
.top-actions { display: flex; align-items: center; gap: 14px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; cursor: pointer;
  border: 1px solid #4a3d2b; border-radius: 9px; background: #221d18; color: var(--text); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.top-btn:hover { border-color: var(--gold); background: #2a231b; }
.top-btn svg { width: 17px; height: 17px; color: var(--gold); }
.top-btn b { color: var(--gold-2); font-variant-numeric: tabular-nums; }

/* dialogs */
.dialog {
  width: min(760px, calc(100vw - 24px)); max-height: min(86vh, 900px); padding: 0;
  border: 1px solid #4a3d2b; border-radius: 16px; background: var(--bg-2); color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(8,6,8,.7); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.dialog-head h2 { color: var(--gold); font-size: 20px; }
.dialog-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dialog-close { border: 0; background: none; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.dialog-close:hover { color: var(--text); }

/* achievements */
.ach-total { height: 5px; margin: 0 18px 10px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.ach-total span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); transition: width .4s; }
.ach-filters { display: flex; gap: 6px; padding: 0 18px 10px; }
.ach-filter { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.ach-filter[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-2); background: #2a231b; }
.ach-list { overflow-y: auto; padding: 0 18px 18px; overscroll-behavior: contain; }
.ach-group h3 { font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin: 12px 0 8px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ach {
  position: relative; overflow: hidden; display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px 11px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); opacity: .62;
}
.ach.unlocked { opacity: 1; border-color: rgba(232,181,74,.55); background: linear-gradient(#2c2620, var(--panel)); }
.ach.secret { border-style: dashed; }
.ach-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #1a1719; color: #5a5052; border: 1px solid var(--line); }
.ach.unlocked .ach-icon { color: #2a1c05; background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 60%, var(--gold-deep)); border-color: var(--gold-deep); }
.ach-icon svg { width: 20px; height: 20px; }
.ach-text { display: flex; flex-direction: column; min-width: 0; }
.ach-text strong { font-size: 13px; }
.ach-desc { color: var(--muted); font-size: 12px; }
.ach-date { color: var(--gold); font-size: 11px; }
.ach-date:empty { display: none; }
.ach-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.04); }
.ach-progress span { display: block; height: 100%; width: 0; background: var(--gold-deep); }

/* achievement toast and sparkles */
.toast-achievement { border-left-color: var(--gold-2); background: linear-gradient(110deg, #3a2f1c, #221c16 60%); }
.toast-achievement .toast-icon { color: #2a1c05; background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 60%, var(--gold-deep)); }
.sparkle {
  position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--gold-2); box-shadow: 0 0 8px var(--gold);
}

/* statistics */
.dialog-wide { width: min(940px, calc(100vw - 24px)); }
.stats-body { overflow-y: auto; padding: 0 18px 18px; overscroll-behavior: contain; }
.stats-body h3 { font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .15em; color: var(--muted); margin: 14px 0 8px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.stat-card span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stat-card b { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--text); }
.stats-chart { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px; }
.stats-chart svg { display: block; width: 100%; height: auto; }
.stats-chart .empty-note { border: 0; padding: 26px 12px; }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.chart-dot { fill: var(--gold-2); }
.chart-grid { stroke: #3a3236; stroke-dasharray: 4 5; }
.chart-axis { stroke: #4a3d2b; }
.chart-label { fill: var(--muted); font: 11px var(--body); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #2c262a; white-space: nowrap; }
.stats-table thead th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: var(--panel); }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.stats-table .num { text-align: right; }
.stats-table tbody th { font-weight: 600; }
.stat-b { display: inline-flex; align-items: center; gap: 8px; }
.stat-b svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.share { min-width: 130px; }
.share-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; margin-right: 6px; }
.share-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.share-pct { color: var(--muted); font-size: 12px; }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.stat-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 11px; border-bottom: 1px solid #2c262a; font-size: 13px; }
.stat-list li:last-child { border-bottom: 0; }
.stat-list span { color: var(--muted); }
.stat-list b { font-variant-numeric: tabular-nums; text-align: right; }

/* prestige */
.top-btn .pending { color: var(--good); }
.top-btn .pending:empty { display: none; }
.legacy-line { color: #d9a5e0; font-size: 12px; text-align: center; margin-top: -10px; }
.seal-cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.seal-cards small { color: var(--good); font-size: 12px; }
.stat-card.highlight { border-color: rgba(232,181,74,.55); background: linear-gradient(#2c2620, var(--panel)); }
.stat-card.highlight b { color: var(--gold-2); font-size: 22px; }
.next-seal { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.plain-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.plain-list li { padding: 7px 11px 7px 30px; border-bottom: 1px solid #2c262a; font-size: 13px; position: relative; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list li::before { position: absolute; left: 11px; font-weight: 700; }
.resets li::before { content: '↺'; color: var(--bad); }
.keeps li::before { content: '✓'; color: var(--good); }
.prestige-after { margin: 12px 0 0; font-size: 13px; color: var(--text); }
.prestige-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.prestige-reason { color: var(--muted); font-size: 12px; }
.prestige-reason:empty { display: none; }
.big-btn {
  padding: 10px 18px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 15px;
  background: linear-gradient(var(--gold-2), var(--gold)); color: #2a1c05; box-shadow: 0 2px 0 var(--gold-deep);
}
.big-btn:hover { filter: brightness(1.06); }
.big-btn:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.6); }
.big-btn.danger { background: linear-gradient(#f0907e, var(--bad)); color: #2a0c05; box-shadow: 0 2px 0 #7a3428; }
.ghost-btn { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); cursor: pointer; }
.ghost-btn:hover { border-color: var(--muted); }
.prestige-confirm { margin-top: 14px; padding: 14px; border: 1px solid #7a3428; border-radius: 12px; background: #2a1b1a; }
.prestige-confirm p { font-size: 14px; }
.h3-note { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.legacy-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.legacy-card {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid #523a5a; border-radius: 10px; background: linear-gradient(#2a2130, var(--panel)); opacity: .75;
}
.legacy-card.affordable { opacity: 1; border-color: #d9a5e0; }
.legacy-card.maxed { opacity: .55; cursor: default; }
.legacy-top { display: flex; justify-content: space-between; gap: 8px; }
.legacy-top strong { font-size: 14px; }
.legacy-level { color: #d9a5e0; font-size: 12px; }
.legacy-desc { color: var(--muted); font-size: 12px; }
.legacy-cost { color: var(--gold-2); font-weight: 700; font-size: 13px; }
.legacy-card.maxed .legacy-cost { color: var(--muted); }
