:root {
  --ink: #172033;
  --muted: #58657a;
  --paper: #ffffff;
  --canvas: #f3f7f8;
  --teal: #086d74;
  --teal-dark: #07555b;
  --teal-soft: #dff3f2;
  --blue: #2d5bd1;
  --orange: #ef8f28;
  --orange-soft: #fff0dc;
  --green: #19713c;
  --green-soft: #e4f5e9;
  --red: #a82920;
  --red-soft: #fdebea;
  --border: #d9e2e6;
  --shadow: 0 16px 38px rgba(23, 32, 51, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(8, 109, 116, .07), transparent 22rem),
    radial-gradient(circle at 93% 90%, rgba(239, 143, 40, .08), transparent 26rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: -80px;
  padding: 12px 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--teal);
  border-radius: 11px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
  font-weight: 900;
  letter-spacing: -.04em;
}

.top-stats, .stat, .icon-button {
  display: flex;
  align-items: center;
}
.top-stats { gap: 10px; }
.stat, .icon-button {
  min-height: 42px;
  gap: 7px;
  padding: 8px 12px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.icon-button { cursor: pointer; }
.icon-button[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); }

.progress-track { height: 4px; background: #dde7e8; }
.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #2ea6a0);
  transition: width .35s ease;
}

main { min-height: calc(100vh - 68px); }
.screen { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 48px; }

.hero-card {
  min-height: 570px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero-copy { padding: clamp(34px, 6vw, 70px); }
.eyebrow {
  display: inline-block;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(32px, 5vw, 54px); line-height: 1.04; letter-spacing: -.035em; }
h2 { margin-bottom: 8px; line-height: 1.15; }
.hero-lead { max-width: 560px; color: var(--muted); font-size: 20px; }

.start-form { display: grid; gap: 14px; max-width: 470px; margin-top: 30px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 750; }
input, textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 2px solid #cbd7dc;
  border-radius: 12px;
  padding: 13px 14px;
}
input:focus, textarea:focus { border-color: var(--teal); }
textarea { min-height: 112px; resize: vertical; }

