.topo-main { width: min(1180px, calc(100% - 8vw)); padding-top: 2.6rem; }
.topo-game [hidden] { display: none !important; }
.topo-heading { display: grid; grid-template-columns: minmax(17rem, .75fr) minmax(20rem, 1.25fr); gap: 1rem 5rem; align-items: end; }
.topo-heading .eyebrow { grid-column: 1 / -1; }
.topo-heading h1 { max-width: none; margin: .7rem 0 0; }
.topo-heading h1 span { color: var(--orange); }
.topo-heading .tool-intro { margin: 0 0 .35rem; font-size: 1.08rem; }
.topo-intro { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 6vw, 6rem); margin: 2.5rem 0 3rem; padding: 2rem 0; border-top: 1px solid #393d34; border-bottom: 1px solid #393d34; }
.topo-intro h2 { margin: .7rem 0 0; font: 900 clamp(1.8rem, 3vw, 2.8rem)/1 var(--display); }
.topo-intro p:not(.eyebrow) { margin: 0 0 .8rem; color: #b8bbb6; line-height: 1.7; }
.topo-game { background: #0c0e0c; border: 1px solid #40443a; border-top: 3px solid var(--orange); box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.game-toolbar { display: grid; grid-template-columns: 1.5fr .7fr .8fr; border-bottom: 1px solid #40443a; }
.game-toolbar > div { min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .9rem 1.1rem; border-right: 1px solid #30342c; }
.game-toolbar > div:last-child { border-right: 0; }
.game-toolbar span { color: #9da494; font: 700 .57rem/1.4 var(--mono); letter-spacing: .11em; }
.game-toolbar strong { overflow-wrap: anywhere; color: var(--orange); font: 800 .72rem/1.4 var(--mono); letter-spacing: .06em; text-align: right; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(19rem, .65fr); }
.game-field { min-width: 0; padding: clamp(1rem, 3vw, 2rem); border-right: 1px solid #40443a; }
.level-brief { min-height: 5.7rem; margin-bottom: 1rem; padding: .9rem 1rem; background: #151914; border-left: 3px solid var(--orange); }
.level-brief p { margin: 0 0 .45rem; color: #eceee8; line-height: 1.55; }
.level-brief small { color: #9fa69a; line-height: 1.45; }
#topo-canvas { display: block; width: 100%; height: auto; border: 1px solid #4a4f42; background: #090b09; cursor: crosshair; touch-action: none; }
#topo-canvas:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.canvas-help { margin: .75rem 0 .4rem; color: #989f92; font: .7rem/1.6 var(--mono); }
.shot-readout { min-height: 1.7rem; margin: .55rem 0 .9rem; color: #f0f1ec; font: 700 .79rem/1.55 var(--mono); }
.game-controls { display: flex; flex-wrap: wrap; gap: .65rem; }
.game-button, .view-button { min-height: 2.9rem; border: 1px solid var(--orange); border-radius: 0; padding: .75rem 1rem; color: #111; background: var(--orange); cursor: pointer; text-decoration: none; font: 800 .64rem/1.25 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.game-button--quiet, .view-button { color: var(--orange); background: transparent; }
.game-button:hover, .game-button:focus-visible, .view-button:hover, .view-button:focus-visible { background: #ffad53; color: #111; }
.game-button:focus-visible, .view-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.game-button:disabled { opacity: .35; cursor: not-allowed; }
.game-button:disabled:hover { color: var(--orange); background: transparent; }
.shot-log { margin-top: 1rem; color: #aeb4a8; font: .75rem/1.55 var(--mono); }
.shot-log summary { width: max-content; max-width: 100%; cursor: pointer; color: var(--orange); }
.shot-log ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1rem; margin: .8rem 0 0; padding-left: 1.7rem; }
.shot-log li { padding: .25rem 0; border-bottom: 1px solid #2b2f28; }
.game-panel { min-width: 0; display: flex; flex-direction: column; padding: clamp(1.2rem, 3vw, 2rem); background: linear-gradient(150deg, rgba(254,149,39,.07), transparent 42%); }
.game-panel h2 { margin: .8rem 0 1rem; font: 900 clamp(1.8rem, 3vw, 2.7rem)/1 var(--display); }
.game-panel p, .game-panel li { color: #b8bbb6; line-height: 1.65; }
.game-panel ul { padding-left: 1.15rem; }
.game-panel li { margin: .55rem 0; }
.game-panel li::marker { color: var(--orange); }
.game-results, .game-finish { display: flex; flex: 1; flex-direction: column; }
.view-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.view-button { min-width: 0; padding-inline: .55rem; border-right-width: 0; font-size: .55rem; }
.view-button:last-child { border-right-width: 1px; }
.view-button.is-active { color: #111; background: var(--orange); }
.surface-key { display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; color: #9ea598; font: .56rem/1.4 var(--mono); text-transform: uppercase; }
.surface-key i { flex: 1; height: .55rem; background: linear-gradient(90deg,#2a6fb0,#3a8f5a,#fe9527,#b5651d); }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid #30342c; }
.result-row span { color: #e3e5df; font-size: .84rem; }
.result-row small { display: block; margin-top: .25rem; color: #969d90; font-size: .7rem; line-height: 1.45; }
.result-row strong { color: #f0f1ec; font: 700 .75rem/1.5 var(--mono); white-space: nowrap; }
.result-score, .finish-score { margin: 1.3rem 0 .5rem; color: #fff !important; font: 900 clamp(1.8rem, 3vw, 2.8rem)/1 var(--display); }
.result-score span, .finish-score span { color: var(--orange); }
.result-explanation { margin: 0 0 1.2rem; font-size: .88rem; }
.result-lead { margin: .2rem 0 1.1rem; padding: 1.1rem; border: 1px solid #545a4c; border-left: 3px solid var(--orange); background: #151914; }
.result-lead .eyebrow { margin: 0 0 .65rem; }
.result-lead h3 { margin: 0 0 .65rem; color: #fff; font: 900 clamp(1.35rem, 2.2vw, 1.9rem)/1.05 var(--display); }
.result-lead p:not(.eyebrow) { margin: 0 0 1rem; font-size: .82rem; line-height: 1.55; }
.result-lead-link { display: inline-flex; width: fit-content; align-items: center; justify-content: center; }
.result-lead--finish { margin-top: 1rem; }
.game-finish .game-controls { margin-top: auto; padding-top: 1rem; }
.game-disclaimer { margin: 0; padding: 1rem clamp(1rem, 3vw, 2rem); border-top: 1px solid #40443a; color: #949b8f; font-size: .72rem; line-height: 1.65; }
.game-disclaimer a { color: #d7dad2; }
.topo-main .tool-related-links { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; margin-top: 2rem; }
@media (max-width: 900px) {
  .topo-heading, .topo-intro, .game-layout { grid-template-columns: minmax(0, 1fr); }
  .topo-heading { gap: 1rem; }
  .game-field { border-right: 0; border-bottom: 1px solid #40443a; }
}
@media (max-width: 600px) {
  .topo-main { width: calc(100% - 1.5rem); padding-top: 2rem; }
  .topo-heading h1 { font-size: clamp(3rem, 17vw, 4.5rem); }
  .topo-intro { margin-block: 1.8rem; }
  .game-toolbar { grid-template-columns: 1fr 1fr; }
  .game-toolbar > div { display: grid; gap: .2rem; }
  .game-toolbar > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #30342c; }
  .game-toolbar strong { text-align: left; }
  .game-field { padding: .75rem; }
  .canvas-help { font-size: .64rem; }
  .game-button { flex: 1 1 calc(50% - .65rem); }
  #build-surface { flex-basis: 100%; }
  .shot-log ol { grid-template-columns: 1fr; }
  .view-button { font-size: .48rem; letter-spacing: .02em; }
}
@media (prefers-reduced-motion: reduce) {
  .topo-game * { scroll-behavior: auto !important; }
}
