.cb-progression-overlay { z-index: 2000000; background: rgba(3, 8, 16, .98); }
.cb-progression-card { width: min(100%, 580px); box-sizing: border-box; padding: 20px; border: 1px solid #30504f; border-radius: 16px; background: #0b141d; color: #f1f5f9; font-family: 'Space Mono', monospace; margin: auto; flex: 0 0 auto; }
.cb-progression-card h2 { font-size: clamp(24px, 5vw, 32px); margin: 8px 0; }
.cb-progression-card p { font-size: 14px; line-height: 1.6; }
.cb-sim-map { height: 220px; position: relative; margin: 14px 0; background: #061018; border: 1px solid #284047; border-radius: 10px; }
.cb-sim-map svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.cb-sim-map path { fill: none; stroke: #36686d; stroke-width: 3; }
.cb-sim-node { position: absolute; transform: translate(-50%, -50%); min-width: 44px; min-height: 44px; padding: 3px; border: 1px solid #67cfcd; border-radius: 50%; background: #11262f; color: #b9eeec; font: bold 13px 'Space Mono', monospace; cursor: pointer; }
.cb-sim-node.completed { color: #b8f66b; border-color: #b8f66b; }
.cb-sim-node.next { background: #b8f66b; color: #0b141d; border-color: #e1ffbe; box-shadow: 0 0 0 4px #b8f66b22; }
#cb-sim-map .cb-sim-node { width: 44px; height: 44px !important; padding: 2px !important; font-size: 12px !important; }
.cb-progression-actions { display: flex; gap: 10px; margin-top: 12px; }
.cb-progression-actions button { flex: 1; font-size: 13px; min-height: 48px; }
.cb-progression-card button, .cb-live-run-result button { cursor: pointer; border-radius: 10px; }
.cb-progression-note { color: #b2c2cb; font-size: 12px !important; line-height: 1.6; }
.cb-live-run-result { width: min(100%, 520px); box-sizing: border-box; padding: 16px; border: 1px solid #4a6952; background: #0c1d20; border-radius: 12px; font-family: 'Space Mono', monospace; color: #f1f5f9; flex: 0 0 auto; }
#end-screen.viewport-overlay { justify-content: flex-start !important; }
#end-screen.viewport-overlay .paper-receipt { margin-top: 0; }
#end-screen.cb-has-live-run > button[onclick="restartMatch()"], #end-screen.cb-has-live-run > button[onclick="returnToMenu()"], #end-screen.cb-has-live-run > #challenge-friend-btn { display: none !important; }
.cb-live-run-result[hidden], #cb-live-run-hud[hidden] { display: none; }
.cb-live-run-result h2 { font-size: 24px; margin: 8px 0; }
.cb-live-run-result p { font-size: 13px; line-height: 1.6; }
.cb-live-run-result .cb-primary { font-size: 14px; margin-top: 12px; }
.cb-live-run-result button:disabled { opacity: .65; cursor: default; }
#cb-live-run-hud { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100002; width: min(calc(100% - 24px), 520px); box-sizing: border-box; padding: 8px 12px; background: rgba(7, 23, 28, .96); border: 1px solid #3b7169; border-radius: 9px; color: #e0f7e6; font: 12px/1.5 'Space Mono', monospace; pointer-events: none; }
#cb-live-run-hud span { display: block; }
.cb-live-run-achievements { border: 1px solid #6ec5a6; background: #0a2020; padding: 12px; margin: 12px 0; color: #dcf7ed; }
.cb-live-run-achievements h3 { font-size: 14px; margin: 0 0 8px; }
.cb-live-run-achievements p, .cb-live-run-achievements small { font-size: 12px; line-height: 1.6; }
#tutorial-modal .tutorial-slide { font-size: 16px; line-height: 1.7; }
#tutorial-modal .tutorial-slide h3 { font-size: 21px; color: #b8f66b; margin: 4px 0 12px; }
#tutorial-modal .tutorial-slide p { margin: 0 0 12px; }
@media (max-height: 700px) { .cb-sim-map { height: 175px; } .cb-progression-card { padding: 14px; } .cb-progression-card p { margin: 6px 0; } }

/* Compact paper receipt shared by every round result. */
#end-screen.viewport-overlay .cb-round-receipt,
.cb-progression-card .cb-round-receipt,
.cb-result-card .cb-round-receipt {
    width: 100%; max-width: 420px; padding: 14px 16px; margin: 12px auto 18px;
    color: #1a1a1a; box-shadow: 0 6px 18px #0004; text-align: left;
}
.cb-round-receipt .receipt-header { font-size: 12px; letter-spacing: 1px; margin: 0 0 5px; }
.cb-round-receipt .receipt-context { font-size: 10px; color: #555; text-align: center; }
.cb-round-receipt .receipt-outcome { font-size: 14px; font-weight: bold; text-align: center; margin: 8px 0; color: #222 !important; }
.cb-round-receipt .receipt-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px dashed #888; font-size: 11px; }
.cb-round-receipt .receipt-net { font-size: 24px; letter-spacing: -1px; }
.cb-round-receipt .receipt-stamp { position: static; display: block; width: fit-content; margin: 0 0 3px auto; transform: rotate(-4deg); border-width: 2px; font-size: 9px; padding: 2px 6px; letter-spacing: 1px; }
.cb-round-receipt .receipt-details { border-top: 1px dashed #888; margin-top: 8px; }
.cb-round-receipt .receipt-details summary { min-height: 44px; padding: 12px 0; font: bold 12px/20px 'Space Mono', monospace; cursor: pointer; touch-action: manipulation; }
.cb-round-receipt .receipt-details summary:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
#end-screen.viewport-overlay .bank-statement, .cb-round-receipt .bank-statement { min-height: 0; max-height: 160px; margin: 0; font-size: 11px; line-height: 1.5; touch-action: pan-y; }
.receipt-trade { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dotted #bbb; }
.receipt-trade strong { white-space: nowrap; }
#cb-simulation-result.viewport-overlay { padding: 16px 12px !important; }
.cb-progression-card { max-width: 420px; padding: 14px; border-radius: 10px; }
.cb-progression-card h2 { font-size: 20px; margin: 4px 0; }
.cb-progression-card .cb-eyebrow { margin-bottom: 4px; }
.cb-progression-card p { margin: 4px 0; }
.cb-progression-card #cb-sim-map { height: 145px; margin: 8px 0; }
.cb-progression-card #cb-sim-detail, .cb-progression-card #cb-sim-entry, .cb-progression-card #cb-sim-score { font-size: 11px !important; line-height: 1.4 !important; }
.cb-progression-card #cb-sim-detail { margin-bottom: 8px; }
.cb-progression-card #cb-sim-next { margin: 0; font-size: 14px !important; }
.cb-progression-card .cb-progression-actions { gap: 6px; margin-top: 8px; }
.cb-progression-card .cb-progression-actions button { margin: 0; padding: 8px !important; font-size: 12px !important; }
#cb-sim-reward:empty, #cb-run-reward:empty { display: none; }
#end-screen.viewport-overlay { gap: 8px; }
#end-screen.viewport-overlay > .end-btn, #end-screen.viewport-overlay > .cb-live-run-result { width: min(100%, 420px) !important; max-width: 420px; }
.cb-live-run-result { padding: 12px; }
.cb-live-run-result h2 { font-size: 19px; }
.cb-live-run-result #cb-run-detail, .cb-live-run-result #cb-run-risk, .cb-live-run-result #cb-run-milestone { font-size: 11px !important; line-height: 1.4 !important; margin: 6px 0; }
#cb-result .cb-result-card { width: min(100%, 420px); padding: 16px; border-radius: 10px; }
#cb-result .cb-result-card h2 { font-size: 20px; margin: 6px 0; }
#cb-result #cb-result-detail { display: none; }
.cb-progression-card .receipt-outcome, .cb-progression-card .receipt-stamp,
.cb-result-card .receipt-outcome, .cb-result-card .receipt-stamp { display: none; }
#cb-sim-score { display: none; }
@media (max-height: 700px) {
    .cb-progression-card #cb-sim-map { height: 128px; }
    .cb-progression-card .cb-round-receipt { padding: 10px 12px; margin: 10px auto 14px; }
}
#cb-result .cb-round-receipt .receipt-header { color: #111; font-size: 12px; letter-spacing: 1px; margin: 0 0 5px; }
