@import url("/assets/typography.css");
:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #29263d;
  background: #f8f7fc;
  font-synthesis: none;
  --accent: #7254d7;
  --pale: #eee8fd;
  --line: #dfdbea;
  --dark: #29263d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 5%, var(--pale), transparent 40%), #f8f7fc;
  min-height: 100vh;
}
body[data-theme="pink"] {
  --accent: #a83e70;
  --pale: #fce6ed;
}
body[data-theme="green"] {
  --accent: #287562;
  --pale: #dcf3e8;
}
body[data-theme="yellow"] {
  --accent: #88601c;
  --pale: #fff0c7;
}
body[data-theme="blue"] {
  --accent: #3266aa;
  --pale: #e1eeff;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--dark);
  padding: 12px 18px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
}
button:hover {
  border-color: var(--accent);
  background: var(--pale);
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #237bca;
  outline-offset: 4px;
}
button[aria-pressed="true"],
button.selected {
  border-color: var(--accent);
  background: var(--pale);
  box-shadow: 0 0 0 2px var(--accent);
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover {
  color: var(--dark);
}
.topbar {
  max-width: 1120px;
  margin: auto;
  padding: 22px 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 19px;
  font-weight: 900;
  text-decoration: none;
  color: var(--dark);
}
.toplinks {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}
.toplinks button {
  padding: 7px 12px;
  min-height: 40px;
}
.wrap {
  max-width: 1080px;
  padding: 0 24px 48px;
  margin: auto;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0;
}
.eyebrow {
  text-transform: uppercase;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
}
h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin: 10px 0 12px;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
}
p {
  line-height: 1.6;
}
.description {
  max-width: 650px;
  margin: 0;
  color: #686176;
}
.intro-art {
  background: var(--pale);
  border: 2px solid var(--line);
  border-radius: 25px;
  min-width: 126px;
  text-align: center;
  padding: 28px 12px;
  font-size: 36px;
  box-shadow: 5px 5px 0 var(--line);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 26px 0 18px;
}
.levels,
.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.levels button {
  min-height: 42px;
  font-size: 13px;
  padding: 9px 15px;
}
.progress {
  font-size: 13px;
  font-weight: 700;
  color: #686176;
}
.board {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: clamp(18px, 4vw, 40px);
  box-shadow: 0 8px 0 #e8e4f0;
  min-height: 440px;
  text-align: center;
  position: relative;
}
.prompt {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 12px;
}
.hint {
  font-size: 14px;
  color: #686176;
  margin: 0 0 24px;
}
.play-area {
  max-width: 730px;
  margin: auto;
}
.status {
  border-radius: 14px;
  min-height: 54px;
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  line-height: 1.5;
  max-width: 720px;
  background: #f5f3fa;
  color: #514963;
}
.status.success {
  background: #dcf4e4;
  color: #205b3b;
}
.status.retry {
  background: #fff3db;
  color: #77561e;
}
.actions {
  margin-top: 20px;
}
.below {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 34px;
}
.below details,
.related {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}
.below summary {
  cursor: pointer;
  font-weight: 800;
}
.below p {
  font-size: 14px;
  color: #686176;
}
.related {
  margin-top: 24px;
}
.related h2 {
  font-size: 19px;
  margin: 0 0 14px;
}
.related-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.related a {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  font-size: 14px;
  background: #faf9fd;
}
.big {
  font-size: 60px;
  line-height: 1.5;
}
.item {
  font-size: 38px;
  min-width: 80px;
  min-height: 88px;
  padding: 14px 10px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.item small {
  font-size: 13px;
  font-weight: 600;
}
.shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}
.shelf .object {
  background: var(--pale);
  border-radius: 18px;
  padding: 15px 20px;
  font-size: 42px;
}
.shelf .object small {
  display: block;
  font-size: 13px;
}
.grid {
  display: grid;
  gap: 8px;
  margin: 20px auto;
  max-width: 500px;
}
.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.cols-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.cell {
  padding: 5px;
  min-height: 52px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: clamp(22px, 4vw, 35px);
  position: relative;
}
.cell small {
  font-size: 10px;
  position: absolute;
  bottom: 3px;
  left: 4px;
}
.cell.dark {
  background: #ede8f7;
}
.cell.rock {
  background: #e9e7ec;
}
.cell.visited {
  background: #d5eedf;
}
.cell.target {
  border-color: #c89523;
  background: #fff4ce;
}
.cell.correct {
  background: #e1f1e5;
  border-color: #337e55;
}
.card-back {
  background: var(--pale);
}
.hidden-item {
  background: #f1eff7;
  border-radius: 18px;
  padding: 20px;
}
.output {
  padding: 18px;
  background: var(--pale);
  border-radius: 18px;
  line-height: 1.8;
  margin: 20px 0;
}
.palette {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.red {
  color: #c42e45;
}
.blue {
  color: #2863cb;
}
.yellow {
  color: #926900;
}
.paint-red {
  background: #d63b50 !important;
  color: white !important;
}
.paint-blue {
  background: #2863cb !important;
  color: white !important;
}
.paint-yellow {
  background: #e1ac21 !important;
  color: #302609 !important;
}
.paint-white {
  background: #fff !important;
}
.cell.muted {
  background: #f5f3fa;
  color: #a9a1b9;
}
.counter {
  border-radius: 50%;
  background: #ffd76c;
  border: 2px solid #d39c24;
  min-width: 40px;
  min-height: 40px;
  padding: 5px;
  font-size: 22px;
}
.target-number {
  font-size: 50px;
  font-weight: 900;
  color: var(--accent);
  margin: 18px;
}
.equation {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  margin: 26px 0;
  letter-spacing: 4px;
}
.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 16px;
  margin: 16px auto;
  max-width: 520px;
}
.range-label input {
  width: 55%;
  min-height: 44px;
  accent-color: var(--accent);
}
.signal {
  width: 110px;
  padding: 16px;
  background: #343149;
  border-radius: 24px;
  margin: 20px auto;
}
.signal-light {
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin: 6px auto;
  background: #625c73;
}
.signal-light.on-red {
  background: #e14853;
  box-shadow: 0 0 20px #e1485366;
}
.signal-light.on-green {
  background: #6ac98e;
  box-shadow: 0 0 20px #6ac98e66;
}
.hold {
  min-width: 200px;
  min-height: 110px;
  font-size: 22px;
  background: var(--pale);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.hold.charging {
  background: #fbe7a7;
}
.hold.charged {
  background: #bcebcf;
  border-color: #34865c;
}
.hold-meter {
  display: block;
  margin: 15px auto;
  width: 220px;
  height: 15px;
  accent-color: #34865c;
}
.tower {
  height: 200px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  margin: 24px;
}
.block {
  height: 27px;
  width: 120px;
  border: 2px solid #817296;
  border-radius: 7px;
}
.height-bar {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  height: 160px;
  gap: 3px;
  flex: 1;
  max-width: 70px;
  cursor: pointer;
}
.height-bar .block {
  width: 100%;
  height: 22px;
}
.blueprint {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  height: 185px;
  margin: 15px auto;
}
.blueprint-column {
  flex: 1;
  max-width: 70px;
}
.blueprint-column button {
  width: 100%;
  margin: 5px 0;
  padding: 3px;
  min-height: 32px;
  border-radius: 9px;
}
.note-row {
  display: grid;
  grid-template-columns: 45px repeat(8, minmax(0, 1fr));
  gap: 5px;
  margin: 5px 0;
  align-items: center;
}
.note-cell {
  padding: 0;
  min-height: 38px;
  border-radius: 8px;
}
.note-cell.on {
  background: var(--accent);
  color: white;
}
.note-cell.playing {
  outline: 3px solid #e0a522;
  outline-offset: 0;
}
.scoreline {
  font-size: 13px;
  color: #686176;
}
.staff {
  margin: 20px 0;
}
.programme {
  min-height: 70px;
  border: 2px dashed var(--line);
  padding: 12px;
  border-radius: 15px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.programme button {
  padding: 8px;
  min-width: 42px;
  font-size: 24px;
}
.scene {
  width: 100%;
  height: auto;
  max-height: 290px;
  background: #eff7fd;
  border-radius: 18px;
  border: 1px solid #d9e7ef;
}
.scene .ground {
  fill: #b7d7ba;
}
.scene .ball {
  fill: #7754c5;
}
.scene .path {
  fill: none;
  stroke: #5e93c7;
  stroke-width: 3;
  stroke-dasharray: 6 4;
}
.scene .fire {
  fill: #e67747;
}
.scene .flag {
  fill: #ba3667;
}
.scene .ramp {
  fill: #c8b895;
}
.scene .weight {
  fill: #7254d7;
}
.scene .beam {
  stroke: #a18963;
  stroke-width: 7;
}
.scene text {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  fill: #40364e;
}
.activity-card {
  text-align: left;
  padding: 24px;
  background: #f8f6fc;
  border: 1px solid var(--line);
  border-radius: 20px;
  margin: 18px 0;
}
.activity-card h2 {
  margin-top: 0;
}
.activity-card h3 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 5px;
}
.activity-card p {
  margin-top: 0;
  font-size: 15px;
}
.activity-tools {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.activity-tools select,
.activity-tools input {
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  max-width: 100%;
  background: white;
}
.bridge-water {
  background: #e2f2fb !important;
}
.bridge-bank {
  background: #d6eacb !important;
}
.pipe {
  font-size: 40px;
  color: #34709b;
}
.pipe.flow {
  background: #d0eff7;
}
.small {
  font-size: 13px;
  color: #686176;
}
.complete {
  font-size: 44px;
  margin: 24px;
}
.share-box {
  text-align: left;
  margin-top: 20px;
}
.story-choices {
  text-align: left;
  margin: 16px 0;
}
.story-choices strong {
  display: block;
  margin-bottom: 8px;
}
.story-choices button {
  margin: 4px;
}
.activity-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.no-script {
  padding: 20px;
  background: #fff3db;
}
.footer {
  text-align: center;
  font-size: 12px;
  color: #746b82;
  margin: 35px 0 0;
}
@media (max-width: 600px) {
  .topbar {
    padding: 15px;
    gap: 10px;
  }
  .toplinks {
    gap: 10px;
  }
  .toplinks a {
    display: none;
  }
  .wrap {
    padding: 0 12px 28px;
  }
  .intro {
    margin-top: 14px;
    gap: 8px;
  }
  .intro-art {
    min-width: 74px;
    font-size: 25px;
    padding: 23px 8px;
    border-radius: 20px;
  }
  .board {
    border-radius: 20px;
    padding: 18px 12px;
    min-height: 400px;
  }
  .below {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .levels {
    gap: 5px;
  }
  .levels button {
    padding: 9px 11px;
    font-size: 12px;
  }
  .toolbar {
    gap: 10px;
  }
  .item {
    min-width: 66px;
    min-height: 74px;
    font-size: 31px;
  }
  .shelf {
    gap: 6px;
  }
  .shelf .object {
    font-size: 30px;
    padding: 12px;
  }
  .grid {
    gap: 5px;
  }
  .cell {
    min-height: 43px;
    border-radius: 8px;
  }
  .cols-6 .cell {
    min-height: 40px;
  }
  .note-row {
    grid-template-columns: 30px repeat(8, minmax(0, 1fr));
    gap: 3px;
  }
  .note-cell {
    min-height: 35px;
  }
  .activity-card {
    padding: 17px;
  }
  .range-label {
    font-size: 13px;
  }
  .related-links a {
    width: 100%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .cell,
  .item,
  button {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
  .success {
    animation: pop 0.25s ease-out;
  }
  @keyframes pop {
    from {
      transform: scale(0.98);
    }
    to {
      transform: scale(1);
    }
  }
}
.level-controls{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;max-width:100%}.level-controls label{display:grid;gap:6px;font-size:13px;font-weight:700;min-width:0}.level-controls select{font:inherit;padding:12px;border:1px solid #bcb1d5;border-radius:12px;background:#fff;max-width:100%;min-height:44px}.study-panel{border:2px dashed #c2b4df;border-radius:16px;background:#f3effb;padding:14px;margin:12px 0;max-width:100%}.study-panel>.small{margin-top:0}.study-panel button{margin:8px 5px 0 0}.cover-notice{min-height:68px;display:grid;place-items:center;background:#e6def5;border-radius:12px;padding:15px}.clue-list{line-height:1.8;padding-left:24px;overflow-wrap:anywhere}.study-panel .grid{margin:0}.sequence-answer{min-height:60px}.size-square{display:block;background:#8b74c9;max-width:108px;border-radius:5px;margin:auto}.paint-green{background:#519a7b!important;color:#fff}.paint-purple{background:#8260b4!important;color:#fff}.blueprint{overflow-x:auto}.blueprint-column{min-width:58px}.activity-card ul{padding-left:22px;line-height:1.8}.note-row{min-width:380px}.staff{overflow-x:auto}.intro h1{overflow-wrap:anywhere}.cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}[hidden]{display:none!important}
@media(max-width:600px){.level-controls{width:100%;display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:8px}.level-controls select{width:100%;font-size:12px;padding:10px 6px}.study-panel{padding:10px}.study-panel>.grid{gap:3px}.cols-8 .cell{min-height:31px;min-width:0;padding:2px}.sequence-answer{overflow-wrap:anywhere}.size-square{max-width:78px}.activity-tools select{max-width:100%}.item{overflow-wrap:anywhere}.clue-list{font-size:14px}}
