/* ===== DISJONCTEUR — DA SPECTRE (cProd/DESIGN.md) × couche VHS (EchosMEMOIRE / ScorePORTES) ===== */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

:root {
    color-scheme: dark;
    /* Substrats SPECTRE */
    --bg-void: #050608;
    --bg-surface: #0C0F14;
    --bg-elevated: #141922;
    --bg-interactive: #1C2330;
    --border-subtle: rgba(255, 255, 255, 0.14);
    --border-panel: rgba(255, 255, 255, 0.24);
    --border-control: rgba(255, 255, 255, 0.34);
    --text-primary: #F3F6FA;
    --text-secondary: #B0BCCE;
    --text-muted: #7E8C9F;

    --accent-cyan: #00F0FF;
    --accent-emerald: #00E676;
    --accent-amber: #FFB800;
    --accent-crimson: #FF1E56;
    --accent-indigo: #5C7CFA;

    /* Franges d'aberration chromatique VHS */
    --chroma-r: rgba(255, 30, 86, 0.55);
    --chroma-b: rgba(0, 240, 255, 0.55);

    --font-osd: 'VT323', ui-monospace, monospace;
    --font-mono: 'Share Tech Mono', ui-monospace, monospace;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);

    accent-color: var(--accent-cyan);
    scrollbar-color: #4B586E #0C0F14;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    font-family: var(--font-mono);
    color: var(--text-primary);
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(176, 188, 206, 0.08), transparent 70%),
        linear-gradient(180deg, #0A0D12 0%, var(--bg-void) 60%);
    inline-size: 100%;
    min-block-size: 100dvh;
    overflow-x: clip;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Couches VHS : vignette, scanlines, grain, bande de tracking ---------- */
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40;
    background:
        radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.78) 100%),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.24) 0 1px, transparent 1px 3px);
}
.vhs-noise {
    position: fixed; inset: -50%; pointer-events: none; z-index: 41; opacity: 0.08;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    animation: grain 0.5s steps(4) infinite;
}
.vhs-tracking {
    position: fixed; inset-inline: 0; block-size: 9vh; pointer-events: none; z-index: 42;
    background: linear-gradient(180deg, transparent, rgba(243, 246, 250, 0.05) 40%, rgba(243, 246, 250, 0.1) 50%, rgba(243, 246, 250, 0.05) 60%, transparent);
    mix-blend-mode: screen;
    animation: tracking 9s linear infinite;
}
@keyframes grain {
    0% { transform: translate(0, 0); } 25% { transform: translate(-5%, 3%); }
    50% { transform: translate(4%, -4%); } 75% { transform: translate(-3%, -2%); } 100% { transform: translate(2%, 4%); }
}
@keyframes tracking { 0% { inset-block-start: -12vh; } 100% { inset-block-start: 110vh; } }

/* OSD caméscope */
.vhs-osd {
    position: fixed; inset: 0; pointer-events: none; z-index: 43;
    font-family: var(--font-osd); color: var(--text-primary); text-transform: uppercase;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8), -1px 0 var(--chroma-r), 1px 0 var(--chroma-b);
}
.vhs-osd > * { position: absolute; font-size: clamp(1.2rem, 2.4vw, 1.9rem); letter-spacing: 0.06em; }
.osd-play { inset-block-start: max(0.7rem, env(safe-area-inset-top)); inset-inline-start: 1rem; }
.osd-sp { inset-block-start: max(0.7rem, env(safe-area-inset-top)); inset-inline-end: 1rem; }
.osd-time { inset-block-end: max(0.7rem, env(safe-area-inset-bottom)); inset-inline-start: 1rem; }
.osd-date { inset-block-end: max(0.7rem, env(safe-area-inset-bottom)); inset-inline-end: 1rem; }
body[data-power="on"] .osd-play { color: var(--accent-crimson); }

