/**
 * Change a Tire — Life Sim #1 styles.
 * Local --cat-life definition (no edits to shared/styles.css to avoid
 * collision with Only Knights' parallel build).
 */

:root {
    --cat-life: #c55a3c;
    --cat-life-bg: #fae8e0;
    --jump-accent: var(--cat-life);
}
[data-theme="dark"] {
    --cat-life: #e07c5e;
    --cat-life-bg: #3a2921;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --cat-life: #e07c5e;
        --cat-life-bg: #3a2921;
    }
}

/* ===== Game-head / lede ===== */
.game-head h1 {
    display: inline-block;
}
.game-head .category {
    background: var(--cat-life-bg);
    color: var(--cat-life);
    font-weight: 600;
}
.game-lede {
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

/* Start-panel chrome (panel-grid, panel-col, panel-subhead, panel-note,
   circle-row, circle-pick, op-icon/mode-icon SVG sizing, op-name/mode-name,
   start-footer, btn-primary) is owned by shared/styles.css under the
   .game-page scope. Local rules previously here (S53-era v5 holdovers)
   were deleted in S54 so that v7-style facelifts can change every game's
   start panel by editing shared, not each game.css. */

/* Per-game tier subtitle copy. Shared .length-row hardcodes
   "Sprint/Standard/Endurance" for the Quick Math drill; tire-tier copy
   describes hint visibility instead. */
.game-page .length-row .circle-pick:has(input[value="easy"])   > span::after { content: "Image + text"; }
.game-page .length-row .circle-pick:has(input[value="medium"]) > span::after { content: "Image only"; }
.game-page .length-row .circle-pick:has(input[value="hard"])   > span::after { content: "Blank — memory"; }

/* Appendix B is a long-form deep-dive — eleven cards, some of which expand
   to large content (the 12-step procedure with photos, the soft-ground
   walkthrough, the tools list). Stack to a single column so opened cards
   get full width instead of toppling a 2-col grid. */
.game-page .v6-faq .faq-grid-stack {
    grid-template-columns: 1fr;
    gap: 0;
}
/* ===== Game area ===== */
.game-area {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 5rem;
}

.hud {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.15rem;
}
.hud-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 60px;
}
.hud-group[hidden] {
    display: none;
}
.hud-hint {
    font-size: 0.62rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.1rem;
    opacity: 0.85;
}
.hud-hint[hidden] {
    display: none;
}
.hud-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 700;
}
.hud-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cat-life);
}
.btn-end {
    margin-left: auto;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 0.3rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-end:hover {
    border-color: var(--cat-life);
    color: var(--cat-life);
}

/* ===== Build surface ===== */
.build-surface { }
.build-prompt, .spot-prompt {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
}

/* Sublabel — small header above the pool / order rows */
.surface-sublabel {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0.5rem 0 0.4rem;
}

/* Two-panel build layout: pool on the left, order on the right.
   Stacks vertically on tablet and below. */
.build-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1rem;
}
@media (max-width: 720px) {
    .build-panels { grid-template-columns: 1fr; gap: 0.75rem; }
}
.build-panel {
    min-width: 0;
    padding: 0.75rem;
    border-radius: 12px;
}
/* Slight tint so the boundary is obvious once photos fill both sides. */
.build-panel.panel-pool {
    background: var(--bg);
    border: 1px solid var(--border);
}
.build-panel.panel-order {
    /* v6: same white-on-rule chrome as panel-pool, distinguished by sublabel
       and the gold-frame on filled slots, not by a heavy tinted background. */
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.build-panel .surface-sublabel {
    margin-top: 0;
}

/* Picked row — the "in-progress" order the player is building */
.picked-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    min-width: 0;
}
/* Force every grid child to let 1fr win — default min-width: auto lets
   wider min-content items grab extra space and throws off column sizing. */
.picked-row > *,
.step-pool > * { min-width: 0; }
@media (max-width: 480px) {
    .picked-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
}
.slot-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0.35;
}

