:root {
  color-scheme: dark;
  --bg: #071725;
  --panel: #0d2233;
  --ink: #fff6e6;
  --muted: #b4cbd4;
  --sun: #ffcd78;
  --sun-deep: #ffb84f;
  --aqua: #87e2da;
  --line: #c2e7fa29;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 55% 0%, #102b3e, transparent 63%), var(--bg);
  color: var(--ink);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 4px; }
.shell { width: min(1180px, calc(100% - 68px)); margin: auto; }
.masthead { min-height: 87px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mast-actions { display: flex; align-items: center; gap: 9px; }
.brand { display: inline-flex; justify-content: center; flex-shrink: 0; }
.brand img { width: 153px; height: 68px; object-fit: contain; }
.quiet {
  min-height: 44px; border: 1px solid var(--line); background: #102739;
  border-radius: 11px; padding: 0 14px; font-size: .875rem; font-weight: 700;
}
.quiet:hover { background: #1d3949; }
.sound { display: inline-flex; align-items: center; gap: 7px; }
.sound-symbol { font-size: 1.13rem; color: var(--aqua); }
.stage {
  overflow: hidden; isolation: isolate; position: relative; border-radius: 24px;
  box-shadow: 0 24px 80px #0005; border: 1px solid #8ccdea45; background: #102745;
}
.intro { min-height: 525px; display: grid; align-items: center; position: relative; isolation: isolate; }
.intro::before, .result-art {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: #144d67 url('assets/baby-whale-dusk.webp') 60% 48% / cover no-repeat;
}
.intro::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #08182df5 0%, #091b30d9 23%, #091b3054 54%, transparent 75%),
              linear-gradient(0deg, #07182d77, transparent 25%);
}
.intro-copy { padding: 51px clamp(28px, 5vw, 70px); position: relative; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; color: var(--aqua);
  font-weight: 800; font-size: .85rem; line-height: 1.2; letter-spacing: .13em; text-transform: uppercase;
}
.wave-mark { font-size: 1.65rem; line-height: .65; margin-right: 2px; }
h1, h2 { margin: 0; letter-spacing: -.058em; font-weight: 900; }
h1 {
  font-size: clamp(3.55rem, 7.1vw, 6.55rem); line-height: .92; margin: 19px 0 23px;
  text-shadow: 0 3px 18px #08162d50;
}
h1 span { display: block; color: var(--sun); }
.intro-description { max-width: 330px; font-size: 1.12rem; line-height: 1.55; margin: 0 0 23px; color: #e8f4fa; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 49px;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 20px;
  font-size: 1rem; line-height: 1.25; font-weight: 830; text-align: center;
}
.button-sun { background: var(--sun); color: #142132; box-shadow: 0 4px 0 #e59644; }
.button-sun:hover { background: #ffdd9e; }
.button-sun:active { box-shadow: 0 2px 0 #e59644; transform: translateY(2px); }
.button-glass { background: #16384d; border-color: #8bb8ca61; color: var(--ink); }
.button-glass:hover { background: #214b60; }
.start { min-width: 205px; }
.play-icon {
  width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor; margin-right: 2px;
}
.intro-meta { display: flex; gap: 9px; align-items: center; margin-top: 17px; color: #d1e4ef; font-size: .875rem; }
.challenge { color: var(--sun); font-weight: 700; margin: -6px 0 17px; }
.best-tag {
  display: flex; align-items: center; gap: 11px; position: absolute; bottom: 22px; right: 22px;
  background: #071b2ace; border: 1px solid #a4d6e36b; border-radius: 12px;
  padding: 7px 12px; font-size: .875rem; color: #e0eff8;
}
.best-tag strong { color: var(--sun); font-size: 1.08rem; }
.beyond { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 17px; }
.link-card {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 14px;
  min-height: 94px; padding: 15px 20px; border: 1px solid var(--line); border-radius: 15px; background: #0d2538;
}
.link-card:hover { border-color: #93e1de8c; }
.tracker-card { background: radial-gradient(ellipse at 100% 90%, #164250, transparent 75%), #0d2538; }
.tour-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #102739 53%, #10273945), url('assets/maui-humpback-whale-breaching.webp') right 45% / auto 260% no-repeat;
}
.card-icon {
  border: 1px solid #94e2db38; border-radius: 11px; width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center; color: var(--aqua); background: #1b3e4f; font-weight: 750; font-size: 1.55rem; line-height: 1;
}
.tour-card .card-icon { color: var(--sun); }
.link-card strong { display: block; font-size: 1.12rem; line-height: 1.3; }
.card-caption { display: block; margin-top: 3px; color: #c3d7e0; font-size: .875rem; line-height: 1.4; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 19px 2px 23px; color: var(--muted); font-size: .8125rem; }
.private-label { white-space: nowrap; }

.play-screen { background: #0a2137; }
.hud {
  min-height: 72px; display: grid; align-items: center; grid-template-columns: 1fr minmax(120px, 260px) 1fr auto;
  gap: 17px; padding: 9px 19px; border-bottom: 1px solid var(--line);
}
.hud-stat span { display: block; color: var(--muted); font-size: .875rem; }
.hud-stat strong { display: block; font-size: 1.57rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hud-time { text-align: right; }
.hud-course { text-align: center; color: var(--aqua); font-size: .95rem; font-weight: 780; }
.course-track { background: #254560; height: 5px; border-radius: 9px; margin-top: 7px; overflow: hidden; }
.course-track i { display: block; width: 100%; height: 100%; background: var(--aqua); transform: scaleX(0); transform-origin: left; }
.pause { min-width: 44px; padding: 0 9px; display: grid; place-items: center; }
.pause span { height: 13px; width: 10px; border-inline: 3px solid currentColor; border-radius: 1px; }
.water { position: relative; height: clamp(340px, 48vw, 454px); background: #155376; }
#sea { display: block; width: 100%; height: 100%; touch-action: none; }
#sea:focus-visible { outline-offset: -4px; }
.announcement, .streak {
  position: absolute; pointer-events: none; left: 50%; translate: -50% 0; text-align: center;
  font-weight: 810;
}
.announcement {
  top: 20px; width: max-content; max-width: calc(100% - 26px); font-size: 1rem;
  color: #f1faff; background: #071d36e8; border: 1px solid #b9e9ec6a; border-radius: 100px; padding: 8px 17px;
}
.announcement:empty { display: none; }
.streak { bottom: 15px; color: #17243b; background: var(--sun); border-radius: 100px; padding: 5px 12px; }
.game-bar {
  min-height: 59px; display: flex; align-items: center; gap: 15px; padding: 6px 19px;
  justify-content: space-between; color: var(--muted); font-size: .875rem;
}
.touch-buttons { display: flex; gap: 7px; }
.touch-buttons button { min-width: 46px; padding: 0; touch-action: none; font-size: 1.2rem; }
.pause-layer { position: absolute; inset: 0; display: grid; place-items: center; background: #071827ad; }
.pause-card { display: grid; justify-items: center; gap: 15px; padding: 25px; text-align: center; }
.pause-card h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
.result { min-height: 540px; position: relative; display: grid; align-items: center; isolation: isolate; }
.result-art { background-position: 68% 46%; }
.result::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #061729fa 9%, #081b2ee0 38%, #0a213a3b 82%); }
.result-content { padding: 42px clamp(25px, 5vw, 64px); max-width: 620px; }
.result h2 { font-size: clamp(2.7rem, 5vw, 4.35rem); line-height: .98; margin: 12px 0 11px; }
.result-summary { margin: 0; color: #d2e4eb; font-size: 1rem; line-height: 1.45; }
.totals { display: flex; flex-wrap: wrap; gap: 25px; margin: 17px 0 22px; }
.totals dt { color: var(--muted); font-size: .875rem; }
.totals dd { margin: 0; color: var(--sun); font-weight: 900; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-status { font-size: .875rem; color: var(--aqua); margin: 11px 0 0; }
.share-status:empty { display: none; }
.reward { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid #ffcd785d; border-radius: 12px; background: #10283cea; margin-top: 22px; }
.reward-symbol { color: var(--sun); font-size: 1.4rem; line-height: 1; }
.reward strong { line-height: 1.25; }
.reward p { margin: 3px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.reward .quiet { display: block; margin-top: 8px; }
.text-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--aqua); font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; font-weight: 750; }
dialog { max-width: min(460px, calc(100% - 32px)); border: 1px solid #82d5d989; background: #0d2639; color: var(--ink); padding: 0; border-radius: 18px; }
dialog::backdrop { background: #03111ac7; }
.dialog-inner { padding: 25px; }
.dialog-inner h2 { margin-top: 9px; font-size: 2.35rem; line-height: 1.1; }
.help-list div + div { margin-top: 13px; }
.help-list dt { font-weight: 800; }
.help-list dd { margin: 3px 0 0; color: #d2e4ed; line-height: 1.5; }
.noscript { padding: 16px; }

@media (max-width: 710px) {
  .shell { width: calc(100% - 28px); }
  .masthead { min-height: 68px; }
  .brand img { width: 117px; height: 56px; }
  .mast-actions { gap: 6px; }
  .quiet { padding-inline: 10px; }
  .sound { justify-content: center; min-width: 44px; }
  #sound-label { display: none; }
  .stage { border-radius: 19px; }
  .intro { min-height: min(626px, max(475px, calc(100svh - 110px))); align-items: end; }
  .intro::before { background-position: 67% 20%; background-size: auto 105%; }
  .intro::after {
    background: linear-gradient(0deg, #071b30 3%, #071b30f5 23%, #071b30ac 44%, #071b301a 70%, transparent 100%);
  }
  .intro-copy { padding: 22px max(18px, 5.2vw) 30px; }
  h1 { font-size: clamp(2.85rem, 10vw, 4.85rem); margin: 12px 0 13px; }
  .intro-description { font-size: 1rem; line-height: 1.45; margin-bottom: 17px; max-width: 290px; }
  .intro-meta { margin-top: 12px; }
  .best-tag { top: 12px; bottom: auto; right: 12px; }
  .beyond { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
  .link-card { padding: 10px 12px; min-height: 71px; gap: 11px; }
  .link-card strong { font-size: 1.05rem; }
  footer { padding-top: 14px; font-size: .75rem; }
  .hud { grid-template-columns: minmax(48px, 1fr) minmax(85px, 2fr) minmax(42px, .8fr) auto; gap: 8px; padding-inline: 10px; min-height: 64px; }
  .hud-course { font-size: .875rem; line-height: 1.15; }
  .hud-stat strong { font-size: 1.26rem; }
  .water { height: clamp(274px, calc(100svh - 240px), 470px); }
  .game-bar { min-height: 58px; padding-inline: 10px; gap: 6px; }
  #steering-hint { display: none; }
  .result-content { padding: 122px 18px 23px; }
  .result-art { background-size: auto 86%; background-position: 65% top; }
  .result::after { background: linear-gradient(0deg, #081d30 13%, #081d30ed 46%, #081d30b5 66%, #081d300a); }
  .totals { gap: 17px; }
}
@media (max-width: 350px) {
  .shell { width: calc(100% - 18px); }
  .brand img { width: 102px; }
  .intro-copy { padding-inline: 15px; }
  .intro-description { max-width: 245px; }
}
@media (max-height: 465px) and (orientation: landscape) {
  .masthead { min-height: 53px; }
  .brand img { height: 47px; }
  .water { height: max(170px, calc(100svh - 165px)); }
  .hud { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
