:root{color-scheme:dark;font-family:'DM Sans',system-ui,-apple-system,sans-serif;background:#070b17;color:#e8f3ff;font-synthesis:none;--muted:#8599b6;--border:#27344e;--panel:#111a2d;--accent:#53dbe9;--amber:#ffb86a}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse 70% 25% at 50% 0%,#152748 0%,transparent 85%),linear-gradient(120deg,#080c17,#0a1122 70%,#090d19)}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,canvas:focus-visible{outline:3px solid #70edfb;outline-offset:4px}
.page-shell{max-width:1250px;margin:auto;padding:0 30px}.site-header{height:88px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #26334b}.brand{display:flex;gap:14px;align-items:center}.brand-copy{letter-spacing:.22em;font-size:13px;font-weight:700}.brand-copy strong{color:#6fe9f5}.brand-copy small{display:block;color:#667b9b;letter-spacing:.13em;font-size:9px;margin-top:6px}.brand-symbol{width:31px;height:31px;display:grid;grid-template-columns:1fr 1fr;transform:rotate(-45deg);gap:5px}.brand-symbol span{border:2px solid #78d7eb;border-radius:2px}.brand-symbol span:nth-child(2){border-color:#f1bd6a}.brand-symbol span:nth-child(3){border-color:#547baf}.header-actions{display:flex;gap:9px;align-items:center}.build-label{border:1px solid #2e4e53;background:#11292e;padding:7px 11px;color:#8fdac6;font-size:10px;letter-spacing:.1em;margin-right:12px}.mini-button{border:1px solid var(--border);background:#151f33;border-radius:7px;color:#c8ddf5;font-size:11px;font-weight:700;min-width:56px;height:35px}.mini-button:hover{border-color:var(--accent)}
.hero{text-align:center;margin:45px auto 31px}.eyebrow{font-size:10px;color:#81a9c1;font-weight:700;letter-spacing:.2em}.live-dot{display:inline-block;width:7px;height:7px;background:#5de2a8;box-shadow:0 0 10px #4ddcbb;border-radius:50%;vertical-align:1px;margin-right:9px}.eyebrow-separator{color:#3e6784;margin:0 10px}.hero h1{font:700 clamp(35px,5vw,65px)/1.05 'Space Grotesk',sans-serif;letter-spacing:-.055em;margin:15px 0 10px;background:linear-gradient(110deg,#ffffff 20%,#b7d9ee 65%,#68cadd);background-clip:text;color:transparent}.hero p{font-size:14px;color:#a5b7cf;margin:0}
.game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,370px);gap:24px;align-items:start}.board-column{border:1px solid #2c3c55;border-radius:14px;padding:14px;background:linear-gradient(140deg,#111b30,#0e1729);box-shadow:0 15px 65px #0004}.board-head,.board-footer{display:flex;justify-content:space-between;align-items:center;padding:8px 12px}.board-head{margin-bottom:8px}.board-head span,.board-index,.board-footer{font-size:10px;letter-spacing:.13em;font-weight:700;color:#7e9ab5}.status-dot{display:inline-block;width:7px;height:7px;background:#58d8a3;border-radius:50%;margin-right:8px}.board-wrap{position:relative;width:100%;border:1px solid #1e3753;overflow:hidden;border-radius:8px}.board-wrap canvas{display:block;width:100%;height:auto;aspect-ratio:1/1;cursor:crosshair;touch-action:manipulation}.canvas-overlay{pointer-events:none;position:absolute;left:1.1%;right:1.1%;top:50%;display:flex;justify-content:space-between;transform:translateY(-50%);font:700 8px 'Space Grotesk';color:#b2cce6;letter-spacing:.02em}.canvas-overlay span:first-child{color:#55e4f2}.canvas-overlay span:last-child{color:#ffb663}.board-footer{margin-top:10px;padding-bottom:3px}.legend{display:flex;gap:8px;align-items:center;letter-spacing:.08em}.legend-blue,.legend-orange{display:inline-block;width:9px;height:9px;background:#57d9f4;border-radius:50%}.legend-orange{background:#ffb15b;margin-left:14px}.footer-mark{opacity:.5}
.control-column{display:flex;flex-direction:column;gap:14px}.score-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.score-card{background:linear-gradient(130deg,#16223a,#101b2e);border:1px solid #293a51;min-height:111px;padding:15px;border-radius:10px;display:flex;flex-direction:column;justify-content:center;gap:7px}.score-card.primary-score{border-color:#2c6372;background:linear-gradient(130deg,#173546,#13243b)}.score-title{font-size:10px;color:#8fb4c9;font-weight:800;letter-spacing:.14em}.score-card strong{font:700 clamp(26px,3vw,34px) 'Space Grotesk',sans-serif;letter-spacing:-.04em}.score-card small{font-size:9px;color:#71869f;letter-spacing:.13em}.score-card.compact{min-height:79px;gap:6px}.score-card.compact strong{font-size:23px}.mode-switch{display:flex;border:1px solid #304057;padding:4px;border-radius:9px;background:#111a2b;gap:4px}.mode-switch button{flex:1;color:#899fb9;background:none;border:0;border-radius:6px;padding:11px 6px;font-size:12px;font-weight:700}.mode-switch button.active{color:#0e1824;background:#78dae6}.mode-switch button:not(.active):hover{color:white}
.deck-panel,.help-panel{border:1px solid #293951;border-radius:11px;padding:18px;background:#101929}.panel-heading{display:flex;align-items:center;gap:15px;color:#83a9c2;font:700 10px 'Space Grotesk',sans-serif;letter-spacing:.16em}.thin-rule{flex:1;height:1px;background:#31435a}.small-label{font-size:11px;color:#9cacc2;margin:20px 0 10px}.tile-hand{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.piece{border:1px solid #33445a;background:#142138;min-height:89px;border-radius:10px;display:flex;align-items:center;justify-content:center;padding:2px;transition:transform .16s,border-color .16s}.piece canvas{max-width:100%}.piece.selected{border-color:#66ddf0;box-shadow:0 0 0 1px #4dcddb80,inset 0 0 20px #3db9db14;transform:translateY(-2px)}.piece:hover{border-color:#8de4ed}.action-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.action-button{font-weight:700;font-size:11px;border:1px solid #3c536b;background:#172b44;color:#d0e1f3;min-height:44px;border-radius:8px;padding:6px}.action-button.rotate{background:linear-gradient(100deg,#1e6781,#1c8792);border-color:#51b3c3;color:white}.action-button:not(:disabled):hover{filter:brightness(1.1)}.help-panel p{font-size:12px;line-height:1.8;color:#a9bed4;margin:13px 0}.hint-pill{display:inline-flex;align-items:center;border:1px solid #2f4156;border-radius:5px;padding:8px 10px;color:#76bad2;font:700 10px 'Space Grotesk';letter-spacing:.13em}.hint-pill span{margin:0 10px;color:#596c86}.reset-button{padding:11px;border:1px solid #39475d;border-radius:8px;background:transparent;color:#b8c9da;font-size:12px;font-weight:700}.reset-button:hover{border-color:#a1b6cc;color:white}.autosave{margin:-3px 0 0;text-align:center;color:#667b97;font-size:10px}.site-footer{display:flex;justify-content:space-between;border-top:1px solid #25334b;padding:27px 0 40px;margin-top:60px;color:#71859d;font-size:10px;letter-spacing:.13em}.toast{position:fixed;z-index:20;left:50%;top:105px;transform:translate(-50%,-12px);background:#ffd47b;color:#182435;padding:13px 25px;border-radius:30px;font-size:13px;font-weight:800;letter-spacing:.08em;box-shadow:0 10px 45px #0008;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s}.toast.visible{opacity:1;transform:translate(-50%,0)}.gameover{position:fixed;inset:0;background:#070b17a8;display:grid;place-items:center;z-index:15}.gameover[hidden]{display:none}.gameover-content{text-align:center;padding:35px;border:1px solid #49627d;border-radius:16px;background:#101b30;box-shadow:0 40px 100px #0009;max-width:360px}.gameover-icon{font-size:55px;color:#8fdcea}.gameover-content h2{letter-spacing:.04em}.gameover-content p{color:#aabfd4;font-size:12px;line-height:1.6}
@media(max-width:820px){.game-layout{grid-template-columns:minmax(0,1fr)}.control-column{display:grid;grid-template-columns:1fr 1fr;align-items:start}.score-grid{grid-column:1/-1;grid-template-columns:repeat(4,1fr)}.score-card{min-height:85px}.score-card strong{font-size:26px}.score-card.compact{min-height:85px}.mode-switch{grid-column:1/-1}.deck-panel,.help-panel{height:100%}.reset-button,.autosave{grid-column:1/-1}}
@media(max-width:550px){.page-shell{padding:0 12px}.site-header{height:67px}.brand{gap:9px}.brand-symbol{width:22px;height:22px;gap:3px}.brand-copy{font-size:10px}.brand-copy small{font-size:7px}.build-label{display:none}.mini-button{min-width:43px;height:32px;font-size:10px}.hero{margin:26px auto 21px}.hero h1{font-size:38px}.hero p{font-size:12px}.eyebrow{font-size:8px;letter-spacing:.08em}.board-column{padding:8px}.board-head,.board-footer{padding:8px 6px}.control-column{display:flex}.score-grid{grid-template-columns:1fr 1fr}.score-card,.score-card.compact{min-height:80px}.deck-panel,.help-panel{padding:14px}.site-footer{gap:12px;flex-wrap:wrap;font-size:8px;margin-top:30px}.tile-hand{gap:8px}.piece{min-height:74px}.canvas-overlay{font-size:6px}.board-index{font-size:8px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}

/* Circuit Blocks 0.2 — escalating challenge controls */
.difficulty-panel{background:linear-gradient(145deg,#151b31,#111b2d);border:1px solid #34435b;border-radius:11px;padding:15px 18px;display:flex;flex-direction:column;gap:11px}
.difficulty-title{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#95bbd0;font-size:10px;font-weight:800;letter-spacing:.11em}
.difficulty-title span:last-child{font-size:10px;letter-spacing:0;font-weight:400;color:#91a4bf;text-align:right;line-height:1.35}
.difficulty-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.difficulty-buttons button{background:#1a2840;color:#bdd0e8;border:1px solid #3b4c64;padding:11px 4px;border-radius:7px;font-size:11px;font-weight:700}
.difficulty-buttons button.active{color:#132b33;background:#83e6dd;border-color:#a5f5e6}
.challenge-status{display:flex;justify-content:space-between;gap:10px;color:#a5b9cd;font-size:11px}
.challenge-status span{font-size:10px;letter-spacing:.1em;color:#8ea4c1;margin-right:4px}
.challenge-status strong{color:#fff;font-size:13px}
.heat-bar{height:7px;background:#26314a;border-radius:10px;overflow:hidden}
.heat-bar span{display:block;height:100%;width:0;background:#53dbe9;border-radius:10px;transition:width .2s ease}
.goal-hint{color:#9fbbd0;margin:0;font-size:11px;line-height:1.5}
@media(min-width:551px) and (max-width:820px){.difficulty-panel{grid-column:1/-1}}
@media(max-width:550px){.difficulty-panel{padding:13px}.difficulty-title span:last-child{max-width:58%}}

.port-label{position:absolute;pointer-events:none;top:50%;transform:translateY(-50%);font:700 9px 'Space Grotesk',sans-serif;letter-spacing:.07em;text-shadow:0 1px 4px #06101b}
.port-in{left:1%;color:#63e8fc}.port-out{right:1%;color:#ffc276}
@media(max-width:550px){.control-column{align-items:stretch}.port-label{font-size:7px}}

/* Circuit Blocks v0.3 — rechargeable board abilities and special tiles */
.charge-status{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#e3bee9;font-size:11px;font-weight:800;letter-spacing:.1em}
.charge-status strong{color:#f3d6ff;font-size:15px;font-variant-numeric:tabular-nums}
.charge-hint{font-size:11px;line-height:1.5;color:#b7a9c7;margin:0}
.ability-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ability-button{border:1px solid #6a5179;border-radius:8px;background:#2b2342;color:#f7dfff;padding:11px 8px;font-size:11px;font-weight:800;min-height:48px}
.ability-button.armed{outline:2px solid #ffd482;box-shadow:0 0 14px #eaba7644}
.ability-button:not(:disabled):hover{background:#45325f}
button:disabled{opacity:.45;cursor:not-allowed}
.piece{position:relative}
.special-badge{position:absolute;top:4px;right:7px;color:#f4c980;text-shadow:0 0 6px #cf8dff;font-size:15px}
.special-hint{color:#dfc1ef!important;border:1px solid #5b3d76;background:#241a37;padding:10px;border-radius:8px;font-size:11px!important}
@media(max-width:550px){.ability-button{font-size:10px;min-height:46px}}

.challenge-status{flex-wrap:wrap;row-gap:5px}.challenge-status>div{flex:1 1 auto;white-space:nowrap}

/* Circuit Blocks v0.4: one-tile reserve and route risk feedback */
.reserve-button{margin-top:9px;width:100%;border-color:#67558b;background:#241f38;color:#e8d9ff;min-height:43px}
.reserve-button:disabled{opacity:.48;cursor:not-allowed}
.preview-info{font-size:11px;line-height:1.5;color:#92c6c7;margin:6px 8px 5px;min-height:17px}
.preview-info.warning{color:#ffabac;font-weight:700}

/* Circuit Blocks v0.5 — campaign panel and mode selector */
.mode-switch {display:flex;flex-wrap:wrap;gap:4px}
.mode-switch button {flex:1 1 30%;min-width:85px}
.mission-panel {background:linear-gradient(135deg,#1d263f,#131c32);border:1px solid #3d5e7c;border-radius:16px;padding:18px;margin:14px 0;color:#e5f8ff}
.mission-panel[hidden],.difficulty-panel[hidden],#missionNext[hidden] {display:none!important}
.mission-counter {font-size:12px;color:#8ce0c2;font-weight:700;letter-spacing:.06em}
.mission-panel h2 {font-size:20px;margin:8px 0;color:#f3fbff}
.mission-panel p {line-height:1.55;color:#c6d7e6;font-size:14px}
#missionNext {margin-top:12px;width:100%}

/* Circuit Blocks v0.6 — thermal pressure and combo readouts */
.thermal-status{display:flex;justify-content:space-between;gap:10px;margin:12px 0 6px;border:1px solid #485169;background:#1a233b;border-radius:10px;padding:10px 12px}
.thermal-status>div{display:flex;flex-direction:column;gap:5px;font-size:11px;letter-spacing:.055em;color:#b4cbd7}
.thermal-status strong{font-size:18px;color:#ffc18b;font-variant-numeric:tabular-nums}
.thermal-status>div:last-child{text-align:right}.thermal-status>div:last-child strong{color:#b4efdc}
.thermal-hint,.combo-hint{margin:6px 0;line-height:1.45;font-size:12px;color:#c1cbdc}
.combo-hint{color:#81e6bf}
@media (prefers-reduced-motion:reduce){.thermal-status strong{transition:none}}

/* v0.6.1 — gameplay-first responsive layout; overrides inherited v0.1-v0.6 CSS */
html { min-width: 320px; }
.page-shell { max-width: 1420px; padding-inline: clamp(12px, 2.5vw, 32px); }
.site-header { height: 64px; }
.hero { margin: 16px auto 18px; }
.hero h1 { font-size: clamp(26px, 3vw, 42px); margin: 8px 0 6px; }
.hero p { font-size: 12px; }
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  align-items: start;
  gap: clamp(12px, 2vw, 24px);
}
.board-column {
  position: sticky;
  top: 12px;
  min-width: 0;
  padding: clamp(8px, 1vw, 14px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.board-wrap {
  width: min(100%, 68dvh, 650px);
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 1;
  flex: none;
}
.board-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
}
.board-head, .board-footer, .preview-info { width: min(100%, 68dvh, 650px); margin-inline: auto; }
.control-column { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.control-column > * { min-width: 0; }
.control-column > .score-grid { order: 1; }
.control-column > .mode-switch { order: 0; }
.control-column > .deck-panel { order: 2; }
.control-column > .difficulty-panel, .control-column > .mission-panel { order: 3; }
.control-column > .help-panel { order: 4; }
.control-column > .reset-button { order: 5; }
.control-column > .autosave { order: 6; }
.score-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.score-card, .score-card.compact { min-width: 0; min-height: 76px; padding: 10px; gap: 5px; }
.score-card strong, .score-card.compact strong { font-size: clamp(18px, 1.7vw, 25px); overflow-wrap: anywhere; }
.score-card small { font-size: 8px; letter-spacing: .03em; }
.score-title { font-size: 9px; letter-spacing: .07em; }
.mode-switch { margin: 0; }
.mode-switch button { min-height: 42px; }
.deck-panel { padding: 12px; }
.deck-panel .small-label { margin: 6px 0 7px; }
.tile-hand { gap: 8px; }
.piece { min-height: 75px; }
.action-row { margin-top: 8px; }
.action-button { min-height: 42px; font-size: 12px; }
.reserve-button { min-height: 38px; margin-top: 7px; }
.difficulty-panel { padding: 12px 14px; gap: 8px; }
.help-panel { padding: 12px; }
.help-panel p { line-height: 1.45; margin: 7px 0; }
.short-path-warning { color: #ffbc90; font-weight: 700; }
#minPathStatus { font-variant-numeric: tabular-nums; }
.difficulty-pressure { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; color: #e3af83; }
.difficulty-pressure strong { color: #ffe0b3; font-size: 14px; }

/* tablet: place the compact module tray immediately before the board */
@media (max-width: 980px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .control-column { display: contents; }
  .game-layout > .board-column { order: 3; position: static; width: 100%; }
  .control-column > .mode-switch { order: 0; }
  .control-column > .deck-panel { order: 1; position: sticky; top: 0; z-index: 5; box-shadow: 0 8px 22px #050b18d9; }
  .control-column > .score-grid { order: 2; }
  .control-column > .difficulty-panel, .control-column > .mission-panel { order: 4; }
  .control-column > .help-panel { order: 5; }
  .control-column > .reset-button { order: 6; }
  .control-column > .autosave { order: 7; }
  .board-wrap, .board-head, .board-footer, .preview-info { width: min(100%, 72dvh, 660px); }
  .score-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .score-card, .score-card.compact { min-height: 60px; }
  .score-card strong, .score-card.compact strong { font-size: clamp(16px, 2.6vw, 24px); }
  .deck-panel { padding: 8px 10px; }
  .deck-panel .panel-heading, .deck-panel .small-label { display: none; }
  .deck-panel .tile-hand { gap: 6px; }
  .deck-panel .piece { min-height: 58px; max-height: 62px; }
  .deck-panel .piece canvas { width: 56px !important; height: 56px !important; }
  .deck-panel .action-row { margin-top: 6px; }
  .deck-panel .action-button { min-height: 35px; padding-block: 4px; }
  .deck-panel .reserve-button { min-height: 32px; margin-top: 5px; }
}
@media (max-width: 550px) {
  .page-shell { padding-inline: 8px; }
  .site-header { height: 49px; }
  .brand-copy small { display: none; }
  .hero { margin: 10px auto 12px; }
  .hero h1 { font-size: clamp(25px, 8vw, 35px); margin: 5px 0 3px; }
  .hero p { font-size: 11px; }
  .hero .eyebrow { font-size: 8px; }
  .game-layout { gap: 8px; }
  .board-column { padding: 5px; border-radius: 9px; }
  .board-head { margin-bottom: 2px; padding: 3px 4px; }
  .board-footer { margin-top: 2px; padding: 3px; }
  .board-wrap, .board-head, .board-footer, .preview-info { width: 100%; }
  .board-wrap { border-radius: 5px; }
  .port-label { font-size: 7px; }
  .deck-panel { border-radius: 8px; }
  .deck-panel .piece { min-height: 56px; }
  .deck-panel .action-button { font-size: 11px; }
  .mode-switch { gap: 2px; }
  .mode-switch button { min-width: 0; min-height: 39px; padding: 6px 3px; font-size: 11px; }
  .score-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px; }
  .score-card, .score-card.compact { min-height: 54px; padding: 6px 4px; border-radius: 7px; }
  .score-title { font-size: 8px; letter-spacing: 0; }
  .score-card strong, .score-card.compact strong { font-size: clamp(15px, 4vw, 19px); }
  .score-card small { display: none; }
  .site-footer { margin-top: 20px; }
  .toast { top: 64px; width: max-content; max-width: calc(100vw - 20px); white-space: normal; text-align: center; }
}
@media (max-width: 360px) {
  .deck-panel .piece { min-height: 50px; }
  .deck-panel .piece canvas { width: 50px !important; height: 50px !important; }
  .board-column { padding: 3px; }
  .score-card strong, .score-card.compact strong { font-size: 15px; }
}

/* Keep the controls and the canvas adjacent on touch screens. */
@media(max-width:980px){
  .control-column > .score-grid{order:4}
  .control-column > .difficulty-panel,.control-column > .mission-panel{order:5}
  .control-column > .help-panel{order:6}
  .control-column > .reset-button{order:7}
  .control-column > .autosave{order:8}
}

/* v0.6.2 — guided Helion-7 Academy and ECHO story presentation */
.mode-switch button { min-width: 74px; }
.control-column > .academy-welcome { order: -1; }
.control-column > .academy-panel { order: 3; }
.academy-welcome,.academy-panel {
  border: 1px solid #345e76; border-radius: 13px; padding: 17px;
  background: linear-gradient(135deg,#17304a,#10192d 75%);
  box-shadow: inset 0 1px 0 #84e2f322;
  color: #e4f4ff;
}
.academy-welcome[hidden],.academy-panel[hidden],#academyNext[hidden]{display:none!important}
.academy-welcome {display:flex;gap:15px;align-items:flex-start}
.academy-symbol {flex:none;width:42px;height:42px;display:grid;place-items:center;font-size:27px;color:#79f1dc;background:#19495b;border-radius:10px}
.academy-welcome-copy {min-width:0;flex:1}
.academy-welcome-copy strong {font-size:15px}
.academy-welcome-copy p {font-size:12px;line-height:1.55;color:#bfd3e6;margin:7px 0 11px}
.academy-welcome-actions,.academy-actions {display:flex;gap:8px;flex-wrap:wrap}
.academy-welcome-actions button,.academy-actions button {flex:1 1 108px;padding:9px;min-height:41px}
.academy-station {font-size:10px;font-weight:800;color:#91e9d1;letter-spacing:.12em}
.academy-progress {display:flex;align-items:center;justify-content:space-between;gap:8px;color:#82d3e6;font-size:10px;letter-spacing:.08em;margin:10px 0}
.academy-progress strong {color:#c0f8e4}
.academy-echo {display:flex;align-items:center;gap:10px;font-size:10px;letter-spacing:.08em;font-weight:700;color:#a9e4f3;border-top:1px solid #3f5265;padding-top:11px}
.academy-avatar {width:31px;height:31px;display:grid;place-items:center;border-radius:8px;background:#31536c;border:1px solid #64cee0;color:#a8f3ea;font-size:18px}
.academy-panel h2 {font:700 23px/1.2 'Space Grotesk',sans-serif;color:#fff;margin:12px 0 8px}
.academy-story {background:#0a1a30;border-left:3px solid #76cfec;border-radius:5px;margin:10px 0;padding:12px;font-size:13px;line-height:1.7;color:#dbedf9}
.academy-goal {font-size:13px;font-weight:700;line-height:1.6;color:#ffdaa0;margin:13px 0 8px}
.academy-outcome {font-size:12px;line-height:1.5;color:#86e2c5;margin:8px 0 15px}
.academy-actions #academyNext {flex-basis:100%;background:linear-gradient(100deg,#207b76,#1d948b)}
.academy-actions #academyExit {background:transparent;color:#98abc2;border-color:#344960}
@media(max-width:980px){
  .control-column > .academy-welcome{order:-1}
  .control-column > .academy-panel{order:5}
  .control-column > .mission-panel,.control-column > .difficulty-panel{order:5}
}
@media(max-width:550px){
  .academy-welcome,.academy-panel{padding:12px}
  .academy-welcome{gap:10px}
  .academy-symbol{width:32px;height:32px;font-size:22px}
  .academy-welcome-copy strong{font-size:13px}
  .academy-panel h2{font-size:21px}
  .mode-switch button{flex:1 1 46%;min-width:0;font-size:11px}
}

/* In Academy the narrative sits directly above the tile tray and board. */
.control-column > .academy-panel { order: 1; }
.academy-actions #academyAbility { flex-basis: 100%; background: linear-gradient(115deg,#326f83,#239b88); }
@media(max-width:980px){
  .control-column > .academy-panel {order:1}
  .control-column > .deck-panel {order:2}
  .game-layout > .board-column {order:3}
  .control-column > .score-grid {order:4}
}

/* Keep the game in view while inviting a first-time visitor to Academy. */
.control-column > .academy-welcome {
  position: fixed;
  inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) auto;
  z-index: 19;
  width: min(410px, calc(100vw - 24px));
  box-shadow: 0 14px 65px #000c, 0 0 0 1px #96eaf02e;
}
.mode-switch { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: stretch; }
.mode-switch button { flex: initial; min-width: 0; overflow-wrap: anywhere; }
@media(max-width:550px){
  .mode-switch { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .control-column > .academy-welcome {
    inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px;
    width: auto;
    padding: 11px;
  }
  .academy-panel {padding:10px 12px}
  .academy-station {font-size:9px}
  .academy-progress {margin:4px 0}
  .academy-echo {padding-top:5px}
  .academy-avatar {width:24px;height:24px;font-size:13px}
  .academy-panel h2 {font-size:18px;margin:6px 0}
  .academy-story {max-height:80px;overflow-y:auto;padding:8px;margin:7px 0;font-size:12px;line-height:1.4}
  .academy-goal {margin:7px 0 4px;font-size:12px;line-height:1.4}
  .academy-outcome {margin:5px 0 7px;font-size:11px}
  .academy-actions button {min-height:35px;padding:6px;font-size:11px}
}

/* v0.6.3 fairness and playtest controls */
.board-reset-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.board-reset-actions .reset-button{width:100%;min-height:43px}
.board-reset-actions .retry-button{color:#d3ecf5;background:#16283c;border-color:#426076}
.fair-play-hint{margin:0;font-size:11px;line-height:1.55;color:#91d6c5}
.board-footer .footer-mark{font-family:monospace;font-size:10px;user-select:text;opacity:.8}
.control-column>.board-reset-actions{order:5}
@media(max-width:980px){.control-column>.board-reset-actions{order:7}}


/* Circuit Blocks v0.6.5 — play first, read only when requested */
.hero{margin:8px auto 12px}
.hero .eyebrow,.hero #tagline{display:none}
.hero h1{font-size:clamp(27px,3vw,38px);margin:2px 0 4px}
.board-head{min-height:12px;padding:0 4px;margin-bottom:3px}
.board-head .status-label span,.board-head .board-index{display:none}
.board-head .status-dot{width:5px;height:5px;margin:0}
.board-footer{margin-top:2px;padding:2px 4px}
.board-footer .legend{display:none}
.preview-info:empty{display:none}
.score-card small{display:none}
.score-card,.score-card.compact{min-height:58px;padding:8px;gap:2px}
.score-card strong,.score-card.compact strong{font-size:clamp(18px,2.1vw,26px)}
.control-column{gap:8px}
.deck-panel{padding:10px}
.deck-panel .panel-heading{margin:0 0 7px;font-size:10px}
.deck-panel .tile-hand{gap:7px}
.deck-panel .piece{min-height:67px}
.deck-panel .action-row{margin-top:7px}
.difficulty-panel{gap:8px;padding:10px 12px}
.difficulty-title{min-height:16px}
.difficulty-title:empty{display:none}
.difficulty-pressure{font-size:11px}
.difficulty-panel .charge-hint,.difficulty-panel > .goal-hint{display:none}
.difficulty-panel .thermal-status{margin:5px 0}
.difficulty-panel .ability-button{min-height:39px;padding:7px 6px}
.help-panel{padding:0 12px}
.help-panel > summary,.advanced-panel > summary{cursor:pointer;list-style:none;color:#a8c6da;font-size:12px;font-weight:700;padding:12px 3px}
.help-panel > summary::-webkit-details-marker,.advanced-panel > summary::-webkit-details-marker{display:none}
.help-panel > summary::after,.advanced-panel > summary::after{content:'⌄';float:right;color:#8caabf}
.help-panel[open] > summary::after,.advanced-panel[open] > summary::after{content:'⌃'}
.help-panel[open]{padding:0 12px 12px}
.advanced-panel{border-top:1px solid #29374b}
.advanced-content{padding:0 2px 9px}
.advanced-content .goal-hint,.advanced-content .fair-play-hint{font-size:11px;margin:5px 0}
.advanced-content .thermal-status{border-radius:8px;padding:7px}
.advanced-content .thermal-hint,.advanced-content .combo-hint{font-size:11px;margin:4px 0}
.academy-compact{box-shadow:none;padding:10px 12px;display:block}
.academy-compact .academy-progress{margin:0 0 4px}
.academy-compact-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.academy-compact-head strong{font-size:12px;color:#e2faff;letter-spacing:.04em}
.briefing-reopen{border:1px solid #42657a;border-radius:7px;background:#152e44;color:#9de3ee;padding:7px 10px;font-weight:700;font-size:11px}
.academy-compact .academy-outcome{margin:7px 0;font-size:12px;line-height:1.45;color:#ffdda5}
.academy-compact .academy-actions button{min-height:35px;font-size:11px}
.academy-briefing-dialog:not([open]){display:none}
.academy-briefing-dialog{
  position:fixed;inset:0;margin:auto;padding:clamp(18px,3vw,30px);
  width:min(440px,calc(100vw - 24px));max-height:min(85dvh,680px);overflow-y:auto;
  border:1px solid #5898a7;border-radius:18px;
  background:linear-gradient(145deg,#1c3550,#111c31 80%);color:#edf9ff;
  box-shadow:0 24px 90px #000b,0 0 0 1px #86f5ff20;
}
.academy-briefing-dialog::backdrop{background:#040913c9;backdrop-filter:blur(4px)}
.briefing-top{display:flex;align-items:center;gap:10px;font-size:11px;font-weight:800;letter-spacing:.12em;color:#8ceada}
.briefing-beacon{display:grid;place-items:center;width:34px;height:34px;border:1px solid #447f91;background:#204354;border-radius:9px;font-size:23px}
.academy-briefing-dialog h2{font-size:clamp(21px,4vw,27px);line-height:1.2;margin:17px 0 12px}
.academy-briefing-dialog .academy-story{margin:0 0 14px;font-size:14px;line-height:1.6;max-height:none;overflow:visible}
.academy-briefing-dialog .academy-goal{font-size:14px;line-height:1.5;color:#ffd798}
.briefing-close{display:block;width:100%;min-height:46px;margin-top:20px}
@media (max-width:980px){
  .control-column > .academy-panel{order:1}
  .control-column > .deck-panel{order:2}
  .control-column > .help-panel{order:8}
  .control-column > .board-reset-actions{order:7}
  .control-column > .autosave{order:9}
}
@media(max-width:550px){
  .hero{margin:5px auto 8px}
  .hero h1{font-size:27px}
  .board-head{min-height:7px}
  .score-card,.score-card.compact{min-height:50px;padding:5px}
  .deck-panel .piece{min-height:55px}
  .help-panel{padding-inline:10px}
  .academy-briefing-dialog{padding:18px}
  .academy-briefing-dialog .academy-story{font-size:13px}
}


/* v0.7 Helion-7 reactor room: compact sci-fi controls, accessible warning text. */
:root{--reactor-blue:#55dff7;--reactor-amber:#ffc47d;--reactor-red:#fa687f}
body{background:radial-gradient(ellipse at 55% -15%,#173759 0%,transparent 48%),radial-gradient(ellipse at 90% 68%,#102344 0%,transparent 44%),#050a14;color:#f0f9ff}
.page-shell{position:relative;isolation:isolate}
.page-shell::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;background:repeating-linear-gradient(0deg,transparent 0 4px,#96caf90a 5px 6px);opacity:.22}
.site-header{border-bottom:1px solid #3a64833b;box-shadow:0 12px 40px #0005}
.hero{text-align:left;max-width:1160px}
.hero h1{font-weight:800;letter-spacing:.025em;text-shadow:0 0 44px #42ccff55;background:linear-gradient(120deg,#fff,#b6e9ff 52%,#6bcded);background-clip:text}
.hero .eyebrow{color:#85e8ff;letter-spacing:.20em}
.game-layout{gap:18px}
.board-column{background:linear-gradient(144deg,#08192c,#0c1b30 44%,#050e1e);border:1px solid #34779977;box-shadow:inset 0 0 30px #3cdfff0b,0 24px 90px #000a;position:relative}
.board-column::before{content:"HELION-7 // CORE A";position:absolute;top:-10px;left:22px;padding:0 10px;background:#0b1727;color:#7df5ff;letter-spacing:.16em;font-size:9px;font-weight:800}
.board-wrap{border:1px solid #4c9dc177;box-shadow:inset 0 0 26px #44e6fa1c,0 0 25px #1cbefa16;position:relative}
.board-wrap::after{content:"";pointer-events:none;position:absolute;inset:0;background:linear-gradient(transparent 95%,#75d9ff0d 100%);background-size:100% 6px;mix-blend-mode:screen}
.board-head{border-bottom:1px solid #37688755}
.board-index,.footer-mark{color:#90c6df}
.station-hud{display:grid;grid-template-columns:1fr 1fr 1.15fr;gap:5px;margin:8px auto 10px;width:min(100%,68dvh,650px)}
.station-hud>div{border:1px solid #2b6377;background:#091c2eaa;padding:9px 10px;display:flex;flex-direction:column;gap:4px;min-width:0}
.station-hud span{font-size:9px;letter-spacing:.12em;color:#8db7cc;font-weight:800}
.station-hud strong{font-size:clamp(10px,1vw,13px);font-weight:800;color:#7eeeff;overflow-wrap:anywhere}
.station-hud .echo-feed{border-color:#7a93aa66;background:#13213caa}
.station-hud .echo-feed strong{color:#d7e6ff}
.station-hud.critical>div:nth-child(2){border-color:#ff8b83;background:#44233688;box-shadow:inset 0 0 22px #ef56652b}
.station-hud.critical>div:nth-child(2) strong{color:#ffb4a7}
.score-card{background:linear-gradient(120deg,#101d34,#09182d);border-color:#2a5c74a8}
.score-card.primary-score{background:linear-gradient(120deg,#0c3b4e,#101e36);box-shadow:inset 0 0 26px #23cad41b}
.score-card strong{color:#f5fdff}
.mode-switch{padding:5px;border:1px solid #366781;background:#091b30;box-shadow:0 0 22px #1d9dc30c}
.mode-switch button{min-width:0;flex:1 1 25%;letter-spacing:.045em;transition:background .18s,border-color .18s,color .18s}
.mode-switch button.active{background:linear-gradient(125deg,#6beeff,#47c6d6);color:#071827;box-shadow:0 0 19px #64e8fa44}
.mode-switch #crisis.active{background:linear-gradient(120deg,#ffb77b,#ff7982);color:#2b0d1a;box-shadow:0 0 24px #fa697755}
.classic-modes{padding:0 10px;color:#8eaebf;font-size:11px}
.classic-modes summary{cursor:pointer;width:max-content;max-width:100%;list-style-position:inside;padding:4px 6px}
.classic-modes-buttons{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.classic-modes button{border:1px solid #375a73;background:#0e2137;color:#b4d4e6;padding:9px 12px;border-radius:6px;font-size:11px}
.classic-modes button.active{color:#061928;background:#71cfe2}
.deck-panel,.difficulty-panel,.help-panel,.academy-panel{background:linear-gradient(155deg,#10253a,#0c182b);border-color:#365f75}
.piece{background:linear-gradient(140deg,#19324a,#0a1d33);border-color:#416780}
.piece.selected{box-shadow:0 0 0 1px #60e9f5,inset 0 0 24px #2ed9ff25,0 0 22px #00bfe02b}
.action-button.rotate{background:linear-gradient(120deg,#116c86,#148e9e);border-color:#61d6ec;box-shadow:0 0 15px #17c9e017}
.heat-bar{background:#112b40;border:1px solid #35657a;height:9px}
.toast{background:#d2fbff;border:1px solid #86e6fa;box-shadow:0 0 40px #37ecff33,0 8px 30px #0009;border-radius:8px}
body[data-play-style="crisis"] .board-column{border-color:#a75470a8;box-shadow:inset 0 0 36px #fd577c17,0 24px 90px #000a}
body[data-play-style="crisis"] .board-column::before{color:#ffbaa2}
body[data-play-style="crisis"] .board-wrap{border-color:#fd788155;box-shadow:inset 0 0 22px #ff627922,0 0 20px #ef62791b}
body[data-play-style="crisis"] .status-dot{background:#ff907c;box-shadow:0 0 14px #f86970}
body[data-play-style="crisis"] .station-hud>div:nth-child(2){border-color:#ff9b7d70}
body[data-play-style="academy"] .station-hud>div:first-child{border-color:#ffe09f;color:#ffe09f}
@media(max-width:980px){.station-hud{width:min(100%,68dvh,650px)}.control-column>.classic-modes{order:7}}
@media(max-width:550px){.hero h1{font-size:clamp(26px,8vw,38px)}.station-hud{gap:3px}.station-hud>div{padding:7px 5px}.station-hud span{font-size:7px;letter-spacing:.04em}.station-hud strong{font-size:10px}.mode-switch button{padding:9px 3px;font-size:10px;min-width:0}.classic-modes{font-size:10px}.board-column::before{font-size:8px}}
@media(prefers-reduced-motion:reduce){.station-hud,.station-hud *,.mode-switch *{transition:none!important}}


/* v0.7.1 compact cockpit refinements: preserves v0.7 Academy + Tactic/Crisis DOM. */
.page-shell{max-width:1500px;padding-inline:clamp(12px,2.6vw,36px)}
.hero{margin:14px auto 14px}.hero h1{font-size:clamp(29px,3.4vw,46px);margin:5px 0 3px}.hero p{font-size:12px}
.game-layout{grid-template-columns:minmax(0,1.45fr) minmax(350px,.92fr);gap:14px;align-items:start}
.board-column{padding:8px;box-shadow:0 12px 38px #0008}
.board-head{padding:4px 8px;margin-bottom:4px}
.board-wrap{max-width:850px;margin:auto}
.board-footer{padding:4px 8px;margin-top:4px}
.control-column{gap:8px;min-width:0}
.score-card,.score-card.compact{min-height:58px;padding:7px 8px}
.score-card strong,.score-card.compact strong{font-size:clamp(18px,1.9vw,27px)}
.score-title{font-size:9px}.score-card small{display:none}
.deck-panel{padding:11px 12px}
.tile-hand{gap:7px}.piece{min-height:65px}.piece canvas{max-height:68px}
.action-row{margin-top:8px;gap:6px}.action-button{min-height:36px}
.reserve-button{min-height:33px;margin-top:5px}
.help-panel{padding:0!important;overflow:hidden}
.help-panel:not([open])>:not(summary){display:none}
.help-panel summary{cursor:pointer;list-style-position:inside;padding:10px 12px;font-weight:700;font-size:11px}
.help-panel[open]>:not(summary){margin-left:12px;margin-right:12px}
.board-reset-actions .reset-button{min-height:35px}
.circuit-back-link{display:inline-grid;place-items:center;text-decoration:none;min-width:60px;padding:0 10px;height:35px;color:#c8ddf5;font-size:11px}
.circuit-fullscreen{min-width:40px}
@media(min-width:981px){.game-layout{grid-template-columns:minmax(0,1.5fr) minmax(390px,.88fr)}.board-column{position:sticky;top:10px}}
@media(max-width:980px){.game-layout{grid-template-columns:minmax(0,1fr);gap:10px}.board-column{width:100%;max-width:740px;margin:auto}.control-column{width:100%;max-width:740px;margin:auto}}
@media(max-width:550px){.page-shell{padding-inline:10px}.hero h1{font-size:31px;letter-spacing:.035em}
.score-card,.score-card.compact{padding:5px;min-height:54px}.score-card strong,.score-card.compact strong{font-size:19px}
.score-title{font-size:8px}.board-column{padding:5px}
.site-header{height:auto;min-height:73px;gap:8px;flex-wrap:wrap;padding-block:10px}
.header-actions{gap:5px;flex-wrap:wrap;justify-content:flex-end}
.brand-copy{font-size:10px;letter-spacing:.09em}.brand-copy small{font-size:8px}
.build-label{margin-right:0;padding:6px}.mini-button{min-width:38px}.circuit-back-link{padding:0 6px;min-width:48px}}
@media(prefers-reduced-motion:reduce){.game-layout,.board-column,.score-card{transition:none!important}}