.toggle-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
}
.toggle-row span:first-child { display: grid; }
.toggle-row small { color: var(--muted); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  background: #9aa6b5;
  border-radius: 999px;
  transition: .2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle-row input:checked + .switch { background: var(--teal); }
.toggle-row input:checked + .switch::after { transform: translateX(22px); }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 780;
  text-decoration: none;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #fff; background: var(--teal); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { color: var(--teal-dark); background: var(--teal-soft); border-color: #a9d8d6; }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--border); }
.button-danger { color: #fff; background: var(--red); }
.button-large { min-height: 54px; font-size: 18px; }
.privacy-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }

.hero-visual {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  background: linear-gradient(150deg, #dff3f2 0%, #cce7f3 100%);
  border-left: 1px solid var(--border);
}
.hero-visual::before, .hero-visual::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(8, 109, 116, .12);
  border-radius: 28px;
  transform: rotate(15deg);
}
.hero-visual::before { top: -35px; right: 30px; }
.hero-visual::after { bottom: -50px; left: 20px; }

.mascot { position: relative; }
.mascot-large { width: 170px; height: 170px; }
.mascot-small { flex: 0 0 auto; width: 88px; height: 88px; }
.dog-face {
  position: absolute;
  inset: 13% 10% 4%;
  z-index: 2;
  background: #d8995f;
  border: 5px solid #8d5738;
  border-radius: 45% 45% 48% 48%;
}
.dog-ear {
  position: absolute;
  z-index: 1;
  top: 8%;
  width: 35%;
  height: 56%;
  background: #8d5738;
  border-radius: 70% 30% 60% 50%;
}
.dog-ear.left { left: 1%; transform: rotate(15deg); }
.dog-ear.right { right: 1%; transform: scaleX(-1) rotate(15deg); }
.dog-eye {
  position: absolute;
  top: 34%;
  width: 10%;
  aspect-ratio: 1;
  background: var(--ink);
  border-radius: 50%;
}
.dog-eye.left { left: 29%; }
.dog-eye.right { right: 29%; }
.dog-nose {
  position: absolute;
  left: 43%;
  top: 58%;
  width: 16%;
  height: 13%;
  background: var(--ink);
  border-radius: 50% 50% 60% 60%;
}
.headphones {
  position: absolute;
  z-index: 3;
  inset: 2% 0 38%;
  border: 8px solid var(--teal);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.key-demo { z-index: 2; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 900; }
.key {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 4px 10px 7px;
  color: var(--ink);
  background: #fff;
  border: 2px solid #a9b8c0;
  border-bottom-width: 5px;
  border-radius: 9px;
  font-family: inherit;
  font-weight: 850;
  line-height: 1;
}
.key-large { min-width: 66px; min-height: 56px; font-size: 23px; }
.primary-key { color: #fff; background: var(--teal); border-color: var(--teal-dark); }
.coach-bubble {
  z-index: 2;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(23, 32, 51, .08);
}
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.feature-strip span { padding: 14px; text-align: center; background: rgba(255, 255, 255, .8); color: var(--muted); }
.feature-strip b { color: var(--teal); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.section-heading h1 { margin: 4px 0 8px; font-size: clamp(32px, 4vw, 46px); }
.section-heading p { margin: 0; color: var(--muted); }
.section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level-card {
  position: relative;
  min-height: 225px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(23, 32, 51, .05);
  cursor: pointer;
}
.level-card:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.level-card:disabled { cursor: not-allowed; opacity: .64; }
.level-card.current { border: 2px solid var(--teal); }
.level-card.completed { background: linear-gradient(145deg, #fff, #effaf5); }
.level-card.final { color: #fff; background: linear-gradient(145deg, #154d61, #086d74); border: 0; }
.level-card.final .level-number, .level-card.final p, .level-card.final .level-shortcuts { color: rgba(255, 255, 255, .86); }
.level-number { color: var(--teal); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.level-card h2 { margin: 0; font-size: 23px; }
.level-card p { margin: 0; color: var(--muted); }
.level-shortcuts { display: flex; gap: 7px; margin-top: auto; color: var(--teal); font-size: 14px; font-weight: 800; }
.level-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  background: var(--canvas);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.completed .level-status { color: var(--green); background: var(--green-soft); }

.bonus-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 22px 26px;
  background: var(--orange-soft);
  border: 1px solid #f1cca2;
  border-radius: var(--radius);
}
.bonus-card h2 { margin: 4px 0; }
.bonus-card p { margin: 0; color: var(--muted); }

.intro-screen { display: grid; place-items: center; }
.intro-card {
  width: min(980px, 100%);
  padding: clamp(24px, 5vw, 48px);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.intro-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.intro-heading h1 { margin: 5px 0 8px; font-size: clamp(32px, 5vw, 48px); }
.intro-lead { max-width: 64ch; margin: 0; color: var(--muted); font-size: 19px; }
.intro-content { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; margin: 30px 0 22px; }
.intro-content h2 { margin: 0 0 8px; font-size: 22px; }
.intro-content p { max-width: 64ch; margin: 0; color: var(--muted); }
.intro-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.intro-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid #addbd8;
  border-radius: 12px;
  font-weight: 800;
}
.intro-shortcut kbd {
  padding: 3px 7px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #b9c6cc;
  border-bottom-width: 3px;
  border-radius: 7px;
  font-weight: 850;
}
.intro-steps-card { padding: 22px; background: var(--canvas); border: 1px solid var(--border); border-radius: 15px; }
.intro-steps-card ol { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 24px; }
.intro-steps-card li { padding-left: 4px; }
.intro-tip { display: flex; align-items: center; gap: 18px; padding: 17px 20px; background: var(--orange-soft); border-radius: 15px; }
.intro-tip .mascot-small { width: 66px; height: 66px; }
.intro-tip p { max-width: 64ch; margin: 0; }
.intro-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.game-header {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 420px) 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.game-header > :last-child { justify-self: end; }
.level-progress { display: grid; gap: 5px; color: var(--muted); font-size: 14px; text-align: center; }
.mini-track { height: 8px; overflow: hidden; background: #dbe5e8; border-radius: 999px; }
.mini-track div { width: 0; height: 100%; background: var(--teal); transition: width .3s; }
.timer-box {
  min-width: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.timer-box.warning { color: var(--red); border-color: #e5aaa6; background: var(--red-soft); }

.game-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, .9fr); gap: 18px; }
.mission-panel, .coach-panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mission-panel { min-height: 545px; padding: clamp(22px, 4vw, 38px); }
.coach-panel {
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 22px;
}
.coach-panel p { margin: 5px 0 0; color: var(--muted); }
.mission-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mission-tag, .shortcut-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}
.mission-tag { color: var(--teal-dark); background: var(--teal-soft); }
.shortcut-badge { color: #865217; background: var(--orange-soft); }
.mission-panel h1 { margin: 15px 0 8px; font-size: clamp(29px, 4vw, 42px); }
.mission-instruction { max-width: 720px; color: var(--muted); font-size: 19px; }

.workspace {
  min-height: 210px;
  margin: 24px 0 18px;
  padding: 22px;
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 15px;
}
.workspace label { display: block; margin-bottom: 7px; font-weight: 800; }
.workspace-note {
  padding: 18px;
  background: #fff;
  border: 1px solid #ccd8dd;
  border-left: 5px solid var(--teal);
  border-radius: 10px;
  font-size: 18px;
}
.workspace-note p:last-child { margin-bottom: 0; }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clipboard {
  margin-top: 12px;
  padding: 9px 12px;
  color: var(--muted);
  background: #edf3f5;
  border-radius: 9px;
  font-size: 14px;
}
.find-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--teal-soft);
  border: 1px solid #a9d8d6;
  border-radius: 11px;
}
.find-bar input { min-height: 44px; }
mark { color: #4f300d; background: #ffd78b; padding: 0 2px; border-radius: 3px; }
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #8a5315;
  font-weight: 800;
}
.save-status.saved { color: var(--green); }

.feedback {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 13px;
}
.feedback.success { color: var(--green); background: var(--green-soft); border-color: #abd5b8; }
.feedback.retry { color: var(--red); background: var(--red-soft); border-color: #efb8b4; }
.feedback.info { color: var(--teal-dark); background: var(--teal-soft); border-color: #addbd8; }
.feedback-icon { flex: 0 0 auto; font-size: 22px; font-weight: 900; }
.feedback p { margin: 3px 0 0; color: var(--ink); }
.mission-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; }

.detected-box {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 12px;
  background: var(--canvas);
  border-radius: 11px;
}
.detected-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.combo-steps { width: 100%; display: grid; gap: 7px; }
.combo-step { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.combo-step.current { color: var(--ink); font-weight: 800; }
.combo-step.done { color: var(--green); }

.reflection-screen { display: grid; place-items: center; min-height: calc(100vh - 100px); }
.reflection-card {
  width: min(720px, 100%);
  padding: clamp(28px, 6vw, 58px);
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.reflection-card h1 { margin-top: 8px; font-size: clamp(30px, 5vw, 44px); }
.reflection-options { display: grid; gap: 10px; margin: 24px 0; }
.reflection-option { min-height: 54px; color: var(--ink); background: var(--canvas); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 750; }
.reflection-option:hover { background: var(--teal-soft); border-color: var(--teal); }

.results-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px;
  color: #fff;
  background: linear-gradient(135deg, #154d61, #087981);
  border-radius: 22px;
}
.results-hero h1 { margin: 5px 0; font-size: clamp(34px, 5vw, 50px); }
.results-hero p { margin: 0; color: rgba(255, 255, 255, .82); }
.results-hero .eyebrow { color: #bce9e5; }
.result-grade {
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(255, 255, 255, .12);
  border: 8px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
}
.result-grade strong { font-size: 30px; }
.result-grade span { font-size: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.result-stat {
  display: grid;
  gap: 7px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.result-stat span { color: var(--muted); font-size: 14px; }
.result-stat strong { font-size: 22px; }
.result-bottom { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.summary-card, .teacher-card {
  padding: 25px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.summary-card h2, .teacher-card h2 { margin: 8px 0; }
.summary-card > p, .teacher-card p, .teacher-card li { color: var(--muted); }
.result-takeaway { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding: 16px; color: var(--green); background: var(--green-soft); border-radius: 12px; }
.result-takeaway > span { flex: 0 0 auto; font-size: 21px; font-weight: 900; }
.result-takeaway p { margin: 0; color: var(--ink); }
.teacher-card h2 { margin-top: 8px; }
.teacher-card ul { padding-left: 20px; }
.teacher-card li { margin: 8px 0; }
.button-row, .results-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.results-actions { justify-content: flex-end; margin-top: 18px; }

.bonus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bonus-tile {
  min-height: 210px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.bonus-tile:hover { border-color: var(--teal); transform: translateY(-2px); }
.bonus-tile kbd { padding: 5px 9px; background: var(--canvas); border: 1px solid #b9c6cc; border-bottom-width: 3px; border-radius: 7px; font-weight: 850; }
.bonus-tile strong, .bonus-tile small { flex-basis: 100%; text-align: center; }
.bonus-tile small { color: var(--muted); }
.bonus-practice {
  margin-top: 18px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sim-windows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.sim-window { padding: 18px; background: var(--canvas); border: 2px solid var(--border); border-radius: 12px; }
.sim-window.active { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }

.dialog {
  max-width: 460px;
  padding: 28px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 25px 80px rgba(23, 32, 51, .3);
}
.dialog::backdrop { background: rgba(23, 32, 51, .55); }
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 12px 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-visual { min-height: 340px; border-left: 0; border-top: 1px solid var(--border); }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .game-layout, .result-bottom { grid-template-columns: 1fr; }
  .coach-panel { order: -1; }
  .mascot-small { width: 70px; height: 70px; }
  .bonus-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-content { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .topbar { position: static; flex-wrap: wrap; padding: 10px 14px; }
  .top-stats { width: 100%; overflow-x: auto; }
  .stat, .icon-button { flex: 0 0 auto; }
  .screen { width: min(100% - 28px, 1180px); padding-top: 22px; }
  .hero-card { min-height: 0; }
  .hero-copy { padding: 28px 22px; }
  .hero-visual { min-height: 300px; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .section-heading, .bonus-card, .results-hero { align-items: flex-start; flex-direction: column; }
  .section-actions { width: 100%; justify-content: flex-start; }
  .level-grid, .result-grid, .bonus-grid { grid-template-columns: 1fr; }
  .game-header { grid-template-columns: 1fr 1fr; }
  .level-progress { grid-row: 2; grid-column: 1 / -1; }
  .game-header > :last-child { justify-self: end; }
  .mission-panel { min-height: 0; padding: 20px; }
  .workspace { padding: 15px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .result-grade { width: 105px; height: 105px; }
  .results-actions .button { flex: 1; }
  .intro-heading { flex-direction: column-reverse; gap: 12px; }
  .intro-actions { flex-direction: column-reverse; }
  .intro-actions .button { width: 100%; }
  .intro-tip { align-items: flex-start; }
}

@media (max-height: 680px) and (min-width: 901px) {
  .screen { padding-top: 20px; }
  .mission-panel { min-height: 470px; padding: 24px 30px; }
  .workspace { min-height: 170px; margin: 16px 0 12px; padding: 16px; }
  .mascot-small { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .topbar, .progress-track, .results-actions, .button-row { display: none !important; }
  body { background: #fff; }
  .screen { width: 100%; padding: 0; }
  #resultsScreen { display: block !important; }
  .results-hero { color: var(--ink); background: #fff; border: 2px solid var(--ink); }
  .results-hero .eyebrow, .results-hero p { color: var(--ink); }
  .result-grade { border-color: var(--ink); }
}
