/* Making Change — game-specific styles.
 * Layered on top of /shared/styles.css.
 */

.game-page {
    padding: 1.5rem 0 2rem;
    --jump-accent: var(--cat-money);
}

.game-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0.25rem;
}

.game-head h1 {
    margin: 0;
    font-size: 1.9rem;
}

.game-head .category {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--cat-money-bg);
    color: var(--cat-money);
}

.game-lede {
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
    font-size: 1.02rem;
    line-height: 1.55;
}

/* Start panel */
.start-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1rem 0 1.5rem;
}

.start-panel h2 {
    font-family: var(--font-hand);
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.start-panel h2::after { display: none; }

.difficulty-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
}

.difficulty-row label {
    flex: 1 1 auto;
    min-width: 120px;
}

.difficulty-row input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.difficulty-row label span {
    display: block;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--bg);
}

.difficulty-row input[type="radio"]:checked + span {
    border-color: var(--cat-money);
    background: var(--cat-money-bg);
    color: var(--cat-money);
    font-weight: 600;
}

.difficulty-row input[type="radio"]:focus-visible + span {
    outline: 2px solid var(--cat-money);
    outline-offset: 2px;
}

.untimed-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--cat-money);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text-muted); }
.btn-ghost:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Game area */
.game-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: transform 0.08s;
}

/* Side-by-side play layout on wider screens */
.play-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 720px) {
    .play-grid {
        grid-template-columns: minmax(300px, 360px) 1fr;
        gap: 1.75rem;
        align-items: start;
    }
}
.play-col { min-width: 0; }
.play-col-ticket { display: flex; flex-direction: column; gap: 0.5rem; }
.play-col-drawer { display: flex; flex-direction: column; gap: 1rem; }

.game-area.shake {
    animation: shake 0.35s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .game-area.shake { animation: none; }
}

.hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border);
    flex-wrap: wrap;
}

.hud-group {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.hud-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.hud-value {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.timer-low {
    color: var(--danger);
    animation: pulse 0.8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
    .timer-low { animation: none; }
}

.score-bump { animation: scoreBump 0.35s ease-out; }
@keyframes scoreBump {
    0%   { transform: scale(1); color: var(--cat-money); }
    40%  { transform: scale(1.35); color: var(--cat-money); }
    100% { transform: scale(1); color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
    .score-bump { animation: none; }
}

.score-pop {
    position: absolute;
    top: -0.5em;
    left: 100%;
    margin-left: 0.2em;
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--cat-money);
    opacity: 0;
    pointer-events: none;
}
.score-pop.pop-run {
    animation: popUp 0.9s ease-out forwards;
}
@keyframes popUp {
    0%   { opacity: 0; transform: translateY(0); }
    25%  { opacity: 1; transform: translateY(-6px); }
    100% { opacity: 0; transform: translateY(-28px); }
}
@media (prefers-reduced-motion: reduce) {
    .score-pop.pop-run { animation: none; opacity: 0; }
}

.hud-streak .streak-value {
    color: var(--accent);
    font-family: var(--font-hand);
    font-size: 1.5rem;
    line-height: 1;
}
.hud-streak.streak-hot .streak-value {
    color: var(--cat-car);
    text-shadow: 0 0 8px rgba(212, 122, 60, 0.4);
}

.btn-end {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-end:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--bg-soft);
}
.btn-end:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

/* Scenario — styled as a paper receipt */
.scenario {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0.25rem 1rem;
}

.receipt {
    --receipt-bg: #fdfaf1;
    --receipt-ink: #2b2a25;
    --receipt-muted: #7a7668;
    width: min(320px, 100%);
    background: var(--receipt-bg);
    color: var(--receipt-ink);
    font-family: var(--font-mono);
    padding: 0.9rem 1.1rem 0.7rem;
    border-radius: 2px;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.04),
        0 10px 24px -12px rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    position: relative;
    transform: rotate(-0.8deg);
    transition: transform 0.25s;
}
.receipt:hover { transform: rotate(0deg); }
@media (prefers-reduced-motion: reduce) {
    .receipt { transform: none; }
    .receipt:hover { transform: none; }
}

:root[data-theme="dark"] .receipt {
    --receipt-bg: #f3ead5;
    --receipt-ink: #2b2a25;
    --receipt-muted: #70695a;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .receipt {
        --receipt-bg: #f3ead5;
        --receipt-ink: #2b2a25;
        --receipt-muted: #70695a;
    }
}

