/* A science-club notebook: bold ink, coloured paper and illustrated task stickers. */
:root {
  --ink: #24361f;
  --muted: #4d5a40;
  --paper: #eef4ff;
  --lime: #ffe27a;
  --line: #d6dcc8;
  --metal: #ffdb78;
  --metalloid: #dbc6ff;
  --nonmetal: #9ee2cf;
  --noble: #cfe3c2;
  --blue: #3a7d40;
  --red: #ed543b;
}
body {
  background-color: var(--paper);
  background-image: radial-gradient(#c4d6b6 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
}
header {
  background: var(--ink);
  color: white;
  padding: 20px 4.5%;
  border-bottom: 4px solid #ffcf5c;
  gap: 28px;
}
.brand {
  color: white;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: -0.4px;
}
.brand-mark {
  background: #ffe27a;
  color: var(--ink);
  border-radius: 5px;
  transform: rotate(-7deg);
  font-size: 26px;
  border: 2px solid white;
}
.brand-mark span {
  color: var(--ink);
}
nav {
  background: none;
  border-radius: 0;
  gap: 8px;
  padding: 0;
}
.nav {
  background: #ffffff0d;
  color: white;
  border-radius: 7px;
  min-height: 47px;
  padding: 11px 19px;
  transition: transform 0.15s;
}
.nav.active {
  background: #ffe27a;
  color: var(--ink);
  box-shadow: 0 3px 0 #1a2414;
  transform: rotate(-2deg);
}
.level {
  color: #e2eedb;
}
.level select {
  background: #f4f7ff;
  color: var(--ink);
  border: 0;
  border-radius: 6px;
}
main {
  max-width: 1480px;
  padding-top: 32px;
}
.heading {
  margin-bottom: 22px;
  align-items: center;
}
h1,
h2,
.brand,
.mission-number {
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
}
h1 {
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -2.5px;
  line-height: 1.1;
  max-width: 750px;
}
h2 {
  letter-spacing: -0.6px;
  font-weight: 800;
}
.eyebrow {
  letter-spacing: 1px;
  font-size: 11px;
  color: #2f6b3a;
}
.heading > div > p:last-child {
  font-size: 16px;
  max-width: 660px;
}
.discovery {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 18px 20px;
  box-shadow: 4px 4px 0 #c4d6b6;
  transform: rotate(1deg);
  gap: 18px;
  max-width: 380px;
}
.passport-label {
  background: var(--red);
  color: white;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 850;
  padding: 13px 11px;
  border-radius: 100%;
  text-align: center;
  transform: rotate(-9deg);
  letter-spacing: 0.5px;
}
.discovery b {
  font-size: 15px;
}
.discovery p {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 10px;
}
.passport-stamps {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.passport-stamp {
  width: 21px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px dashed #8f9c7c;
  border-radius: 3px;
  color: #566244;
}
.passport-stamp.stamped {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: white;
  font-weight: 800;
  transform: rotate(-5deg);
}
.board-bar {
  border-top: 1px solid #c4d6b6;
  padding-top: 15px;
  margin-top: 25px;
}
.board-bar p {
  font-size: 14px;
}
.visit-note {
  font-size: 12px;
}
.mission-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.board-mission {
  padding: 19px 145px 23px 23px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  min-height: 237px;
  background: #fff !important;
  box-shadow: 4px 4px 0 #c4d6b6;
  gap: 10px;
  overflow: hidden;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  position: relative;
}
.board-mission:hover {
  filter: none;
  transform: translateY(-3px);
  box-shadow: 5px 7px 0 #93b37f;
}
.board-mission:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #93b37f;
}
.board-mission:first-child {
  grid-column: span 2;
  background: #ffe58c !important;
  padding-right: 220px;
  min-height: 242px;
}
.board-mission:first-child h2 {
  font-size: 38px;
  max-width: 430px;
}
.board-mission:first-child p {
  font-size: 17px;
  max-width: 370px;
}
.board-mission:nth-child(4n + 3) {
  background: #e4efdc !important;
}
.board-mission:nth-child(4n + 4) {
  background: #daf3e9 !important;
}
.board-mission:nth-child(4n + 5) {
  background: #ffe6dc !important;
}
.board-mission h2 {
  font-size: 25px;
  line-height: 1.12;
  max-width: 260px;
  margin-top: 11px;
  position: relative;
  z-index: 1;
}
.board-mission p {
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.board-mission .mission-label {
  font-size: 11px;
  color: #33452a;
  width: calc(100% + 122px);
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.board-mission:first-child .mission-label {
  width: calc(100% + 197px);
}
.mission-number {
  font-size: 21px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.completed-label {
  margin-left: auto;
  color: white;
  background: #3a7d40;
  font-size: 11px;
  transform: rotate(-3deg);
}
.mission-illustration {
  display: block;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  width: 145px;
  aspect-ratio: 1;
  position: absolute;
  right: 2px;
  top: 57px;
  transform: rotate(4deg);
  pointer-events: none;
}
.sticker-0 {
  background-image: url("stickers/ipad.webp");
}
.sticker-1 {
  background-image: url("stickers/balloon.webp");
}
.sticker-2 {
  background-image: url("stickers/pencil.webp");
}
.sticker-3 {
  background-image: url("stickers/bike.webp");
}
.sticker-4 {
  background-image: url("stickers/cable.webp");
}
.sticker-5 {
  background-image: url("stickers/water.webp");
}
.sticker-6 {
  background-image: url("stickers/magnifier.webp");
}
.sticker-7 {
  background-image: url("stickers/plant.webp");
}
.sticker-8 {
  background-image: url("stickers/bolt.webp");
}
.sticker-9 {
  background-image: url("stickers/can.webp");
}
.board-mission:first-child .mission-illustration {
  width: 205px;
  top: 25px;
  right: 10px;
  transform: rotate(-7deg);
}
.board-mission:nth-child(even) .mission-illustration {
  transform: rotate(-5deg);
}
.board-mission .start-label {
  background: var(--ink);
  color: white;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: 5px;
  border: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.primary,
.view-passport {
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 15px;
  min-height: 48px;
  font-weight: 750;
  transition: transform 0.1s;
}
.primary:active,
.view-passport:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.primary:disabled {
  box-shadow: none;
  border-color: #a3ab92;
}
.link-button {
  color: #2a5f33;
}
.journey-header .pill {
  color: #4d5a40;
}
.journey-title {
  border-bottom: 2px solid var(--ink);
  margin-bottom: 22px;
}
.journey-title h1 {
  font-size: 43px;
  margin-top: 8px;
}
.journey-card,
.mission-card {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 #c4d6b6;
}
.steps {
  gap: 12px;
}
.step {
  border: 1px solid #c4d6b6;
  border-radius: 6px;
  background: white;
}
.step.active {
  background: var(--blue);
  color: white;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.step.done {
  background: #ffe58c;
  color: var(--ink);
}
.find-element {
  border: 2px solid #a8c596;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #a8c596;
  min-height: 143px;
}
.find-element.selected {
  background: #ffe58c;
  border-color: var(--ink);
}
.find-element.seen {
  border-color: #227264;
}
.find-element b {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 43px;
}
.find-note,
.thinking {
  background: #e9f1ff;
  border-color: #cddfc4;
  border-radius: 8px;
}
.task-option,
.answer {
  border: 2px solid #d2e1c8;
  background: #f3f7ff;
  border-radius: 8px;
}
.task-option.correct,
.answer.correct {
  border-color: #277355;
  background: #d4f1dd;
}
.task-option.wrong,
.answer.wrong {
  border-color: #ab5b2f;
  background: #ffedda;
}
.feedback {
  border-radius: 7px;
  background: #edf3ff;
  border-left: 4px solid #6f9a5a;
  font-size: 15px;
}
.feedback.correct {
  background: #d4f1dd;
  border-left-color: #287353;
}
.feedback.retry {
  background: #fff0ca;
  border-left-color: #9a6c1c;
}
.badge-finish {
  background: #ffe58c;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding-top: 10px;
}
.finish-sticker {
  position: relative;
  width: 160px;
  margin: 0 auto;
  top: auto;
  right: auto;
  transform: rotate(-5deg);
}
.badge-finish .eyebrow {
  color: #24361f;
}
.saved-discovery {
  background: #eef4ff;
  border: 1px solid #c9dbbb;
  border-radius: 6px;
}
.discovery-input {
  background: repeating-linear-gradient(white, white 30px, #e2ebf9 31px, white 32px);
  line-height: 32px;
  border: 2px solid #93b37f;
  border-radius: 7px;
}
.table-card {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 #c4d6b6;
}
.table-top h2 {
  font-size: 27px;
}
.element {
  border: 1px solid #24361f40;
  border-radius: 4px;
  box-shadow: 0 2px 0 #24361f20;
  transition: transform 0.12s;
}
.element:hover {
  transform: translateY(-2px);
}
.element.selected {
  border: 2px solid var(--ink);
  box-shadow: 2px 3px 0 var(--ink);
}
.detail {
  background: var(--ink);
  border-radius: 10px;
  border: 2px solid var(--ink);
}
.detail .eyebrow {
  color: #c9dbbb;
}
.detail .thinking {
  background: #2e3d26;
  color: white;
}
.detail .thinking p {
  color: #e4efdc;
}
.detail h3 {
  color: #ffe58c;
}
.big-symbol {
  border-radius: 7px;
  transform: rotate(-3deg);
}
.concept {
  background: #e4efdc;
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.challenge-teaser {
  background: #ffe58c;
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.lab-grid {
  gap: 26px;
}
.lab-card {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 #c4d6b6;
  padding: 28px;
  background: white;
}
.lab-card > .pill {
  font-size: 11px;
  color: #2f6b3a;
  border-bottom: 2px solid #b3cba3;
  padding-bottom: 6px;
}
.lab-card h2 {
  font-size: 29px;
  line-height: 1.15;
}
.lab-card.rust {
  background: #ffe8de;
  grid-column: auto;
}
.science-diagram,
.particle-box {
  border: 2px solid #bfd4b1;
  border-radius: 8px;
  background: #eef5f0;
}
.state-buttons {
  gap: 8px;
  flex-wrap: wrap;
}
.state-buttons button {
  border: 1px solid #a8c596;
  min-height: 46px;
  background: #eef4ff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
}
.state-buttons .active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 2px 2px 0 var(--ink);
}
.atom-choices .active {
  background: var(--blue);
}
.material-options button {
  background: #f3f7ff;
  border: 1px solid #b3cba3;
  border-radius: 8px;
}
.material-options button > b {
  border-radius: 5px;
}
.choices button {
  border: 1px solid #9bb98a;
  border-radius: 6px;
}
.segmented {
  background: #e8f0ff;
  border-radius: 6px;
}
.segmented .active {
  background: var(--blue);
}
.legend span {
  border: 1px solid #24361f25;
  border-radius: 4px;
}
.curriculum-chip {
  line-height: 1.5;
  color: #566244 !important;
}
.model-note {
  line-height: 1.5;
}
footer {
  border-top: 2px solid #bfd4b1;
  margin-top: 35px;
}
dialog {
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 8px 8px 0 #24361f40;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
.table-scroll:focus-visible,
summary:focus-visible {
  outline-color: #f27328;
}
#return-to-mission {
  display: block;
  padding: 10px 0;
}
.mission-source {
  border-top: 1px solid #dbe8d2;
  padding-top: 13px;
}
@media (min-width: 1350px) {
  .board-mission {
    padding-right: 158px;
  }
  .board-mission .mission-label {
    width: calc(100% + 135px);
  }
}
@media (max-width: 1100px) {
  header {
    gap: 16px;
  }
  .nav {
    padding: 11px 15px;
  }
  .mission-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board-mission:first-child {
    grid-column: span 2;
  }
  .heading h1 {
    font-size: 48px;
  }
  .discovery {
    padding: 15px;
    max-width: 340px;
  }
  .board-mission {
    min-height: 228px;
  }
  .board-mission:first-child {
    min-height: 210px;
  }
  .board-mission:first-child .mission-illustration {
    top: 0;
  }
}
@media (max-width: 800px) {
  header {
    padding: 16px 4%;
    gap: 12px;
  }
  nav {
    width: 100%;
    gap: 7px;
  }
  .nav {
    padding: 11px 9px;
    font-size: 14px;
  }
  .heading {
    align-items: flex-start;
    gap: 22px;
    flex-wrap: wrap;
  }
  .heading h1 {
    font-size: 46px;
    letter-spacing: -2px;
  }
  .heading > div > p:last-child {
    font-size: 15px;
  }
  .discovery {
    max-width: unset;
    padding: 13px 15px;
    transform: none;
  }
  .discovery p {
    display: block;
  }
  .passport-label {
    font-size: 10px;
    padding: 11px;
  }
  .board-mission {
    padding: 18px 122px 20px 18px;
    min-height: 245px;
  }
  .board-mission .mission-label {
    width: calc(100% + 104px);
  }
  .mission-illustration {
    width: 125px;
    top: 73px;
    right: 0;
  }
  .board-mission h2 {
    font-size: 25px;
  }
  .board-mission:first-child h2 {
    font-size: 34px;
  }
  .board-mission:first-child .mission-label {
    width: calc(100% + 202px);
  }
  .lab-card {
    padding: 24px;
  }
  .lab-card h2 {
    font-size: 27px;
  }
  .journey-title h1 {
    font-size: 37px;
  }
}
@media (max-width: 600px) {
  .mission-board {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .board-mission:first-child {
    grid-column: auto;
    padding-right: 150px;
    min-height: 240px;
  }
  .board-mission:first-child .mission-illustration {
    width: 155px;
    top: 47px;
    right: 0;
  }
  .board-mission:first-child h2 {
    font-size: 29px;
    max-width: 220px;
  }
  .board-mission:first-child p {
    font-size: 14px;
  }
  .board-mission:first-child .mission-label {
    width: calc(100% + 132px);
  }
  .board-mission {
    min-height: 220px;
    padding-right: 145px;
  }
  .board-mission .mission-label {
    width: calc(100% + 127px);
  }
  .mission-illustration {
    width: 145px;
    top: 54px;
  }
  .board-mission h2 {
    font-size: 26px;
  }
  .heading h1 {
    font-size: 41px;
  }
  .heading .eyebrow {
    font-size: 10px;
  }
  .discovery {
    width: 100%;
    max-width: 360px;
    margin-top: 0;
  }
  .passport-stamp {
    width: 19px;
    height: 23px;
  }
  .passport-stamps {
    gap: 3px;
  }
  .passport-label {
    flex-shrink: 0;
  }
  .board-bar {
    margin-top: 16px;
  }
  .board-bar p {
    font-size: 13px;
    max-width: 230px;
  }
  .lab-card {
    padding: 21px;
  }
  .lab-card h2 {
    font-size: 25px;
  }
  .journey-card {
    padding: 22px;
  }
  .journey-title h1 {
    font-size: 34px;
  }
  .brand {
    font-size: 20px;
  }
  .nav {
    font-size: 13px;
  }
  .primary,
  .view-passport {
    font-size: 14px;
  }
  .find-element b {
    font-size: 36px;
  }
  .find-element {
    min-height: 130px;
  }
  .step {
    font-size: 13px;
    padding: 10px;
  }
  .discovery p {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .board-mission,
  .primary,
  .element,
  .nav {
    transition: none !important;
  }
}
.mission-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 22px;
}
.audio-step {
  background: white;
  border: 1px solid #8fa77e;
  min-height: 46px;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #2a5f33;
}
.word-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.word-chips button {
  background: #e4efdc;
  color: #234f2b;
  border: 1px dashed #93b37f;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 14px;
  min-height: 44px;
}
.inv-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 25px;
  margin: 20px 0;
}
.inv-layout .science-diagram {
  margin-top: 10px;
}
.inv-layout .primary {
  margin-bottom: 16px;
}
.prediction {
  border-top: 1px solid #d2e1c8;
  padding-top: 16px;
  margin: 18px 0;
}
.mission-target,
.explore-note {
  font-size: 15px;
  color: var(--muted);
}
.results-scroll {
  overflow-x: auto;
  margin: 22px 0;
}
.test-results {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background: white;
  text-align: left;
}
.test-results caption {
  text-align: left;
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 10px;
}
.test-results th {
  background: #e4efdc;
}
.test-results td,
.test-results th {
  padding: 12px;
  border: 1px solid #c4d6b6;
  vertical-align: top;
}
.results-empty {
  padding: 16px;
  background: #eef4ff;
  margin: 20px 0;
  font-size: 14px;
}
.case-stamps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.case-stamps span {
  background: #edf3ff;
  border: 1px dashed #9bb98a;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 6px;
}
.case-stamps .done {
  background: #d4f1dd;
  border-style: solid;
  border-color: #277355;
}
.investigation-particles.solid .particle {
  animation: ice-vibrate 0.4s ease-in-out infinite alternate;
}
.investigation-particles {
  height: 270px;
}
.investigation-particles.liquid .particle {
  animation: wobble 2s ease-in-out infinite alternate;
}
.investigation-particles.gas .particle {
  animation: float 2s ease-in-out infinite alternate;
}
@keyframes ice-vibrate {
  to {
    transform: translate(1px, -1px);
  }
}
#word-example {
  background: #edf3ff;
  border-left: 4px solid #6f9a5a;
  padding: 15px;
  border-radius: 6px;
}
@media (max-width: 850px) {
  .inv-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .inv-layout .science-diagram {
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
  }
  .test-results td,
  .test-results th {
    padding: 10px;
    font-size: 13px;
  }
  .mission-tools {
    align-items: flex-start;
  }
  .investigation-card > h2 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .investigation-particles .particle {
    animation: none !important;
  }
}

/* ---------- Passport fits on iPad portrait ---------- */
.passport-stamps {
  grid-template-columns: repeat(5, 26px);
}
.passport-stamp {
  width: 26px;
  height: 24px;
}

/* ---------- Particle movement trails (visible even with reduced motion) ---------- */
.particle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--trail, 0);
  height: 2px;
  background: #328d6c;
  opacity: 0.5;
  transform-origin: 0 50%;
  transform: rotate(var(--a, 0deg));
}
.show-trails.solid .particle {
  --trail: 8px;
}
.show-trails.liquid .particle {
  --trail: 17px;
}
.show-trails.gas .particle {
  --trail: 36px;
}

/* ---------- Lab bench ---------- */
.lab-bench {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
  margin: 6px 0 14px;
}
.lab-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 158px;
  padding: 12px 14px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  box-shadow: 4px 4px 0 #c4d6b6;
  text-align: left;
  color: var(--ink);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.lab-tile:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #93b37f;
}
.lab-tile.suits.tag-34 {
  background: #ffe58c;
}
.lab-tile.suits.tag-56 {
  background: #c4efe2;
}
.lab-tile.suits.tag-36 {
  background: #e4efdc;
}
.lab-tile.suits.tag-extra {
  background: #e9ddff;
}
.lab-tile-num {
  font-size: 12px;
  font-weight: 800;
  color: #4d5a40;
}
.lab-tile-code {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.lab-tile-title {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}
.lab-tile-tag {
  margin-top: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #24361f35;
}
.lab-tile-stamp {
  position: absolute;
  top: 10px;
  right: 8px;
  transform: rotate(8deg);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  padding: 5px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--ink);
}
.lab-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 900px;
  margin: 0 auto 18px;
}
.lab-nav .link-button {
  min-height: 44px;
  font-weight: 800;
  font-size: 15px;
}
#lab-position {
  font-size: 13px;
  font-weight: 800;
  color: #4d5a40;
}
.lab-goal {
  flex-basis: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 2px dashed #9bb98a;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
}
.lab-goal.done {
  border-style: solid;
  border-color: #277355;
  background: #d4f1dd;
}
.lab-stamp-live {
  flex-basis: 100%;
  margin: 0;
  font-weight: 850;
  color: #c2412d;
}
.lab-stamp-live:empty {
  display: none;
}
.lab-grid {
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
}
.lab-card .science-diagram {
  max-width: 640px;
}
.lab-app > b {
  display: block;
  margin-top: 18px;
}
.lab-app .state-buttons {
  margin: 10px 0 6px;
}
.lab-app .state-buttons button {
  font-size: 14px;
  padding: 8px 14px;
}
.temp-chips button {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.temp-chips small {
  font-weight: 600;
  font-size: 12px;
  opacity: 0.85;
}
.lab-test {
  display: block;
  margin: 12px 0 14px;
  padding: 0 22px;
  color: #fff;
}
.state-buttons button.wrong,
.state-buttons button.wrong:disabled {
  background: #ffedda;
  border-color: #ab5b2f;
  color: #7a3b14;
  text-decoration: line-through;
}

/* Material match-up */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.job-chip {
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #a8c596;
  background: #eef4ff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
}
.job-chip small {
  font-weight: 600;
  font-size: 12px;
  color: #4d5a40;
}
.job-chip.matched {
  background: #d4f1dd;
  border-color: #277355;
}
.job-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}
.job-chip.active small {
  color: #e6eeff;
}
.job-card {
  background: #ffe58c;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0;
  transform: rotate(-0.6deg);
}
.job-card .eyebrow {
  margin: 0;
}
.job-card h3 {
  margin: 2px 0 4px;
  font-size: 22px;
}
.job-card p {
  margin: 0;
}
.lab-app .material-options {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 16px;
}
.lab-app .material-options button {
  gap: 10px;
  padding: 10px 12px;
  min-height: 58px;
  font-weight: 750;
}
.lab-app .material-options button.verdict-best {
  background: #d4f1dd;
  border: 2px solid #277355;
}
.lab-app .material-options button.verdict-okay {
  background: #fff0ca;
  border: 2px solid #9a6c1c;
}
.lab-app .material-options button.verdict-no {
  background: #ffedda;
  border: 2px solid #ab5b2f;
}
.mat-swatch {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.mat-copper {
  background: #c9733f;
}
.mat-steel {
  background: #aab3bd;
}
.mat-plastic {
  background: #4fb3a9;
  border-radius: 12px;
}
.mat-glass {
  background: #eef5e6;
  box-shadow: inset 8px -8px 0 -5px #fff;
}
.mat-wood {
  background: repeating-linear-gradient(100deg, #b98252 0 5px, #a06b3e 5px 8px);
}
.mat-cotton {
  background-color: #f7f3ea;
  background-image: radial-gradient(#cfc5ae 1.2px, transparent 1.4px);
  background-size: 6px 6px;
}

/* Change sorter */
.change-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 5px 5px 0 var(--red);
  margin: 10px 0 18px;
  transform: rotate(-1deg);
}
.change-card b {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 27px;
  line-height: 1.2;
}
.change-card-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #4d5a40;
}
.sort-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sort-bins button {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 19px;
  font-weight: 800;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #eef4ff;
  color: var(--ink);
}
.sort-bins small {
  font-size: 12px;
  font-weight: 600;
}
.sort-bins .correct,
.sort-bins .correct:disabled {
  background: #d4f1dd;
  border-color: #277355;
  opacity: 1;
}
.sort-bins .wrong,
.sort-bins .wrong:disabled {
  background: #ffedda;
  border-color: #ab5b2f;
  opacity: 1;
}
.sort-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 20px;
}
.sort-summary > div {
  border: 2px solid #d2e1c8;
  border-radius: 10px;
  padding: 12px 16px;
  background: #f3f7ff;
}
.sort-summary p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--muted);
}
.sort-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* Rust race */
.tube-key {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 14px;
}
.tube-key b {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  margin-right: 6px;
  font-size: 13px;
}
.day-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}
.day-controls .primary {
  padding: 0 18px;
  color: #fff;
}
.day-controls button:not(.primary) {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #a8c596;
  background: #eef4ff;
  border-radius: 7px;
  font-weight: 700;
}
.day-counter {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  background: #ffe58c;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
}