/* Aberration chromatique + texte glitché (data-text) */
.chroma { text-shadow: -2px 0 var(--chroma-r), 2px 0 var(--chroma-b); }
.glitch { position: relative; }
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; inset: 0;
    pointer-events: none; opacity: 0; white-space: pre-line;
}
.glitch::before { color: var(--accent-crimson); transform: translateX(-3px); mix-blend-mode: screen; }
.glitch::after { color: var(--accent-cyan); transform: translateX(3px); mix-blend-mode: screen; }
.glitch.auto::before { animation: slice-a 7s infinite steps(1); }
.glitch.auto::after { animation: slice-b 7s infinite steps(1); }
@keyframes slice-a {
    0%, 89%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
    90% { opacity: 0.9; clip-path: inset(12% 0 70% 0); transform: translateX(-8px); }
    92% { opacity: 0.9; clip-path: inset(55% 0 25% 0); transform: translateX(6px); }
    94% { opacity: 0.9; clip-path: inset(80% 0 5% 0); transform: translateX(-4px); }
}
@keyframes slice-b {
    0%, 89%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
    91% { opacity: 0.9; clip-path: inset(30% 0 50% 0); transform: translateX(7px); }
    93% { opacity: 0.9; clip-path: inset(65% 0 12% 0); transform: translateX(-6px); }
}
body.glitching .glitch::before { opacity: 0.95; animation: burst-a 0.45s steps(1) 1; }
body.glitching .glitch::after { opacity: 0.95; animation: burst-b 0.45s steps(1) 1; }
body.glitching .scene, body.glitching .game-card { animation: shake 0.45s steps(2) 1; }
body.glitching .vhs-tracking { animation-duration: 0.6s; }
@keyframes burst-a {
    0% { clip-path: inset(5% 0 75% 0); transform: translateX(-14px); }
    25% { clip-path: inset(40% 0 40% 0); transform: translateX(10px); }
    50% { clip-path: inset(70% 0 10% 0); transform: translateX(-6px); }
    75% { clip-path: inset(20% 0 60% 0); transform: translateX(12px); }
    100% { clip-path: inset(0 0 100% 0); opacity: 0; }
}
@keyframes burst-b {
    0% { clip-path: inset(60% 0 20% 0); transform: translateX(12px); }
    33% { clip-path: inset(10% 0 80% 0); transform: translateX(-10px); }
    66% { clip-path: inset(45% 0 35% 0); transform: translateX(8px); }
    100% { clip-path: inset(0 0 100% 0); opacity: 0; }
}
@keyframes shake {
    0% { transform: translate(0, 0); filter: none; }
    20% { transform: translate(-6px, 1px) skewX(-1deg); filter: saturate(1.6) hue-rotate(-12deg); }
    40% { transform: translate(5px, -1px); filter: contrast(1.3); }
    60% { transform: translate(-3px, 0) skewX(1deg); filter: saturate(0.4); }
    80% { transform: translate(2px, 1px); filter: none; }
    100% { transform: translate(0, 0); }
}

:where(button):focus-visible { outline: 3px solid var(--accent-cyan); outline-offset: 2px; }
button { font: inherit; color: inherit; user-select: none; }
h1, h2 { text-wrap: balance; font-weight: 400; }
p { text-wrap: pretty; }

/* ---------- SCÈNE ---------- */
.scene {
    min-block-size: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(1rem, 3vh, 1.75rem);
    padding: clamp(3.2rem, 9vh, 4.5rem) 16px;
    transition: filter 0.6s var(--ease);
}
/* Coupure : la pièce plonge dans le noir (on garde l'effet sombre demandé par DESIGN.md) */
body[data-power="off"] .scene { filter: brightness(0.62) saturate(0.7); }
body[data-power="on"] .scene { animation: neon 6s infinite; }
@keyframes neon {
    0%, 100% { opacity: 1; } 92% { opacity: 1; } 93% { opacity: 0.86; } 94% { opacity: 1; } 96% { opacity: 0.92; } 97% { opacity: 1; }
}
body.flickering .scene { animation: flick 0.15s linear 4; }
@keyframes flick { 0%, 100% { opacity: 1; } 25% { opacity: 0.35; } 50% { opacity: 0.85; } 75% { opacity: 0.2; } }