/* Perforated top + bottom edges */
.receipt-edge {
    position: relative;
    height: 10px;
    margin: -0.9rem -1.1rem 0.5rem;
    background:
        linear-gradient(45deg, transparent 50%, var(--receipt-bg) 50%) 0 0 / 10px 10px,
        linear-gradient(-45deg, transparent 50%, var(--receipt-bg) 50%) 0 0 / 10px 10px;
    background-color: transparent;
}
.receipt-edge:last-child {
    margin: 0.5rem -1.1rem -0.7rem;
    transform: scaleY(-1);
}

.receipt-header {
    text-align: center;
    padding-bottom: 0.35rem;
}
.receipt-brand {
    display: block;
    font-weight: 700;
    letter-spacing: 0.16em;
    font-size: 0.95rem;
}
.receipt-sub {
    display: block;
    font-size: 0.65rem;
    color: var(--receipt-muted);
    letter-spacing: 0.14em;
    margin-top: 0.15rem;
}
.receipt-divider {
    border-top: 1px dashed var(--receipt-muted);
    margin: 0.45rem 0;
}
.receipt-divider-double {
    border-top: 1px solid var(--receipt-muted);
    border-bottom: 1px solid var(--receipt-muted);
    height: 3px;
}
.receipt-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    padding: 0.15rem 0;
}
.receipt-label {
    letter-spacing: 0.02em;
}
.receipt-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.receipt-change-line {
    padding: 0.35rem 0 0.2rem;
}
.receipt-change-line .receipt-label {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.receipt-amount-change {
    font-size: 1.15rem;
    font-weight: 700;
}
.receipt-amount-change.is-hidden-value {
    color: var(--receipt-muted);
    letter-spacing: 0.15em;
}
.receipt-thanks {
    text-align: center;
    font-size: 0.72rem;
    color: var(--receipt-muted);
    margin-top: 0.4rem;
    letter-spacing: 0.05em;
}

/* Tray */
.tray-wrap {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    min-height: 74px;
}

.tray-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

#trayTotal {
    font-family: var(--font-mono);
    color: var(--text);
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
}

.tray {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 38px;
    align-items: center;
}

.tray-empty {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.tray-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.92rem;
    color: #2a2a2a;
    cursor: pointer;
    transition: border-color 0.15s, filter 0.15s, transform 0.1s;
    animation: chipIn 0.18s ease-out;
}
@keyframes chipIn {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .tray-chip { animation: none; }
}

.tray-chip:hover {
    filter: brightness(0.93);
    border-color: var(--danger);
}