/* Sandy salt water plan */
.plan-slots {
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.plan-slots li {
  border: 2px dashed #9bb98a;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.plan-slots li span {
  color: #6b7058;
}
.sand-dot {
  background: #c69a63;
}

/* Molecule builder */
.builder-atoms button {
  min-width: 64px;
  min-height: 52px;
  font-size: 17px;
}
.word-chips > span {
  font-size: 13px;
  font-weight: 700;
  color: #4d5a40;
  align-self: center;
}

@media (max-width: 600px) {
  .lab-bench {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .lab-tile {
    min-height: 140px;
  }
  .lab-tile-code {
    font-size: 32px;
  }
  .sort-bins,
  .sort-summary,
  .tube-key {
    grid-template-columns: 1fr;
  }
  .change-card b {
    font-size: 22px;
  }
}
#lab.lab-open .heading h1,
#lab.lab-open .heading > div > p,
#lab.lab-open .heading .discovery {
  display: none;
}
#lab.lab-open .heading {
  margin-bottom: 10px;
}
.inv-layout > div > b {
  display: block;
  margin: 16px 0 8px;
}
.board-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: flex-end;
}

/* Keep it warm and dissolving race */
.warm-chart svg text {
  font-family: system-ui, sans-serif;
}
.warm-point {
  cursor: pointer;
}
.warm-readout {
  min-height: 1.4em;
  font-weight: 700;
  margin: 6px 0 0;
}
.cup-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cup-setup > div {
  border: 2px solid #d2e1c8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8faff;
}
.cup-setup .state-buttons {
  margin: 8px 0;
  gap: 6px;
}
.cup-setup .state-buttons button {
  flex: 1;
  font-size: 13px;
  padding: 6px 8px;
  min-height: 44px;
}
.fair-check {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px dashed #9bb98a;
  background: #fff;
  font-weight: 650;
}
.fair-check.fair {
  border: 2px solid #277355;
  background: #d4f1dd;
}
.fair-check.unfair {
  border: 2px solid #9a6c1c;
  background: #fff0ca;
}
@media (max-width: 600px) {
  .cup-setup {
    grid-template-columns: 1fr;
  }
}

