.fx-purse { --fx-b: 0; --fx-l: 0; --fx-t: 0; display: grid; gap: 16px; }
.fx-purse:has(#fx-purse-b:checked) { --fx-b: 1; }
.fx-purse:has(#fx-purse-l:checked) { --fx-l: 1; }
.fx-purse:has(#fx-purse-t:checked) { --fx-t: 1; }
.fx-purse .fx-goal { margin: 0; color: var(--fx-ink); }
.fx-purse .fx-note ol { margin: 0; padding-left: 24px; }
.fx-purse .fx-controls { min-width: 0; border: 0; padding: 0; margin: 0; }
.fx-purse .fx-controls legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
.fx-purse .fx-btn { min-height: 44px; box-sizing: border-box; color: var(--fx-ink); }
.fx-purse .fx-btn:has(input:checked) { background: var(--fx-mint); color: var(--fx-ink); }
.fx-purse .fx-btn:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-purse .fx-stack { display: grid; min-width: 0; }
.fx-purse .fx-state { grid-area: 1 / 1; visibility: hidden; }
.fx-purse:has(#fx-purse-b:not(:checked)):has(#fx-purse-l:not(:checked)):has(#fx-purse-t:not(:checked)) .fx-s0, .fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:not(:checked)):has(#fx-purse-t:not(:checked)) .fx-s1, .fx-purse:has(#fx-purse-b:not(:checked)):has(#fx-purse-l:checked):has(#fx-purse-t:not(:checked)) .fx-s2, .fx-purse:has(#fx-purse-b:not(:checked)):has(#fx-purse-l:not(:checked)):has(#fx-purse-t:checked) .fx-s3, .fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:checked):has(#fx-purse-t:not(:checked)) .fx-s4, .fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:not(:checked)):has(#fx-purse-t:checked) .fx-s5, .fx-purse:has(#fx-purse-b:not(:checked)):has(#fx-purse-l:checked):has(#fx-purse-t:checked) .fx-s6, .fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:checked):has(#fx-purse-t:checked) .fx-s7 { visibility: visible; }
.fx-purse .fx-scene { height: 460px; box-sizing: border-box; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; align-items: start; color: var(--fx-ink); }
.fx-purse .fx-purse-panel, .fx-purse .fx-shop, .fx-purse .fx-results { min-width: 0; display: grid; gap: 10px; }
.fx-purse .fx-results { display: flex; flex-direction: column; }
.fx-purse .fx-wallet { margin-top: 14px; padding: 16px 8px 10px; border: 3px solid var(--fx-ink); border-radius: 12px; background: var(--fx-coral-pale); text-align: center; }
.fx-purse .fx-money { border: 2px solid var(--fx-ink); background: var(--fx-mint-pale); margin-bottom: 12px; padding: 12px 2px; font-size: 24px; font-weight: 800; }
.fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:checked):has(#fx-purse-t:checked) .fx-money { background: var(--fx-paper); border-style: dashed; }
.fx-purse .fx-hint { font-size: 14px; }
.fx-purse .fx-item { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 6px; background: var(--fx-sun-pale); border: 1px solid var(--fx-ink); border-radius: 6px; font-size: 14px; }
.fx-purse .fx-item svg { width: 60px; height: 48px; fill: var(--fx-sun); stroke: var(--fx-ink); stroke-width: 2; stroke-linejoin: round; }
.fx-purse .fx-item .fx-outline { fill: none; }
.fx-purse .fx-basket { position: relative; height: 100px; box-sizing: border-box; padding: 4px 8px; border: 3px solid var(--fx-ink); border-top: 2px dashed var(--fx-ink); border-radius: 0 0 12px 12px; background: var(--fx-paper); display: grid; gap: 3px; }
.fx-purse .fx-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.fx-purse .fx-bought { visibility: hidden; transform: translateY(-12px); transition: transform 0.3s; background: var(--fx-sun-pale); border: 1px solid var(--fx-ink); border-radius: 4px; padding: 2px 4px; font-size: 14px; }
.fx-purse:has(#fx-purse-b:checked) .fx-bag, .fx-purse:has(#fx-purse-l:checked) .fx-lunch, .fx-purse:has(#fx-purse-t:checked) .fx-ticket { visibility: visible; transform: translateY(0); }
.fx-purse .fx-spent-label, .fx-purse .fx-scale { display: flex; justify-content: space-between; gap: 6px; }
.fx-purse .fx-track { height: 18px; border: 2px solid var(--fx-ink); background: var(--fx-paper); }
.fx-purse .fx-fill { height: 100%; width: calc(var(--fx-b) * 40% + var(--fx-l) * 25% + var(--fx-t) * 35%); background: var(--fx-sun); transition: width 0.3s; }
.fx-purse:has(#fx-purse-b:checked):has(#fx-purse-l:checked):has(#fx-purse-t:checked) .fx-fill { background: var(--fx-mint); }
.fx-purse .fx-scale { font-size: 12px; }
.fx-purse .fx-read { font-size: 14px; }
.fx-purse .fx-column { border: 1px solid var(--fx-ink); background: var(--fx-paper); padding: 8px; }
.fx-purse .fx-column-row { display: grid; grid-template-columns: minmax(0, 1fr) 16px 64px; align-items: center; min-height: 32px; font-size: 14px; }
.fx-purse .fx-column-row > :last-child { grid-column: 3; }
.fx-purse .fx-digits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.fx-purse .fx-digits > span, .fx-purse .fx-digits::before { border-left: 1px solid var(--fx-sky); border-bottom: 1px solid var(--fx-sky); }
.fx-purse .fx-digits:has(> span:only-child)::before { content: ""; }
.fx-purse .fx-head small { font-size: 12px; }
.fx-purse .fx-answer { border-top: 2px solid var(--fx-ink); font-weight: 800; }
.fx-purse .fx-messages p { margin: 0; }
@container (max-width: 480px) { .fx-purse .fx-scene { height: 900px; grid-template-columns: minmax(0, 1fr); grid-template-rows: 190px 220px 430px; gap: 12px; padding: 12px; } .fx-purse .fx-purse-panel { gap: 6px; } .fx-purse .fx-wallet { margin-top: 0; padding: 8px; } .fx-purse .fx-money { margin-bottom: 4px; padding: 5px; } .fx-purse .fx-shop { gap: 6px; } .fx-purse .fx-item { grid-template-columns: 60px minmax(0, 1fr); text-align: left; justify-items: start; padding: 2px 6px; } .fx-purse .fx-results { gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .fx-purse .fx-bought, .fx-purse .fx-fill { transition: none; } }