:root {
  --bg: #1d1020;
  --bg2: #2a1730;
  --card: #34203b;
  --line: #4c3355;
  --ink: #fbeff5;
  --muted: #c2a9c6;
  --accent: #ff5d8f;
  --accent2: #ffb347;
  --gold: #f4c95d;
  --good: #6fdc9b;
  --bad: #ff7a6b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.primary { background: var(--accent); color: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 600; }
.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 16px; }
.danger { background: #5a2330; color: #ffd0d0; }

/* Start */
.screen { padding: 12px; }
.start-card { background: var(--card); border-radius: 20px; padding: 22px; margin-top: 24px; text-align: center; }
.face { background: #2a1730 url(carmen.webp) no-repeat; background-size: 520% auto; background-position: 57% 4%; }
.start-photo { display: inline-block; width: 120px; height: 120px; object-fit: cover; object-position: 50% 8%; border-radius: 50%; border: 3px solid var(--gold); }
.start-card h1 { margin: 12px 0 4px; font-size: 26px; }
.start-card h2 { margin: 4px 0 10px; color: var(--gold); }
.start-card label { display: block; text-align: left; margin-top: 18px; font-size: 13px; color: var(--muted); }
.start-card input { width: 100%; margin-top: 6px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); font-size: 16px; }
.swatches { display: flex; gap: 10px; justify-content: center; }
.swatches button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; }
.swatches button.on { border-color: var(--gold); }
.trait { background: var(--bg2); padding: 10px; border-radius: 10px; }

/* HUD */
.hud { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 10px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.gains { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gains small { font-size: 13px; color: var(--muted); font-weight: 500; }
.rate { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hud-side { display: flex; gap: 6px; align-items: center; }
.pill { background: var(--card); border-radius: 999px; padding: 5px 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.icon { background: var(--card); width: 34px; height: 34px; border-radius: 50%; font-size: 17px; }

/* Coach */
.coach { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.coach-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 8%; border: 2px solid var(--gold); flex: none; }
.bubble { background: var(--card); border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 14px; min-height: 46px; flex: 1; }
.bubble b { display: block; font-size: 12px; color: var(--gold); }
.bubble.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.96); opacity: .4; } 100% { transform: none; opacity: 1; } }

/* Stage */
.stage { position: relative; background: radial-gradient(ellipse at 50% 30%, #4a2650 0%, var(--bg2) 70%); border-radius: 20px; padding: 10px 14px 14px; overflow: hidden; }
#lifter { height: 250px; display: flex; justify-content: center; }
#lifter svg { height: 100%; overflow: visible; }
#lifter.flex svg { animation: flex .25s ease; }
@keyframes flex { 50% { transform: scale(1.04); } }
#floaters { position: absolute; inset: 0; pointer-events: none; }
.floater { position: absolute; font-weight: 700; color: var(--gold); animation: up 1s ease-out forwards; text-shadow: 0 1px 3px #000; }
@keyframes up { to { transform: translateY(-60px); opacity: 0; } }
.rec { margin: 6px 0 10px; }
.rec-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bar { height: 10px; background: #1a0d1d; border-radius: 99px; overflow: hidden; margin-top: 4px; }
#rec-fill { height: 100%; background: linear-gradient(90deg, var(--good), #9ff0c0); width: 100%; transition: width .2s; }
#rec-fill.low { background: linear-gradient(90deg, var(--bad), #ffa89c); }
.train { width: 100%; background: linear-gradient(180deg, var(--accent), #e2386d); border-radius: 16px; padding: 14px; box-shadow: 0 4px 0 #9e2149; user-select: none; }
.train:active { transform: translateY(3px); box-shadow: 0 1px 0 #9e2149; }
.train.tired { background: var(--line); box-shadow: 0 4px 0 #2a1730; }
.train-top { display: block; font-size: 19px; font-weight: 700; }
.train-sub { display: block; font-size: 13px; opacity: .85; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 12px 0 8px; position: sticky; top: 52px; background: var(--bg); z-index: 4; padding: 4px 0; }
.tabs button { flex: 1; background: var(--card); padding: 9px 0; border-radius: 10px; font-size: 14px; color: var(--muted); }
.tabs button.on { background: var(--accent); color: #fff; font-weight: 600; }
.tabs button.locked { opacity: .45; }
.tabs button.dot::after { content: "•"; color: var(--gold); margin-left: 3px; }
.panel { padding-bottom: 40px; }

/* Rows */
.item { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .name small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.item .desc { font-size: 12.5px; color: var(--muted); }
.item .buy { min-width: 92px; text-align: center; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 6px; font-weight: 600; font-size: 13.5px; line-height: 1.15; }
.item .buy:disabled { background: var(--line); color: var(--muted); cursor: default; }
.item .buy small { display: block; font-weight: 400; font-size: 11.5px; opacity: .85; }
.item.lockedrow { opacity: .5; }
.lvl { display: inline-block; background: var(--bg2); border-radius: 6px; padding: 1px 7px; font-size: 12px; margin-left: 6px; color: var(--gold); }
.section-h { margin: 16px 2px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Shows */
.divs { display: flex; gap: 6px; }
.divs button { flex: 1; background: var(--card); border-radius: 12px; padding: 10px 4px; }
.divs button.on { outline: 2px solid var(--gold); }
.divs small { display: block; color: var(--muted); font-size: 11.5px; }
.showbox { background: var(--card); border-radius: 16px; padding: 14px; margin-top: 10px; }
.showbox h3 { margin: 0 0 4px; }
.score-bar { height: 14px; background: #1a0d1d; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--gold)); }
.ladder { display: flex; gap: 4px; margin: 10px 0; }
.ladder span { flex: 1; text-align: center; font-size: 11px; padding: 6px 2px; border-radius: 8px; background: var(--bg2); color: var(--muted); }
.ladder span.won { background: #4b3a14; color: var(--gold); }
.ladder span.next { outline: 1px solid var(--gold); color: var(--ink); }
.balance { display: grid; grid-template-columns: 72px 1fr 1fr; gap: 4px 8px; font-size: 12px; align-items: center; margin-top: 8px; }
.balance .b { height: 7px; border-radius: 9px; background: #1a0d1d; position: relative; overflow: hidden; }
.balance .b i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 9px; }
.balance .b.want i { background: var(--muted); }

/* Story / DNA cards */
.card { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.card .yr { color: var(--gold); font-size: 12px; font-weight: 600; }
.card h4 { margin: 2px 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card.locked { opacity: .45; }
.quote { border-left: 3px solid var(--gold); padding-left: 10px; font-style: italic; }

/* Modal + dev */
.modal, .dev { position: fixed; inset: 0; background: rgba(10, 4, 12, .75); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal-card, .dev-card { background: var(--card); border-radius: 20px; padding: 20px; max-width: 420px; width: 100%; text-align: center; }
.modal-card h2 { margin: 6px 0; color: var(--gold); }
.modal-card .big-n { font-size: 30px; font-weight: 700; }
.dev-card { text-align: left; }
.dev-card h3 { margin: 0 0 4px; }
.row { display: flex; gap: 6px; }
.row button { flex: 1; background: var(--bg2); border-radius: 10px; padding: 10px; }
.row button.on { background: var(--accent); color: #fff; }
.dev-card .primary { width: 100%; margin-top: 12px; }
