/* DM Sans and Space Grotesk are linked from each page's head, where they load
   beside the page instead of holding up its first paint. */
.input-wrap{display:block}
.investment-choice{border:0;padding:0;margin:0 0 22px;min-width:0}
.investment-choice legend{font-size:12px;font-weight:500;margin-bottom:10px}
.investment-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.investment-options label{position:relative;cursor:pointer}
.investment-options input{position:absolute;opacity:0;width:1px;height:1px}
.investment-options span{display:block;text-align:center;border:1px solid var(--line);background:var(--white);padding:15px 8px;border-radius:10px;font-size:13px}
.investment-options input:checked+span{background:#e7f2e0;border-color:#25632f;box-shadow:inset 0 0 0 1px #25632f;color:#25632f}
.investment-options input:focus-visible+span{outline:3px solid var(--ink);outline-offset:3px}
.direction-choice{border:0;padding:0;margin:0 0 22px;min-width:0}
.direction-choice legend{font-size:12px;font-weight:500;margin-bottom:10px}
.direction-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.direction-buttons button{height:54px;border:2px solid transparent;border-radius:10px;font-size:30px;font-weight:600;line-height:1}
.direction-gain{background:#e7f2e0;color:#25632f}
.direction-loss{background:#fbe5e2;color:#a32c2c}
.direction-gain[aria-pressed=true]{border-color:#25632f;box-shadow:0 0 0 1px #25632f}
.direction-loss[aria-pressed=true]{border-color:#a32c2c;box-shadow:0 0 0 1px #a32c2c}
.direction-buttons button:focus-visible{outline:3px solid var(--ink);outline-offset:4px}
.type-icon.space-art{background:transparent;border-radius:0;padding:0}
.space-art svg{display:block;width:100%;height:100%;overflow:hidden}
#roll-dialog>.space-art{width:88px;height:88px;margin:10px 0 16px}
.history-row .space-art{width:40px;height:40px;flex-shrink:0}
.charity-control{margin-top:18px;border-top:1px solid var(--line);padding-top:18px}
.charity-status{margin:0;color:var(--deep);font-size:13px;font-weight:600}
.charity-control .form-caption{margin-bottom:0}
main>.escape:first-child{margin-top:0}
.dice-shortcuts .die-face{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;width:32px;height:32px;margin:auto}
.die-pip{display:block;background:var(--deep);border-radius:50%}
.die-pip.empty{visibility:hidden}
.dice-shortcuts button[data-die]{min-height:58px;padding:12px 4px;border-radius:10px}
.dice-shortcuts button[data-die]:active{transform:scale(.96)}
.dice-prompt{font-size:13px;margin:0}
.dice-panel+.turn-tools{margin-bottom:16px}
.dice-panel{background:var(--white);border:1px solid var(--line);border-radius:16px;padding:25px;margin-top:20px}
.dice-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.dice-heading h2{font-size:24px;margin-bottom:16px}
.dice-heading .eyebrow{margin-bottom:7px}
.dice-symbol{font-size:45px;color:var(--deep);transform:rotate(-10deg)}
.position-line{border-top:1px solid var(--line);padding:13px 0 18px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}
.text-button{border:0;background:none;padding:5px 0;color:var(--muted);font-size:11px}
.dice-entry{display:grid;grid-template-columns:1fr 1.4fr;gap:12px}
.dice-entry input{margin:0;text-align:center;font-family:'Space Grotesk',sans-serif;font-size:27px;padding:10px;min-width:0}
.dice-panel label.field{margin-bottom:10px}
.dice-shortcuts{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-top:13px}
.dice-shortcuts button{border:1px solid #d6dfcb;background:#edf2e4;border-radius:8px;padding:11px 5px;font-size:17px;font-family:'Space Grotesk',sans-serif}
.dice-shortcuts button:hover{background:var(--green);border-color:#809764}
.turn-tools{display:flex;align-items:center;justify-content:space-between;font-size:11px;margin:8px 3px 27px}
.turn-tools a{color:var(--muted)}
.passed-payday{background:#e7efdb;color:#405439;padding:12px;border-radius:8px;font-size:12px;margin-bottom:20px}
#roll-dialog{max-width:530px;max-height:90dvh;overflow-y:auto}
#roll-dialog .dialog-heading .eyebrow{margin-bottom:0}
#roll-dialog>.type-icon{margin:14px 0}
#roll-dialog .preview p+p{margin-top:7px}
#board-dialog{max-width:850px;max-height:90dvh;overflow-y:auto}
.physical-board{width:100%;height:auto;display:block;margin:16px 0}
.win-note{background:var(--green);padding:18px;border-radius:10px}
@media(max-width:700px){
  .dice-panel{padding:20px 17px}
  .dice-heading h2{font-size:22px}
  .dice-entry{grid-template-columns:1fr 1.4fr}
  .dice-panel .form-caption{line-height:1.65}
  .position-line{font-size:11px}
  .position-line button{font-size:10px}
}
.gender-picker{border:0;padding:0;margin:0 0 22px;min-width:0}
.gender-picker legend{font-size:12px;font-weight:500;margin-bottom:10px}
.gender-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gender-options label{position:relative;cursor:pointer}
.gender-options input{position:absolute;opacity:0;width:1px;height:1px}
.gender-options label>span{display:block;border:1px solid var(--line);border-radius:9px;padding:13px;font-size:13px}
.gender-options small{display:block;color:var(--muted);font-size:10px;margin-top:5px}
.gender-options input:checked+span{background:#edf2e4;border-color:#78905c;box-shadow:inset 0 0 0 1px #78905c}
.gender-options input:focus-visible+span{outline:3px solid #6b903e;outline-offset:3px}
.gender-picker p{margin:9px 0 0}
.player-chip{min-width:0}
/* A name is a name: it never breaks mid-word. Squeezed, it ends in an
   ellipsis; on a phone it drops to its own row instead (see the 700px block),
   because the language and settings buttons leave it no room beside them. */
.player-chip>bdi{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.player-chip>span{flex:0 0 auto;white-space:nowrap}
:root{--paper:#f5f4ee;--white:#fffefa;--ink:#252c27;--muted:#72776c;--line:#dfe1d6;--green:#cced91;--deep:#334b3b;--red:#a13c36;--radius:18px;font-family:'DM Sans',sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}
body{margin:0}
button,input,select{font:inherit}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
button:disabled{cursor:not-allowed;opacity:.45}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #6b903e;outline-offset:5px}
button{color:inherit}
h1,h2,h3,p{margin-top:0}
h1,h2,.brand{font-family:'Space Grotesk',sans-serif}
h1{font-size:36px;letter-spacing:-1.5px;font-weight:500;margin-bottom:10px}
h2{font-weight:500;letter-spacing:-.6px}
p{line-height:1.65}
.app-shell{min-height:100vh;display:grid;grid-template-columns:248px minmax(0,1fr)}
.sidebar{border-right:1px solid var(--line);padding:42px 25px 24px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{font-size:44px;font-weight:700;letter-spacing:-3px;line-height:1;display:block;padding:0 13px}
.brand-caption{display:block;font-family:'DM Sans',sans-serif;font-size:9px;font-weight:600;letter-spacing:2.15px;margin-top:14px}
.session-label{font-size:10px;letter-spacing:1.5px;color:var(--muted);margin:64px 12px 18px;display:flex;align-items:center;gap:8px}
.live-dot{width:6px;height:6px;background:#648751;border-radius:50%;display:inline-block;flex-shrink:0}
nav a{display:flex;align-items:center;gap:12px;font-size:13px;padding:15px 14px;border-radius:9px;margin-bottom:6px}
nav a.active{background:#e7ebdb;font-weight:650}
nav a>span:first-child{font-size:21px;line-height:1}
nav a .nav-arrow{margin-left:auto;font-size:16px}
.count{margin-left:auto;font-size:10px;background:#e3e5dd;padding:3px 7px;border-radius:5px}
.table-note{margin-top:auto;padding:35px 13px 32px}
.table-note p{font-size:13px;line-height:1.6;margin:19px 0 14px}
.table-note>span{font-size:8px;letter-spacing:1.7px;color:var(--muted)}
.board-mark{display:grid;grid-template-columns:16px 16px;gap:4px;transform:rotate(-9deg);width:36px}
.board-mark i{height:16px;border:1.5px solid #6d7f63;border-radius:4px}
.board-mark i:nth-child(2){background:var(--green);border-color:var(--green)}
.saved{border-top:1px solid var(--line);padding:20px 12px 0;margin-top:14px;font-size:10px;color:var(--muted);display:flex;gap:7px;align-items:center}
main{max-width:1190px;width:100%;margin:0 auto;padding:40px 64px 48px}
.topline{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:25px;font-size:10px;letter-spacing:1.8px;color:var(--muted);margin-bottom:40px}
.player-chip{display:flex;align-items:center;gap:10px;color:var(--ink);letter-spacing:0;font-size:12px}
/* Language and settings stay together at the end of the header, so a long
   player name wraps instead of pushing either of them off a phone screen. */
.header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.avatar{border-radius:50%;background:#e9ddc8;width:30px;height:30px;display:grid;place-items:center;font-size:14px}
.title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:28px}
.title-row p{color:var(--muted);font-size:14px;margin-bottom:0}
.phase{display:flex;align-items:center;gap:7px;border:1px solid #d4dbc9;border-radius:30px;padding:8px 12px;font-size:10px;white-space:nowrap;margin-top:10px}
.phase .live-dot{background:#96ae6b}
.stat{border-radius:var(--radius);padding:28px 30px;min-height:215px;position:relative}
.currency{font-family:'DM Sans',sans-serif;font-size:11px;letter-spacing:.5px;margin-left:7px;opacity:.65;font-weight:500}
.math{font-size:12px;line-height:1.8;border-top:1px solid #ffffff30;margin-top:18px;padding-top:12px}
.math-line{display:flex;justify-content:space-between;gap:15px}
.math-line.total{font-weight:700;border-top:1px solid currentColor;margin-top:6px;padding-top:6px}
.negative{color:var(--red)}
.escape{margin:22px 0 28px;border:1px solid var(--line);padding:21px 24px;border-radius:13px;background:#fafaf5}
.escape-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px}
.escape-name{display:flex;gap:10px;align-items:center;font-weight:600}
.escape-name span{font-size:17px}
.escape-heading>span{color:var(--muted);font-size:10px}
.track{height:5px;background:#e5e7dc;border-radius:8px;margin:16px 0 11px;overflow:hidden}
.track>div{background:#7c9c58;height:100%;border-radius:8px}
.escape-bottom{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:10px}
.escape-bottom strong{color:#566e42;font-weight:500}
.empty-note{padding:26px 0;border-top:1px solid var(--line);display:flex;align-items:center;gap:17px}
.empty-icon{width:41px;height:41px;display:grid;place-items:center;border:1px dashed #b8c1a9;border-radius:50%;font-size:20px;color:#738566}
.empty-note p{font-size:12px;margin:0 0 3px}
.empty-note small{font-size:10px;color:var(--muted)}
summary{cursor:pointer;list-style:none}
summary::-webkit-details-marker{display:none}
.page-footer{margin-top:34px;padding-top:17px;border-top:1px solid var(--line);display:flex;justify-content:space-between;font-size:9px;color:var(--muted)}
.page-footer span:last-child{letter-spacing:1px}
.back{border:0;background:none;padding:0;color:var(--muted);font-size:12px;margin-bottom:23px}
.eyebrow{font-size:10px;letter-spacing:1.6px;color:var(--muted);margin-bottom:13px}
.picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.type-card{background:var(--white);border:1px solid var(--line);border-radius:12px;padding:21px;text-align:left;min-height:143px;transition:border-color .15s,transform .15s}
.type-card:hover{border-color:#92ad72;transform:translateY(-2px)}
.type-icon{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:#eaf0de;color:#546e43;font-size:21px;margin-bottom:18px}
.type-card:nth-child(3n+2) .type-icon{background:#f0e6d9;color:#8f6a41}
.type-card:nth-child(3n) .type-icon{background:#e6eae9;color:#526e69}
.type-card strong{display:block;font-size:13px;font-weight:600}
.type-card small{display:block;color:var(--muted);font-size:10px;margin-top:6px;line-height:1.5}
.form-box{background:var(--white);padding:28px;border:1px solid var(--line);border-radius:var(--radius)}
label.field{display:block;font-size:12px;font-weight:500;margin-bottom:21px}
input,select{display:block;width:100%;border:1px solid #d8dbce;border-radius:8px;padding:14px;margin-top:9px;background:#fffefa;color:var(--ink);outline:none}
input:focus,select:focus{border-color:#7e9a60;box-shadow:0 0 0 3px #a1c67925}
input[type=file]{padding:0;border:0;width:1px;height:1px;opacity:0;position:absolute}
.file-label:focus-within{outline:3px solid #6b903e;outline-offset:3px}
.input-wrap{position:relative}
.input-wrap input{padding-right:52px}
.input-wrap>span{position:absolute;right:15px;top:17px;font-size:11px;color:var(--muted)}
.muted{color:var(--muted);font-size:13px}
.small{font-size:11px}
.preview{background:#edf2e4;border-radius:10px;padding:20px;margin-top:10px}
.preview-label{font-size:10px;color:var(--muted)}
.preview-value{font-family:'Space Grotesk',sans-serif;font-size:29px;letter-spacing:-1px;margin:7px 0}
.preview p{margin:0;font-size:11px;color:#626d56}
.primary,.secondary,.danger-button{border:0;border-radius:8px;padding:13px 18px;font-size:12px;font-weight:500}
.primary{background:var(--ink);color:white}
.primary:hover{background:#40533d}
.secondary{border:1px solid var(--line);background:var(--white)}
.danger-button{color:var(--red);background:#f8e9e1}
.wide{display:block;width:100%;margin-top:12px;text-align:center}
.form-caption{text-align:center;margin:16px 0 0;font-size:10px;color:var(--muted)}
.error{font-size:12px;color:var(--red);margin:12px 0 0;line-height:1.5}
.undo-banner{display:flex;align-items:center;justify-content:space-between;background:#e9eddf;padding:17px 20px;border-radius:10px;font-size:12px;gap:12px;margin-bottom:25px}
.undo-banner p{margin:0;font-size:11px;color:var(--muted)}
.undo-banner button{white-space:nowrap}
.history-row{border-bottom:1px solid var(--line)}
.history-row summary{padding:20px 0;display:flex;gap:14px;align-items:center}
.history-row .type-icon{margin:0;flex-shrink:0;width:38px;height:38px;font-size:19px}
.history-main{flex:1;min-width:0}
.history-main strong{font-size:12px;font-weight:500;display:block;overflow-wrap:anywhere}
.history-main small{display:block;color:var(--muted);font-size:10px;margin-top:5px}
.history-amount{text-align:right;font-family:'Space Grotesk',sans-serif;font-size:15px;flex-shrink:0}
.history-amount small{display:block;font-family:'DM Sans',sans-serif;color:var(--muted);font-size:9px;margin-top:5px}
.history-detail{padding:0 0 20px 52px;font-size:11px;color:var(--muted);line-height:1.9}
.history-detail dl{display:grid;grid-template-columns:1fr 1fr;margin:10px 0}
.history-detail dd{text-align:right;margin:0;overflow-wrap:anywhere}
.history-detail dt{margin:0}
.history-detail p{margin:4px 0}
.welcome{max-width:560px;margin:20px auto}
.welcome .type-icon{width:50px;height:50px;font-size:28px;margin-bottom:23px}
.welcome h1{font-size:39px}
.welcome>p{margin-bottom:28px}
.mobile-nav{display:none}
dialog{border:1px solid var(--line);border-radius:18px;max-width:460px;width:calc(100% - 32px);padding:28px;background:var(--paper);color:var(--ink);box-shadow:0 30px 100px #18211b33}
dialog::backdrop{background:#18211b70;backdrop-filter:blur(3px)}
dialog h2{font-size:24px}
dialog p{font-size:13px}
.dialog-heading{display:flex;align-items:center;justify-content:space-between}
.dialog-heading h2{margin:0}
.icon-button{background:none;border:0;font-size:28px;padding:4px 8px;min-width:44px;min-height:44px}
.button-row{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}
hr{border:0;border-top:1px solid var(--line);margin:24px 0}
#toast{position:fixed;bottom:28px;left:50%;transform:translate(-50%,20px);border-radius:10px;background:var(--ink);color:white;padding:14px 23px;font-size:12px;box-shadow:0 6px 25px #2222;opacity:0;pointer-events:none;transition:.2s;z-index:5;max-width:90vw}
#toast.visible{opacity:1;transform:translate(-50%,0)}
[hidden]{display:none!important}
@media(min-width:1450px){
  main{padding-top:48px}
  .stat{min-height:240px;padding:32px}
}
@media(max-width:1100px){
  .app-shell{grid-template-columns:205px minmax(0,1fr)}
  .sidebar{padding:35px 18px 22px}
  main{padding:32px}
  .stat{padding:24px}
  .picker{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .app-shell{display:block}
  .sidebar{display:none}
  main{padding:24px 20px 95px}
  .topline{padding-bottom:18px;margin-bottom:28px;font-size:9px}
  .topline>span{letter-spacing:1.2px}
  .topline>span:before{content:'felosy / ';font-weight:700;color:var(--ink)}
  h1{font-size:30px}
  .title-row{margin-bottom:24px}
  .title-row p{font-size:12px}
  .phase{font-size:9px;padding:7px 9px}
  .stat{padding:19px 17px;min-height:181px;border-radius:13px}
  .currency{display:block;margin:7px 0 0;font-size:9px}
  .escape{padding:19px 17px;margin:17px 0 20px}
  .escape-heading{font-size:11px}
  .escape-heading>span{font-size:9px}
  .escape-bottom{font-size:9px}
  .mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;background:#f5f4eef5;border-top:1px solid var(--line);backdrop-filter:blur(12px);align-items:center;justify-content:space-around;padding:17px 15px max(17px,env(safe-area-inset-bottom));font-size:12px;z-index:3}
  .picker{gap:10px}
  .type-card{padding:17px;min-height:135px}
  .form-box{padding:22px}
  .welcome{margin-top:0}
  .welcome h1{font-size:35px}
  .math-line{display:block}
  .math-line span{display:block}
  .math{font-size:10px}
  .history-row summary{gap:10px}
  .history-main strong{font-size:11px}
  .history-amount{font-size:13px}
  .history-detail{padding-left:0}
  .undo-banner{padding:15px}
  .undo-banner .secondary{padding:11px}
  .page-footer{font-size:8px}
  #toast{bottom:82px}
}
@media(prefers-reduced-motion:reduce){
  *{transition:none!important;scroll-behavior:auto!important}
}
.cash-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.cash-actions button{min-height:48px;flex:1;border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--white);font-weight:600}
.cash-actions [data-cash=gain]{color:#255832;background:#e8f2e3}
.cash-actions [data-cash=loss]{color:#962f2b;background:#f9e9e5}
.cash-actions button:disabled{opacity:.45;cursor:default}
.cash-amount{font-size:28px;font-weight:700;text-align:center}
#cash-dialog summary{padding:12px 0}
.turn-home{max-width:680px;margin:auto}
.turn-home .topline{margin-bottom:8px;padding-bottom:12px}
.turn-zone{font-size:12px;color:var(--muted);margin:8px 0}
.cash-score{padding:22px 24px;border-radius:18px;background:var(--deep);color:#fff}
.cash-score h1{font:500 16px 'DM Sans',sans-serif;letter-spacing:0;margin:0 0 12px}
.cash-score>strong{display:block;font-size:clamp(36px,6vw,64px);line-height:1.12;letter-spacing:-2px;overflow-wrap:anywhere}
.cash-score>strong small{font-size:13px;letter-spacing:0}
.flow-score{display:flex;align-items:center;gap:12px;margin-top:20px;padding-top:14px;border-top:1px solid #ffffff40;font-size:13px}
.flow-score b{margin-inline-start:auto;font-size:22px;white-space:nowrap}
.statement-link{display:inline-block;padding:12px 0;font-size:14px;text-decoration:underline;text-underline-offset:4px}
.turn-home .dice-panel{margin-top:8px;padding:18px}
.turn-home .dice-heading{padding-bottom:10px;margin-bottom:10px}
.turn-home .dice-heading h2{font-size:22px}
.turn-home .dice-heading .eyebrow{display:none}
.turn-home .position-line{margin-bottom:10px}
.turn-home .dice-shortcuts{gap:6px}
.turn-home .cash-actions{margin-bottom:0}
.turn-home .cash-actions button{font-size:13px}
.turn-home .form-caption{font-size:12px}
.statement-section{padding:20px 0;border-bottom:1px solid var(--line)}
.statement-section h2{font-size:22px}
.statement-line{display:flex;justify-content:space-between;gap:20px;padding:10px 0;font-size:15px}
.statement-line strong{white-space:nowrap}
.statement-total{border-top:1px solid var(--line);margin-top:10px}
.statement-flow{font-size:32px}
.holding-cards{display:flex;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;padding:6px 2px 16px}
.holding-card{flex:0 0 240px;padding:20px;border:1px solid #d9c181;border-radius:14px;background:#fff6d9;scroll-snap-align:start}
.holding-card h3{font-size:18px;overflow-wrap:anywhere}
.holding-card p{font-size:14px;line-height:1.7}
.holding-card>span{font-size:22px}
.loan-card{background:#f9e9e5;border-color:#e5b6ae}
body[data-zone=safe]{--deep:#49335e;--green:#dfc8ef}
.turn-home button{touch-action:manipulation}
@media(max-width:700px){
  .turn-home .cash-score{padding:18px}
  .turn-home .cash-score>strong{font-size:clamp(32px,9vw,54px)}
  .turn-home .flow-score{gap:6px}
  .turn-home .flow-score b{font-size:21px}
  .turn-home .cash-actions{gap:5px}
  .turn-home .cash-actions button{padding:10px 6px}
  .turn-home .dice-panel{padding:14px}
  .turn-home .dice-heading h2{font-size:20px}
  .statement-line{font-size:14px}
  .holding-card{flex-basis:220px}
}
.money-field{margin-bottom:21px;font-size:14px;font-weight:500}
.number-entry{display:flex;align-items:center;gap:8px;margin-top:9px}
.number-entry .input-wrap{flex:1;min-width:0}
.number-entry input{margin:0;text-align:center;font-size:20px;padding:14px 46px 14px 8px}
.number-entry>button{flex:0 0 48px;min-height:52px;border:1px solid var(--line);border-radius:10px;background:var(--white);font-size:24px;touch-action:none;user-select:none}
.amount-shortcuts{display:flex;gap:8px;margin-top:8px}
.amount-shortcuts button{min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:8px;background:var(--white);font-size:14px;touch-action:none;user-select:none}
.amount-shortcuts button:last-child{margin-inline-start:auto}
.number-entry button:active,.amount-shortcuts button:active{background:var(--green)}
.milestone{text-align:center;max-width:600px;margin:auto;padding:32px 20px}
.milestone h1{font-size:clamp(30px,5vw,44px);line-height:1.15}
.milestone p{font-size:16px;line-height:1.6}
.milestone .space-art{width:160px;height:110px;margin:0 auto 24px}
.milestone-number{background:var(--deep);color:white;padding:24px;border-radius:16px;margin:24px 0}
.milestone-number span{display:block;font-size:14px}
.milestone-number strong{display:block;font-size:clamp(30px,6vw,48px);overflow-wrap:anywhere}
.milestone-number small{font-size:14px}
.milestone-dialog{max-width:none;width:100%;height:100%;max-height:100%;margin:0;border:0;border-radius:0;background:#f6f0fa;display:none;overflow:auto}
.milestone-dialog[open]{display:grid;align-items:center}
.escape-equation{display:grid;gap:12px;padding:25px 10px;border-radius:16px;background:#e8d8f2;font-size:24px}
.escape-equation strong{font-size:clamp(26px,5vw,38px);animation:milestone-rise .7s ease-out both}
.win-moment .space-art{animation:milestone-rise .7s ease-out both}
@keyframes milestone-rise{
  from{opacity:0;transform:translateY(14px) scale(.96)}
  to{opacity:1;transform:none}
}
.cash-score.money-in{animation:cash-in .7s ease-out}
.cash-score.money-out{animation:cash-out .7s ease-out}
@keyframes cash-in{
  50%{box-shadow:0 0 0 5px #7da95077}
}
@keyframes cash-out{
  50%{box-shadow:0 0 0 5px #c25d5277}
}
@media(prefers-reduced-motion:reduce){
  .escape-equation strong,.win-moment .space-art,.cash-score.money-in,.cash-score.money-out{animation:none}
}
.next-turn{margin:16px 0}
.next-turn>p:first-child{font-size:15px;font-weight:600}
.main-action-bar{margin:20px 0}
.main-action-bar button{min-height:56px;font-size:17px}
.turn-home .turn-tools{margin:12px 0}
#roll-dialog .dice-panel{border:0;padding:0;margin:10px 0;background:transparent}
#roll-dialog .dice-heading{display:none}
#roll-dialog .dice-shortcuts{gap:8px}
#roll-dialog .dice-shortcuts button{min-height:50px}
#roll-dialog .dialog-heading{position:sticky;top:-28px;padding-top:8px;background:var(--paper);z-index:1}
#roll-dialog{max-height:90dvh;overflow-y:auto}
@media(max-width:700px){
  body:has(.turn-home) main{padding-bottom:170px}
  .main-action-bar{position:fixed;inset-inline:0;bottom:64px;margin:0;padding:10px 20px;background:var(--paper);border-top:1px solid var(--line);z-index:2}
  .main-action-bar button{margin:0}
  .next-turn{margin-top:10px}
  #roll-dialog{width:100%;max-width:none;max-height:92dvh;margin:auto 0 0;border-radius:20px 20px 0 0;padding:24px 20px calc(24px + env(safe-area-inset-bottom))}
  #roll-dialog .dialog-heading{top:-24px}
}
.language-toggle{min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--white);font:500 13px 'DM Sans',sans-serif;letter-spacing:0}
.topline{gap:10px;flex-wrap:wrap}
html[dir=rtl] body{font-family:Tahoma,Arial,sans-serif}
html[dir=rtl] h1,html[dir=rtl] h2,html[dir=rtl] h3{font-family:Tahoma,Arial,sans-serif;letter-spacing:0;line-height:1.5}
html[dir=rtl] .cash-score>strong{letter-spacing:0}
html[dir=rtl] .type-card{text-align:right}
html[dir=rtl] nav a .nav-arrow,html[dir=rtl] .count{margin-left:0;margin-right:auto}
html[dir=rtl] .history-amount{text-align:left}
html[dir=rtl] .player-chip{flex-wrap:wrap}
html[dir=rtl] .cash-actions button{font-family:inherit}
html[dir=rtl] .topline>span:before{content:''}
.expense-row{width:100%;background:transparent;border:0;border-bottom:1px solid var(--line,#dedfd5);font:inherit;color:inherit;text-align:start;min-height:56px;cursor:pointer;gap:12px}
.expense-row:hover{background:rgba(100,130,70,.08)}
.expense-row:focus-visible{outline:2px solid currentColor;outline-offset:2px}
#expense-dialog output{display:block;padding:16px;line-height:1.7}
#table-find{max-width:440px;margin:24px 0}
#table-find input{text-transform:uppercase}
.brand-logo{display:block;width:min(184px,100%);height:auto;object-fit:contain;object-position:left center}
.market-panel{border:0;padding:0;margin:18px 0;min-width:0}
.market-asset{cursor:pointer;position:relative}
.market-asset input{position:absolute;opacity:0;width:1px;height:1px}
.market-asset input:focus-visible+span{outline:3px solid var(--deep);outline-offset:3px}
.market-asset{flex:0 0 min(240px,85%)}
.market-asset>span{display:grid;gap:10px;padding:18px;border:2px solid var(--line);border-radius:14px;background:#fff8e5;overflow-wrap:anywhere}
.market-asset input:checked+span{border-color:var(--deep);background:#e8f0dc}
.market-asset input:checked+span:before{content:'✓';font-weight:bold}
.market-asset small{display:block}
.market-panel[hidden]{display:none}
.bank-paydays{border:0;padding:0;margin:24px 0}
.bank-paydays legend{margin-bottom:12px}
.bank-paydays>div{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.bank-paydays label{cursor:pointer;position:relative}
.bank-paydays input{position:absolute;opacity:0;width:1px;height:1px}
.bank-paydays span{display:block;text-align:center;padding:16px 8px;border:1px solid var(--line);border-radius:10px;background:var(--white)}
.bank-paydays input:checked+span{background:var(--deep);color:white;border-color:var(--deep)}
.bank-paydays input:focus-visible+span{outline:3px solid var(--deep);outline-offset:3px}
.header-brand>a{display:none}
.header-brand{min-width:0}
.picker .type-card .space-art{width:64px;height:68px}
.header-brand img{display:block;width:88px;height:auto;object-fit:contain}
@media(max-width:700px){
  .header-brand{display:grid;gap:3px;max-width:105px;font-size:8px;letter-spacing:1px}
  .header-brand>a{display:flex;align-items:center;min-height:44px}
  .topline .player-chip{flex:1 0 100%;order:3;justify-content:flex-start;gap:6px}
  .topline .language-toggle{flex-shrink:0}
}
.circle-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:0 0 20px}
.circle-progress span{height:6px;border-radius:999px;background:var(--line)}
.circle-progress span.filled{background:#78905c}
.circle-amount{text-align:center;margin:14px 0 22px}
.circle-amount strong{font-size:28px;font-weight:600;font-variant-numeric:tabular-nums}
.circle-durations{border:0;padding:0;margin:0 0 20px;min-width:0}
.circle-durations legend{font-size:12px;font-weight:500;margin-bottom:10px}
.circle-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.slot-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.circle-card{position:relative;cursor:pointer;min-width:0}
.circle-card input{position:absolute;opacity:0;width:1px;height:1px}
.circle-card-body{display:block;border:1px solid var(--line);border-radius:11px;padding:14px 12px;text-align:center;font-size:13px;height:100%;box-sizing:border-box}
.circle-card-body strong{display:block;font-size:19px;font-weight:600}
.circle-card-body small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.circle-card-body em{display:block;font-style:normal;font-size:11px;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
.circle-card input:checked+.circle-card-body,.circle-card.chosen .circle-card-body{background:#edf2e4;border-color:#78905c;box-shadow:inset 0 0 0 1px #78905c}
.circle-card input:focus-visible+.circle-card-body{outline:3px solid #6b903e;outline-offset:3px}
.slot-card .circle-card-body strong{font-size:14px}
.slot-position{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.slot-fee{color:#8a5a2b}
.slot-free{color:#3f5327;font-weight:600}
.circle-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:0 0 14px}
.circle-tabs button{border:1px solid var(--line);background:transparent;border-radius:999px;padding:9px 6px;font:inherit;font-size:12px;cursor:pointer}
.circle-tabs button.active{background:#edf2e4;border-color:#78905c;font-weight:600}
.circle-tabs button:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.circle-schedule{margin:10px 0}
.circle-table{width:100%;border-collapse:collapse;font-size:12px}
.circle-table td{padding:7px 4px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
.circle-table td:last-child{text-align:right}
.circle-heading{font-size:13px;font-weight:600;margin:14px 0 10px}
.market-event-inline{margin:14px 0}
.market-event-banner{border:1px solid var(--line);border-radius:12px;padding:16px;margin:0 0 14px;background:#edf2e4}
.market-event-top{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.market-event-label{font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600}
.market-close{margin-inline-start:auto;min-width:44px;min-height:44px;border:0;background:transparent;font-size:20px;cursor:pointer;border-radius:50%}
.market-event-banner h2{font-size:17px;font-weight:600;margin:0 0 8px}
.market-everyone{font-size:11px;font-weight:600;color:#3f5327;margin:0 0 8px}
.market-trigger{font-size:13px;font-style:italic;margin:0 0 8px;overflow-wrap:anywhere}
.market-lesson{font-size:12px;color:var(--muted);margin:0}
.market-household{border:1px solid var(--line);border-radius:11px;padding:12px 14px;margin:0 0 14px}
.market-household h3{font-size:12px;font-weight:600;margin:0 0 8px}
.market-note{font-size:12px;color:var(--muted);border-inline-start:3px solid #78905c;padding-inline-start:10px;margin:0 0 12px}
.market-split{border-inline-start-color:#8a5a2b;font-weight:600;color:inherit}
.market-event-intro h3{font-size:13px;font-weight:600;margin:0 0 3px}
.market-event-intro p{font-size:11px;color:var(--muted);margin:0 0 12px}
.market-asset-section h3{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;font-weight:600;margin:14px 0 8px}
.market-asset-section h3 span{font-size:10px;color:var(--muted);font-weight:400}
.market-asset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.market-asset-card{display:flex;flex-direction:column;gap:4px;text-align:start;border:1px solid var(--line);border-radius:12px;padding:12px;background:transparent;font:inherit;cursor:pointer;min-width:0}
.market-asset-card:hover{background:#f4f7ee}
.market-asset-card:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.market-asset-card.is-featured{border-color:#78905c;box-shadow:inset 0 0 0 1px #78905c}
.market-asset-card.is-screened{border-style:dashed}
.market-asset-card.is-chosen{background:#edf2e4;border-color:#3f5327;box-shadow:inset 0 0 0 2px #3f5327}
.market-asset-top{display:flex;align-items:center;gap:8px;min-height:44px}
.market-asset-top img{width:44px;height:44px;object-fit:contain}
.market-focus-label{font-size:8px;letter-spacing:.08em;text-transform:uppercase;color:#3f5327;font-weight:700}
.market-asset-name{font-size:13px;font-weight:600;overflow-wrap:anywhere}
.market-ticker{font-size:10px;letter-spacing:.06em;color:var(--muted)}
.market-was-now{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.market-was-now strong{color:inherit;font-size:12px}
.market-pay{font-size:12px;margin-top:4px;font-variant-numeric:tabular-nums}
.market-discount{font-size:10px;color:#3f5327;font-weight:600}
.market-unit{font-size:10px;color:var(--muted)}
.market-screened{font-size:10px;color:var(--muted);font-weight:600}
.market-event-footer p{font-size:10px;color:var(--muted);margin:12px 0 0}
.market-household .math-line{flex-wrap:wrap;gap:2px 10px}
.market-household .math-line>span:last-child{white-space:nowrap}
.market-hint{border:1px solid #d8e2cb;background:#edf2e4;border-radius:11px;padding:12px 14px;margin:0 0 14px}
.market-hint h3{font-size:11px;font-weight:600;margin:0 0 5px;letter-spacing:.04em;text-transform:uppercase;color:#3f5327}
.market-hint p{font-size:12px;margin:0;line-height:1.55}
.market-shabka{border:1px solid var(--line);border-radius:11px;padding:12px 14px;margin:0 0 14px}
.market-shabka h3{font-size:12px;font-weight:600;margin:0 0 4px}
.market-shabka-name{font-size:12px;color:var(--muted);margin:0 0 8px}
.market-decision{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:600}
.market-decision--good{color:#3f5327}
.market-decision--caution{color:#8a5a2b}
.market-advice{font-size:10px;color:var(--muted);line-height:1.4}
.market-holding{font-size:10px;font-weight:600;color:#3f5327}
.market-tap{margin-top:6px;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#3f5327}
.market-asset-card.is-chosen .market-tap{color:#fff}
.market-asset-card.is-chosen{background:#3f5327;color:#fff;border-color:#3f5327}
.market-asset-card.is-chosen .market-advice,.market-asset-card.is-chosen .market-unit,.market-asset-card.is-chosen .market-was-now{color:#e4ecd8}
.market-asset-card.is-chosen .market-decision--good,.market-asset-card.is-chosen .market-decision--caution,.market-asset-card.is-chosen .market-holding{color:#dbe7c9}
.market-trade{border:0;padding:0;margin:0;min-width:0}
.market-trade-back{background:transparent;border:0;font:inherit;font-size:12px;color:var(--muted);padding:6px 0;cursor:pointer}
.market-trade-head{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:14px;margin:0 0 14px}
.market-trade-head img{width:48px;height:48px;object-fit:contain;flex:0 0 auto}
.market-trade-glyph{font-size:28px}
.market-trade-head strong{display:block;font-size:15px;font-weight:600;overflow-wrap:anywhere}
.market-trade-head span{display:block;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.market-trade-sides{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 16px}
.market-trade-sides:has(button:only-child){grid-template-columns:1fr}
.market-side{min-height:52px;border:1px solid var(--line);border-radius:11px;background:transparent;font:inherit;font-size:15px;font-weight:600;cursor:pointer}
.market-side--buy.is-on{background:#3f5327;border-color:#3f5327;color:#fff}
.market-side--sell.is-on{background:#8a5a2b;border-color:#8a5a2b;color:#fff}
.market-side:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.market-trade-units input{font:inherit;font-size:17px;padding:12px;border:1px solid var(--line);border-radius:10px;width:100%;max-width:160px;font-variant-numeric:tabular-nums}
.market-trade-max{font-size:11px;color:var(--muted);margin:6px 0 12px}
.market-trade-total{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;border-top:1px solid var(--line);padding-top:12px}
.market-yours h3{border-top:1px solid var(--line);padding-top:14px;margin-top:18px}
.market-owned{border-style:solid}
.market-owned .market-trade-glyph{font-size:34px;line-height:1}
.market-trade-offer input{font:inherit;font-size:17px;padding:12px;border:1px solid var(--line);border-radius:10px;width:100%;max-width:200px;font-variant-numeric:tabular-nums}
.market-trade-units[hidden]{display:none}
.market-empty-own{font-size:12px;color:var(--muted);margin:0;border:1px dashed var(--line);border-radius:11px;padding:14px}
.market-asset-card.is-halted{opacity:.62;cursor:not-allowed;background:repeating-linear-gradient(135deg,transparent,transparent 7px,rgba(138,90,43,.06) 7px,rgba(138,90,43,.06) 14px)}
.market-halt{font-size:10px;font-weight:700;color:#8a5a2b;letter-spacing:.02em}
.market-paused{font-size:10px;font-weight:600;color:#8a5a2b}
.market-halt-all{border-inline-start-color:#8a5a2b;font-weight:600;color:inherit}
.market-trade-duty{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.market-trade-duty[hidden]{display:none}
.market-trade-after{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums;border-top:1px solid var(--line);padding-top:10px;margin-top:4px}
.market-trade-confirm{margin-top:14px}
.market-trade-sides[hidden]{display:none}
.market-trade-back{font-size:15px;font-weight:600;color:var(--text,#2b2b2b);padding:10px 0 12px;min-height:44px;display:inline-flex;align-items:center;gap:6px}
.market-trade-back:hover{text-decoration:underline}
.market-trade-back:focus-visible{outline:3px solid #6b903e;outline-offset:3px;border-radius:8px}
.portfolio{display:grid;gap:10px;margin:0 0 14px}
.portfolio-row{display:flex;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:11px;padding:12px 14px;flex-wrap:wrap}
.portfolio-name strong{display:block;font-size:13px;font-weight:600}
.portfolio-name small{display:block;font-size:10px;color:var(--muted)}
.portfolio-pending{color:#8a5a2b;font-weight:600}
.portfolio-figures{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:11px;font-variant-numeric:tabular-nums;text-align:end}
.portfolio-figures strong{font-size:13px}
.portfolio-up{color:#3f5327;font-weight:600}
.portfolio-down{color:#8a5a2b;font-weight:600}
.drowning-dialog{max-width:430px;width:calc(100% - 24px)}
.rescue-gap{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border:1px solid #8a5a2b;background:#fbf3ec;border-radius:12px;padding:14px 16px;margin:0 0 12px}
.rescue-gap strong{font-size:22px;font-weight:600;color:#8a5a2b;font-variant-numeric:tabular-nums}
.rescue-list{display:grid;gap:10px;margin:14px 0}
.rescue-row{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.rescue-what{display:flex;gap:10px;align-items:flex-start;min-width:0}
.rescue-what img{width:40px;height:40px;object-fit:contain;flex:0 0 auto}
.rescue-glyph{font-size:26px;line-height:1}
.rescue-what strong{display:block;font-size:13px;font-weight:600;overflow-wrap:anywhere}
.rescue-what small{display:block;font-size:10px;color:var(--muted)}
.rescue-rate{font-weight:600}
.rescue-deal{display:flex;flex-direction:column;align-items:flex-end;gap:3px;text-align:end;font-variant-numeric:tabular-nums}
.rescue-full{font-size:11px;color:var(--muted)}
.rescue-gets{font-size:15px;color:#3f5327}
.rescue-loss{font-size:10px;color:#8a5a2b}
.rescue-units{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--muted)}
.rescue-units input{font:inherit;font-size:14px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;width:70px;font-variant-numeric:tabular-nums}
.rescue-sell{margin-top:4px;min-height:40px;padding:0 18px;border:0;border-radius:999px;background:#3f5327;color:#fff;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.rescue-sell:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.out-of-game .type-icon{font-size:34px}
.out-figures{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}
.out-figures div{border:1px solid var(--line);border-radius:11px;padding:14px 8px;text-align:center}
.out-figures strong{display:block;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}
.out-figures span{display:block;font-size:10px;color:var(--muted);margin-top:2px}
.lender{position:relative;cursor:pointer}
.lender input{position:absolute;opacity:0;width:1px;height:1px}
.lender>span{display:block;border:1px solid var(--line);border-radius:11px;padding:12px 14px}
.lender small{display:block;font-size:11px;color:var(--muted)}
.lender input:checked+span{background:#edf2e4;border-color:#78905c;box-shadow:inset 0 0 0 1px #78905c}
.lender input:focus-visible+span{outline:3px solid #6b903e;outline-offset:3px}
.previous-game{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #78905c;background:#edf2e4;border-radius:12px;padding:14px 16px;margin:0 0 18px}
.previous-game strong{display:block;font-size:13px;font-weight:600}
.previous-game small{display:block;font-size:11px;color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
.previous-game button{min-height:44px;padding:0 18px;white-space:nowrap}
.table-choices{display:grid;gap:12px;margin:16px 0}
.table-choice{border:1px solid var(--line);border-radius:12px;padding:16px}
.table-choice h2{font-size:15px;font-weight:600;margin:0 0 4px}
.table-choice p{margin:0 0 12px}
.table-choice .field{margin:0 0 10px}
/* On the first page the two ways onto a table sit side by side when there is
   room, with their buttons lined up along the bottom. */
.welcome .table-choices{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));margin:22px 0 8px}
.welcome .table-choice{display:flex;flex-direction:column}
.welcome .table-choice>button,.welcome .table-choice>form{margin-top:auto}
.welcome>.back{display:block}
/* Playing alone is still one tap, just not the first thing offered. */
/* Leaving a table loses your seat, so it reads as the deliberate act it is
   rather than hiding as a text link among the player cards. */
.resp-prompt{font-size:13px;font-weight:600;margin:0 0 10px}
.resp-boxes{margin:0 0 16px}
.chance-group:disabled{opacity:.55;cursor:not-allowed}
.luck-boxes{border:0;padding:0;margin:0 0 22px;min-width:0}
.luck-boxes legend{font-size:12px;font-weight:500;margin-bottom:10px}
.chance-group.is-chosen{border-color:#3f5327;box-shadow:inset 0 0 0 2px #3f5327;background:#edf2e4}
/* Chance: three screens, one decision each. Shown one at a time inside the roll dialog. */
.chance-panel{border:0;padding:0;margin:0 0 18px;min-width:0}
.chance-panel[hidden]{display:none!important}
.chance-panel legend{font-size:12px;font-weight:600;margin-bottom:12px;padding:0}
.chance-back{background:transparent;border:0;font:inherit;font-size:12px;color:var(--muted);padding:6px 0;margin-bottom:6px;cursor:pointer}
.chance-group-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.chance-group{display:grid;gap:4px;text-align:start;border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--white);font:inherit;cursor:pointer;min-width:0}
.chance-group:hover{border-color:#92ad72;background:#f4f7ee}
.chance-group:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.chance-group-icon{font-size:24px;line-height:1}
.chance-group strong{font-size:13px;font-weight:600}
.chance-group small{font-size:10px;color:var(--muted);line-height:1.5}
.chance-group-count{font-size:10px;color:#566e42;font-weight:600;margin-top:2px}
.chance-asset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.chance-asset{display:grid;gap:3px;text-align:start;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--white);font:inherit;cursor:pointer;min-width:0}
.chance-asset:hover{border-color:#92ad72;background:#f4f7ee}
.chance-asset:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.chance-asset-kind{font-size:9px;letter-spacing:1.2px;text-transform:uppercase;color:var(--muted)}
.chance-asset strong{font-size:13px;font-weight:600;overflow-wrap:anywhere}
.chance-asset-price{font-size:13px;font-variant-numeric:tabular-nums}
.chance-asset-price small{font-size:9px;color:var(--muted)}
.chance-asset-earn{font-size:11px;font-weight:600;color:#3f5327;font-variant-numeric:tabular-nums}
.chance-asset-earn.is-idle{color:var(--muted);font-weight:400}
.chance-asset-down{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.chance-buy-head{display:grid;gap:4px;border:1px solid var(--line);border-radius:12px;padding:14px;margin:0 0 14px;background:var(--white)}
.chance-buy-head strong{font-size:16px;font-weight:600;overflow-wrap:anywhere}
.chance-buy-head span{font-size:11px;color:var(--muted);line-height:1.6}
.chance-range{font-variant-numeric:tabular-nums}
.chance-units input{max-width:140px}
.chance-modes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 14px}
.chance-mode{display:grid;gap:3px;min-height:60px;padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--white);font:inherit;cursor:pointer;text-align:center}
.chance-mode strong{font-size:14px;font-weight:600}
.chance-mode span{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.chance-mode.is-on{background:#3f5327;border-color:#3f5327;color:#fff}
.chance-mode.is-on span{color:#dbe7c9}
.chance-mode:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.chance-terms .math-line{font-size:12px;font-variant-numeric:tabular-nums;padding:3px 0}
.chance-note{font-size:10px;color:var(--muted);margin:8px 0 0;line-height:1.5}
.chance-repay small{display:block;font-size:10px;color:var(--muted);margin-top:6px;font-weight:400;line-height:1.5}
.chance-funding{border:1px solid #d9c9a8;background:#fdf7ea;border-radius:12px;padding:14px;margin:14px 0}
.chance-funding-lead{font-size:12px;font-weight:600;margin:0 0 10px}
.chance-routes{display:grid;gap:8px}
.chance-route{display:grid;gap:2px;text-align:start;border:1px solid var(--line);border-radius:10px;padding:11px;background:var(--white);font:inherit;cursor:pointer}
.chance-route strong{font-size:13px;font-weight:600}
.chance-route small{font-size:10px;color:var(--muted);line-height:1.5}
.chance-route.is-on{background:#3f5327;border-color:#3f5327;color:#fff}
.chance-route.is-on small{color:#dbe7c9}
.chance-route:disabled{opacity:.4;cursor:not-allowed}
.chance-route:focus-visible{outline:3px solid #6b903e;outline-offset:3px}
.chance-route-detail{margin-top:12px}
.chance-route-lines .math-line{font-size:12px;font-variant-numeric:tabular-nums;padding:3px 0}
.chance-total{border-top:1px solid var(--line);padding-top:12px;margin-top:6px}
.chance-total .math-line{font-size:14px;font-variant-numeric:tabular-nums;padding:3px 0}
@media(max-width:700px){
  .chance-group-grid,.chance-asset-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
  .chance-modes{grid-template-columns:1fr}
}
html[dir=rtl] .chance-group,html[dir=rtl] .chance-asset,html[dir=rtl] .chance-route{text-align:right}

/* Dividend season: a shower of notes over the payout. */
#dividend-dialog{position:relative;overflow:hidden;text-align:center}
.dividend-rain{position:absolute;inset:0;pointer-events:none;z-index:0}
#dividend-dialog>*:not(.dividend-rain){position:relative;z-index:1}
.dividend-note{position:absolute;top:-70px;left:var(--x);width:74px;opacity:0;transform:rotate(var(--spin));animation:dividend-fall 2.4s cubic-bezier(.3,.6,.4,1) var(--delay) 2 both}
@keyframes dividend-fall{0%{opacity:0;transform:translateY(0) rotate(0)}12%{opacity:.95}80%{opacity:.85}100%{opacity:0;transform:translateY(560px) rotate(var(--spin))}}
.dividend-lead{color:var(--muted)}
.dividend-total{font-family:var(--display);font-size:22px;margin:8px 0 14px;color:var(--sage-ink)}
.dividend-total span{display:inline-block;font-size:46px;font-weight:800;animation:dividend-pop .7s cubic-bezier(.2,1.6,.4,1) .2s both}
@keyframes dividend-pop{0%{transform:scale(.3);opacity:0}100%{transform:scale(1);opacity:1}}
.dividend-rows{list-style:none;padding:0;margin:0 0 12px;display:grid;gap:8px;text-align:start}
.dividend-rows li{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:14px;background:var(--sage);color:var(--sage-ink);animation:dividend-pop .5s ease-out both}
.dividend-rows li:nth-child(2){animation-delay:.1s}.dividend-rows li:nth-child(3){animation-delay:.2s}.dividend-rows li:nth-child(n+4){animation-delay:.3s}
.dividend-rows span{flex:1}
@media(prefers-reduced-motion:reduce){.dividend-rain{display:none}.dividend-total span,.dividend-rows li{animation:none}}

.game-disclaimer{font-size:11px;color:var(--muted);margin:8px 0 0;text-align:center}

.market-sync-code{margin:6px 0;padding:8px 12px;border-radius:12px;background:var(--butter);color:var(--butter-ink);font-weight:600}
.market-sync-code strong{font-size:22px;letter-spacing:2px;margin-inline-start:6px}
.sync-code-input{display:block;width:100%;font-size:40px;text-align:center;letter-spacing:10px;padding:10px;border-radius:16px;border:2px solid var(--line);background:var(--white);color:var(--ink)}
.sync-code-preview{min-height:20px;text-align:center;font-weight:700;font-size:15px}

/* A synced card is shown, not traded: nothing on it can be tapped. */
.is-view-only .market-tap{display:none}
.is-view-only button{pointer-events:none}

.dividend-countdown{margin:4px 0 0;font-size:13px;font-weight:650;color:var(--sage-ink)}

/* Tap an asset card for the rest of its story. */
.asset-more{margin-top:8px}
.asset-more summary{cursor:pointer;font-size:13px;font-weight:650;color:var(--deep)}
.spouse-archetype{font-weight:700;margin:4px 0}
/* The jump to Amaan: money bursts from the middle to every edge. */
#escape-moment{overflow:hidden}
.money-burst{position:fixed;inset:0;pointer-events:none;z-index:-1}
.investor-moment{position:relative;z-index:1}
.burst-note{position:absolute;left:50%;top:50%;width:84px;margin:-24px 0 0 -42px;opacity:0;animation:money-burst 1.8s cubic-bezier(.15,.7,.3,1) var(--delay) 2 both}
@keyframes money-burst{0%{opacity:0;transform:translate(0,0) rotate(0) scale(.3)}12%{opacity:1}75%{opacity:.9}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(1)}}
.ten-x{text-align:start;margin:16px auto;max-width:460px;line-height:1.6;padding-inline-start:22px}
.ten-x li{margin:6px 0}
@media(prefers-reduced-motion:reduce){.money-burst{display:none}}

/* An asset card is a door to its story. */
.asset-card{cursor:pointer;transition:transform .15s ease}
.asset-card:active{transform:scale(.98)}
.asset-card:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.asset-tap{display:block;margin-top:8px;font-weight:650;color:var(--deep)}
.sheet-head{display:flex;align-items:center;gap:14px;margin:4px 0 12px}
.sheet-head img{border-radius:14px}
.sheet-name{margin:0;font-size:22px}
.sheet-glyph{display:grid;place-items:center;width:56px;height:56px;border-radius:14px;background:var(--butter);color:var(--butter-ink);font-size:26px;font-weight:800}
.asset-sheet h3{font-size:14px;letter-spacing:.02em;margin:16px 0 6px}
.sheet-about p{font-size:15px;line-height:1.55;margin:0}
.sheet-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.sheet-tile{background:var(--white);border:1px solid var(--line);border-radius:14px;padding:10px 12px;display:grid;gap:2px}
.sheet-tile span{font-size:12px;color:var(--muted)}
.sheet-tile strong{font-size:18px}
.sheet-tile small{font-size:11px;color:var(--muted)}
.sheet-tile.is-up{background:var(--sage);color:var(--sage-ink);border-color:transparent}
.sheet-tile.is-down{background:var(--pink);color:var(--pink-ink);border-color:transparent}
.sheet-tile.is-up span,.sheet-tile.is-up small,.sheet-tile.is-down span,.sheet-tile.is-down small{color:inherit;opacity:.8}
.sheet-pending{font-size:12px;color:var(--muted);margin:8px 0 0}
.sheet-words dl{margin:0;display:grid;gap:8px}
.sheet-words dt{font-weight:750}
.sheet-words dd{margin:0;font-size:13px;line-height:1.5;color:var(--muted)}

.sheet-glyph.is-owed{background:var(--pink);color:var(--pink-ink)}

/* Short of cash: the three ways to borrow, each a big tap target. */
.short-ways{display:grid;gap:10px;margin:14px 0}
.short-way{display:flex;align-items:center;gap:12px;text-align:start;padding:12px 14px;border-radius:16px;border:1px solid var(--line);background:var(--white);color:var(--ink);font:inherit;cursor:pointer}
.short-way .type-icon{width:56px;height:56px;flex:none}
.short-way strong{display:block;font-size:15px}
.short-way small{display:block;color:var(--muted);font-size:12px;line-height:1.4}
.short-way:active{transform:scale(.98)}

.rescue-mortgage{display:block;font-size:11px;color:var(--muted)}
.rescue-cashflow{display:block;font-size:12px;font-weight:700;color:var(--pink-ink)}
.rescue-cashflow.is-saved{color:var(--sage-ink)}

.rescue-heading{font-size:14px;margin:16px 0 6px}
