
.game-page { max-width: 1240px; margin: 0 auto; padding: 22px 36px 0; }
body:has(.launch-rules[open]) { overflow: hidden; }
.launch-rules { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 30px 32px 26px; border: 1px solid #c9cdbe; background: var(--paper); color: var(--ink); box-shadow: 0 16px 60px #25252216; }
.launch-rules::backdrop { background: #25252238; }
.launch-rules h2 { font: 400 32px/1.15 Newsreader, Georgia, serif; margin: 0 0 12px; }
.launch-rules h2:focus { outline: none; }
.launch-rules p { font-size: 15px; line-height: 1.65; margin: 0; color: var(--secondary); }
.launch-rules-list { margin: 24px 0 18px; padding: 0; display: grid; gap: 18px; }
.launch-rules-list strong { font-weight: 500; color: var(--ink); }
.launch-rules-list h3 { font: 500 15px/1.65 Inter, Arial, sans-serif; margin: 0 0 3px; color: var(--link); }
.launch-rules .launch-payoff { font-size: 14px; color: var(--ink); border-top: 1px solid #dcddd4; padding-top: 14px; }
.launch-rules .launch-controls { margin-top: 12px; font-size: 14px; }
.launch-rules-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.launch-rules-footer > span { font-size: 13px; color: var(--secondary); }
.launch-rules-footer .primary-button { min-height: 44px; margin-left: auto; }
.game-header { display: flex; align-items: center; gap: 16px; position: relative; margin-bottom: 12px; }
.game-header h1 { font: 400 30px/1.2 Newsreader, Georgia, serif; letter-spacing: -.015em; margin: 0; }
.back-link { text-decoration: none; font-size: 20px; min-width: 32px; min-height: 40px; display: grid; place-items: center; }
.game-info { margin-left: auto; flex-shrink: 0; }
.game-info > summary { list-style: none; cursor: pointer; font-size: 14px; color: var(--link); padding: 12px 0 12px 12px; }
.game-info > summary::-webkit-details-marker { display: none; }
.game-info[open] > summary { text-decoration: underline; text-underline-offset: .2em; }
.info-body { position: absolute; top: 48px; right: 0; z-index: 10; background: var(--paper); border: 1px solid #d6d8cc; padding: 18px 22px; width: min(430px, 100%); max-height: 75vh; overflow: auto; box-shadow: 0 12px 30px #2525220c; font-size: 14px; line-height: 1.75; }
.info-body p { margin: 0 0 12px; }
.info-body h2 { font: 400 21px/1.3 Newsreader, Georgia, serif; margin: 10px 0; }
.info-body details { border-top: 1px solid #e0e1d8; padding-top: 5px; margin-top: 8px; }
.info-body summary { color: var(--link); cursor: pointer; padding: 8px 0; }
.info-body a { font-size: 13px; }
.info-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; }
.info-stats > div { display: grid; gap: 2px; }
.info-stats dt { font-size: 12px; color: var(--secondary); }
.info-stats dd { margin: 0; }
.paper-reference { color: var(--secondary); font-size: 12px; margin-top: 16px !important; }
.recording-status { display: block; color: var(--secondary); font-size: 12px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
.glossary-term { display: inline; border: 0; border-radius: 0; padding: 0; margin: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: inherit; text-decoration: underline dotted #939a86; text-underline-offset: .22em; cursor: help; }
.glossary-term:hover, .glossary-term[aria-expanded="true"] { color: var(--link); text-decoration-style: solid; }
.term-definition { position: fixed; inset: auto; margin: 0; width: min(330px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 19px 22px 20px; border: 1px solid #b9bfa9; background: var(--paper); color: var(--ink); box-shadow: 0 8px 30px #25252220; z-index: 30; }
.term-definition h2 { margin: 0 22px 9px 0; font: 400 23px/1.2 Newsreader, Georgia, serif; }
.term-definition h2:focus { outline: none; }
.term-definition p { margin: 0; font: 400 14px/1.7 Inter, Arial, sans-serif; color: var(--secondary); }
.term-definition-close { position: absolute; top: 3px; right: 3px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--link); font-size: 20px; }
.term-definition-close:hover { color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.game-setup { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; border-bottom: 1px solid #dcddd4; padding: 8px 0 14px; }
#setup-form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 30px; width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.role-field legend { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 8px; padding: 0; }
.role-options { display: flex; gap: 6px; }
.role-options label { position: relative; cursor: pointer; }
.role-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.role-options span { display: grid; gap: 2px; min-width: 132px; padding: 10px 16px; border: 1px solid #bec4b0; border-radius: 3px; color: var(--link); }
.role-options strong { font-size: 17px; font-weight: 500; }
.role-options small { font-size: 13px; }
.role-options input:checked + span { color: #fff; border-color: var(--link); background: var(--link); }
.role-options label:hover span { border-color: var(--ink); }
.role-options input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 3px; }
.number-field { display: grid; gap: 8px; }
.number-field > label { font-size: 14px; color: var(--ink); }
.number-control { display: grid; grid-template-columns: 36px 32px 36px; min-height: 44px; border: 1px solid #bec4b0; border-radius: 3px; }
.number-control button { background: transparent; border: 0; color: var(--link); font-size: 19px; }
.number-control input { width: 100%; background: transparent; border: 0; text-align: center; color: var(--ink); font-size: 16px; appearance: textfield; -moz-appearance: textfield; }
.number-control input::-webkit-inner-spin-button { appearance: none; }
.cost-field { width: 260px; min-width: 180px; }
.cost-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.cost-heading output { color: var(--link); font-size: 18px; font-variant-numeric: tabular-nums; }
#link-cost { display: block; width: 100%; margin: 2px 0; min-height: 28px; cursor: pointer; accent-color: var(--link); }
.cost-presets { display: flex; gap: 6px; }
.cost-presets button { flex: 1; padding: 5px 8px; min-height: 30px; border: 1px solid #c9cebd; border-radius: 3px; background: transparent; color: var(--link); font-size: 13px; }
.cost-presets button:hover, .cost-presets button[aria-pressed="true"] { background: #e6eadc; border-color: var(--link); }
.settings-note { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.5; color: var(--secondary); }
.randomise-button { border: 1px solid var(--link); border-radius: 3px; background: transparent; color: var(--link); font-size: 14px; min-height: 40px; padding: 8px 12px; white-space: nowrap; }
.randomise-button:hover { background: #e6eadc; }
.primary-button { border: 1px solid var(--link); background: var(--link); color: #fff; font-size: 14px; padding: 9px 18px; min-height: 38px; white-space: nowrap; }
.primary-button:hover:not(:disabled) { background: #424a2e; }
.primary-button:disabled { background: transparent; border-color: #b9bdae; color: var(--secondary); opacity: 1; }
#setup-form .primary-button { margin-left: auto; }
#run-summary, #active-panel { display: flex; align-items: center; gap: 16px; }
#run-summary { flex-wrap: wrap; }
#scenario-summary { margin: 0; font-size: 14px; color: var(--secondary); }
#active-panel { margin-left: auto; flex-wrap: wrap; }
.run-facts, .net-value, .result-facts { display: flex; gap: 18px; margin: 0; }
.run-facts > div, .net-value > div, .result-facts > div { display: flex; align-items: baseline; gap: 6px; }
.run-facts dt, .net-value dt, .result-facts dt { font-size: 12px; color: var(--secondary); }
.run-facts dd, .net-value dd, .result-facts dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
#fact-role, .net-value dd, .result-facts dd { color: var(--link); }
.text-button { background: transparent; border: 0; padding: 8px 0; min-height: 38px; color: var(--link); font-size: 13px; text-decoration: underline; text-underline-offset: .2em; white-space: nowrap; }
.sandbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.phase-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; }
.phase-info h2 { font: 500 16px/1.6 Inter, Arial, sans-serif; margin: 0; color: var(--link); }
.phase-info p { font-size: 14px; line-height: 1.6; margin: 0; color: var(--secondary); }
.guidance { margin: 0 0 14px; padding: 14px 18px; border-left: 3px solid var(--link); background: #eeefe7; color: var(--ink); }
.guidance-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.takeaway-label { color: var(--link); font-size: 14px; font-weight: 600; }
#hint-count { color: var(--secondary); font-size: 13px; }
#next-hint { margin-left: auto; min-height: 32px; padding: 3px 8px; background: transparent; border: 1px solid #bdc5ad; border-radius: 3px; color: var(--link); font-size: 14px; }
#next-hint:hover { background: #e0e5d4; }
.guidance h3 { margin: 0 0 4px; font: 500 17px/1.4 Inter, Arial, sans-serif; }
.guidance p { margin: 0; max-width: 95ch; font-size: 16px; line-height: 1.6; }
.paper-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid #cbd0bf; }
.paper-result .paper-result-source { margin: 0 0 8px; color: var(--link); font-size: 13px; font-weight: 500; }
.paper-result-excerpt { font-family: Newsreader, Georgia, serif; font-size: 19px; line-height: 1.5; }
.paper-result-excerpt p, .paper-result-excerpt blockquote { font: inherit; margin: 0 0 8px; }
.paper-result-excerpt blockquote { padding: 0; border: 0; }
.paper-result .paper-result-note { margin: 8px 0 0; font-size: 13px; color: var(--secondary); line-height: 1.55; }
.paper-result-full { margin-top: 8px; }
.paper-result-full > summary { cursor: pointer; color: var(--link); font-size: 13px; padding: 6px 0; }
.paper-result-statement { padding: 10px 0 2px; font-size: 15px; line-height: 1.65; }
.paper-result-statement p, .paper-result-statement blockquote { margin: 0 0 12px; font-size: inherit; }
.paper-result-statement blockquote { padding: 0 0 0 14px; border-left: 2px solid #c2c8b5; }
.paper-result-statement h3, .paper-result-statement h4 { font: 500 15px/1.5 Inter, Arial, sans-serif; margin: 12px 0 6px; }
.paper-result math { font-family: 'Cambria Math', 'STIX Two Math', math; font-size: 1em; }
.paper-result math[display="block"] { display: block; overflow-x: auto; max-width: 100%; padding: 6px 0; text-align: left; }
.paper-result-statement ul, .paper-result-statement ol { padding-left: 22px; }
.paper-result-statement dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.paper-result-statement dd { margin: 0; }
.info-body .paper-result-statement { font-size: 14px; }
.info-body .paper-result-excerpt { font-size: 18px; }
.board-tools, #edit-tools { display: flex; align-items: center; gap: 4px; }
.icon-button { min-width: 36px; min-height: 36px; background: transparent; border: 0; color: var(--link); font-size: 18px; }
.icon-button:hover { background: #eceee5; }
.icon-button[aria-pressed="true"] { background: #e5e8db; }
.board-scroll { overflow: auto; max-width: 100%; scrollbar-width: thin; scrollbar-color: #c6c9b9 transparent; }
.network-board { position: relative; width: var(--board-width, 100%); height: var(--board-height, 390px); margin: 0 auto; }
#network-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.network-edge { stroke: #919981; stroke-width: 1.2; opacity: .6; }
.network-edge.damaged { stroke: #a37354; stroke-dasharray: 2 7; opacity: .18; }
#attack-effects { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 5; }
.attack-effect { color: #976947; }
.attack-effect.attack-blocked { color: var(--link); }
.attack-trail, .attack-ring, .attack-shield, .attack-spark, .attack-fragment { fill: none; stroke: currentColor; stroke-linecap: round; }
.attack-trail { stroke-width: 2; }
.attack-projectile { fill: currentColor; }
.attack-ring { stroke-width: 1; }
.attack-shield { stroke-width: 2.5; }
.attack-fragment { stroke-width: 1.6; }
.attack-spark { stroke-width: 1.5; }
.node { --node-size: 44px; position: absolute; width: var(--node-size); height: var(--node-size); transform: translate(-50%, -50%); border: 1px solid #939a86; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 14px; display: flex; justify-content: center; align-items: center; z-index: 1; padding: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.node:hover, .node:focus-visible { background: #eff0e8; border-color: var(--link); z-index: 3; }
.node.dragging, .node:active { cursor: grabbing; z-index: 4; }
.node.selected { background: var(--link); color: #fff; border-color: var(--link); box-shadow: 0 0 0 3px #e0e4d3; }
.node.protected { background: #e0e6d3; border: 2px solid var(--link); }
.node.targeted { border: 2px solid #946645; box-shadow: 0 0 0 3px #ece1d7; }
.node.protected.targeted { box-shadow: 0 0 0 3px #d5ddc5; }
.node.breached { background: #eee9e2; color: #775a47; border-style: dashed; }
.node.disconnected { border-style: dashed; }
.node-value { position: absolute; bottom: -20px; font-size: 12px; line-height: 16px; color: var(--secondary); background: var(--paper); padding: 0 4px; white-space: nowrap; pointer-events: none; opacity: 0; }
.node:hover .node-value, .node:focus-visible .node-value, .node.selected .node-value, .node.dragging .node-value, .node.protected .node-value, .node.targeted .node-value { opacity: 1; }
.node-marker { position: absolute; top: -6px; right: -3px; background: var(--paper); color: var(--link); font-size: 12px; border: 1px solid currentColor; border-radius: 50%; width: 17px; height: 17px; line-height: 15px; }

@media (max-width: 760px) {
  .game-page { padding: 18px 22px 0; }
  .game-header { gap: 10px; }
  .game-header h1 { font-size: 26px; }
  .game-setup { gap: 6px 16px; }
  #active-panel { width: 100%; margin-left: 0; }
  #active-panel .primary-button { margin-left: auto; }
  #setup-form { gap: 14px 22px; }
  .cost-field { flex-grow: 1; }
}
@media (max-width: 440px) {
  .launch-rules { padding: 24px 20px 20px; }
  .launch-rules-list { gap: 15px; margin-top: 20px; }
  .game-page { padding: 14px 16px 0; }
  .game-header h1 { font-size: 24px; }
  .back-link { min-width: 22px; }
  #setup-form { gap: 12px 16px; }
  .role-field { width: 100%; }
  .role-options label { flex: 1; }
  .role-options span { min-width: 0; }
  .cost-field { width: calc(100% - 130px); min-width: 180px; }
  #setup-form .primary-button { margin-left: 0; }
  .run-facts { flex-wrap: wrap; gap: 8px 14px; }
  #run-summary { gap: 10px; }
  #active-panel { gap: 12px; }
  .result-facts { gap: 10px; }
  .net-value > div, .result-facts > div { flex-direction: column; gap: 2px; }
  .sandbox-bar { align-items: flex-start; padding-top: 8px; }
  .phase-info { flex-direction: column; gap: 0; }
  .board-tools { flex-shrink: 0; }
  .icon-button { min-width: 32px; }
  .info-body { padding: 14px 16px; }
  .guidance { padding: 12px 14px; }
}
@media (pointer: coarse) { .icon-button, .text-button, .primary-button, .game-info > summary { min-height: 44px; } }
@media (pointer: coarse) { .paper-result-full > summary, #next-hint, .cost-presets button, #link-cost { min-height: 44px; } }
@media (prefers-reduced-motion: no-preference) { .node { transition: background-color .12s, box-shadow .12s; } }
@media print { .game-setup, .board-tools, .game-info { display: none; } .game-page { padding: 0; } }
