* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #04101c;
  font-family: system-ui, 'Segoe UI', sans-serif;
  color: #cfe8f5;
  user-select: none;
  -webkit-user-select: none;
}

canvas#sea { position: fixed; inset: 0; display: block; touch-action: none; }

.hidden { display: none !important; }

/* ---- HUD ---- */
#hud {
  position: fixed; top: 18px; left: 22px;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}
#depthVal { font-size: 28px; font-weight: 200; letter-spacing: 2px; }
#zoneName {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  opacity: .7; margin-top: 2px;
}

#topBtns { position: fixed; top: 14px; right: 16px; display: flex; gap: 8px; z-index: 3; }
#topBtns button {
  background: rgba(10, 30, 50, .45);
  border: 1px solid rgba(160, 220, 255, .25);
  color: #cfe8f5;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 14px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s;
}
#topBtns button:hover { background: rgba(30, 70, 110, .6); }

/* ---- zone announcement ---- */
#zoneCard {
  position: fixed; top: 26%; left: 0; right: 0;
  text-align: center; pointer-events: none;
  animation: zonecard 4.5s ease forwards;
}
#zoneCardDepth { font-size: 13px; letter-spacing: 4px; opacity: .75; }
#zoneCardName {
  font-size: clamp(22px, 5vw, 36px); font-weight: 200;
  letter-spacing: 10px; text-transform: uppercase; margin-top: 6px;
  text-shadow: 0 0 30px rgba(120, 200, 255, .4);
}
@keyframes zonecard {
  0% { opacity: 0; transform: translateY(14px); }
  12% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- toasts ---- */
#toasts {
  position: fixed; bottom: 86px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(8, 24, 42, .72);
  border: 1px solid rgba(140, 220, 255, .35);
  padding: 10px 22px; border-radius: 999px;
  font-size: 14px; letter-spacing: 1px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 24px rgba(80, 180, 255, .15);
  animation: toast 4s ease forwards;
}
@keyframes toast {
  0% { opacity: 0; transform: translateY(12px); }
  10% { opacity: 1; transform: none; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

#hintBar {
  position: fixed; bottom: 26px; left: 0; right: 0;
  text-align: center; font-size: 13px; letter-spacing: 2px;
  opacity: .65; pointer-events: none;
  transition: opacity 1.5s;
}

/* ---- title screen ---- */
#titleScreen {
  position: fixed; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  background: radial-gradient(ellipse at 50% 120%, rgba(6, 30, 60, .4), rgba(2, 8, 18, .75));
}
#titleScreen h1 {
  font-size: clamp(64px, 14vw, 120px);
  font-weight: 100; letter-spacing: 26px; text-indent: 26px;
  color: #e6f6ff;
  text-shadow: 0 0 60px rgba(90, 190, 255, .5);
}
.tagline { letter-spacing: 6px; text-transform: uppercase; font-size: 13px; opacity: .7; }
#bestVal { font-size: 13px; letter-spacing: 2px; min-height: 18px; color: #9fdcff; opacity: .85; }
#diveBtn {
  margin-top: 10px;
  font-size: 17px; letter-spacing: 5px;
  padding: 14px 46px; border-radius: 999px;
  border: 1px solid rgba(150, 220, 255, .5);
  background: rgba(20, 60, 100, .35);
  color: #eaf7ff; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .25s, box-shadow .25s;
  animation: breathe 3.2s ease-in-out infinite;
}
#diveBtn:hover { background: rgba(50, 120, 180, .5); box-shadow: 0 0 40px rgba(90, 190, 255, .35); }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 18px rgba(90, 190, 255, .15); }
  50% { box-shadow: 0 0 34px rgba(90, 190, 255, .4); }
}
.controls { font-size: 12px; opacity: .55; line-height: 1.8; letter-spacing: 1px; margin-top: 14px; }

/* ---- pause menu ---- */
#pauseMenu {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 8, 16, .55);
  backdrop-filter: blur(10px);
}
.panel {
  width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  background: rgba(8, 22, 40, .8);
  border: 1px solid rgba(140, 210, 255, .25);
  border-radius: 18px; padding: 26px 30px;
}
.panel h2 {
  font-weight: 200; letter-spacing: 6px; font-size: 18px;
  text-transform: uppercase; text-align: center;
  margin-bottom: 18px; opacity: .9;
}
.cat {
  margin: 16px 0 6px;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase; opacity: .6;
}
.items { display: flex; flex-wrap: wrap; gap: 8px; }
.item {
  border: 1px solid rgba(140, 210, 255, .25);
  border-radius: 10px; padding: 8px 14px;
  font-size: 13px; letter-spacing: 1px; cursor: pointer;
  background: rgba(16, 40, 66, .4);
  transition: background .15s, box-shadow .15s;
}
.item:hover { background: rgba(40, 90, 140, .45); }
.item.selected {
  border-color: #8fd8ff;
  background: rgba(60, 140, 200, .4);
  box-shadow: 0 0 14px rgba(110, 200, 255, .25);
}
.item.locked { opacity: .45; cursor: default; background: rgba(10, 20, 34, .4); }
.item.locked:hover { background: rgba(10, 20, 34, .4); }
.item .req { display: block; font-size: 10px; opacity: .75; margin-top: 2px; letter-spacing: .5px; }

.row { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.row button {
  font-size: 14px; letter-spacing: 3px;
  padding: 10px 26px; border-radius: 999px;
  border: 1px solid rgba(150, 220, 255, .4);
  background: rgba(20, 60, 100, .4);
  color: #eaf7ff; cursor: pointer;
  transition: background .2s;
}
.row button:hover { background: rgba(50, 120, 180, .5); }
