/* Opération Sapin Fantôme — thème nuit de Noël (bleu nuit, or pâle, blanc givré, houx) */
:root {
    --tp-bg: radial-gradient(circle at 50% 0%, #1b2d5c 0%, #0a1330 72%);
    --tp-text: #eef4ff;
    --tp-muted: #b4c3e6;
    --tp-accent: #f2c75c;
    --tp-accent-2: #ffe7a3;
    --tp-card: rgba(15, 27, 58, 0.93);
    --tp-border: rgba(242, 199, 92, 0.35);
    --tp-header-bg: rgba(8, 15, 38, 0.9);
    --tp-font-head: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
    --tp-font-body: 'Nunito', system-ui, sans-serif;
    --tp-play-bg: linear-gradient(135deg, #f2c75c, #a3263a);
    --tp-play-ink: #1a1405;
    --tp-notebook-bg: rgba(242, 199, 92, 0.1);
    --tp-notebook-border: #f2c75c;
    --tp-notebook-title: #ffe7a3;
}
.eg {
    --eg-card: rgba(15, 27, 58, 0.95);
    --eg-card-2: rgba(238, 244, 255, 0.05);
    --eg-text: #eef4ff;
    --eg-muted: #b4c3e6;
    --eg-accent: #f2c75c;
    --eg-accent-ink: #1a1405;
    --eg-border: rgba(242, 199, 92, 0.28);
    --eg-ok: #86efac;
    --eg-err: #fca5a5;
    --eg-radius: 10px;
    --eg-font-head: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
    --eg-font-body: 'Nunito', system-ui, sans-serif;
    --eg-font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.eg .eg-input { background: #f4f8ff; color: #10204a; }
.eg .eg-room-title { color: var(--eg-accent); font-size: clamp(1.3rem, 4.5vw, 1.9rem); }
.tk-play { color: var(--tp-play-ink); }

/* Salle 1 : guirlande */
.g-tabs { display: flex; gap: 0.5rem; margin: 0.6rem 0; flex-wrap: wrap; }
.garland-wrap { background: #0c1633; border: 1px solid var(--eg-border); border-radius: 12px; padding: 0.8rem 0.6rem 0.9rem; margin: 0.5rem 0; position: relative; }
.garland-wrap::before { content: ''; position: absolute; left: 3%; right: 3%; top: 3.6rem; height: 3px; background: #3a4a78; border-radius: 3px; }
.jump-row, .g-row { display: grid; gap: 4px; position: relative; }
.jump-row { min-height: 1.7rem; margin-bottom: 0.2rem; }
.jumper { background: linear-gradient(180deg, #ffd98a, #d49a2a); color: #3a2400; border: 2px solid #fff3cf; border-radius: 6px; font-size: 0.72rem; font-weight: 800; cursor: pointer; padding: 0.15rem 0.2rem; }
.bulb { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 2px solid transparent; border-radius: 12px; padding: 0.3rem 0.1rem; color: var(--eg-text); cursor: pointer; font: inherit; }
.bulb .glass { width: clamp(1.4rem, 7vw, 2.4rem); height: clamp(1.9rem, 9vw, 3.1rem); border-radius: 50% 50% 46% 46%; background: #2a3558; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55); border: 1px solid #4b5b8c; }
.bulb.lit .glass { background: radial-gradient(circle at 50% 40%, #fffbe0, #ffd34d 60%, #f09a14); box-shadow: 0 0 18px 4px rgba(255, 211, 77, 0.7); border-color: #fff3b0; }
.bulb.short .glass { opacity: 0.55; border-style: dashed; }
.bulb.pend { border-color: var(--eg-accent); }
.bulb.blackened .glass { background: radial-gradient(circle at 50% 40%, #fffbe0 0%, #ffd34d 28%, #3a2f19 70%); box-shadow: 0 0 14px 3px rgba(255, 211, 77, 0.55); }
.bulb small { font-family: var(--eg-font-mono); font-size: 0.68rem; color: var(--eg-muted); }
.bulb .idx { font-size: 0.64rem; opacity: 0.7; }
.g-status { min-height: 1.4em; font-size: 0.92rem; margin: 0.4rem 0; }
.g-status.on { color: var(--eg-ok); }
.g-status.off { color: var(--eg-err); }
.log-box { margin: 0.6rem 0; }
.log-list { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; line-height: 1.5; }
.log-list .on { color: var(--eg-ok); font-weight: 700; }
.log-list .off { color: var(--eg-err); font-weight: 700; }

/* Salle 2 : flocon */
.flake-box { max-width: 380px; margin: 0.6rem auto; }
.flake-svg { width: 100%; height: auto; display: block; background: #0c1633; border: 1px solid var(--eg-border); border-radius: 50%; }
.flake-svg > *:not(.wedge):not(.hub) { pointer-events: none; }
.flake-svg .wedge { fill: rgba(255, 255, 255, 0.02); stroke: rgba(242, 199, 92, 0.18); cursor: pointer; }
.flake-svg .wedge:hover { fill: rgba(242, 199, 92, 0.1); }
.flake-svg .wedge.sel { fill: rgba(242, 199, 92, 0.22); stroke: #f2c75c; stroke-width: 1.5; }
.flake-svg .dig { fill: #10204a; font: 700 11px var(--eg-font-mono); }
.flake-svg .frost { fill: rgba(255, 255, 255, 0.35); }
.flake-svg .sec-n { fill: #f2c75c; font: 700 11px var(--eg-font-mono); }
.flake-svg .hub { fill: #f2c75c; cursor: pointer; }
.calque-ctrl { justify-content: center; }
.calque { background: rgba(255, 255, 255, 0.07); border: 1px dashed #ffe7a3; border-radius: 10px; padding: 0.6rem; margin: 0.6rem 0; }
.calque-title { font-size: 0.85rem; color: var(--eg-accent); }
.slot-row { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.4rem; }
.slot { width: 3rem; text-align: center; border: 1px solid var(--eg-border); border-radius: 8px; padding: 0.2rem; background: rgba(0, 0, 0, 0.25); }
.slot.on { background: #fff6c9; color: #10204a; }
.slot b { display: block; font: 800 1.4rem var(--eg-font-mono); }
.slot small { font-size: 0.65rem; opacity: 0.75; }
.arms { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.6rem; margin: 0.6rem 0 1rem; }
.arm-card { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; border: 1px solid var(--eg-border); border-radius: 10px; padding: 0.4rem; background: #0c1633; cursor: pointer; }
.arm-svg { width: 74px; height: auto; display: block; }
.arm-who { font-weight: 700; }
.arm-ref { display: flex; align-items: center; gap: 0.8rem; margin: 0.4rem 0 0.8rem; }
.arm-ref > div { background: #0c1633; border: 1px solid var(--tp-accent); border-radius: 10px; padding: 0.3rem; }

/* Salle 3 : balance */
.scale { background: #0c1633; border: 1px solid var(--eg-border); border-radius: 12px; padding: 1.4rem 0.8rem 0.8rem; margin: 0.6rem 0; }
.beam { height: 8px; background: linear-gradient(90deg, #8a6a2a, #f2c75c, #8a6a2a); border-radius: 4px; width: 80%; margin: 0 auto 0.5rem; transition: transform 0.6s ease; transform-origin: center; }
.pans { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.pan { border: 2px solid #f2c75c; border-top: 0; border-radius: 0 0 40% 40%; padding: 0.4rem 0.5rem 0.7rem; text-align: center; min-height: 4.4rem; }
.pan b { display: block; font-size: 0.78rem; color: var(--eg-muted); }
.pan-list { font-family: var(--eg-font-mono); font-size: 1rem; margin-top: 0.3rem; }
.parcels { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 0.4rem; margin: 0.6rem 0; }
.parcel { background: rgba(255, 255, 255, 0.06); border: 2px solid var(--eg-border); border-radius: 10px; color: var(--eg-text); padding: 0.4rem 0.2rem; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; }
.parcel small { font-family: var(--eg-font-mono); font-size: 0.7rem; color: var(--eg-muted); }
.parcel.s1 { border-color: #7dd3fc; background: rgba(125, 211, 252, 0.14); }
.parcel.s2 { border-color: #fca5a5; background: rgba(252, 165, 165, 0.14); }
.parcel.s1::after { content: '◀'; font-size: 0.65rem; }
.parcel.s2::after { content: '▶'; font-size: 0.65rem; }
.w-count { margin: 0.4rem 0; }

/* Salle 4 : plan */
.map { margin: 0.6rem 0; background: #0c1633; border: 1px solid var(--eg-border); border-radius: 12px; padding: 0.4rem; }
.map-svg { width: 100%; max-width: 680px; height: auto; display: block; margin: 0 auto; }
.map .street { stroke: #5f7bbd; stroke-width: 3; stroke-linecap: round; }
.map .street.used { stroke: #f2c75c; stroke-width: 4.5; }
.map .dur { fill: #cfe0ff; font: 700 9px var(--eg-font-mono); stroke: #0c1633; stroke-width: 3px; paint-order: stroke; }
.map .node { cursor: pointer; }
.map .node circle { fill: #1b2d5c; stroke: #f2c75c; stroke-width: 2; }
.map .node:hover circle, .map .node:focus circle { fill: #2c4586; }
.map .node.cur circle { fill: #a3263a; stroke: #ffe7a3; stroke-width: 3; }
.map .node.first circle { stroke: #86efac; }
.map .nl { fill: #fff; font: 800 11px var(--eg-font-mono); pointer-events: none; }
.map .pl { fill: #b4c3e6; font: 600 8px var(--eg-font-body); pointer-events: none; }
.route-list { margin: 0.4rem 0; }
.route-line { font-family: var(--eg-font-mono); line-height: 2; }
.route-line small { color: var(--eg-muted); margin-left: 0.15rem; }
.route-done { color: var(--eg-ok); }
.route-warn { color: #f3b04a; }

/* Salle 5 : alibis et rapport */
.stmt-box { border: 1px solid var(--eg-border); border-radius: 10px; padding: 0.5rem 0.8rem; background: var(--eg-card-2); }
.stmt-box h4 { margin: 0 0 0.3rem; color: var(--eg-accent); font-family: var(--eg-font-mono); }
.stmt { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; line-height: 1.5; }
.alibi th, .alibi td { text-align: center; }
.alibi th:first-child { text-align: left; }
.cell { width: 2.4rem; height: 2.2rem; border-radius: 8px; border: 1px solid var(--eg-border); background: rgba(255, 255, 255, 0.05); color: var(--eg-text); font-size: 1.1rem; cursor: pointer; }
.cell.y { background: rgba(134, 239, 172, 0.22); border-color: #86efac; color: #86efac; }
.cell.n { background: rgba(252, 165, 165, 0.12); color: #fca5a5; }
.grid-stage .eg-btn { margin: 0.4rem 0 1rem; }
.cross { border: 1px solid var(--eg-border); border-radius: 12px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; background: var(--eg-card-2); }
.cross h4 { margin: 0 0 0.3rem; }

@media (max-width: 480px) {
    .garland-wrap::before { top: 3.2rem; }
    .slot { width: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .beam { transition: none; } }

/* les deux relevés ont la même hauteur */
.tk-split { align-items: stretch; }
.tk-split > .stmt-box { height: auto; }

/* Salle 5 (v2) : dossiers, déclarations cliquables, grille guidée, tableau de croisement */
.folders { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0 0.6rem; }
.folder { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border-radius: 12px; border: 1px solid var(--eg-border); background: var(--eg-card-2); color: var(--eg-text); cursor: pointer; font: inherit; font-weight: 600; transition: transform .15s, border-color .15s; }
.folder:hover { transform: translateY(-2px); border-color: var(--eg-accent); }
.folder.open { border-color: var(--eg-accent); box-shadow: 0 0 0 2px rgba(243, 208, 130, 0.25); }
.folder small { font-weight: 400; opacity: .75; }
.f-ico { font-size: 1.3rem; }
.stmt.clickable { list-style: none; padding-left: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.35rem; }
.st-btn { width: 100%; text-align: left; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px dashed var(--eg-border); background: rgba(255, 255, 255, 0.04); color: var(--eg-text); font: inherit; font-size: 0.9rem; cursor: pointer; transition: background .15s, transform .1s; }
.st-btn:hover:not([disabled]) { background: rgba(243, 208, 130, 0.12); border-style: solid; }
.st-btn:active:not([disabled]) { transform: scale(0.98); }
.st-btn.noise { font-style: italic; opacity: .85; }
.st-btn.used { text-decoration: line-through; opacity: .4; cursor: default; border-style: solid; }
.alibi th.bridge-col, .alibi td.bridge-col { background: rgba(147, 197, 253, 0.08); }
.cell.glow { border-color: var(--eg-accent); box-shadow: 0 0 10px rgba(243, 208, 130, 0.7); animation: cellGlow 1.2s ease-in-out infinite alternate; }
@keyframes cellGlow { from { box-shadow: 0 0 4px rgba(243, 208, 130, 0.4); } to { box-shadow: 0 0 14px rgba(243, 208, 130, 0.9); } }
.g-msg { min-height: 1.3em; }
.bridge-reveal { margin: 0.6rem 0 1.2rem; }
.bridge-people { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bp { padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(243, 208, 130, 0.14); border: 1px solid rgba(243, 208, 130, 0.5); animation: bpIn .5s ease both; }
.bp:nth-child(2) { animation-delay: .15s; } .bp:nth-child(3) { animation-delay: .3s; }
@keyframes bpIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.board { border: 1px solid var(--eg-border); border-radius: 12px; padding: 0.7rem 0.9rem; background: var(--eg-card-2); }
.board h4 { margin: 0 0 0.5rem; }
.list-toggles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ltog { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.75rem; border-radius: 10px; border: 1px solid var(--eg-border); background: rgba(255, 255, 255, 0.04); color: var(--eg-text); font: inherit; font-size: 0.9rem; cursor: pointer; opacity: .7; }
.ltog.on { opacity: 1; border-color: var(--eg-accent); background: rgba(243, 208, 130, 0.14); }
.l-ico { font-size: 1.2rem; }
.suspects { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; margin-top: 0.4rem; }
.suspect { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.6rem 0.4rem; border-radius: 12px; border: 1px solid var(--eg-border); background: rgba(255, 255, 255, 0.04); color: var(--eg-text); font: inherit; cursor: pointer; text-align: center; transition: transform .15s, border-color .15s; }
.suspect:hover { transform: translateY(-2px); }
.suspect small { font-size: 0.75rem; opacity: .7; line-height: 1.2; }
.suspect .lamps { font-size: 1.15rem; min-height: 1.5rem; letter-spacing: 0.1rem; }
.suspect.all { border-color: var(--eg-accent); box-shadow: 0 0 16px rgba(243, 208, 130, 0.55); }
.suspect.sel { outline: 3px solid #86efac; outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .cell.glow, .bp { animation: none; } }

/* Secrets « carillon » : rejouer la séquence de lumières */
.secret-wrap { display: inline; }
.secret-panel { display: block; margin: 0.5rem 0 0.8rem; }
.secret-panel[hidden] { display: none; }
.chime { border: 1px solid var(--eg-border); border-radius: 14px; padding: 0.7rem 0.9rem; background: rgba(243, 208, 130, 0.06); max-width: 34rem; }
.tk-egg .chime { margin: 0.6rem auto; text-align: center; }
.tk-egg .chime .eg-row { justify-content: center; }
.chime-row { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; margin: 0.3rem 0 0.6rem; }
.chime-row.busy .chime-light { cursor: wait; }
.chime-light { position: relative; width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-size: 1.35rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; transition: transform .12s, box-shadow .15s, background .15s; opacity: .75; }
.chime-light small { font-size: 0.65rem; color: var(--eg-text); opacity: .8; margin-top: 2px; }
.chime-light:hover { opacity: 1; }
.chime-light.lit { opacity: 1; transform: scale(1.14); background: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 0 18px var(--c), 0 0 4px var(--c) inset; }
.chime-light.look-tree { border-radius: 50% 50% 45% 45%; }
.chime-light.look-flake { border-radius: 12px; }
.chime-light.look-bridges { border-radius: 10px; width: 3.2rem; }
.chime-row.look-tree { display: grid; grid-template-columns: repeat(6, 3rem); justify-content: center; }
.chime-row.look-tree .chime-light:nth-child(1) { grid-column: 3 / span 2; justify-self: center; }
.chime-row.look-tree .chime-light:nth-child(2) { grid-column: 2 / span 2; justify-self: center; }
.chime-row.look-tree .chime-light:nth-child(3) { grid-column: 4 / span 2; justify-self: center; }
.chime-row.look-tree .chime-light:nth-child(4) { grid-column: 1 / span 2; justify-self: center; }
.chime-row.look-tree .chime-light:nth-child(5) { grid-column: 5 / span 2; justify-self: center; }
.chime-row.won .chime-light { opacity: 1; }
.chime-msg { min-height: 1.3em; margin: 0.3rem 0 0; }
@media (prefers-reduced-motion: reduce) { .chime-light, .chime-light.lit { transition: none; transform: none; } }