.top {
    inline-size: min(100%, 420px);
    display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.brand h1 {
    font-family: var(--font-osd);
    font-size: clamp(2.2rem, 9vw, 3rem); line-height: 0.9;
    letter-spacing: 0.14em; text-transform: uppercase;
}
.brand .sub { margin-block-start: 0.3rem; color: var(--text-muted); font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase; }

.badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-family: var(--font-osd); font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border-panel); padding: 0.1rem 0.55rem;
}
.badge .dot { inline-size: 9px; block-size: 9px; border-radius: 50%; background: var(--text-muted); }
.badge[data-state="online"] .dot { background: var(--accent-emerald); animation: blink 1.4s steps(1) infinite; }
.badge[data-state="offline"] .dot { background: var(--accent-crimson); }
.badge[data-state="offline"] { color: var(--accent-crimson); border-color: var(--accent-crimson); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- BOÎTIER ÉLECTRIQUE ---------- */
.box {
    position: relative;
    inline-size: min(100%, 420px);
    display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
    padding: 1.6rem 1.25rem 1.4rem;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 4px),
        linear-gradient(180deg, #161B24 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-panel);
    border-top: 3px solid var(--accent-amber);
    border-radius: 12px;
    outline: 1px solid rgba(0, 0, 0, 0.6); outline-offset: 3px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.screw {
    position: absolute; inline-size: 11px; block-size: 11px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #4B586E, #1C2330 70%);
    border: 1px solid var(--border-subtle);
}
.screw::after { content: ""; position: absolute; inset: 4px 1px; background: rgba(0, 0, 0, 0.55); transform: rotate(35deg); }
.screw.tl { inset: 10px auto auto 10px; } .screw.tr { inset: 10px 10px auto auto; }
.screw.bl { inset: auto auto 10px 10px; } .screw.br { inset: auto 10px 10px auto; }

.readout {
    inline-size: 100%;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-void);
    border: 1px solid var(--border-panel); border-radius: 6px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7);
}
.led { inline-size: 16px; block-size: 16px; border-radius: 50%; background: var(--bg-interactive); border: 1px solid var(--border-control); }
.led[data-state="on"] { background: radial-gradient(circle, #69F0AE, var(--accent-emerald)); box-shadow: 0 0 14px rgba(0, 230, 118, 0.7); animation: ledPulse 2s infinite; }
.led[data-state="off"] { background: radial-gradient(circle, #FF6B8A, var(--accent-crimson)); box-shadow: 0 0 12px rgba(255, 30, 86, 0.6); animation: blink 1s steps(1) infinite; }
@keyframes ledPulse { 50% { box-shadow: 0 0 22px rgba(0, 230, 118, 0.9); } }
.state-label { font-family: var(--font-osd); font-size: clamp(1.4rem, 5.8vw, 2.1rem); letter-spacing: 0.06em; line-height: 1; white-space: nowrap; }
.state-label[data-state="on"] { color: var(--accent-emerald); text-shadow: 0 0 16px rgba(0, 230, 118, 0.45), -1px 0 var(--chroma-r), 1px 0 var(--chroma-b); }
.state-label[data-state="off"] { color: var(--accent-crimson); text-shadow: 0 0 14px rgba(255, 30, 86, 0.4), -1px 0 var(--chroma-r), 1px 0 var(--chroma-b); }
.volt { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 1rem; }
body[data-power="on"] .volt { color: var(--accent-amber); }

/* Disjoncteur principal */
.breaker {
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
    padding: 0.9rem 1.6rem 1.1rem;
    background: linear-gradient(180deg, #1C2330, #11151C);
    border: 1px solid var(--border-panel); border-radius: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 4px 18px rgba(0, 0, 0, 0.45);
}
.breaker-tag {
    font-size: 0.8125rem; letter-spacing: 0.14em; color: var(--bg-void);
    background: var(--text-secondary); padding: 0.05rem 0.5rem; border-radius: 2px;
}
.lever {
    position: relative;
    inline-size: 84px; block-size: 170px;
    background: linear-gradient(180deg, #0A0D12, #12161E);
    border: 2px solid var(--border-control); border-radius: 10px;
    box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.8);
    cursor: pointer; overflow: visible;
}
.lever:disabled { cursor: progress; opacity: 0.7; }
.lever-mark {
    position: absolute; inset-inline: 0; text-align: center;
    font-family: var(--font-osd); font-size: 1.25rem; letter-spacing: 0.14em; color: var(--text-muted);
    z-index: 1;
}
.lever-mark.on { inset-block-start: 10px; }
.lever-mark.off { inset-block-end: 10px; }
.lever[data-state="on"] .lever-mark.on { color: var(--accent-emerald); }
.lever[data-state="off"] .lever-mark.off { color: var(--accent-crimson); }
.lever-handle {
    position: absolute; inset-inline: 7px; block-size: 74px;
    border-radius: 7px;
    background: linear-gradient(180deg, #5A667D 0%, #3A4456 45%, #262E3C 100%);
    border: 1px solid var(--border-control);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: inset-block-start 0.25s var(--ease), background 0.25s var(--ease);
    z-index: 2;
}
.lever-handle::before {
    content: ""; position: absolute; inset-inline: 18px; inset-block-start: 26px; block-size: 3px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 7px 0 rgba(255, 255, 255, 0.16), 0 14px 0 rgba(255, 255, 255, 0.1);
}
.lever[data-state="off"] .lever-handle { inset-block-start: 84px; }
.lever[data-state="on"] .lever-handle { inset-block-start: 8px; background: linear-gradient(180deg, #6B7891 0%, #4A5568 45%, #2F3848 100%); }
.lever:not(:disabled):hover .lever-handle { border-color: var(--text-primary); }
.lever:not(:disabled):active .lever-handle { transform: scale(0.97); }
.lever[data-state="off"]:not(:disabled) { animation: callout 2.4s ease-in-out infinite; }
@keyframes callout { 50% { border-color: var(--accent-amber); box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 184, 0, 0.25); } }

.spark-box { position: absolute; inset-inline-start: 50%; inset-block-start: 50%; pointer-events: none; z-index: 5; }
.spark {
    position: absolute; inline-size: 4px; block-size: 4px; border-radius: 50%;
    background: #FFE27A; box-shadow: 0 0 8px var(--accent-amber), 0 0 16px rgba(255, 184, 0, 0.5);
    animation: spark 0.45s ease-out forwards; opacity: 0;
}
@keyframes spark {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0); }
}

.instruction {
    font-size: 0.9375rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: center;
    color: var(--text-secondary); min-block-size: 1.4em;
}
body[data-power="off"] .instruction { color: var(--accent-amber); }

/* Circuits secondaires (décor qui suit l'état principal) */
.circuits {
    list-style: none; inline-size: 100%;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    padding-block-start: 1rem; border-block-start: 1px dashed var(--border-subtle);
}
.circuits li {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.mini {
    flex: none; position: relative; inline-size: 14px; block-size: 24px; border-radius: 3px;
    background: var(--bg-void); border: 1px solid var(--border-panel);
}
.mini::after {
    content: ""; position: absolute; inset-inline: 2px; block-size: 9px; border-radius: 2px;
    background: #4A5568; inset-block-start: 12px;
    transition: inset-block-start 0.2s var(--ease), background 0.2s;
    transition-delay: calc(var(--i) * 70ms);
}
body[data-power="on"] .mini::after { inset-block-start: 2px; background: var(--accent-emerald); }
body[data-power="on"] .circuits li { color: var(--text-secondary); }

/* =====================================================================
   MINI-JEU
   ===================================================================== */
.game {
    position: fixed; inset: 0; z-index: 30;
    display: grid; place-items: center;
    padding: 3.5rem 16px;
    background: rgba(5, 6, 8, 0.78);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}
.game-card {
    inline-size: min(100%, 420px);
    display: flex; flex-direction: column; gap: 0.85rem;
    padding: 1.25rem 1.1rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-panel);
    border-top: 3px solid var(--accent-amber);
    border-radius: 12px;
    outline: 1px solid rgba(0, 0, 0, 0.6); outline-offset: 3px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
.game[data-mode="cut"] .game-card { border-top-color: var(--accent-crimson); }
.game.solved .game-card { border-color: var(--accent-emerald); }
.game.shake .game-card { animation: shake 0.45s steps(2) 1; }
.game-eyebrow { font-family: var(--font-osd); font-size: 1.3rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-amber); }
.game[data-mode="cut"] .game-eyebrow { color: var(--accent-crimson); }
.game-title { font-family: var(--font-osd); font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 0.95; letter-spacing: 0.06em; text-transform: uppercase; }
.game-hint { color: var(--text-secondary); font-size: 0.9375rem; }
.game-body { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 0.5rem 0; }
.game-body.locked { pointer-events: none; opacity: 0.55; filter: saturate(0.4); transition: opacity 0.2s; }
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-block-size: 44px; border-block-start: 1px solid var(--border-subtle); padding-block-start: 0.75rem; }
.game-msg { font-size: 0.9375rem; color: var(--text-secondary); }
.game-msg[data-tone="ok"] { color: var(--accent-emerald); }
.game-msg[data-tone="ko"] { color: var(--accent-crimson); }

.ghost-btn, .act-btn {
    min-block-size: 44px; min-inline-size: 44px; padding: 0 1rem;
    border: 2px solid var(--border-control); border-radius: 8px;
    background: var(--bg-interactive); cursor: pointer;
    font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.ghost-btn { color: var(--text-secondary); font-size: 0.875rem; flex: none; }
.act-btn {
    inline-size: 100%; min-block-size: 56px; font-size: 1.05rem;
    border-color: var(--accent-amber); color: var(--text-primary);
    background: color-mix(in oklab, var(--accent-amber) 18%, var(--bg-elevated));
}
.act-btn:active { transform: scale(0.98); }

/* 1) Jauge */
.gauge { inline-size: 100%; }
.gauge-track {
    position: relative; block-size: 46px;
    background: repeating-linear-gradient(90deg, var(--border-subtle) 0 1px, transparent 1px 10%), var(--bg-void);
    border: 1px solid var(--border-panel); border-radius: 6px;
    overflow: hidden;
}
.gauge-zone {
    position: absolute; inset-block: 0;
    background: color-mix(in oklab, var(--accent-emerald) 30%, transparent);
    border-inline: 2px solid var(--accent-emerald);
}
.gauge-needle {
    position: absolute; inset-block: -2px; inline-size: 4px; margin-inline-start: -2px;
    background: var(--text-primary); box-shadow: 0 0 10px var(--text-primary), -2px 0 var(--chroma-r), 2px 0 var(--chroma-b);
}
.gauge-scale { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--text-muted); margin-block-start: 0.3rem; font-variant-numeric: tabular-nums; }

/* 2) Câbles */
.wires { position: relative; inline-size: 100%; display: flex; justify-content: space-between; gap: 4.5rem; }
.wires-svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; overflow: visible; }
.wires-svg path { fill: none; stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)); }
.wires-col { display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.wire-end, .wire-term {
    min-block-size: 50px; display: flex; align-items: center; gap: 0.6rem; justify-content: space-between;
    padding: 0 0.75rem; cursor: pointer;
    background: var(--bg-elevated); border: 2px solid var(--border-control); border-radius: 8px;
    font-size: 1.15rem; letter-spacing: 0.1em;
    border-inline-start: 6px solid var(--w);
}
.wire-term { border-inline-start-width: 2px; border-inline-end: 6px solid var(--w); }
.plug { inline-size: 14px; block-size: 14px; border-radius: 50%; background: var(--w); box-shadow: 0 0 8px var(--w); }
.wire-end[aria-pressed="true"] { border-color: var(--text-primary); background: color-mix(in oklab, var(--w) 22%, var(--bg-elevated)); }
.wire-end[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--w); }
.wire-end.linked, .wire-term.linked { opacity: 0.6; cursor: default; }
.wire-end.linked::before, .wire-term.linked::after { content: "✓"; color: var(--accent-emerald); }

/* 3) Interrupteurs */
.label-plate {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    padding: 0.45rem 1rem; background: #D9DEE6; color: var(--bg-void); border-radius: 3px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); transform: rotate(-1deg);
}
.label-title { font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; }
.label-code { font-size: 1.5rem; letter-spacing: 0.25em; }
.switches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; inline-size: 100%; }
.sw {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0; min-block-size: 44px; cursor: pointer;
    background: var(--bg-elevated); border: 2px solid var(--border-control); border-radius: 8px;
}
.sw-num { font-size: 0.8125rem; color: var(--text-muted); }
.sw-lever { position: relative; inline-size: 22px; block-size: 46px; border-radius: 4px; background: var(--bg-void); border: 1px solid var(--border-panel); }
.sw-lever::after {
    content: ""; position: absolute; inset-inline: 2px; block-size: 20px; border-radius: 3px;
    background: #4A5568; inset-block-start: 22px; transition: inset-block-start 0.15s var(--ease), background 0.15s;
}
.sw[aria-pressed="true"] { border-color: var(--accent-emerald); background: color-mix(in oklab, var(--accent-emerald) 14%, var(--bg-elevated)); }
.sw[aria-pressed="true"] .sw-lever::after { inset-block-start: 2px; background: var(--accent-emerald); }
.sw-txt { font-size: 0.8125rem; letter-spacing: 0.08em; }
.sw[aria-pressed="true"] .sw-txt { color: var(--accent-emerald); }

