:root { font-family: 'Trebuchet MS', Arial, sans-serif; --background: #073f61; --foreground: #78d9d7; --cream: #fff1cc; }
* { box-sizing: border-box; }
body { margin: 0; background: #073f61; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ocean { position: relative; isolation: isolate; min-height: 100svh; height: 100dvh; min-height: 650px; overflow: hidden; background: var(--background); color: var(--cream); transition: background-color 1.8s; }
#current { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .76; }
#current canvas { width: 100%; height: 100%; display: block; }
.topbar { position: absolute; inset: 0 0 auto; padding: 24px 32px; z-index: 4; pointer-events: none; }
.topbar a, .topbar select { pointer-events: auto; }
.wordmark { text-shadow: 0 2px 14px var(--background); }
.wordmark > span { font-size: 13px; letter-spacing: .02em; }
h1 { font-size: 27px; letter-spacing: -.8px; margin: 2px 0 0; }
.little-star { display: inline-block; color: #ffc785; margin-left: 8px; }
.dive-picker { position: relative; display: flex; align-items: center; gap: 12px; font-size: 12px; }
.dive-picker > span { text-shadow: 0 1px 8px var(--background); }
.dive-picker::after { content: ''; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select { appearance: none; -webkit-appearance: none; min-height: 48px; padding: 10px 42px 10px 18px; border: 1px solid #b9e9df66; border-radius: 30px; color: var(--cream); background: var(--background); cursor: pointer; font-size: 14px; }
option { background: #073f61; color: #fff1cc; }
#waters { position: absolute; inset: 120px 50px 218px; z-index: 2; touch-action: none; }
.treasure { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--cream); opacity: 0; transform: scale(.65); transition: opacity .35s, transform .55s; pointer-events: none; cursor: pointer; }
.treasure.revealed { opacity: 1; transform: scale(1); pointer-events: auto; }
.treasure .sprite { width: 100%; height: 100%; filter: drop-shadow(0 9px 15px #001b3766); animation: float 4s ease-in-out infinite; }
.sprite { display: block; background-image: url('./assets/treasures.png'); background-size: 300% 300%; background-repeat: no-repeat; }
.treasure.collected { opacity: 0; transform: scale(1.65); pointer-events: none; }
.treasure:focus-visible { opacity: 1; transform: scale(1); outline: 2px dashed var(--cream); outline-offset: 8px; }
.welcome { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; width: 90%; z-index: 1; transition: opacity .9s; text-shadow: 0 3px 24px var(--background); }
.welcome p { font-family: Georgia, serif; font-size: clamp(40px, 5.6vw, 76px); line-height: 1.03; font-weight: normal; letter-spacing: -2px; margin: 17px 0 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: 10px; font-weight: bold; }
.welcome > span:last-child { font-size: 15px; }
.ocean.exploring .welcome { opacity: 0; }
#brush { position: absolute; z-index: 1; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 1px solid #c7fbec50; border-radius: 50%; background: radial-gradient(circle, #c0f9e619, transparent 70%); pointer-events: none; opacity: 0; transition: opacity .3s; display: grid; place-items: center; }
#brush span { font-size: 18px; opacity: .55; }
#brush.visible { opacity: 1; }
.controls { position: absolute; z-index: 4; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); padding: 12px 22px max(20px, env(safe-area-inset-bottom)); }
.hunt-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
#instruction { margin: 0; font-size: 14px; text-shadow: 0 2px 10px var(--background); }
#progress { white-space: nowrap; font-size: 26px; font-family: Georgia, serif; }
#progress span { font-family: 'Trebuchet MS', sans-serif; font-size: 13px; color: #a6d9d0; }
#checklist { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.check-item { position: relative; border: 1px solid #b9e9df4d; border-radius: 18px; background: color-mix(in srgb, var(--background) 90%, transparent); padding: 7px 4px 10px; display: flex; align-items: center; flex-direction: column; gap: 1px; transition: background .3s, border-color .3s; }
.check-item .sprite { width: 53px; height: 53px; }
.check-item .name { font-size: 11px; text-align: center; }
.check-item .check { position: absolute; right: 8px; top: 6px; font-size: 14px; color: #073f61; }
.check-item.found { color: #073f61; background: #bee8ce; border-color: #bee8ce; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
button { color: var(--cream); background: var(--background); border: 1px solid #b9e9df66; border-radius: 30px; padding: 10px 16px; min-height: 44px; font-size: 13px; cursor: pointer; }
button:hover { border-color: var(--cream); }
button:focus-visible, select:focus-visible { outline: 3px solid #ffe0a4; outline-offset: 4px; }
button:disabled { opacity: .5; cursor: default; }
#new-dive { margin-left: auto; }
#dive-note { font-size: 10px; color: #bde4d9; text-align: center; text-shadow: 0 2px 10px var(--background); }
#find-pop { position: absolute; z-index: 5; pointer-events: none; font-size: 18px; color: #ffe0a4; text-align: center; transform: translate(-50%,-50%); }
#find-pop.pop { animation: found-pop 1.2s both; }
.celebration { position: absolute; z-index: 6; top: 47%; left: 50%; transform: translate(-50%,-50%); width: min(520px, calc(100% - 36px)); padding: 36px 26px; border-radius: 32px; background: color-mix(in srgb, var(--background) 95%, transparent); border: 1px solid #b9e9df66; text-align: center; box-shadow: 0 20px 80px #00152755; }
.celebration h2 { font: 38px/1.1 Georgia, serif; margin: 16px 0; letter-spacing: -1px; }
.celebration p { font-size: 14px; line-height: 1.5; max-width: 350px; margin: 12px auto 22px; }
.celebration button { background: #fff1cc; color: #073f61; font-weight: bold; padding: 12px 24px; }
#collected { display: flex; justify-content: center; }
#collected .sprite { width: 65px; height: 65px; }
.noscript { position: relative; z-index: 10; padding: 30px; }
@keyframes float { 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes found-pop { 0% { opacity: 0; margin-top: 0; } 20% { opacity: 1; } 100% { opacity: 0; margin-top: -70px; } }
@media (max-width: 700px) {
  .ocean { min-height: 720px; }
  .topbar { padding: 18px 20px; }
  h1 { font-size: 23px; }
  .dive-picker { justify-content: space-between; margin-top: 10px; }
  .dive-picker select { min-width: 190px; }
  #waters { inset: 185px 25px 242px; }
  .treasure { width: 82px; height: 82px; margin: -41px 0 0 -41px; }
  .welcome { top: 44%; }
  .welcome p { font-size: 43px; }
  .controls { padding-left: 14px; padding-right: 14px; }
  #checklist { gap: 5px; } .check-item { border-radius: 13px; } .check-item .sprite { width: 45px; height: 45px; } .check-item .name { font-size: 9px; }
  #instruction { font-size: 12px; } #dive-note { display: none; }
  #collected .sprite { width: 52px; height: 52px; }
  .celebration h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
