/* CHAIN REACTION module styles (built on css/kit.css) */

/* ---------- maintenance hatch ---------- */
.hatch-mod { position: absolute; inset: 0; overflow: hidden; border-radius: 10px; }
.hatch-cover { position: absolute; inset: 14px; border-radius: 10px; z-index: 2; transition: transform 600ms cubic-bezier(.3,.8,.3,1), filter 600ms;
  background: var(--grain), repeating-linear-gradient(135deg, rgba(0,0,0,.05) 0 2px, transparent 2px 9px), linear-gradient(165deg, #8a9097, #5d636a 50%, #42474d);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 6px rgba(0,0,0,.4), 0 6px 14px rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
/* open = slid left into the frame, a gripped lip left showing; click the lip to shut it again.
   (It used to swing out on a hinge, and the open door covered the next module.) */
.hatch-mod.open .hatch-cover { transform: translateX(calc(-100% + 16px)); filter: brightness(.8); cursor: pointer; }
.hatch-mod.unlocked .hatch-cover { cursor: pointer; }
.slot.solved .hatch-mod.unlocked .hatch-cover { pointer-events: auto; } /* a solved module ignores clicks, but the cover still opens and shuts */
.hatch-cover::after { content: ''; position: absolute; right: 4px; top: 50%; width: 8px; height: 96px; margin-top: -48px; border-radius: 3px;
  background: repeating-linear-gradient(180deg, #2a2e33 0 3px, #9aa1a8 3px 7px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.hatch-warn { font: 900 18px var(--mono); letter-spacing: 3px; color: #1b1d20; background: repeating-linear-gradient(45deg, #f5c518 0 12px, #1b1d20 12px 24px); padding: 4px; }
.hatch-warn::before { content: ''; }
.hatch-warn { background: #f5c518; padding: 6px 14px; border: 3px solid #1b1d20; }
.hatch-grill { width: 220px; height: 120px; border-radius: 8px; background: repeating-linear-gradient(0deg, #2a2e33 0 6px, #50565c 6px 12px); box-shadow: inset 0 2px 6px #000; }
.bolt { position: absolute; z-index: 3; width: 54px; height: 54px; padding: 0; border: none; background: none; cursor: pointer; transition: transform 200ms, opacity 400ms; }
.bolt.turning .bolt-svg { animation: unscrew 900ms linear forwards; }
@keyframes unscrew { from { transform: rotate(0) scale(1); } to { transform: rotate(-900deg) scale(1.18); } }
.bolt.gone { opacity: 0; transform: translateY(-30px) scale(1.3); pointer-events: none; }
.hatch-mod.open .bolt { display: none; }
.bolt-head { stroke: rgba(0,0,0,.6); stroke-width: 2; }
.bolt-head.brass { fill: url(#none); fill: #c9a23a; }
.bolt-head.steel { fill: #b9c0c7; }
.bolt-head.black { fill: #2a2d31; }
.bolt-mark { fill: none; stroke: rgba(0,0,0,.65); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.bolt-head.black + .bolt-mark { stroke: #8d949b; }
.bolt-mark.fill { fill: rgba(0,0,0,.25); }
.bolt-paint { fill: #e11d1d; stroke: #7a0c0c; stroke-width: 1.5; }
.hatch-inside { position: absolute; inset: 14px; display: flex; align-items: center; justify-content: center; }
.fuses { display: flex; gap: 12px; }
.fuse { display: flex; flex-direction: column; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; color: #cfd4d9; font: 800 14px var(--mono); }
.fuse-glass { width: 40px; height: 150px; border-radius: 20px; background: linear-gradient(90deg, rgba(255,255,255,.15), rgba(255,255,255,.45) 30%, rgba(255,255,255,.1) 70%, rgba(255,255,255,.3)); box-shadow: inset 0 0 0 3px #b9c0c7, 0 4px 8px rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; transition: transform 200ms; }
.fuse-band { width: 40px; height: 22px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.fuse.pulled .fuse-glass { transform: translateY(-40px); }

/* ---------- binary register ---------- */
.reg-mod { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.reg-top { display: flex; align-items: center; gap: 26px; }
.reg-n { font-size: 52px; min-width: 120px; text-align: center; }
.reg-n.blink { animation: blink .3s 2; }
.k-led.big { width: 44px; height: 44px; }
.kswitch { width: 46px; height: 96px; border: none; border-radius: 10px; background: #15171a; box-shadow: inset 0 0 0 3px #3a3f45, inset 0 4px 10px #000; position: relative; cursor: pointer; }
.kswitch::after { content: ''; position: absolute; left: 6px; right: 6px; height: 42px; bottom: 6px; border-radius: 6px; background: linear-gradient(180deg, #f2f3f4, #a9aeb4); box-shadow: 0 2px 3px rgba(0,0,0,.6); transition: bottom 120ms; }
.kswitch.up::after { bottom: 48px; background: linear-gradient(180deg, #ffffff, #c9cdd2); }
.reg-run { font-size: 24px; padding: 12px 40px; }

/* ---------- caesar cipher ---------- */
.ci-mod { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.ci-top { display: flex; align-items: flex-end; gap: 18px; }
.ci-word { font-size: 46px; letter-spacing: 10px; }
.ci-key { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #cfd4d9; font: 800 12px var(--mono); letter-spacing: 2px; }
.ci-key .k-lcd { font-size: 30px; }
.ci-opts { display: grid; grid-template-columns: repeat(3, 108px); gap: 14px; }
.ci-opt { font: 800 17px var(--mono); padding: 14px 0; }

/* ---------- map (reuses the survey markup) on a metal panel ---------- */
#bomb.chain .svy-sel { color: #d8dde2; }

/* ---------- expert pages ---------- */
.bin-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 18px; max-width: 760px; font: 16px var(--mono); }
.bin-table b { color: var(--hazard); }
.az-strip { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; max-width: 880px; margin-top: 12px; }
.az-strip div { background: #1a1d22; border-radius: 6px; text-align: center; padding: 6px 0; }
.az-strip b { display: block; font: 800 22px var(--mono); }
.az-strip small { color: var(--dim); }