/* 4) Séquence */
.seq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; inline-size: min(100%, 260px); }
.seq-btn {
    aspect-ratio: 1; cursor: pointer;
    font-family: var(--font-osd); font-size: 2.4rem;
    color: var(--text-secondary);
    background: color-mix(in oklab, var(--c) 10%, var(--bg-void));
    border: 2px solid color-mix(in oklab, var(--c) 55%, transparent); border-radius: 12px;
    transition: background 0.1s, box-shadow 0.1s;
}
.seq-btn:disabled { cursor: default; }
.seq-btn.lit { background: var(--c); color: var(--bg-void); box-shadow: 0 0 26px var(--c); border-color: var(--text-primary); }
.seq-dots { display: flex; gap: 0.5rem; }
.seq-dots i { inline-size: 12px; block-size: 12px; border-radius: 50%; border: 1px solid var(--border-control); }
.seq-dots i.on { background: var(--accent-emerald); border-color: var(--accent-emerald); }

/* ---------- Accessibilité OS ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
@media (prefers-contrast: more) {
    :root { --border-panel: rgba(255, 255, 255, 0.5); --border-control: rgba(255, 255, 255, 0.7); --text-secondary: #FFFFFF; --text-muted: #D0D8E4; }
}
@media (forced-colors: active) {
    .lever, .box, .game-card, .sw, .seq-btn, .wire-end, .wire-term { border: 2px solid CanvasText; }
    .seq-btn.lit { outline: 4px solid Highlight; }
}
