/**
 * 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);
}

/* ===== PB strip ===== */
.pb-strip {
    background: var(--cat-life-bg);
    color: var(--cat-life);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    margin: 0.75rem 0 1rem;
    font-size: 0.9rem;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}
.pb-strip-label {
    opacity: 0.85;
}
.pb-strip-value {
    font-weight: 700;
}

/* ===== Start panel ===== */
.start-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.start-panel h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}
.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (max-width: 720px) {
    .panel-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}
.panel-col { min-width: 0; }
.panel-subhead {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 0.6rem;
}
.panel-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.6rem 0 0;
    line-height: 1.4;
}

/* Mode/Op/Tier pickers */
.circle-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.circle-pick {
    flex: 1 1 0;
    min-width: 75px;
    position: relative;
    cursor: pointer;
}
.circle-pick input { position: absolute; opacity: 0; pointer-events: none; }
.circle-pick > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.6rem 0.5rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-align: center;
    min-height: 48px;
}
.circle-pick input:checked + span {
    border-color: var(--cat-life);
    background: var(--cat-life-bg);
    color: var(--cat-life);
}
.circle-pick .op-icon {
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
}
.circle-pick .op-icon svg {
    width: 22px;
    height: 22px;
}
.circle-pick .op-name {
    font-size: 0.78rem;
    opacity: 0.85;
}

.start-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn-primary {
    background: var(--cat-life);
    color: #fff;
    border: none;
    padding: 0.7rem 1.3rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-ghost:hover {
    border-color: var(--cat-life);
    color: var(--cat-life);
}

/* ===== Game area ===== */
.game-area {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.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-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;
}

/* Picked row — the "in-progress" order the player is building */
.picked-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 12px;
    min-height: 120px;
}
@media (max-width: 720px) {
    .picked-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
    .picked-row { grid-template-columns: repeat(3, 1fr); }
}
.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.9rem;
    opacity: 0.4;
}

/* Step pool — shuffled chips to pick from */
.step-pool {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
@media (max-width: 720px) {
    .step-pool { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
}

/* Chip — the unit */
.step-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    color: var(--text);
    min-height: 150px;
    text-align: center;
}
.step-chip:hover {
    border-color: var(--cat-life);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.step-chip:active { transform: translateY(0); }
.step-chip.picked {
    background: var(--cat-life-bg);
    border-color: var(--cat-life);
    color: var(--cat-life);
}
.chip-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    color: var(--cat-life);  /* inherits for SVG currentColor */
    background: var(--cat-life-bg);
}
.chip-label {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}
.chip-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    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.15);
}

/* 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(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}
@media (max-width: 720px) {
    .spot-sequence { grid-template-columns: repeat(2, 1fr); }
}
.spot-chip {
    cursor: pointer;
    user-select: none;
}
.spot-chip.spot-selected,
.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: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spot-gap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    min-height: 110px;
    font-size: 0.78rem;
    transition: border-color 0.15s, background 0.15s;
}
.spot-gap:hover {
    border-color: var(--cat-life);
    color: var(--cat-life);
}
.gap-num {
    font-size: 2rem;
    font-weight: 700;
    opacity: 0.6;
}
.gap-label {
    font-style: italic;
}

/* 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;
    margin-bottom: 1.5rem;
}
.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;
}
.feedback-list li.ok { background: rgba(76, 175, 80, 0.08); }
.feedback-list li.bad { background: rgba(220, 80, 50, 0.1); }
.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-list-spot li {
    grid-template-columns: 1fr auto;
}
.feedback-list-spot li::before { grid-row: 1; }
.feedback-list-spot li.defect-highlight {
    background: var(--cat-life-bg);
    border: 1.5px solid var(--cat-life);
}
.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;
}
.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: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.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: 8px;
    color: var(--cat-life);
    background: var(--cat-life-bg);
}
.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;
}

/* ===== FAQ TOC ===== */
.faq-toc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin: 1rem 0 1.25rem;
}
.faq-toc-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.4rem;
}
.faq-toc ol {
    padding-left: 1.2rem;
    margin: 0;
}
.faq-toc li {
    margin: 0.2rem 0;
}
.faq-toc a {
    color: var(--cat-life);
    text-decoration: none;
}
.faq-toc a:hover { text-decoration: underline; }

/* ===== Walkthrough ===== */
.walkthrough {
    padding-left: 1.3rem;
    margin: 0.8rem 0;
}
.walkthrough li {
    margin-bottom: 0.5rem;
    line-height: 1.55;
}
