/* Component Repair Shop (/games/component-repair-shop). Effects follow the Grammar Gauntlet kit, prefix crs-. */

.crs-hero { background: linear-gradient(135deg, #0f766e, #0e7490); }
.crs-card { overflow: hidden; }

/* The stage clips every effect. */
.crs-stage { position: relative; overflow: hidden; }

.crs-example { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem; }
.crs-example-part { display: inline-flex; flex-direction: column; align-items: center; min-width: 3.4rem; padding: 0.3rem 0.6rem; border: 2px solid #a5d8d3; border-radius: 0.6rem; background: #f0fdfa; font-size: 1.6rem; line-height: 1.1; }
.crs-example-part small { font-size: 0.7rem; color: #6b7280; }
.crs-example-swap { border-color: #f59e0b; background: #fffbeb; font-size: 1.25rem; }
.crs-example-done { position: relative; border-color: #16a34a; background: #dcfce7; }
/* A strip of tape across the broken example, and a small check on the fixed one. */
.crs-example-broken { position: relative; overflow: hidden; border-color: #f59e0b; background: #fffbeb; transform: rotate(-3deg); }
.crs-example-broken::after { content: ""; position: absolute; left: -15%; right: -15%; top: 30%; height: 24%; background: rgba(120, 130, 142, 0.45); transform: rotate(-20deg); pointer-events: none; }
.crs-example-check { position: absolute; top: -0.45rem; right: -0.45rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2px solid #fff; background: #16a34a; color: #fff; font-size: 0.62rem; display: flex; align-items: center; justify-content: center; transform: rotate(-10deg); }
.crs-arrow { font-weight: 800; color: #0f766e; }

.crs-band-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
@media (min-width: 768px) { .crs-band-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.crs-band { display: flex; flex-direction: column; align-items: center; padding: 0.55rem 0.4rem; border: 2px solid #a5d8d3; border-radius: 0.75rem; background: #fff; color: #1f2937; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.crs-band span { font-size: 0.78rem; color: #6b7280; }
.crs-band.active, .crs-band[aria-pressed="true"] { background: linear-gradient(135deg, #0f766e, #0e7490); border-color: #14b8a6; color: #fff; }
.crs-band.active span, .crs-band[aria-pressed="true"] span { color: #ccfbf1; }
@media (hover: hover) { .crs-band:hover:not(.active) { border-color: #0f766e; } }
.crs-band:active { transform: scale(0.97); }
.crs-band.crs-picked { animation: crs-pop 0.3s ease; }

.crs-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.crs-heart { display: inline-block; color: #dc2626; font-size: 1.15rem; }
.crs-heart-lost { color: #9ca3af; }
.crs-last-try { margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 0.72rem; font-weight: 700; }
.crs-heart.crs-heart-gain { animation: crs-heart-gain 0.7s ease; }
@keyframes crs-heart-gain { 0% { transform: scale(0.4); } 50% { transform: scale(1.6); color: #f43f5e; } 100% { transform: scale(1); } }
.crs-sound { margin-left: auto; }
.crs-combo-badge { color: #fff; background: #6b7280; }
.crs-combo-badge.crs-combo-2 { background: #0284c7; }
.crs-combo-badge.crs-combo-3 { background: #7c3aed; }
.crs-combo-badge.crs-combo-4 { background: #ea580c; }
.crs-combo-badge.crs-combo-5 { background: linear-gradient(135deg, #dc2626, #f97316); animation: crs-glow 1.2s ease-in-out infinite; }

/* The shelf view reserves its height so nothing below it moves when 3D arrives. */
.crs-scene { position: relative; height: 180px; border-radius: 0.75rem; background: linear-gradient(180deg, #3a2f24, #1d1813); overflow: hidden; margin-bottom: 0.6rem; }
@media (min-width: 768px) { .crs-scene { height: 260px; } }
.crs-scene .crs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.crs-scene-3d .crs-flat { display: none; }
.crs-flat { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2.5%; padding: 0 5% 22px; border-bottom: 14px solid #7c5435; }
.crs-ftile { position: relative; flex: 0 1 13%; aspect-ratio: 1; max-height: 70%; border-radius: 0.4rem; border: 2px dashed #64748b; display: flex; align-items: center; justify-content: center; font-size: clamp(1.1rem, 5vw, 2rem); font-weight: 700; color: transparent; }
.crs-ftile-focus { border-color: #fde68a; box-shadow: 0 0 0 2px #fde68a, 0 0 16px rgba(253, 230, 138, 0.55); }
.crs-ftile-done { border: 2px solid #ffffff; background: linear-gradient(160deg, #ffffff, #f1f5f9); color: #0f172a; box-shadow: 0 0 14px rgba(255, 255, 255, 0.55); animation: crs-pop 0.35s ease; }
.crs-ftile-gold { border-color: #fde047; background: linear-gradient(160deg, #fef9c3, #facc15); box-shadow: 0 0 18px rgba(250, 204, 21, 0.7); }
/* Repaired and waiting for its pick-up: on the shelf, not yet glowing or stickered. */
.crs-ftile-staged { border: 2px solid #e2e8f0; background: linear-gradient(160deg, #ffffff, #e2e8f0); color: #0f172a; }
/* The sticker on a finished tile: a green check when repaired, a red X when missed. */
.crs-sticker { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; transform: rotate(-10deg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); pointer-events: none; animation: crs-pop 0.35s ease; }
.crs-sticker-ok { background: #16a34a; }
.crs-sticker-bad { background: #dc2626; }
.crs-ftile-missed { border: 2px solid #f87171; background: #475569; color: #fecaca; }

/* ── The repair ticket: the owner's note, the broken tile (the biggest thing on the bench), what it should be ── */
.crs-ticket { position: relative; max-width: 36rem; margin: 0 auto; padding: 0.5rem 0.7rem 0.7rem; border: 1px solid #d8c49c; border-radius: 0.6rem; background: #f8eed8; color: #3b2f22; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12); }
.crs-ticket::before { content: ""; position: absolute; top: 0.55rem; left: 0.65rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--bs-card-bg, #fff); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35); }
.crs-ticket-head { padding-left: 1.15rem; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #8a6a3d; }
.crs-story { margin: 0.15rem 0 0.75rem; min-height: 2.6em; font-size: 0.95rem; font-style: italic; line-height: 1.3; text-align: center; }
.crs-ticket-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0.65rem; align-items: start; }
.crs-broken-box { position: relative; z-index: 1; text-align: center; }
.crs-broken-box.crs-shake { animation: crs-shake 0.4s ease; }
/* The tile: glazed porcelain, as on the shelf, set down crooked until it is fixed. */
.crs-tile {
    position: relative; width: 100%; max-width: 15rem; aspect-ratio: 1; margin: 0.3rem auto 0.55rem;
    border: 1px solid #e7e1d4; border-radius: 0.9rem; background: #fbfaf6;
    box-shadow: 0 5px 0 #d8cfbd, 0 10px 18px rgba(0, 0, 0, 0.22);
    transform: rotate(var(--tilt, 0deg)); transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.crs-tile.crs-drop { animation: crs-tile-drop 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) backwards; }
@keyframes crs-tile-drop {
    0% { opacity: 0; transform: translateY(-2.5rem) rotate(calc(var(--tilt, 0deg) - 14deg)); }
    100% { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
}
.crs-tile .crs-glyph-big { position: absolute; inset: 7%; width: auto; height: auto; margin: 0; }
.crs-tile .crs-stroke { fill: #1f2937; }
.crs-tile .crs-stroke-bad { fill: #dc2626; }
.crs-tile .crs-stroke-good { fill: #16a34a; }
.crs-tile .crs-glyph-masked { border: 0; font-size: clamp(3.5rem, 18vw, 6rem); color: #b8ad98; }
.crs-tile .crs-glyph-text { font-size: clamp(4rem, 22vw, 9rem); color: #1f2937; }
/* Patches: tape, band-aids, a nailed board, staples and a crack. Multiplied onto the glaze so every
   stroke under them stays readable; they fall away when the tile is fixed. */
.crs-patches { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; }
.crs-crack { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.35s ease; }
.crs-crack path { fill: none; stroke: #8f9aa8; stroke-width: 1.4px; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.crs-patch {
    position: absolute; left: var(--x); top: var(--y); width: var(--w);
    transform: translate(-50%, -50%) rotate(var(--r));
    transition: transform 0.55s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.45s ease;
}
.crs-patch svg { display: block; width: 100%; height: auto; overflow: visible; }
.crs-patches-off .crs-patch { opacity: 0; transform: translate(calc(-50% + var(--ox)), calc(-50% + 9rem)) rotate(calc(var(--r) + var(--or))); }
.crs-patches-off .crs-crack { opacity: 0; }
.crs-tape { fill: #bcc3cb; }
.crs-tape-weave { fill: none; stroke: #d6dbe0; stroke-width: 1.2; }
.crs-aid { fill: #e2a979; }
.crs-aid-pad { fill: #f3d6b6; }
.crs-aid-holes { fill: #b9784c; }
.crs-plank { fill: #d9ab7c; }
.crs-plank-grain { fill: none; stroke: #c08d5a; stroke-width: 1.2; }
.crs-nail { fill: #71717a; stroke: #3f3f46; stroke-width: 1.2; }
.crs-nail-shine { fill: #d4d4d8; }
.crs-staple { fill: none; stroke: #8f9aa8; stroke-width: 3.5; stroke-linecap: square; }
/* The green Fixed sticker, slapped onto the tile's corner. */
.crs-fixed {
    position: absolute; top: -0.65rem; right: -0.75rem; z-index: 2;
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem;
    border: 3px solid #fff; border-radius: 0.55rem; background: #16a34a; color: #fff;
    font-size: clamp(0.85rem, 3.6vw, 1.1rem); font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); transform: rotate(-12deg); pointer-events: none;
}
.crs-fixed[hidden] { display: none; }
.crs-fixed .fa { font-size: 1.15em; }
.crs-fixed.crs-stamp { animation: crs-stamp 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes crs-stamp {
    0% { opacity: 0; transform: rotate(-30deg) scale(2.4); }
    60% { opacity: 1; transform: rotate(-9deg) scale(0.9); }
    100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}
/* What it should be (and, after a pick-up, the look-alike). */
.crs-sheet { position: relative; padding: 0.4rem 0.35rem 0.5rem; border: 1px solid #e3d5b8; border-radius: 0.55rem; background: #fffdf8; text-align: center; }
.crs-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.crs-glyph { width: 6.2rem; height: 6.2rem; margin: 0.15rem auto; }
.crs-glyph-target { width: 4.4rem; height: 4.4rem; }
@media (min-width: 768px) { .crs-glyph-target { width: 5.6rem; height: 5.6rem; } }
.crs-glyph svg, .crs-part svg { width: 100%; height: 100%; display: block; }
.crs-glyph-text { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 3rem; }
.crs-stroke { fill: #1f2937; transition: fill 0.25s ease, opacity 0.35s ease; }
.crs-stroke-dim { fill: #cbd5e1; }
.crs-stroke-bad { fill: #dc2626; }
.crs-stroke-good { fill: #16a34a; }
.crs-stroke-ghost { opacity: 0; }
.crs-glyph-masked { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #94a3b8; border: 2px dashed #cbd5e1; border-radius: 0.6rem; }
.crs-word { font-size: 0.95rem; line-height: 1.25; }
.crs-word .crs-hz { font-size: 1.15rem; font-weight: 700; }
.crs-ticket .crs-word { font-size: 0.85rem; }
.crs-ticket .crs-sheet .crs-word .crs-hz { font-size: 1.05rem; }
.crs-gap { display: inline-block; min-width: 1.2em; border-bottom: 3px solid #0f766e; color: #0f766e; }
.crs-sheet.crs-shake { animation: crs-shake 0.4s ease; }
.crs-sheet.crs-deal { animation: crs-deal-in 0.3s ease backwards; }

.crs-clock { height: 6px; border-radius: 3px; background: #e2f3f1; overflow: hidden; }
.crs-clock-bar { height: 100%; width: 100%; background: #16a34a; }
.crs-clock-urgent .crs-clock-bar { background: #f97316; animation: crs-pulse 0.6s ease-in-out infinite; }
.crs-clock-off { visibility: hidden; }

.crs-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; max-width: 30rem; margin: 0 auto; }
.crs-choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 23rem; }
.crs-choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 20rem; }
.crs-part {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; min-height: 4.6rem; padding: 0.35rem;
    border: 2px solid #a5d8d3; border-radius: 0.7rem; background: #fff; color: #1f2937;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    animation: crs-deal-in 0.28s ease backwards;
}
.crs-part .crs-part-glyph { width: 3.6rem; height: 3.6rem; transition: transform 0.15s ease; }
.crs-part-caption { font-size: 0.74rem; color: #4b5563; line-height: 1.15; }
.crs-choices-hanzi .crs-part { min-height: 3.6rem; font-size: 2rem; font-weight: 700; }
/* Hover lifts the drawing, never the button: a lifted box slides off a cursor resting on its edge and
   jitters, and the tray opens exactly where the cursor just pressed (seen 2026-11-19). */
@media (hover: hover) {
    .crs-part:hover:not(:disabled) { border-color: #0f766e; }
    .crs-part:hover:not(:disabled) .crs-part-glyph { transform: translateY(-2px); }
}
.crs-part:active:not(:disabled) { transform: scale(0.97); background: #ccfbf1; }
.crs-part.correct { border-color: #16a34a; background: #dcfce7; animation: crs-pop 0.35s ease; }
.crs-part.wrong { border-color: #dc2626; background: #fee2e2; animation: crs-shake 0.35s ease; }
.crs-part.faded { opacity: 0.5; }

/* The question, in words. */
.crs-prompt { text-align: center; line-height: 1.35; font-weight: 600; }

/* The tray: a wooden board with a raised rim, the parts sitting on it like tiles. */
.crs-tray-board {
    max-width: 32rem; margin: 0 auto; padding: 0.85rem 0.75rem 1rem;
    border-radius: 1rem; border: 6px solid #6b4227;
    background:
        repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.05) 0 3px, transparent 3px 22px),
        linear-gradient(180deg, #c08a5c, #9c6a43);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(255, 255, 255, 0.15), 0 6px 14px rgba(0, 0, 0, 0.18);
}
.crs-tray-board .crs-part { box-shadow: 0 4px 0 #d6c3a5, 0 6px 10px rgba(0, 0, 0, 0.28); border-color: #f1e3cc; background: #fffdf8; }
.crs-tray-board .crs-part-caption { font-weight: 600; }
.crs-tray-board .crs-part.correct { border-color: #16a34a; background: #dcfce7; }
.crs-tray-board .crs-part.wrong { border-color: #dc2626; background: #fee2e2; }

.crs-recall { text-align: center; font-size: 2rem; font-weight: 700; letter-spacing: 0.08em; }
.crs-recall small { display: block; font-size: 0.9rem; font-weight: 400; letter-spacing: 0; color: #4b5563; }

.crs-chest { display: inline-block; padding: 0.75rem 1.25rem; border-radius: 0.75rem; background: #ccfbf1; border: 2px solid #14b8a6; color: #134e4a; }
.crs-writer { width: 220px; height: 220px; border: 2px solid #a5d8d3; border-radius: 0.75rem; background: #fff; }
.crs-review li { padding: 0.35rem 0; border-bottom: 1px solid #e2f3f1; }

.crs-result-dialog { display: block; position: relative; width: 100%; max-width: 40rem; margin: 0 auto; padding: 1.5rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 1rem; color: var(--bs-body-color, #212529); background: var(--bs-body-bg, #fff); }
.crs-result-dialog[open] { position: fixed; width: calc(100% - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; margin: auto; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25); }
.crs-result-dialog::backdrop { background: rgba(15, 23, 42, 0.65); }
.crs-result-close { position: absolute; top: 0.75rem; right: 0.75rem; }
.crs-result-dialog:not([open]) .crs-result-close { display: none; }
.crs-play-again { display: inline-flex; flex-direction: column; align-items: center; min-width: 13rem; padding: 0.7rem 1.5rem; }
.crs-play-again small { font-size: 0.75rem; font-weight: 400; }

/* ── Effects (chrome: never clickable, clipped by the stage) ───────── */
.crs-float {
    position: absolute; transform: translate(-50%, -50%);
    font-weight: 800; font-size: 1.5rem; color: #15803d; text-shadow: 0 1px 0 #fff;
    pointer-events: none; z-index: 4;
    animation: crs-float-up 0.9s ease-out forwards;
}
@keyframes crs-float-up {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
    20% { transform: translate(-50%, -70%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
.crs-particle {
    position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
    pointer-events: none; z-index: 3;
    animation: crs-burst 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.crs-spark { width: 6px; height: 6px; animation-duration: 1s; animation-fill-mode: both; }
@keyframes crs-burst {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}
.crs-confetti {
    position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
    pointer-events: none; z-index: 6;
    animation: crs-confetti-fall 1.8s ease-in forwards;
}
@keyframes crs-confetti-fall {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    100% { opacity: 0; transform: translate(var(--drift), 460px) rotate(var(--spin)); }
}
.crs-combo-pop {
    position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
    font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 900; color: #0f766e;
    text-shadow: 0 2px 0 #fff, 0 6px 18px rgba(20, 184, 166, 0.45);
    white-space: nowrap; pointer-events: none; z-index: 4;
    animation: crs-combo-pop 1.1s ease-out forwards;
}
.crs-combo-pop-3 { color: #7c3aed; }
.crs-combo-pop-4 { color: #ea580c; }
.crs-combo-pop-5 { color: #dc2626; }
@keyframes crs-combo-pop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-6deg); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(2deg); }
    45% { transform: translate(-50%, -50%) scale(1) rotate(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
.crs-toast {
    position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%);
    padding: 0.35rem 0.9rem; border-radius: 999px;
    background: #facc15; color: #422006;
    font-weight: 800; font-size: 0.9rem; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    pointer-events: none; z-index: 4;
    animation: crs-toast 2.1s ease forwards;
}
@keyframes crs-toast {
    0% { opacity: 0; transform: translate(-50%, -12px); }
    12% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -6px); }
}
.crs-heart.crs-heart-break { animation: crs-heart-break 0.6s ease; }
@keyframes crs-heart-break {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); color: #ef4444; }
    60% { transform: scale(0.7) rotate(-12deg); }
    100% { transform: scale(0.85); }
}
.crs-bump { display: inline-block; animation: crs-bump 0.35s ease; }
@keyframes crs-bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes crs-pop { 0% { transform: scale(1); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes crs-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes crs-deal-in { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes crs-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes crs-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}

/* ── Dark theme: selected states named explicitly so they out-rank the plain dark rules ── */
[data-bs-theme="dark"] .crs-band, [data-bs-theme="dark"] .crs-part { background: #1f2937; color: #f3f4f6; border-color: #4b5563; }
[data-bs-theme="dark"] .crs-band span, [data-bs-theme="dark"] .crs-part-caption, [data-bs-theme="dark"] .crs-recall small { color: #cbd5e1; }
[data-bs-theme="dark"] .crs-band.active,
[data-bs-theme="dark"] .crs-band[aria-pressed="true"] { background: linear-gradient(135deg, #0f766e, #0e7490); border-color: #5eead4; color: #fff; }
[data-bs-theme="dark"] .crs-band.active span,
[data-bs-theme="dark"] .crs-band[aria-pressed="true"] span { color: #ccfbf1; }
[data-bs-theme="dark"] .crs-part.correct { background: #14532d; border-color: #22c55e; color: #fff; }
[data-bs-theme="dark"] .crs-part.wrong { background: #7f1d1d; border-color: #f87171; color: #fff; }
[data-bs-theme="dark"] .crs-example-part { background: #1f2937; border-color: #2f6f69; color: #f3f4f6; }
[data-bs-theme="dark"] .crs-example-broken { border-color: #b45309; background: #292018; }
[data-bs-theme="dark"] .crs-example-done { border-color: #22c55e; background: #14532d; }
[data-bs-theme="dark"] .crs-ticket { background: #2b241b; border-color: #5a4a33; color: #f1e7d6; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45); }
[data-bs-theme="dark"] .crs-ticket-head { color: #d6b98a; }
[data-bs-theme="dark"] .crs-sheet { background: #1f2937; border-color: #4b5563; color: #f3f4f6; }
[data-bs-theme="dark"] .crs-label { color: #cbd5e1; }
/* The glaze stays light in the dark theme, so its strokes stay dark. */
[data-bs-theme="dark"] .crs-tile { background: #f1efe9; border-color: #cfc8b8; box-shadow: 0 5px 0 #8f8572, 0 10px 18px rgba(0, 0, 0, 0.5); }
[data-bs-theme="dark"] .crs-tile .crs-stroke { fill: #1f2937; }
[data-bs-theme="dark"] .crs-tile .crs-stroke-bad { fill: #dc2626; }
[data-bs-theme="dark"] .crs-tile .crs-stroke-good { fill: #16a34a; }
[data-bs-theme="dark"] .crs-fixed { border-color: #f1efe9; }
[data-bs-theme="dark"] .crs-stroke { fill: #f3f4f6; }
[data-bs-theme="dark"] .crs-stroke-dim { fill: #475569; }
[data-bs-theme="dark"] .crs-stroke-bad { fill: #f87171; }
[data-bs-theme="dark"] .crs-stroke-good { fill: #4ade80; }
[data-bs-theme="dark"] .crs-tray-board { border-color: #3f2a1a; background: repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 3px, transparent 3px 22px), linear-gradient(180deg, #7a5233, #5c3d25); }
[data-bs-theme="dark"] .crs-tray-board .crs-part { background: #1f2937; border-color: #6b5434; box-shadow: 0 4px 0 #3f2a1a, 0 6px 10px rgba(0, 0, 0, 0.5); }
[data-bs-theme="dark"] .crs-tray-board .crs-part.correct { background: #14532d; border-color: #22c55e; }
[data-bs-theme="dark"] .crs-tray-board .crs-part.wrong { background: #7f1d1d; border-color: #f87171; }
[data-bs-theme="dark"] .crs-gap { color: #5eead4; border-color: #5eead4; }
[data-bs-theme="dark"] .crs-clock { background: #374151; }
[data-bs-theme="dark"] .crs-chest { background: #134e4a; color: #ccfbf1; }
[data-bs-theme="dark"] .crs-writer { background: #f8fafc; }
[data-bs-theme="dark"] .crs-review li { border-color: #374151; }
[data-bs-theme="dark"] .crs-float { text-shadow: none; }

/* Last in the file: reduced motion turns every effect off, not just slower. */
@media (prefers-reduced-motion: reduce) {
    .crs-stage *, .crs-hud * { animation: none !important; transition: none !important; }
    .crs-part:active:not(:disabled), .crs-band:active { transform: none; }
}
