:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #25484b;
  background: #e8f3ee;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 3%, rgba(255, 255, 255, .95) 0 5%, transparent 18%),
    radial-gradient(circle at 94% 12%, rgba(216, 240, 222, .82), transparent 22%),
    #e8f3ee;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid rgba(242, 183, 72, .52);
  outline-offset: 3px;
}

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.brand,
.sound-button,
.quiet-button,
.hint-button,
.next-level-button {
  border: 0;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: #25484b;
  text-align: left;
  background: transparent;
}

.brand-mark {
  display: grid;
  width: 60px;
  height: 48px;
  place-items: center;
}

.brand-mark .submarine {
  width: 58px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.05;
}

.brand small {
  margin-top: 3px;
  color: #65837e;
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-button,
.quiet-button,
.hint-button,
.next-level-button {
  min-height: 46px;
  padding: 0 17px;
  border: 2px solid #c9ded4;
  border-radius: 16px;
  color: #385d5c;
  font-weight: 800;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 6px 14px rgba(43, 82, 75, .06);
}

.sound-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiet-button:hover,
.sound-button:hover,
.hint-button:hover:not(:disabled),
.next-level-button:hover {
  border-color: #8fbbb0;
  transform: translateY(-1px);
}

.quiet-button.large {
  min-height: 54px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  min-height: 448px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 36px;
  background: #fbf5df;
  box-shadow: 0 22px 52px rgba(39, 83, 73, .13);
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 48px 18px 48px 52px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #43847a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  color: #25484b;
  line-height: 1.07;
  letter-spacing: -.035em;
}

.hero h1 {
  max-width: 590px;
  margin-bottom: 19px;
  font-size: clamp(36px, 4.25vw, 59px);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 555px;
  margin-bottom: 27px;
  color: #5a736c;
  font-size: 17px;
  line-height: 1.55;
}

.primary-button {
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font: 900 17px/1 "Trebuchet MS", "Segoe UI", sans-serif;
  cursor: pointer;
  background: #e47b58;
  box-shadow: 0 10px 0 #bb5d40, 0 16px 24px rgba(170, 79, 51, .2);
  transition: transform .15s, box-shadow .15s;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 0 #bb5d40, 0 19px 26px rgba(170, 79, 51, .2);
}

.primary-button:active {
  transform: translateY(7px);
  box-shadow: 0 3px 0 #bb5d40;
}

.primary-button span {
  margin-left: 8px;
}

.primary-button.compact {
  min-height: 47px;
  padding: 0 18px;
  font-size: 15px;
  box-shadow: 0 7px 0 #bb5d40;
}

.hero-scene {
  position: relative;
  min-height: 448px;
  overflow: hidden;
  background: linear-gradient(180deg, #a5dfdf 0 9%, #44b4bd 10%, #167f9a 47%, #10566f 100%);
  clip-path: ellipse(88% 84% at 100% 50%);
}

.hero-surface,
.water-surface {
  position: absolute;
  z-index: 2;
  top: 8%;
  left: 0;
  width: 100%;
  height: 15px;
  opacity: .7;
  background: radial-gradient(14px 7px at 50% 0, transparent 48%, #e8ffff 52% 67%, transparent 71%) 0 0 / 28px 14px repeat-x;
}

.hero-rays,
.light-rays {
  position: absolute;
  inset: 8% 0 auto;
  height: 68%;
  overflow: hidden;
}

.hero-rays i,
.light-rays i {
  position: absolute;
  top: -20px;
  width: 72px;
  height: 120%;
  opacity: .15;
  background: linear-gradient(180deg, #fff, transparent);
  clip-path: polygon(35% 0, 64% 0, 100% 100%, 0 100%);
}

.hero-rays i:nth-child(1),
.light-rays i:nth-child(1) { left: 12%; transform: rotate(-7deg); }
.hero-rays i:nth-child(2),
.light-rays i:nth-child(2) { left: 47%; transform: rotate(5deg); }
.hero-rays i:nth-child(3),
.light-rays i:nth-child(3) { right: 7%; transform: rotate(11deg); }

.hero-sub {
  position: absolute;
  z-index: 4;
  top: 31%;
  left: 12%;
  width: 54%;
  filter: drop-shadow(0 15px 9px rgba(13, 54, 67, .2));
  transform: rotate(-3deg);
}

.submarine {
  display: block;
  width: 100%;
  height: auto;
}

.hero-example {
  position: absolute;
  z-index: 5;
  top: 13%;
  right: 6%;
  display: grid;
  min-width: 125px;
  padding: 14px 18px;
  border: 3px solid rgba(255, 255, 255, .7);
  border-radius: 24px;
  color: #fff;
  text-align: center;
  background: rgba(21, 91, 110, .52);
  box-shadow: 0 12px 25px rgba(15, 55, 73, .18);
  backdrop-filter: blur(5px);
}

.hero-example small {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-example strong { margin: 4px 0; font-size: 27px; }
.hero-example b { color: #ffe17b; font-size: 22px; }

.hero-treasure {
  position: absolute;
  z-index: 3;
  right: 12%;
  bottom: 5%;
  font-size: 60px;
}

.hero-treasure span {
  position: absolute;
  left: 37px;
  bottom: 11px;
  font-size: 53px;
}

.hero-bubbles i,
.sea-bubbles i {
  position: absolute;
  z-index: 3;
  display: block;
  border: 2px solid rgba(225, 255, 253, .58);
  border-radius: 50%;
}

.hero-bubbles i:nth-child(1) { top: 24%; left: 9%; width: 18px; height: 18px; }
.hero-bubbles i:nth-child(2) { top: 58%; right: 17%; width: 12px; height: 12px; }
.hero-bubbles i:nth-child(3) { top: 66%; left: 30%; width: 22px; height: 22px; }
.hero-bubbles i:nth-child(4) { top: 21%; right: 35%; width: 9px; height: 9px; }

.how,
.levels {
  padding: 48px 14px 0;
}

.how > .eyebrow {
  text-align: center;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.how-grid article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 3px 14px;
  padding: 19px;
  border: 1px solid #d7e7df;
  border-radius: 23px;
  background: rgba(255, 255, 255, .72);
}

.how-grid article > span {
  grid-row: 1 / 3;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  font-size: 25px;
  font-weight: 900;
  background: #48a99d;
}

.how-grid article:nth-child(2) > span { background: #388eae; }
.how-grid article:nth-child(3) > span { background: #e47b58; }
.how-grid strong { align-self: end; font-size: 17px; }
.how-grid p { margin: 2px 0 0; color: #67817b; font-size: 13px; line-height: 1.4; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(29px, 4vw, 42px);
}

.section-heading > p {
  max-width: 425px;
  margin: 0;
  color: #66807a;
  line-height: 1.45;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.level-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 330px;
  overflow: hidden;
  flex-direction: column;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 27px;
  color: #25484b;
  text-align: left;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 12px 25px rgba(43, 84, 77, .09);
  transition: transform .18s, box-shadow .18s;
}

.level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 19px 35px rgba(43, 84, 77, .15);
}

.level-number {
  position: absolute;
  z-index: 4;
  top: 13px;
  left: 13px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: var(--accent);
}

.level-preview {
  position: relative;
  display: block;
  height: 145px;
  overflow: hidden;
  background: linear-gradient(180deg, #bce9e2 0 10%, #4fb8bd 11%, #237e98 100%);
}

.blue-lagoon .level-preview { background: linear-gradient(180deg, #a8dfe0 0 9%, #319aaa 10%, #176e88 100%); }
.treasure-depth .level-preview { background: linear-gradient(180deg, #7cc9d2 0 9%, #257e9a 10%, #174b6a 100%); }

.preview-water {
  position: absolute;
  inset: 0;
}

.preview-water > i {
  position: absolute;
  top: 9%;
  width: 100%;
  height: 10px;
  background: radial-gradient(12px 6px at 50% 0, transparent 48%, rgba(255, 255, 255, .65) 52% 67%, transparent 71%) 0 0 / 24px 12px repeat-x;
}

.preview-water > b {
  position: absolute;
  top: 35px;
  left: 20%;
  width: 44%;
}

.preview-water > em {
  position: absolute;
  right: 14px;
  bottom: 9px;
  font-size: 34px;
  font-style: normal;
}

.preview-example {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 12px;
  color: #fff;
  font-weight: 900;
  background: rgba(20, 70, 82, .45);
}

.level-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 19px 19px 10px;
}

.level-copy small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.level-copy strong {
  margin: 5px 0 7px;
  font-size: 22px;
}

.level-copy em {
  color: #69817c;
  font-size: 14px;
  font-style: normal;
  line-height: 1.42;
}

.level-status {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin: 0 18px;
  border-top: 1px solid #e2ece7;
  color: #68817b;
  font-size: 13px;
  font-weight: 800;
}

.level-status b {
  color: var(--accent);
  font-size: 24px;
}

.mini-stars { color: #ecb63f; letter-spacing: 2px; }

.adult-note {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 34px 14px 0;
  padding: 20px 24px;
  border: 1px solid #cfe3d6;
  border-radius: 22px;
  background: rgba(228, 244, 231, .86);
}

.adult-note > span { font-size: 34px; }
.adult-note p { margin: 0; color: #5e776f; line-height: 1.5; }
.adult-note strong { display: block; color: #386b60; }

.game-shell {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 34px;
  background: rgba(250, 253, 248, .82);
  box-shadow: 0 20px 48px rgba(39, 83, 73, .12);
}

.game-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.game-head h1 {
  margin: 0;
  font-size: clamp(26px, 3.7vw, 43px);
}

.round-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #78918b;
}

.round-count strong { color: var(--level-accent); font-size: 35px; }
.round-count span { font-weight: 900; }

.progress-track {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 7px;
  margin: 20px 0;
}

.progress-track i {
  height: 8px;
  border-radius: 999px;
  background: #dbe8e2;
}

.progress-track i.done { background: var(--level-accent); }
.progress-track i.current { background: #f2c65d; box-shadow: 0 0 0 3px rgba(242, 198, 93, .24); }

.dive-game {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 20px;
}

.dive-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 5px solid #f8fbf2;
  border-radius: 29px;
  background: linear-gradient(180deg, #8bd5d7 0, #3a9fb2 27%, #207a98 56%, #18536f 100%);
  box-shadow: inset 0 0 42px rgba(9, 68, 85, .18), 0 9px 21px rgba(33, 83, 91, .12);
}

.dive-scene .water-surface { top: 4%; }
.dive-scene .light-rays { top: 4%; }

.depth-scale {
  position: absolute;
  z-index: 4;
  top: 11%;
  bottom: 13%;
  left: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.depth-scale::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 2px;
  content: "";
  background: rgba(232, 255, 251, .34);
}

.depth-scale span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(238, 255, 252, .58);
  font-size: 9px;
}

.depth-scale i {
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(232, 255, 251, .6);
  border-radius: 50%;
  background: #2b88a0;
}

.depth-scale .reached { color: #fff3b1; }
.depth-scale .reached i { border-color: #ffe17c; background: #efb84d; }

.dive-status {
  position: absolute;
  z-index: 5;
  top: 19px;
  right: 19px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-radius: 15px;
  color: #fff;
  background: rgba(14, 78, 96, .42);
  backdrop-filter: blur(5px);
}

.dive-status strong { color: #ffe17c; font-size: 18px; }
.dive-status span { font-size: 11px; font-weight: 800; }

.sub-runner {
  position: absolute;
  z-index: 6;
  left: 24%;
  width: 42%;
  filter: drop-shadow(0 13px 7px rgba(4, 48, 64, .25));
  transition: top .65s cubic-bezier(.25, .8, .25, 1);
}

.sub-runner > span { display: block; transform: rotate(-2deg); }
.sub-runner > i {
  position: absolute;
  left: -17px;
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(232, 255, 251, .66);
  border-radius: 50%;
}
.sub-runner > i:nth-child(2) { top: 48%; }
.sub-runner > i:nth-child(3) { top: 33%; left: -34px; width: 7px; height: 7px; }
.sub-runner > i:nth-child(4) { top: 60%; left: -29px; width: 5px; height: 5px; }
.sub-runner.diving > span { animation: dive-nod .65s ease-in-out; }

@keyframes dive-nod {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(6deg) translateY(4px); }
}

.sea-bubbles i:nth-child(1) { top: 21%; left: 18%; width: 12px; height: 12px; }
.sea-bubbles i:nth-child(2) { top: 48%; right: 18%; width: 19px; height: 19px; }
.sea-bubbles i:nth-child(3) { top: 71%; left: 44%; width: 10px; height: 10px; }
.sea-bubbles i:nth-child(4) { top: 38%; right: 8%; width: 7px; height: 7px; }
.sea-bubbles i:nth-child(5) { top: 80%; right: 31%; width: 14px; height: 14px; }

.sea-floor {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  height: 55px;
  align-items: end;
  justify-content: space-around;
  padding: 0 12% 8px;
  font-size: 28px;
  background: #e2b879;
  border-radius: 55% 48% 0 0 / 28px 25px 0 0;
}

.sea-floor b { font-size: 45px; filter: drop-shadow(0 5px 3px rgba(75, 48, 26, .22)); }

.mission-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px;
  border: 2px solid #d8e8e2;
  border-radius: 29px;
  background: #fffdf5;
}

.equation-board {
  padding: 22px 18px;
  border: 2px dashed #bbd5cb;
  border-radius: 22px;
  text-align: center;
  background: #f0f7ef;
}

.equation-board > small {
  display: block;
  margin-bottom: 7px;
  color: #65827b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.equation-board > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.equation-board strong,
.equation-board b {
  font-size: clamp(41px, 5vw, 61px);
}

.equation-board i {
  color: #77918a;
  font-size: 35px;
  font-style: normal;
  font-weight: 900;
}

.equation-board b { color: var(--level-accent); }

.mission-tip {
  display: grid;
  min-height: 75px;
  place-items: center;
  margin: 9px 0;
  color: #728a84;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.counting-hint {
  min-height: 93px;
  padding: 9px 0 4px;
  text-align: center;
}

.counting-hint small {
  display: block;
  margin-bottom: 8px;
  color: #668078;
  font-size: 11px;
  font-weight: 800;
}

.counting-hint > div {
  display: flex;
  overflow-x: auto;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.counting-hint span {
  display: grid;
  min-width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid #bddbd3;
  border-radius: 50%;
  color: #456d66;
  font-size: 12px;
  font-weight: 900;
  background: #fff;
}

.counting-hint span.start { border-color: #efb84d; background: #fff1be; }
.counting-hint span.finish { border-color: var(--level-accent); color: #fff; background: var(--level-accent); }
.counting-hint i { margin: 0 2px; color: #89a79f; font-style: normal; }

.sonar-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
  margin-top: auto;
}

.sonar-option {
  position: relative;
  min-height: 91px;
  overflow: hidden;
  border: 3px solid #cee3dc;
  border-radius: 22px;
  color: #28565b;
  cursor: pointer;
  background: #eaf7f3;
  box-shadow: 0 6px 0 #b7d7cd;
  transition: transform .14s, border-color .14s;
}

.sonar-option:hover:not(:disabled) {
  z-index: 2;
  border-color: #5cafaa;
  transform: translateY(-3px);
}

.sonar-option:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #b7d7cd; }
.sonar-option > small { position: absolute; top: 8px; left: 10px; color: #70938c; font-weight: 900; }
.sonar-option strong { position: relative; z-index: 2; font-size: 35px; }
.sonar-option > span { position: absolute; inset: 0; opacity: .45; }
.sonar-option > span i { position: absolute; border: 2px solid #72bdb4; border-radius: 50%; }
.sonar-option > span i:first-child { top: 14px; right: 21px; width: 52px; height: 52px; }
.sonar-option > span i:last-child { top: 28px; right: 35px; width: 24px; height: 24px; }
.sonar-option.wrong { border-color: #e59181; color: #9b4d42; background: #ffebe6; box-shadow: 0 6px 0 #dda99c; animation: shake .25s ease-in-out; }
.sonar-option.correct { border-color: #55a883; color: #fff; background: #58ad87; box-shadow: 0 6px 0 #368263; }
.sonar-option:disabled { cursor: default; }

@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.game-tools {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0;
}

.hint-button:disabled { cursor: default; opacity: .48; }

.feedback-card {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #d5e5df;
  border-radius: 23px;
  background: #fff;
}

.feedback-card.correct { border-color: #aedbc5; background: #eefaf2; }
.feedback-card.wrong { border-color: #edc3b8; background: #fff3ef; }
.feedback-card.hint { border-color: #e9d79e; background: #fff9df; }
.feedback-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; font-size: 25px; background: #e8f4f1; }
.feedback-card p { flex: 1; margin: 0; }
.feedback-card strong,
.feedback-card small { display: block; }
.feedback-card strong { margin-bottom: 3px; }
.feedback-card small { color: #69817b; line-height: 1.35; }

.result-wrap {
  display: grid;
  min-height: 680px;
  padding: 40px 18px;
  place-items: center;
  overflow: hidden;
  border-radius: 35px;
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, .13) 0 8px, transparent 9px),
    radial-gradient(circle at 87% 48%, rgba(255, 255, 255, .13) 0 14px, transparent 15px),
    linear-gradient(180deg, #58b8bf, #176a88 62%, #164c68);
  box-shadow: 0 20px 46px rgba(31, 77, 83, .16);
}

.result-card {
  width: min(660px, 100%);
  padding: 34px;
  border: 4px solid rgba(255, 255, 255, .6);
  border-radius: 31px;
  text-align: center;
  background: #fffdf4;
  box-shadow: 0 21px 44px rgba(8, 52, 70, .23);
}

.result-treasure {
  position: relative;
  height: 150px;
  margin: -9px auto 9px;
}

.result-treasure > span { position: absolute; top: 0; left: 12%; width: 45%; transform: rotate(-4deg); }
.result-treasure > b { position: absolute; right: 16%; bottom: 10px; font-size: 75px; }
.result-treasure > i { position: absolute; right: 5%; bottom: 0; font-size: 54px; font-style: normal; }
.result-card h1 { margin-bottom: 10px; font-size: clamp(35px, 5vw, 51px); }
.result-card > p:not(.eyebrow) { max-width: 490px; margin: 0 auto 10px; color: #637c76; line-height: 1.5; }
.result-stars { margin: 10px 0 18px; color: #efb83f; font-size: 42px; letter-spacing: 7px; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.result-stats span { padding: 13px 8px; border-radius: 17px; background: #edf5ed; }
.result-stats strong,
.result-stats small { display: block; }
.result-stats strong { color: #3f887a; font-size: 25px; }
.result-stats small { color: #6d837e; font-size: 11px; font-weight: 800; }
.result-actions { display: flex; justify-content: center; gap: 13px; }

@media (max-width: 1000px) {
  .hero-copy { padding-left: 38px; }
  .level-card { min-height: 344px; }
  .dive-game { grid-template-columns: minmax(0, .94fr) minmax(350px, 1.06fr); }
  .game-shell { padding: 23px; }
}

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 42px; }
  .hero-scene { min-height: 330px; clip-path: ellipse(78% 93% at 50% 100%); }
  .hero-sub { top: 24%; left: 23%; width: 43%; }
  .hero-example { top: 15%; right: 17%; }
  .how-grid { grid-template-columns: 1fr; }
  .how-grid article { grid-template-columns: 52px 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { display: grid; min-height: 180px; grid-template-columns: 37% 1fr; }
  .level-preview { height: 100%; min-height: 180px; grid-row: 1 / 3; }
  .level-copy { padding: 23px 20px 5px; }
  .level-status { align-self: end; }
  .dive-game { grid-template-columns: 1fr; }
  .dive-scene { min-height: 390px; }
  .mission-panel { min-height: 425px; }
}

@media (max-width: 700px) {
  .app { width: min(1120px, calc(100% - 20px)); padding-top: 10px; }
  .topbar { gap: 8px; margin-bottom: 12px; }
  .brand-mark { width: 48px; }
  .brand-mark .submarine { width: 47px; }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  .sound-button { width: 47px; padding: 0; justify-content: center; }
  .sound-button span:last-child { display: none; }
  .top-actions .quiet-button { padding: 0 12px; font-size: 13px; }
  .hero { border-radius: 26px; }
  .hero-copy { padding: 31px 23px 38px; }
  .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .hero-scene { min-height: 275px; }
  .hero-sub { top: 26%; left: 18%; width: 48%; }
  .hero-example { right: 10%; min-width: 105px; padding: 10px 12px; }
  .hero-treasure { right: 9%; font-size: 45px; }
  .hero-treasure span { left: 28px; font-size: 42px; }
  .how,
  .levels { padding: 37px 2px 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 10px; }
  .adult-note { margin-right: 2px; margin-left: 2px; padding: 17px; }
  .game-shell { padding: 16px; border-radius: 25px; }
  .game-head { align-items: center; }
  .game-head .eyebrow { font-size: 10px; }
  .game-head h1 { font-size: 25px; }
  .round-count strong { font-size: 29px; }
  .dive-scene { min-height: 350px; border-width: 3px; }
  .mission-panel { min-height: 410px; padding: 17px; }
  .feedback-card { align-items: flex-start; }
  .feedback-card .primary-button { width: 100%; margin-top: 10px; }
  .feedback-card.correct { flex-wrap: wrap; }
  .feedback-card.correct p { min-width: calc(100% - 70px); }
  .feedback-card.correct .primary-button { flex-basis: 100%; }
  .result-wrap { min-height: 600px; padding: 25px 10px; border-radius: 27px; }
  .result-card { padding: 25px 16px 28px; }
  .result-actions { flex-direction: column; }
  .result-actions > * { width: 100%; }
}

@media (max-width: 520px) {
  .level-card { display: flex; min-height: 320px; }
  .level-preview { width: 100%; min-height: 135px; height: 135px; }
  .level-status { align-self: auto; width: calc(100% - 36px); }
  .dive-status span { display: none; }
  .sub-runner { left: 26%; width: 47%; }
  .equation-board > div { gap: 8px; }
  .equation-board strong,
  .equation-board b { font-size: 43px; }
  .equation-board i { font-size: 28px; }
  .counting-hint > div { justify-content: flex-start; }
  .result-stats { gap: 5px; }
  .result-stats span { padding: 11px 4px; }
}

@media (max-width: 390px) {
  .app { width: calc(100% - 16px); }
  .top-actions .quiet-button { max-width: 90px; padding: 0 9px; font-size: 11px; }
  .primary-button { width: 100%; padding: 0 15px; }
  .hero-copy { padding-right: 18px; padding-left: 18px; }
  .hero h1 { font-size: 34px; }
  .hero-scene { min-height: 245px; }
  .how-grid article { padding: 15px; }
  .game-shell { padding: 12px; }
  .game-head h1 { font-size: 21px; }
  .round-count strong { font-size: 25px; }
  .progress-track { gap: 4px; margin: 14px 0; }
  .dive-scene { min-height: 320px; }
  .depth-scale { left: 10px; }
  .dive-status { top: 12px; right: 12px; }
  .mission-panel { min-height: 390px; padding: 12px; }
  .equation-board { padding: 17px 8px; }
  .sonar-option { min-height: 83px; }
  .feedback-card { padding: 12px; }
  .feedback-icon { width: 42px; height: 42px; }
  .result-treasure { height: 125px; }
  .result-treasure > b { font-size: 62px; }
  .result-stars { font-size: 34px; }
}

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