/* Quick brain check */
.brain-check {
  margin-top: 30px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  box-shadow: 4px 4px 0 #c4d6b6;
  padding: 22px 26px;
  max-width: 760px;
}
.brain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brain-head .link-button {
  min-height: 44px;
}
.brain-check h2 {
  font-size: 24px;
  margin: 12px 0;
}
.brain-check .primary {
  padding: 0 20px;
  color: #fff;
}

/* Show my teacher journal */
.journal-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.journal-actions .primary {
  padding: 0 22px;
  color: #fff;
}
.journal-section {
  margin-top: 26px;
}
.journal-entry {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  padding: 18px 22px;
  margin: 14px 0;
  break-inside: avoid;
}
.journal-entry h3 {
  font-size: 22px;
  margin: 4px 0 8px;
}
.journal-label {
  font-weight: 800;
  margin: 12px 0 6px;
}
.journal-stamps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.journal-stamps li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #ffe58c;
  padding: 8px 12px;
  font-weight: 750;
}
.journal-stamps .lab-tile-code {
  font-size: 26px;
}
@media print {
  header,
  footer,
  .journal-actions,
  dialog {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .page:not(#journal) {
    display: none !important;
  }
}
.journal-actions {
  margin-bottom: 12px;
}

/* Element ID card and family chips */
.id-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.id-card div {
  background: #2a3b24;
  border: 1px solid #3d5a32;
  border-radius: 8px;
  padding: 8px 10px;
}
.id-card dt {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #d2e1c8;
}
.id-card dd {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.family-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.family-chips button {
  min-width: 48px;
  min-height: 48px;
  border-radius: 8px;
  border: 2px solid #fff;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.family-chips .metal {
  background: var(--metal);
}
.family-chips .metalloid {
  background: var(--metalloid);
}
.family-chips .nonmetal {
  background: var(--nonmetal);
}
.family-chips .noble {
  background: var(--noble);
}
.detail-actions button {
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
}

/* Element hunt */
.hunt-card {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #ffe58c;
  box-shadow: 4px 4px 0 #c4d6b6;
  padding: 16px 22px;
  margin-bottom: 20px;
}
.hunt-card h2 {
  font-size: 22px;
  margin: 8px 0;
}
.hunt-card .primary {
  padding: 0 20px;
  color: #fff;
}
.hunt-card .feedback {
  background: #fff;
}
.hunt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.hunt-actions .link-button {
  min-height: 44px;
}
.hunt-hint {
  margin: 8px 0 0;
}
.hunt-found {
  padding-left: 20px;
}

/* Detective tabs and games */
.detective-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
}
.detective-tabs button {
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
  border-radius: 6px;
}
.detective-tabs .active {
  color: #fff;
}
.match-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) 1.4fr;
  gap: 12px;
  margin: 16px 0;
}
.match-col {
  display: grid;
  gap: 8px;
  align-content: start;
}
.match-word,
.match-meaning {
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid #d2e1c8;
  border-radius: 8px;
  background: #f3f7ff;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
}
.match-word {
  font-weight: 800;
  font-size: 17px;
}
.match-word.active {
  background: var(--blue);
  border-color: var(--ink);
  color: #fff;
}
.match-word.matched,
.match-meaning.matched {
  background: #d4f1dd;
  border-color: #277355;
  opacity: 1;
}
.muddle-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fffdf3;
  border: 2px dashed #9a6c1c;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 14px 0;
  transform: rotate(-0.8deg);
}
.muddle-note span {
  font-size: 13px;
  font-weight: 800;
  color: #7a5a14;
}
.muddle-note b {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 22px;
  line-height: 1.25;
}

/* Water cycle, balloons, atom builder */
.cycle-log {
  margin: 14px 0 0;
  padding-left: 22px;
  font-size: 14px;
  display: grid;
  gap: 4px;
}
.balloon {
  transition: transform 1.4s cubic-bezier(0.3, 0.1, 0.3, 1);
}
.atom-challenges {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.atom-challenges li {
  padding: 6px 10px;
  border-radius: 6px;
  background: #f3f7ff;
  border: 1px solid #d2e1c8;
}
.atom-challenges li.done {
  background: #d4f1dd;
  border-color: #277355;
}
.builder-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.builder-controls .atom-choices {
  margin-top: 8px;
}
.builder-controls button {
  flex: 1;
  font-size: 15px;
}
.build-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 0;
}
.build-readout div {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
}
.build-readout dt {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4d5a40;
}
.build-readout dd {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: 17px;
}
@media (prefers-reduced-motion: reduce) {
  .balloon {
    transition: none;
  }
}
@media (max-width: 600px) {
  .match-grid,
  .builder-controls,
  .build-readout {
    grid-template-columns: 1fr;
  }
}
