body.expert-page { background: #101215; font-size: 20px; overflow: hidden; }
.x-top { position: fixed; left: 0; right: 0; top: 0; height: 104px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px; background: #07080a; border-bottom: 3px solid var(--hazard); z-index: 10; }
.x-title { font-family: 'Future'; font-size: 26px; color: var(--hazard); }
.x-role { font-size: 16px; color: var(--dim); margin-top: 4px; }
.x-clock { display: flex; align-items: center; gap: 18px; background: #000; padding: 10px 18px; border-radius: 12px; box-shadow: inset 0 0 0 3px #2b2b2b; }
.x-lcd { width: 170px; }
.x-lcd.low { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.x-strikes { display: flex; gap: 8px; }
.x-strikes .sbox { width: 38px; height: 38px; border-radius: 8px; border: 3px solid #4a1714; display: grid; place-items: center; font-size: 24px; font-weight: 900; color: #fff; }
.x-strikes .sbox.on { background: var(--red); border-color: var(--red); box-shadow: 0 0 14px var(--red); }
.x-right { justify-self: end; text-align: right; }
.x-status { font-family: 'FutureNarrow'; font-size: 22px; letter-spacing: 1px; color: var(--dim); }
.x-status.play { color: var(--green); }
.x-status.paused { color: var(--hazard); }
.x-status.defused { color: var(--green); }
.x-status.exploded { color: var(--red); }
.x-net { font-size: 13px; color: var(--dim); margin-top: 4px; }
.x-net::before { content: '●'; margin-right: 6px; color: #888; }
.x-net.online::before { color: var(--green); } .x-net.offline::before { color: var(--red); } .x-net.connecting::before { color: var(--hazard); }

.x-body { position: fixed; top: 104px; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 290px 1fr; }
.x-nav { background: #0b0c0f; border-right: 1px solid #23272e; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.x-tab { text-align: left; padding: 16px 16px; border-radius: 10px; border: 2px solid #2a2f37; background: #171a1f; color: var(--ink); font: 800 19px var(--sans); letter-spacing: 2px; }
.x-tab:hover { border-color: #4b525c; }
.x-tab.on { background: var(--hazard); color: #111; border-color: var(--hazard); }
.x-tab.solved { opacity: .6; }
.x-tab .ok { color: var(--green); }
.x-tab.on .ok { color: #0f5b2c; }
.x-tab .here { display: block; margin-top: 6px; font-family: var(--sans); font-size: 13px; letter-spacing: 0; color: var(--green); }
.x-tab.on .here { color: #0f5b2c; }
.x-tab.live:not(.on) { border-color: var(--green); }
.x-page { overflow-y: auto; padding: 30px 48px 80px; }
.x-mod h1 { font-family: 'Future'; font-size: 44px; color: var(--hazard); margin: 0 0 10px; letter-spacing: 2px; }

/* manual pages */
.mp { max-width: 1100px; line-height: 1.45; }
.mp h2 { font: 900 32px var(--sans); letter-spacing: 2px; color: var(--hazard); margin: 0 0 12px; }
.mp h3 { font-size: 24px; margin: 26px 0 10px; color: var(--ink); }
.mp .lead { font-size: 24px; margin: 0 0 14px; }
.mp .howto, .mp .steps { font-size: 21px; color: #d7dce1; }
.mp .steps li { margin-bottom: 8px; }
.mp .note { font-size: 18px; color: var(--dim); margin-top: 16px; }
.mp .callout { margin: 16px 0; padding: 14px 18px; border-radius: 10px; background: rgba(255,59,48,.1); border-left: 5px solid var(--red); font-size: 21px; }
.mp b.green { color: var(--green); } .mp b.red { color: var(--red); } .mp b.orange { color: var(--orange); }
table.rules { border-collapse: separate; border-spacing: 0 8px; margin: 10px 0 18px; width: 100%; max-width: 900px; }
table.rules caption { text-align: left; font-family: 'Future'; font-size: 24px; color: var(--hazard); padding-bottom: 4px; }
table.rules td { background: #1a1d22; padding: 14px 16px; font-size: 22px; }
table.rules td:first-child { border-radius: 10px 0 0 10px; }
table.rules td:last-child { border-radius: 0 10px 10px 0; }
table.rules td.num { width: 46px; text-align: center; font-family: 'Future'; color: var(--dim); }
table.rules td.arrow { width: 40px; text-align: center; color: var(--dim); }
table.rules td.act { color: #fff; }
table.rules .big { font-size: 34px; color: var(--hazard); margin-left: 4px; }
.chip { display: inline-block; width: 22px; height: 22px; border-radius: 5px; vertical-align: -4px; }
.chip.strip-blue { background: #3b82f6; } .chip.strip-red { background: #ef4444; } .chip.strip-yellow { background: #facc15; } .chip.strip-white { background: #f8fafc; }
.extra { margin-top: 30px; padding-top: 10px; border-top: 2px dashed #333; }

.glyph-cols { display: flex; gap: 22px; margin: 18px 0; }
.glyph-col { background: #f4f1e8; color: #15171a; border-radius: 12px; padding: 10px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.glyph-col-h { font-family: 'FutureNarrow'; font-size: 16px; color: #555; }
.glyph-cell { width: 70px; height: 70px; display: grid; place-items: center; border-bottom: 1px solid #ddd6c4; }
.glyph-cell:last-child { border-bottom: none; }

.maze-list { display: grid; grid-template-columns: repeat(2, 260px); gap: 22px; margin-top: 16px; }
.maze-card { background: #f4f1e8; color: #111; border-radius: 12px; padding: 10px; }
.maze-card-h { font-weight: 800; font-size: 18px; margin: 2px 4px 6px; }
.maze-card .maze-label { fill: #3a3a3a; }
.maze-card .maze-tile { fill: #e3dece; stroke: none; }
.maze-card .maze-marker { filter: none; }

.chess-list { display: grid; grid-template-columns: repeat(3, minmax(260px, 340px)); gap: 22px; margin-top: 16px; }
.chess-card { background: #1a1d22; border-radius: 12px; padding: 12px; }
.chess-card-h { font-weight: 800; font-size: 19px; margin-bottom: 8px; }
.chess-card .chess-svg { width: 100%; height: auto; }
.chess-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 18px; }
.lg.best { color: #22c55e; font-weight: 800; font-size: 22px; }
.chess-list .chess-arrow.best, .chess-list .chess-head.best { stroke: #22c55e; fill: #22c55e; opacity: 1; } /* both moves can be the answer now (QC number) */
.lg.second { color: var(--orange); font-weight: 800; font-size: 22px; }

/* flash + result */
.x-flash { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 30; pointer-events: none; text-align: center; padding: 0 60px; }
.x-flash.show { display: flex; animation: flashin 1.6s ease-out forwards; }
.x-flash.strike { background: radial-gradient(ellipse at center, rgba(255,59,48,.2), rgba(255,59,48,.75)); }
.x-flash.win { background: rgba(20,120,70,.8); animation-duration: 2.6s; }
.x-flash.boom { background: radial-gradient(ellipse at center, rgba(255,200,80,.6), rgba(160,20,0,.9)); animation-duration: 2.6s; }
.x-flash .f-big { font-family: 'Future'; font-size: 120px; color: #fff; }
.x-flash .f-small { font-size: 28px; color: #fff; max-width: 1000px; margin-top: 10px; }
@keyframes flashin { 0% { opacity: 0; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.x-result { position: fixed; inset: 104px 0 0 0; display: none; align-items: center; justify-content: center; background: rgba(5,6,8,.9); z-index: 20; }
.x-result.show { display: flex; }
.x-result .r-card { width: 820px; padding: 34px 40px; border-radius: 20px; background: #15181d; border: 4px solid var(--green); }
.x-result .r-card.lose { border-color: var(--red); }
.x-result .r-head { font-family: 'Future'; font-size: 76px; color: var(--green); }
.x-result .r-card.lose .r-head { color: var(--red); }
.x-result .r-team { font-size: 28px; margin: 8px 0 18px; }
.x-result .r-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.x-result .r-stats > div { background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 16px; }
.x-result .r-stats small { display: block; font-size: 14px; letter-spacing: 2px; color: var(--dim); }
.x-result .r-stats b { font-family: var(--mono); font-size: 40px; }
.x-result .r-rank { margin-top: 14px; font-family: 'Future'; font-size: 28px; color: var(--hazard); }
.x-result .notes h3 { font-size: 20px; color: var(--dim); letter-spacing: 2px; text-transform: uppercase; }
.x-result .notes h3.clean { color: var(--green); }
.x-result .note { font-size: 20px; padding: 10px 14px; margin-bottom: 8px; border-radius: 8px; background: rgba(255,59,48,.1); border-left: 4px solid var(--red); }
.x-result .note b { color: var(--hazard); margin-right: 6px; }
.x-result .note-html { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.x-wait { color: var(--dim); font-size: 18px; margin-bottom: 0; }

/* print */
body.print { overflow: visible; background: #fff; color: #111; font-size: 15px; }
body.print .pp { page-break-after: always; padding: 10mm 12mm; }
body.print table.rules, body.print .glyph-cols, body.print .maze-card, body.print .chess-card { break-inside: avoid; }
body.print .x-mod h1, body.print .pp h1 { color: #111; }
body.print .glyph-col { border: 1px solid #ccc; }
body.print .pp h1 { font-family: 'Future'; color: #111; font-size: 30px; margin: 0 0 8px; }
body.print .mp .lead, body.print .mp .howto, body.print .mp .steps { color: #111; font-size: 16px; }
body.print table.rules td { background: #eee; color: #111; font-size: 15px; padding: 8px 10px; }
body.print table.rules caption { color: #111; }
body.print table.rules td.act { color: #111; }
body.print .chess-card { background: #f3f3f3; color: #111; }
body.print .mp .callout { color: #111; }
@media print { @page { size: A4; margin: 0; } }

.pw-words { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 900px; margin-top: 12px; }
.pw-words div { background: #1a1d22; padding: 10px; border-radius: 8px; text-align: center; font: 800 22px var(--mono); letter-spacing: 3px; }
.chip.sig-red { background: #ef4444; } .chip.sig-blue { background: #3b82f6; } .chip.sig-green { background: #22c55e; } .chip.sig-yellow { background: #facc15; }

.x-tab .lk-badge { display: block; margin-top: 6px; font: 800 12px var(--mono); letter-spacing: 1px; color: #f2d27a; }
.x-tab.on .lk-badge { color: #6b4e00; }

/* print: everything dark-themed on screen becomes ink-on-paper */
body.print .mp h2, body.print .mp h3, body.print h3 { color: #111 !important; }
body.print .mp, body.print .mp p, body.print .mp li, body.print .mp td, body.print .mp th, body.print .mp span:not(.chip) { color: #111; }
body.print .mp .note { color: #555; }
body.print .az-strip div, body.print .pw-words div { background: #eee; color: #111; }
body.print .az-strip b, body.print .bin-table b { color: #111; }
body.print .chip { outline: 1px solid #888; }
body.print .mp [style*="background: #1"], body.print .mp [style*="background:#1"] { background: #eee !important; }
body.print .glyph-col, body.print .maze-card, body.print .lm-legend > div { box-shadow: none; }
body.print .mp table td, body.print .mp table th, body.print .cl-tab td, body.print .cl-tab th { background: #f2f2f2 !important; color: #111 !important; }
body.print .cl-tab th { background: #ddd !important; }
body.print .cl-morse div { background: #f2f2f2 !important; color: #111 !important; }
body.print .cl-morse div * { color: #111 !important; }

/* crossing out in the on-screen manual */
.x-page .pw-words > div, .x-page .glyph-col, .x-page .maze-card, .x-page .chess-card, .x-page table.rules tr, .x-page .cl-tab tr, .x-page .lm-legend > div { cursor: pointer; transition: opacity 120ms; }
.x-page .crossed { opacity: .28; text-decoration: line-through; text-decoration-thickness: 3px; position: relative; }
.x-page .glyph-col.crossed::after, .x-page .maze-card.crossed::after, .x-page .chess-card.crossed::after, .x-page .lm-legend > div.crossed::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 4px; background: var(--red); transform: rotate(-35deg); border-radius: 2px; }

/* the defuser's compass dial, drawn in the manual (map / survey / security pages) */
.dial-fig { display: flex; align-items: center; gap: 18px; margin: 14px 0; padding: 12px 16px; border-radius: 10px; background: #fff7e0; border: 2px solid #e0a800; color: #222; }
.dial-pic { width: 230px; height: 230px; flex: none; }
.dial-pic .dp-face { fill: #2b3036; stroke: #888; stroke-width: 3; }
.dial-pic .dp-btn { fill: #e9ecef; stroke: #555; stroke-width: 2; }
.dial-pic .dp-btn.lie { fill: #ffd6d2; stroke: #c0392b; }
.dial-pic .dp-lab { font: 800 13px var(--mono, monospace); text-anchor: middle; fill: #111; }
.dial-pic .dp-true { font: 900 15px var(--mono, monospace); text-anchor: middle; fill: #13803b; }
.dial-pic .dp-pos { font: 700 9px var(--sans, sans-serif); text-anchor: middle; fill: #666; letter-spacing: .5px; }
.dial-pic .dp-note { font: 800 7.5px var(--mono, monospace); text-anchor: middle; fill: #ffcf5a; }
.dial-fig figcaption { font-size: 15px; line-height: 1.45; }
.dial-fig .dp-true-t { color: #13803b; font-weight: 800; }
.dial-warn { margin: 10px 0; padding: 10px 14px; border-radius: 8px; background: #c0392b; color: #fff; font-weight: 800; font-size: 17px; }
.dial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 900px; }
.dial-grid .dial-fig { flex-direction: column; margin: 0; gap: 6px; }
.dial-grid .dial-fig figcaption { font-size: 13px; }
@media (max-width: 700px) { .dial-grid { grid-template-columns: 1fr; } }
