:root {
  color-scheme:light;
  --ink:#153e55;
  --muted:#476778;
  --gold:#ffe088;
  --green:#8fe0a8;
  --red:#ff8f8f;
  --deep:#042b43;
  font:500 16px/1.55 system-ui,-apple-system,'Segoe UI',sans-serif;
  background:#eef7fc;
  color:var(--ink)
}
* {
  box-sizing:border-box
}
html {
  min-height:100%;
  scroll-behavior:smooth
}
body {
  margin:0;
  background:linear-gradient(180deg,#f2fbff 0,#dceff9 55%,#edf7fc 100%);
  min-height:100vh
}
button,input,select {
  font:inherit
}
button,a,input,select {
  -webkit-tap-highlight-color:transparent
}
button {
  border:1px solid transparent;
  border-radius:10px;
  padding:11px 19px;
  background:var(--gold);
  color:#172e3b;
  font-weight:750;
  cursor:pointer;
  min-height:46px;
  transition:background .15s,transform .15s
}
button:hover {
  background:#ffedb7
}
button:active {
  transform:translateY(1px)
}
button:disabled {
  opacity:.55;
  cursor:default
}
button.secondary {
  background:#124e69;
  color:#f4fcff;
  border-color:#80b9cd
}
button.secondary:hover {
  background:#20617b
}
.text-button {
  background:transparent;
  color:#125c7d;
  text-decoration:underline;
  text-underline-offset:4px
}
.text-button:hover {
  background:#145a7a0c
}
a {
  color:#145a7a;
  text-underline-offset:4px
}
a:hover {
  color:#073e5a
}
:focus-visible {
  outline:3px solid #946400;
  outline-offset:4px
}
[hidden] {
  display:none!important
}
.about-link {
  display:block;
  width:fit-content;
  margin:8px 0 0 auto;
  font-size:14px;
  text-decoration:none
}
.site-app {
  max-width:1264px;
  padding:0 28px;
  margin:auto
}
h1,h2,h3,p {
  margin:0 0 16px
}
h1,h2,h3 {
  line-height:1.15
}
h2 {
  font-size:clamp(22px,3vw,30px)
}
h3 {
  font-size:19px
}
.game-shell.is-welcome .stage {
  height:auto;
  min-height:440px
}
.game-shell.is-welcome canvas {
  position:absolute;
  inset:0
}
.game-shell.is-welcome .score-row,
.game-shell.is-welcome .hud,
.game-shell.is-welcome .toolbar,
.game-shell.is-welcome .touch-controls,
.game-shell.is-welcome .game-tip {
  display:none
}
.welcome {
  position:relative;
  z-index:5;
  min-height:inherit;
  display:grid;
  place-items:start center;
  padding:12px 24px 24px;
  color:var(--ink);
  background:#073a5426
}
.welcome-panel {
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);
  gap:24px;
  align-items:center;
  width:100%;
  padding:20px 28px 28px;
  border:1px solid #ffffffcc;
  border-radius:16px;
  background:#f5fbfff2;
  backdrop-filter:blur(8px);
  box-shadow:0 14px 40px #032d4c38;
  animation:arrive .35s ease-out
}
.eyebrow {
  font-size:18px;
  letter-spacing:normal;
  color:#126487;
  margin-bottom:14px
}
.welcome h1 {
  font-size:clamp(34px,4.2vw,58px);
  font-weight:850;
  letter-spacing:-2px;
  line-height:1.02;
  margin:0 0 16px
}
.welcome h1 span {
  color:#096c91
}
.intro-text {
  font-size:19px;
  line-height:1.5
}
.welcome-copy>p:not(.eyebrow) {
  max-width:560px
}
.welcome-copy>p:not(.intro-text):not(.eyebrow) {
  color:var(--muted)
}
.actions {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 12px
}
.actions .primary {
  padding:14px 26px
}
.intro-detail {
  font-size:13px;
  margin-bottom:0
}
.welcome-art {
  width:min(100%,360px);
  justify-self:center;
  height:auto;
  filter:drop-shadow(0 18px 20px #5e91ad38)
}
.dive-info {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  align-items:start;
  gap:40px;
  margin:24px 0 36px
}
.tier-panel {
  border-top:1px solid #37678333;
  padding-top:25px;
  min-width:0
}
.tier-panel h2 {
  font-size:23px;
  margin:0 0 12px
}
.tier-guide {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:0
}
.tier {
  display:flex;
  align-items:center;
  gap:14px;
  padding:22px 0
}
.tier img {
  width:78px;
  height:55px;
  object-fit:contain
}
.tier strong,.tier small {
  display:block
}
.tier small {
  color:var(--muted);
  font-size:14px
}
.play-screen {
  padding-top:8px;
  animation:arrive .35s ease-out
}
.score-row {
  display:flex;
  align-items:center;
  gap:20px;
  justify-content:space-between;
  margin:0 0 12px
}
.score-row h1 {
  font-size:clamp(22px,3vw,31px);
  margin:0;
  letter-spacing:-.7px
}
.meters {
  display:flex;
  gap:32px;
  margin:0;
  text-align:right
}
.meters dt {
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.7px
}
.meters dd {
  font-size:25px;
  font-weight:800;
  margin:0;
  font-variant-numeric:tabular-nums
}
.stage {
  color:#effbff;
  width:100%;
  height:clamp(330px,48vw,550px);
  position:relative;
  border:1px solid #90d3ed80;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 16px 44px #356c8f35;
  background:linear-gradient(#5ac9ec,#126a98 50%,#052a50)
}
canvas {
  display:block;
  width:100%;
  height:100%;
  touch-action:pan-y
}
#game:focus,#game:focus-visible {
  outline:none
}
.diver-sprite {
  position:absolute;
  z-index:1;
  pointer-events:none;
  user-select:none;
  max-width:none;
  transform-origin:center
}
.stage :focus-visible,.dialog-shell :focus-visible {
  outline-color:var(--gold)
}
.hud {
  z-index:3;
  position:absolute;
  top:14px;
  left:16px;
  right:16px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  pointer-events:none;
  font-size:13px;
  font-weight:750
}
.hud span {
  padding:5px 10px;
  border-radius:6px;
  background:#032b48e8;
  border:1px solid #bde9ff80
}
.hud #hudShield {
  color:#b3f4c9;
  border-color:#8fe0a8
}
.hud #hudRecovery {
  color:#ffe8ab
}
.stage-message {
  z-index:4;
  position:absolute;
  inset:0;
  background:#03273cb8;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  padding:22px;
  text-align:center;
  backdrop-filter:blur(3px)
}
.stage-message h2 {
  margin-bottom:10px
}
.stage-message p {
  max-width:560px
}
.stage-message button {
  margin:5px
}
.stage-message>div {
  max-height:100%;
  overflow:auto;
  padding:5px 8px
}
.countdown {
  background:#03273c45;
  pointer-events:none
}
.countdown>span {
  font-size:110px;
  line-height:1.1;
  font-weight:850
}
.short-controls {
  font-size:14px;
  color:#c9e7f5
}
.game-notice {
  z-index:3;
  position:absolute;
  left:12px;
  bottom:12px;
  max-width:calc(100% - 24px);
  padding:5px 10px;
  background:#042638e8;
  border-radius:6px;
  font-size:14px;
  pointer-events:none;
  margin:0
}
.game-notice.hit-notice {
  background:#5c2635;
  border:1px solid #ffb4b4;
  color:#ffe6e6;
  font-weight:750
}
.game-notice:empty {
  display:none
}
.toolbar {
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin:20px 0 10px
}
.game-tip {
  text-align:center;
  font-size:13px;
  color:var(--muted);
  margin:12px 0 28px
}
.touch-controls {
  display:flex;
  gap:30px;
  align-items:center;
  justify-content:center;
  margin:18px 0
}
.dpad {
  display:grid;
  grid-template-columns:repeat(3,52px);
  grid-template-rows:repeat(2,48px);
  gap:5px
}
.dpad button {
  padding:4px;
  font-size:22px;
  touch-action:none;
  user-select:none;
  background:#184e67;
  color:white;
  border-color:#73b3cc
}
.dpad [data-move=up] {
  grid-column:2
}
.dpad [data-move=left] {
  grid-column:1;
  grid-row:2
}
.dpad [data-move=down] {
  grid-column:2;
  grid-row:2
}
.dpad [data-move=right] {
  grid-column:3;
  grid-row:2
}
#touchFire {
  min-width:95px;
  min-height:70px;
  touch-action:none;
  user-select:none
}
.leaderboard {
  min-width:0;
  margin:0;
  border-top:1px solid #37678333;
  padding-top:25px
}
.board-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap
}
.board-heading h2 {
  font-size:23px;
  margin:0
}
.board-heading label {
  font-size:13px;
  color:var(--muted)
}
select {
  margin-left:8px;
  padding:7px;
  border:1px solid #80afc7;
  border-radius:6px;
  background:#093851;
  color:white
}
#boardNote,#boardStatus {
  font-size:14px;
  color:var(--muted);
  margin:12px 0
}
.board-list {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:0;
  padding:0;
  list-style:none;
  counter-reset:rank
}
.board-list li {
  counter-increment:rank;
  display:flex;
  align-items:center;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid #37678326;
  font-size:14px
}
.board-list li:before {
  content:counter(rank,decimal-leading-zero);
  color:#4f7185;
  font-variant-numeric:tabular-nums
}
.board-list li strong {
  margin-left:auto;
  color:#855300
}
.board-list li span {
  overflow-wrap:anywhere
}
footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  border-top:1px solid #37678333;
  padding:22px 0 30px;
  font-size:12px;
  color:var(--muted)
}
footer nav {
  display:flex;
  gap:16px
}
.dialog-shell {
  position:fixed;
  z-index:20;
  inset:0;
  background:#0014219c;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  backdrop-filter:blur(5px)
}
.dialog {
  color:#effbff;
  color-scheme:dark;
  width:min(100%,680px);
  max-height:calc(100dvh - 32px);
  display:flex;
  flex-direction:column;
  background:linear-gradient(145deg,#073e55ee,#062c43f5);
  border:1px solid #abdbed6b;
  box-shadow:0 24px 90px #001725b0;
  border-radius:16px;
  overflow:hidden
}
.dialog .text-button {
  color:#d4edf7
}
.dialog .text-button:hover {
  background:#ffffff12
}
.dialog-scroll {
  padding:25px 27px 12px;
  overflow-y:auto;
  overscroll-behavior:contain;
  min-height:0;
  scroll-padding:12px
}
.dialog-actions {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  flex-shrink:0;
  padding:15px 27px;
  border-top:1px solid #ffffff26;
  background:#052c40
}
.dialog-eyebrow {
  color:#9ee9ff;
  font-size:13px;
  font-weight:750;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px
}
.clock-paused {
  color:#ceebf7;
  font-weight:500;
  font-size:12px;
  white-space:nowrap
}
.reward {
  font-size:14px;
  color:#ffe6a1
}
.question-panel {
  max-height:min(calc(100dvh - 32px),var(--question-max-height,700px))
}
.question-panel h2 {
  font-size:clamp(20px,2.5vw,26px);
  line-height:1.3
}
.options {
  display:grid;
  gap:9px
}
.option {
  text-align:left;
  padding:13px 15px;
  background:#154b63;
  border:1px solid #90bdd580;
  color:#f4fcff;
  box-shadow:none;
  font-weight:500;
  width:100%;
  line-height:1.4
}
.option:hover {
  background:#215e76
}
.option[aria-checked=true] {
  border-color:var(--gold);
  box-shadow:inset 0 0 0 1px var(--gold);
  background:#2a5968
}
.option:disabled {
  opacity:1;
  cursor:default
}
.option.correct {
  border-color:var(--green);
  color:var(--green)
}
.option.incorrect {
  border-color:var(--red);
  color:var(--red)
}
.answer-label {
  display:block;
  font-weight:750;
  margin-top:4px
}
.feedback {
  border-left:4px solid var(--green);
  padding:5px 0 2px 16px;
  margin:18px 0 6px
}
.feedback.incorrect {
  border-color:var(--red)
}
.feedback h3 {
  margin:0 0 9px;
  font-size:22px
}
.feedback p {
  margin-bottom:10px
}
.feedback #explanation {
  color:var(--green)
}
.feedback.incorrect #explanation {
  color:var(--red)
}
#correctAnswer {
  font-weight:650;
  font-size:14px
}
#pointsEarned {
  font-size:14px
}
.bank-notice {
  color:#ccefff;
  font-size:13px
}
#answerValidation {
  font-size:14px;
  color:#ffdc98;
  margin:10px 0 0
}
.help-tiers {
  font-size:14px;
  color:#ffe6a1;
  margin-bottom:18px
}
.help-tiers strong {
  display:block;
  margin:5px 0
}
.results-panel {
  width:min(100%,920px);
  color:var(--ink);
  color-scheme:light;
  background:linear-gradient(145deg,#f7fcfff7,#e1f0faf5);
  border-color:#ffffffcc;
  box-shadow:0 14px 40px #032d4c38
}
.results-panel .dialog-eyebrow {
  color:#126487
}
.dialog.results-panel .text-button {
  color:#125c7d
}
.dialog.results-panel .text-button:hover {
  background:#145a7a0c
}
.results-panel :focus-visible {
  outline-color:#946400
}
.results-panel .final-score {
  color:#096c91
}
.results-panel input {
  background:#fff;
  border-color:#7296aa
}
.results-layout {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  grid-template-areas:"summary entry" "actions entry";
  align-items:start;
  gap:20px 30px;
  padding:24px 26px 18px
}
.results-summary {
  grid-area:summary;
  min-width:0
}
.results-summary #finalBest {
  margin-bottom:0;
  color:var(--muted);
  font-size:14px
}
.results-entry {
  grid-area:entry;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:16px;
  border-left:1px solid #37678333;
  padding-left:26px
}
#resultsDialog .results-actions {
  grid-area:actions;
  align-self:start;
  background:transparent;
  border-top:0;
  padding:0;
  gap:10px
}
.final-score {
  display:flex;
  align-items:baseline;
  gap:10px;
  color:var(--gold)
}
.final-score>span:first-child {
  font-size:65px;
  font-weight:850;
  line-height:1.2;
  font-variant-numeric:tabular-nums
}
#saveForm {
  display:grid;
  gap:8px;
  margin:0
}
#saveForm h3 {
  font-size:22px
}
#saveForm h3,#saveForm p {
  margin:0
}
#saveForm p,#saveForm label {
  font-size:14px;
  color:var(--muted)
}
input {
  width:100%;
  background:#f4fbff;
  color:#123044;
  border:1px solid #9ccddf;
  border-radius:8px;
  padding:10px 12px;
  min-height:46px
}
#saveStatus {
  min-height:0
}
.noscript {
  padding:30px;
  text-align:center
}
@keyframes arrive {
  from {
    opacity:0;
    transform:translateY(8px)
  }
  to {
    opacity:1;
    transform:none
  }
}
@media(pointer:fine) and (min-width:800px) {
  .touch-controls {
    display:none
  }
}
@media(max-width:700px) {
  .results-layout {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"summary" "entry" "actions";
    gap:20px
  }
  .results-entry {
    border-left:0;
    border-top:1px solid #37678333;
    padding-left:0;
    padding-top:18px
  }

  .site-app {
    padding:0 16px
  }
  .game-shell.is-welcome .stage {
    min-height:0
  }
  .welcome {
    padding:8px 12px 12px
  }
  .welcome-panel {
    grid-template-columns:minmax(0,1fr);
    gap:14px;
    padding:16px 18px 18px
  }
  .welcome-art {
    width:160px
  }
  .welcome h1 {
    font-size:34px
  }
  .intro-text {
    font-size:18px
  }
  .dive-info {
    grid-template-columns:minmax(0,1fr);
    gap:28px
  }
  .tier {
    gap:14px;
    padding:16px 0
  }
  .tier img {
    width:65px;
    height:45px
  }
  .tier strong {
    font-size:16px
  }
  .tier small {
    font-size:14px
  }
  .score-row {
    gap:14px;
    align-items:flex-start;
    flex-wrap:wrap
  }
  .score-row h1 {
    font-size:24px
  }
  .meters {
    width:100%;
    justify-content:space-between;
    text-align:left;
    gap:24px
  }
  .meters>div {
    display:flex;
    gap:12px;
    align-items:baseline
  }
  .meters dd {
    font-size:22px
  }
  .stage {
    height:360px;
    border-radius:12px
  }
  .hud {
    left:10px;
    top:10px;
    gap:5px;
    font-size:12px
  }
  .hud span {
    padding:4px 7px
  }
  .toolbar button {
    font-size:14px;
    padding:9px 12px
  }
  .board-list {
    grid-template-columns:1fr
  }
  .dialog .text-button {
  color:#d4edf7
}
.dialog .text-button:hover {
  background:#ffffff12
}
.dialog-scroll {
    padding:20px 18px 10px
  }
  .dialog-actions {
    padding:12px 18px;
    gap:8px
  }
  .dialog-actions button {
    font-size:14px;
    padding:10px 12px
  }
  .dialog-shell {
    padding:10px
  }
  .dialog {
    max-height:calc(100dvh - 20px)
  }
  .question-panel {
    max-height:min(calc(100dvh - 20px),var(--question-max-height,700px))
  }
  .question-panel h2 {
    font-size:20px
  }
  footer {
    flex-direction:column;
    align-items:flex-start;
    gap:12px
  }
  .stage-message {
    padding:12px
  }
  .short-controls {
    font-size:12px
  }
  .board-heading {
    align-items:flex-start
  }
}
@media(max-height:480px) {
  .dialog-shell {
    padding:8px
  }
  .dialog,.question-panel {
    max-height:calc(100dvh - 16px)
  }
  .dialog .text-button {
  color:#d4edf7
}
.dialog .text-button:hover {
  background:#ffffff12
}
.dialog-scroll {
    padding:12px 16px
  }
  .dialog-actions {
    padding:9px 16px
  }
  .dialog-eyebrow {
    margin-bottom:8px
  }
  .question-panel h2 {
    font-size:19px
  }
  .stage {
    height:330px
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto
  }
  *,*:before,*:after {
    animation:none!important;
    transition:none!important
  }
}
