:root {
  --paper: #f4efe3; --card: #fffaf0; --ink: #14201a; --soft: #5b6b61; --line: #ddd3bf;
  --bill: #123d2b; --green: #2f9e5f; --red: #c2412d; --gold: #d9a441;
  --serif: 'Fraunces', Georgia, serif; --sans: 'Work Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--sans); }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
a { color: var(--bill); }
button { font: inherit; cursor: pointer; }
.loading { padding: 40px 16px; text-align: center; color: var(--soft); }
.caps { font: 600 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }

/* HOME */
.hero { background: var(--bill); color: var(--paper); margin: 0 -16px; padding: 34px 16px 30px; position: relative; overflow: hidden; }
.hero .caps { color: #9fc6ad; }
.hero h1 { font: 800 clamp(58px, 17vw, 132px)/.86 var(--serif); margin: 14px 0 16px; letter-spacing: -.03em; }
.hero h1 span { color: var(--gold); display: block; }
.hero p { font-size: 19px; max-width: 30ch; margin: 0 0 20px; color: #e3eadf; }
.bill-mark { position: absolute; right: -40px; top: 26px; width: 210px; height: 110px; border: 3px solid #2c6648; border-radius: 12px; transform: rotate(-12deg); opacity: .55; }
.bill-mark::after { content: '$'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 64px var(--serif); color: #2c6648; }
.ask { display: flex; gap: 0; background: var(--paper); border-radius: 14px; padding: 5px; position: relative; z-index: 1; }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; font: 500 18px var(--sans); padding: 12px; color: var(--ink); outline: none; }
.ask button { border: 0; background: var(--green); color: #fff; border-radius: 10px; padding: 0 16px; font-weight: 700; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.chip { text-decoration: none; border: 1.5px solid #3d7a59; background: transparent; color: var(--paper); border-radius: 99px; padding: 7px 13px; font-size: 15px; }
.results { margin-top: 12px; position: relative; z-index: 1; }
.results a { display: block; background: var(--paper); color: var(--ink); text-decoration: none; padding: 12px 14px; border-radius: 10px; margin-top: 6px; font-weight: 600; }
.results .none { color: #e3eadf; }

.play { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); border-radius: 18px; padding: 22px 20px; margin: 22px 0 8px; text-decoration: none; }
.play b { display: block; font: 800 40px/1 var(--serif); color: var(--gold); letter-spacing: -.02em; }
.play span { color: #c9d3cc; font-size: 15px; }
.play .go { background: var(--gold); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-weight: 700; }

.group { margin-top: 26px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.tile b { display: block; font: 700 18px/1.25 var(--sans); }
.tile span { display: block; margin-top: 4px; font-size: 14px; color: var(--soft); }

/* TOPIC */
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
.top a { text-decoration: none; font-weight: 600; }
.hear { border: 1.5px solid var(--bill); background: transparent; color: var(--bill); border-radius: 99px; padding: 6px 14px; font-weight: 600; font-size: 15px; }
.t-head h1 { font: 800 clamp(38px, 10vw, 64px)/.98 var(--serif); margin: 8px 0 18px; letter-spacing: -.02em; }
.answer { background: var(--bill); color: var(--paper); border-radius: 18px; padding: 20px; }
.answer .caps { color: var(--gold); }
.answer p { font: 600 21px/1.4 var(--sans); margin: 8px 0 0; }
section.block { margin-top: 26px; }
section.block h2 { font: 800 26px/1.1 var(--serif); margin: 0 0 10px; }
.gb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gb > div { border-radius: 14px; padding: 14px 16px; }
.gb .g { background: #e3f1e6; } .gb .b { background: #f8e3dd; }
.gb ul { margin: 6px 0 0; padding-left: 18px; } .gb li { margin: 6px 0; font-size: 16px; }
.gb .caps { color: var(--green); } .gb .b .caps { color: var(--red); }
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 12px 12px 12px 52px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
ol.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--bill); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
summary { padding: 13px 16px; font-weight: 600; cursor: pointer; }
details p { margin: 0; padding: 0 16px 14px; }
.trap { border-left: 5px solid var(--red); background: #fbeee9; padding: 14px 16px; border-radius: 0 12px 12px 0; }
.trap .caps { color: var(--red); }
.trap p { margin: 4px 0 0; font-weight: 600; }
.sources a { display: inline-block; margin: 0 14px 6px 0; font-size: 15px; }
.next { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; }
.next a { flex: 1; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; color: var(--ink); }
.next a:last-child { text-align: right; }
.gamelink { display: block; margin-top: 12px; background: var(--ink); color: var(--gold); text-decoration: none; padding: 14px 16px; border-radius: 12px; font-weight: 700; }

/* TOOLS */
.tool { background: var(--card); border: 2px solid var(--bill); border-radius: 18px; padding: 18px; }
.tool label { display: block; font-size: 14px; font-weight: 600; color: var(--soft); margin-top: 10px; }
.tool .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tool input, .tool select { width: 100%; font: 600 18px var(--sans); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); margin-top: 4px; }
.out { margin-top: 16px; display: grid; gap: 8px; }
.out .big { font: 800 34px/1.1 var(--serif); color: var(--bill); }
.out .big.red { color: var(--red); }
.out .line { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.out .line span { flex: 1; } .out .line b { text-align: right; max-width: 55%; }
.out .say { font-weight: 600; }

/* GAME */
.g-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 6px; }
.g-top a { text-decoration: none; font-weight: 600; }
.g-title { font: 800 clamp(50px, 15vw, 96px)/.9 var(--serif); margin: 6px 0 4px; letter-spacing: -.03em; color: var(--bill); }
.owed { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 18px; margin-top: 12px; }
.owed .num { font: 800 clamp(46px, 13vw, 72px)/1 var(--serif); color: var(--gold); display: inline-block; }
.owed .caps { color: #9fb1a5; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 15px; color: #c9d3cc; }
.meta b { color: var(--paper); display: inline-block; }
.debts { margin-top: 14px; display: grid; gap: 8px; }
.debt { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.debt .hd { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; }
.debt .hd span { color: var(--soft); font-weight: 500; }
.bar { height: 10px; background: #eee5d3; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.debt.dead { opacity: .55; } .debt.dead .hd b { text-decoration: line-through; } .debt.dead .bar i { background: var(--green); }
.event { background: var(--card); border: 2px solid var(--bill); border-radius: 18px; padding: 18px; margin-top: 16px; }
.event h2 { font: 800 28px/1.1 var(--serif); margin: 4px 0 6px; }
.event p { margin: 0 0 12px; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); }
.choice b { display: block; font-size: 17px; }
.choice span { display: block; font-size: 14px; color: var(--soft); margin-top: 2px; }
.choice .proj { color: var(--bill); font-weight: 600; margin-top: 6px; }
.choice .proj.bad { color: var(--red); }
.choice:disabled { opacity: .45; cursor: not-allowed; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { border: 0; background: var(--bill); color: var(--paper); border-radius: 12px; padding: 13px 18px; font-weight: 700; font-size: 17px; }
.btn.alt { background: transparent; color: var(--bill); border: 2px solid var(--bill); }
.btn.gold { background: var(--gold); color: var(--ink); }
.learn { font-size: 15px; font-weight: 600; }
.ledger { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; }
.ledger .l { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.ledger .l:last-child { border: 0; }
.l.k-in b { color: var(--green); } .l.k-bad b, .l.k-bad { color: var(--red); } .l.k-attack { font-weight: 700; } .l.k-attack b { color: var(--green); } .l.k-save b { color: #a77a1f; }
.ledger .caps { padding: 6px 0 4px; }
.plan { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.plan button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.plan button.on { background: var(--bill); color: var(--paper); border-color: var(--bill); }
.truth { margin-top: 12px; font-weight: 600; }
.truth.bad { color: var(--red); }
.win { text-align: center; padding: 40px 10px 10px; }
.win .caps { color: var(--green); }
.win h1 { font: 800 clamp(64px, 19vw, 140px)/.85 var(--serif); margin: 12px 0; color: var(--bill); letter-spacing: -.03em; }
.win .stat { font: 800 30px var(--serif); }
.win .vs { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 18px 0; text-align: left; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.foot { max-width: 760px; margin: 0 auto; padding: 20px 16px 90px; font-size: 14px; color: var(--soft); border-top: 1px solid var(--line); }
.foot p { margin: 6px 0; }
@media (max-width: 520px) { .gb { grid-template-columns: 1fr; } .play { grid-template-columns: 1fr; } }
.vs .line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.vs .line:last-child { border: 0; } .vs .line b { text-align: right; }

/* SWAP TEST */
.play.swap { background: var(--bill); margin-top: 0; } .play.swap b { color: var(--paper); }
.save-all { margin-top: 12px; } .big-save { font: 800 30px/1.1 var(--serif); color: var(--gold); display: inline-block; }
.empty { color: var(--soft); }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.item-hd { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--soft); padding: 0 4px; }
.item-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 15px; color: var(--soft); }
.item-edit label { display: flex; align-items: center; gap: 4px; }
.item-edit input { width: 76px; font: 600 16px var(--sans); padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.item-edit input[data-f="times"] { width: 54px; }
.item-edit select { font: 600 16px var(--sans); padding: 6px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
.item-edit .yr { margin-left: auto; font-weight: 700; color: var(--red); font-size: 17px; }
.swap-card { margin-top: 10px; background: #e3f1e6; border-radius: 12px; padding: 12px 14px; }
.swap-card .caps { color: var(--green); } .swap-card b { font-size: 18px; display: block; margin-top: 2px; }
.swap-card p { margin: 6px 0 0; font-size: 15px; } .swap-card .give { color: var(--soft); }
.swap-num { font: 800 22px var(--serif); color: var(--bill); margin-top: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.qchip { border: 1.5px solid var(--bill); background: transparent; color: var(--bill); border-radius: 99px; padding: 7px 12px; font-size: 15px; font-weight: 600; }
.add { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.add > input, .add input, .add select { width: 100%; font: 600 16px var(--sans); padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; margin-top: 4px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 8px 0 10px; }
.row3 label { font-size: 14px; font-weight: 600; color: var(--soft); }
.small { font-size: 14px; color: var(--soft); } .linkbtn { border: 0; background: none; color: var(--red); padding: 0; text-decoration: underline; }