/* Step pool — shuffled chips to pick from */
.step-pool {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    min-width: 0;
}
@media (max-width: 480px) {
    .step-pool { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
}

/* Chip — minimalist: just a photo + label, no card chrome. */
.step-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
    font-family: inherit;
    color: var(--text);
    text-align: center;
}
.step-chip:hover .chip-img {
    box-shadow: inset 0 0 0 3px var(--cat-life);
}
.step-chip:active { transform: translateY(1px); }
.step-chip.picked .chip-img {
    box-shadow: inset 0 0 0 3px var(--cat-life);
}
.step-chip.picked .chip-label {
    color: var(--cat-life);
    font-weight: 700;
}
.chip-img {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    color: var(--cat-life);  /* inherits for SVG currentColor */
    background: var(--cat-life-bg);
    transition: box-shadow 0.15s;
}
.chip-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0 0.15rem;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
.chip-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cat-life);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Speedrun tier masking */
.step-pool.tier-medium .chip-label { visibility: hidden; }
.step-pool.tier-hard .chip-label { visibility: hidden; }
.step-pool.tier-hard .chip-img { visibility: hidden; }
.step-pool.tier-hard .step-chip::before {
    content: '?';
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 700;
    opacity: 0.5;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ===== Spot surface ===== */
.spot-sequence {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
@media (max-width: 720px) {
    .spot-sequence { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .spot-sequence { grid-template-columns: repeat(2, 1fr); }
}
/* Spot selection: first tap is "partial" (single chip), second tap locks the pair */
.spot-chip.spot-selected-partial .chip-img {
    box-shadow: 0 0 0 3px var(--cat-life-bg), 0 0 0 5px var(--cat-life);
    opacity: 0.85;
}
.spot-chip {
    cursor: pointer;
    user-select: none;
}
.spot-chip.spot-selected .chip-img {
    box-shadow: 0 0 0 3px var(--cat-life);
}
.spot-gap.spot-selected {
    border-color: var(--cat-life);
    background: var(--cat-life-bg);
    box-shadow: 0 0 0 3px rgba(197, 90, 60, 0.3);
}
.spot-seq-num {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
/* Omit-scenario palette — "Which step is missing?" button group.
   No container chrome — just the heading + buttons flowing inline. */
.omit-palette {
    margin: 0.5rem 0 0.9rem;
}
/* When Submit/Clear is relocated under the palette, space it out from the buttons */
.omit-palette .spot-actions {
    margin-top: 0.75rem;
}
.omit-palette-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.omit-option {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}
.omit-option:hover {
    border-color: var(--cat-life);
    color: var(--cat-life);
}
.omit-option.omit-selected {
    border-color: var(--cat-life);
    background: var(--cat-life);
    color: #fff;
}

/* Spot action row */
.spot-actions, .build-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.spot-actions .btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== Feedback ===== */
.feedback {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin: 0 auto 1.5rem;
    max-width: 760px;
    /* Reserve space for the sticky site-header when scrollIntoView snaps here. */
    scroll-margin-top: 5rem;
}
/* Feedback header — verdict + buttons on the same row */
.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.feedback-title-block {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
}
.fb-verdict {
    font-size: 1.05rem;
    font-weight: 700;
    margin-right: 0.15rem;
}
.fb-verdict.ok { color: #2e7d32; }
.fb-verdict.bad { color: var(--cat-life); }
.feedback-header .feedback-actions {
    margin-top: 0;
    flex: 0 0 auto;
    gap: 0.4rem;
}
@media (max-width: 560px) {
    .feedback-header { flex-direction: column; align-items: stretch; }
}

/* Compact 3-column step-review grid — inline check/label, minimal padding */
.feedback-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 0.85rem;
}
.feedback-grid-3col li {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.25rem 0.4rem;
    margin: 0;
    border-radius: 5px;
    font-size: 0.82rem;
    line-height: 1.25;
    flex-wrap: wrap;
}
.feedback-grid-3col li::before { content: none; }
.feedback-grid-3col .feedback-check {
    font-size: 0.9rem;
    flex: 0 0 auto;
}
.feedback-grid-3col .feedback-step-label {
    flex: 1 1 auto;
    min-width: 0;
}
.feedback-grid-3col .feedback-why {
    flex: 1 0 100%;
    font-size: 0.72rem;
    margin: 0.15rem 0 0;
    padding-left: 1.1rem;
    line-height: 1.3;
}
@media (max-width: 720px) {
    .feedback-grid-3col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .feedback-grid-3col { grid-template-columns: 1fr; }
}
.feedback-title {
    margin: 0 0 0.85rem;
    font-size: 1.3rem;
    color: var(--cat-life);
}
.feedback-lead {
    color: var(--text);
    margin-bottom: 1rem;
}
.feedback-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    counter-reset: step;
}
.feedback-list li {
    counter-increment: step;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}
.feedback-list li::before {
    content: counter(step);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.75rem;
    align-self: start;
    line-height: 1.6;
    grid-row: span 2;
    min-width: 20px;
}
/* v6: status shown by the colored ✓/✗ glyph and a 2px left border, not by
   a heavy fill. Keeps the verdict scannable without breaking the white-on-rule
   page rhythm. */
.feedback-list li.ok  { background: #fff; border-left: 2px solid #2e7d32; }
.feedback-list li.bad { background: #fff; border-left: 2px solid var(--cat-life); }
.feedback-check {
    font-weight: 700;
    font-size: 0.95rem;
}
.feedback-list li.ok .feedback-check { color: #2e7d32; }
.feedback-list li.bad .feedback-check { color: var(--cat-life); }
.feedback-step-label {
    font-weight: 500;
}
.feedback-why {
    grid-column: 2 / -1;
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}
.feedback-why-lead {
    display: block;
    grid-column: unset;
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text);
    font-style: normal;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    background: var(--v6-accent-soft);
    border-left: 3px solid var(--v6-accent);
    border-radius: 0;
}
.feedback-list-spot {
    padding: 0;
    margin: 0 0 0.85rem;
    list-style: none;
    counter-reset: step;
}
.feedback-list-spot li {
    counter-increment: step;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.55rem;
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    line-height: 1.3;
    border-radius: 5px;
}
.feedback-list-spot li::before {
    content: counter(step);
    flex: 0 0 auto;
    min-width: 1.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
}
.feedback-list-spot .feedback-step-label {
    flex: 1 1 auto;
    min-width: 0;
}
.feedback-list-spot .defect-tag {
    flex: 0 0 auto;
    margin-left: auto;
}
.feedback-list-spot li.defect-highlight {
    background: #fff;
    border: 1.5px solid var(--cat-life);
    border-left-width: 3px;
}
.defect-tag {
    font-size: 0.7rem;
    background: var(--cat-life);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.feedback-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ===== Summary ===== */
.summary {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    scroll-margin-top: 5rem;
}
.summary h2 {
    margin: 0 0 0.6rem;
    font-size: 1.25rem;
}
.summary-score {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--cat-life);
    margin: 0.5rem 0 0;
    font-family: 'JetBrains Mono', monospace;
}
.summary-label {
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
}
.summary-pb {
    font-weight: 600;
    color: var(--cat-life);
    margin: 0.5rem 0 1rem;
}
.summary-fail {
    color: var(--text);
    margin: 1rem 0 0.5rem;
    font-weight: 500;
}
.summary-flag {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0.5rem 0 1rem;
}
.summary-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.share-note {
    font-size: 0.82rem;
    color: var(--cat-life);
    margin-top: 0.6rem;
    min-height: 1.2em;
}

/* ===== FAQ procedure block (Q1 gets photos) ===== */
.procedure-steps {
    list-style: none;
    padding: 0;
    counter-reset: proc;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1rem 0;
}
.procedure-steps li {
    counter-increment: proc;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.85rem;
    align-items: center;
    padding: 0.6rem;
    background: #fff;
    border-radius: 0;
    border: 1px solid var(--v6-rule);
}
.procedure-steps li::before {
    content: counter(proc);
    position: absolute;
    left: -12px;
    top: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cat-life);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.procedure-steps li {
    position: relative;
}
.procedure-steps img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 0;
    color: var(--v6-muted);
    background: var(--v6-rule-soft);
}
.procedure-steps p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

/* ===== Affiliates ===== */
.affiliate-links {
    list-style: none;
    padding: 0;
}
.affiliate-links li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.affiliate-links li:last-child { border-bottom: none; }
.affiliate-links a {
    color: var(--cat-life);
    font-weight: 600;
    text-decoration: none;
}
.affiliate-links a:hover { text-decoration: underline; }
.affiliate-links .blurb {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 0.3rem;
}
.ftc-disclosure {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

/* ===== Walkthrough ===== */
.walkthrough {
    padding-left: 1.3rem;
    margin: 0.8rem 0;
}
.walkthrough li {
    margin-bottom: 0.5rem;
    line-height: 1.55;
}