.tray-chip-b1  { background: linear-gradient(145deg, #c7ebd4, #8fcfa6); border-color: #5fa77e; }
.tray-chip-b5  { background: linear-gradient(145deg, #efd7c4, #d9a07a); border-color: #a87550; }
.tray-chip-b10 { background: linear-gradient(145deg, #f8e3a6, #e9bd5d); border-color: #b48b2d; }
.tray-chip-b20 { background: linear-gradient(145deg, #d8c7ef, #a585d4); border-color: #755aa7; }
.tray-chip-b50 { background: linear-gradient(145deg, #bfd9e4, #6f9fbc); border-color: #4a7590; }

.tray-chip-q,
.tray-chip-d,
.tray-chip-n {
    background: radial-gradient(circle at 30% 30%, #f5f5f3 0%, #cfcfcc 100%);
    border-color: #a6a5a0;
}
.tray-chip-p {
    background: radial-gradient(circle at 30% 30%, #e8a879 0%, #c47844 100%);
    border-color: #8e5424;
    color: #2b1b0b;
}

.tray-chip-count {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Action row */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.25rem 0 0;
    justify-content: center;
}

.feedback {
    min-height: 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    margin: 0.25rem 0 0.5rem;
    color: transparent;
    transition: color 0.2s;
}

.feedback-right { color: var(--success); }
.feedback-wrong { color: var(--danger); }
.feedback-skip  { color: var(--text-muted); }

/* Denominations */
.denoms {
    display: grid;
    gap: 1rem;
    margin-top: 0.5rem;
}

.denom-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
    gap: 0.55rem;
}

.denom-row-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.denom {
    position: relative;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s ease;
}

.denom:hover { transform: translateY(-2px); }
.denom:active { transform: translateY(0) scale(0.97); }
.denom:focus-visible {
    outline: 3px solid var(--cat-money);
    outline-offset: 3px;
    border-radius: 6px;
}

.denom-key {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    font-family: var(--font-mono);
}

/* ------- Bills ------- */
.denom-bill {
    min-height: 72px;
}
.denom-bill .bill-face {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 72px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow:
        inset 0 0 0 4px rgba(255, 255, 255, 0.35),
        inset 0 0 0 5px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.12);
    font-family: var(--font-sans);
    color: #1f1d17;
    overflow: hidden;
}
.denom-bill .bill-face::before {
    /* subtle engraving pattern */
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0 2px, transparent 2px 6px);
    pointer-events: none;
}
.denom-bill .bill-number {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}
.denom-bill .bill-word {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    opacity: 0.7;
    margin-top: 0.1rem;
    position: relative;
    z-index: 1;
}
.denom-bill .bill-corner {
    position: absolute;
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.55);
    z-index: 2;
}
.denom-bill .bill-corner-tl { top: 4px; left: 7px; }
.denom-bill .bill-corner-br { bottom: 4px; right: 7px; }

/* Per-denom bill colors (play-money palette, not real US currency) */
.denom-b1  .bill-face { background: linear-gradient(145deg, #c7ebd4 0%, #8fcfa6 100%); }
.denom-b5  .bill-face { background: linear-gradient(145deg, #efd7c4 0%, #d9a07a 100%); }
.denom-b10 .bill-face { background: linear-gradient(145deg, #f8e3a6 0%, #e9bd5d 100%); }
.denom-b20 .bill-face { background: linear-gradient(145deg, #d8c7ef 0%, #a585d4 100%); }
.denom-b50 .bill-face { background: linear-gradient(145deg, #bfd9e4 0%, #6f9fbc 100%); }

/* ------- Coins ------- */
.denom-coin {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}
.denom-coin .coin-face {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 3px rgba(0, 0, 0, 0.2),
        inset 0 -3px 6px rgba(0, 0, 0, 0.18),
        inset 0 3px 4px rgba(255, 255, 255, 0.4);
    font-family: var(--font-sans);
}
.denom-coin .coin-ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed rgba(0, 0, 0, 0.18);
}
.denom-coin .coin-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #2a2a2a;
    line-height: 1;
}
.denom-coin .coin-name {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(0, 0, 0, 0.55);
    margin-top: 0.15rem;
}

/* Silver coins */
.denom-q .coin-face,
.denom-d .coin-face,
.denom-n .coin-face {
    background: radial-gradient(circle at 35% 30%, #f5f5f3 0%, #cfcfcc 45%, #a6a5a0 100%);
}
/* Dime is noticeably smaller */
.denom-d .coin-face { width: 52px; height: 52px; }
/* Nickel slightly larger than dime, smaller than quarter */
.denom-n .coin-face { width: 58px; height: 58px; }
/* Penny: copper */
.denom-p .coin-face {
    width: 54px; height: 54px;
    background: radial-gradient(circle at 35% 30%, #e8a879 0%, #c47844 45%, #8e5424 100%);
}
.denom-p .coin-value { color: #2b1b0b; }

@media (max-width: 560px) {
    .denom-key { display: none; }
    .denom-bill { min-height: 64px; }
    .denom-bill .bill-face { height: 64px; }
    .denom-bill .bill-number { font-size: 1.1rem; }
    .denom-coin { min-height: 64px; }
    .denom-coin .coin-face { width: 54px; height: 54px; }
    .denom-d .coin-face { width: 46px; height: 46px; }
    .denom-n .coin-face { width: 50px; height: 50px; }
    .denom-p .coin-face { width: 48px; height: 48px; }
}

/* Countdown */
.countdown {
    text-align: center;
    font-family: var(--font-hand);
    font-size: 4rem;
    font-weight: 600;
    color: var(--cat-money);
    padding: 2rem 0;
    line-height: 1;
}

/* Handle dialog */
.handle-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.handle-dialog[hidden] { display: none; }

.handle-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 380px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.4);
}

.handle-card h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-hand);
    font-size: 1.6rem;
}

.handle-card p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.handle-card input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    margin-bottom: 0.5rem;
}

.handle-card input:focus {
    outline: 2px solid var(--cat-money);
    outline-offset: 1px;
}

.handle-error {
    color: var(--danger);
    font-size: 0.85rem;
    min-height: 1.2em;
    margin: 0 0 0.6rem;
}

.handle-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Summary */
.summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.summary h2 {
    font-family: var(--font-hand);
    font-size: 2rem;
    margin: 0 0 0.25rem;
    padding: 0;
}

.summary h2::after { display: none; }

.summary-score {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--cat-money);
    line-height: 1;
    margin: 0.5rem 0 0.25rem;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
}

.summary-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.summary-meta span strong {
    color: var(--text);
    font-family: var(--font-mono);
}

.summary-best-flag {
    color: var(--accent);
    font-family: var(--font-hand);
    font-size: 1.25rem;
    font-weight: 600;
    min-height: 1.5em;
    margin: 0.25rem 0 0.5rem;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.share-note {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    min-height: 1.2em;
}

/* Leaderboard (local) */
.leaderboard {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.leaderboard-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.local-best-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.local-best-list li {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto auto 3rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.local-best-list li:last-child { border-bottom: none; }
.local-best-list li.empty {
    display: block;
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
}

.local-best-list .rank {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 600;
}

.local-best-list .handle { font-weight: 500; }

.local-best-list .diff,
.local-best-list .date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.local-best-list .score {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--cat-money);
    text-align: right;
}

/* Content sections */
.game-content {
    margin-top: 2.25rem;
}

.game-content section {
    margin-bottom: 2rem;
}

.game-content h2 {
    margin-top: 0;
}

.game-content h3 {
    font-size: 1.1rem;
    margin: 1.25em 0 0.4em;
}

/* Subheads inside start panel */
.panel-subhead {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 1.25rem 0 0.4rem;
}

/* Callout (gotcha box) */
.callout {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    line-height: 1.55;
}
.callout-gotcha {
    background: #fff5e0;
    border: 1px solid #e9c87a;
    color: #5a4318;
}
:root[data-theme="dark"] .callout-gotcha {
    background: #3a2f15;
    border-color: #7a5f2a;
    color: #f0d99a;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .callout-gotcha {
        background: #3a2f15;
        border-color: #7a5f2a;
        color: #f0d99a;
    }
}
.callout strong { font-weight: 700; }

/* Worked example block */
.wx {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: 1rem 0;
}
.wx-q {
    font-weight: 600;
    font-family: var(--font-mono);
    margin: 0 0 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--border-strong);
    color: var(--text);
}
.wx-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    counter-reset: wxstep;
}
.wx-steps li {
    counter-increment: wxstep;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0;
    font-family: var(--font-mono);
    font-size: 0.92rem;
}
.wx-steps li::before {
    content: counter(wxstep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.35rem;
    flex-shrink: 0;
}
.wx-from, .wx-to {
    font-weight: 700;
    color: var(--text);
}
.wx-to { color: var(--cat-money); }
.wx-arrow {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0 0.15rem;
}
.wx-answer {
    margin: 0.5rem 0 0;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-strong);
    font-family: var(--font-sans);
    font-size: 0.95rem;
}
.wx-note {
    margin: 0.6rem 0 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Inline denomination chips inside worked examples */
.wx-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    min-width: 2rem;
    height: 1.7rem;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.8rem;
    color: #2a2a2a;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}
.chip-b1  { background: linear-gradient(145deg, #c7ebd4, #8fcfa6); border-color: #5fa77e; }
.chip-b5  { background: linear-gradient(145deg, #efd7c4, #d9a07a); border-color: #a87550; }
.chip-b10 { background: linear-gradient(145deg, #f8e3a6, #e9bd5d); border-color: #b48b2d; }
.chip-b20 { background: linear-gradient(145deg, #d8c7ef, #a585d4); border-color: #755aa7; }
.chip-b50 { background: linear-gradient(145deg, #bfd9e4, #6f9fbc); border-color: #4a7590; }
.chip-q, .chip-d, .chip-n {
    background: radial-gradient(circle at 30% 30%, #f5f5f3 0%, #cfcfcc 100%);
    border-color: #a6a5a0;
    border-radius: 50%;
    min-width: 1.7rem;
    padding: 0.15rem;
}
.chip-p {
    background: radial-gradient(circle at 30% 30%, #e8a879 0%, #c47844 100%);
    border-color: #8e5424;
    color: #2b1b0b;
    border-radius: 50%;
    min-width: 1.7rem;
    padding: 0.15rem;
}

.ftc-disclosure {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    margin: 1rem 0;
    border: 1px solid var(--border);
}

.affiliate-links {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.affiliate-links li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.affiliate-links li:last-child { border-bottom: none; }

.affiliate-links a { font-weight: 500; }

.affiliate-links .blurb {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.15rem;
}

/* Keyboard hint */
.kb-hints {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}
.kb-hints kbd {
    font-family: var(--font-mono);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

@media (max-width: 560px) {
    .kb-hints { display: none; }
    .local-best-list li {
        grid-template-columns: 2rem 1fr auto 3rem;
    }
    .local-best-list .date { display: none; }
}
