/* =====================================================================
   WATSUMI — shared styles (deep-ocean descent)
   ===================================================================== */
:root {
  --abyss: #050A12;
  --deep: #091422;
  --mid: #0E2236;
  --teal: #12546B;
  --surface: #2E7E8C;
  --aqua: #57E0CF;       /* bioluminescent accent */
  --aqua-dim: #2FA89A;
  --coral: #F0876E;
  --pearl: #ECE6D6;
  --pearl-dim: #B9B6A8;
  --gold: #E7CE86;
  --line: rgba(120, 220, 220, 0.16);
  --panel: rgba(8, 18, 30, 0.92);
  --shadow: 0 20px 60px rgba(0, 6, 14, 0.6);

  --f-display: "Cinzel", Georgia, serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", monospace;
  --f-pixel: "Silkscreen", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  color: var(--pearl);
  background: var(--abyss);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
canvas { display: block; }

/* ---------- shared ---------- */
.mono { font-family: var(--f-mono); letter-spacing: .3px; }
.btn {
  font-family: var(--f-mono); font-weight: 600; letter-spacing: 1px;
  border: none; cursor: pointer; border-radius: 10px; text-transform: uppercase;
  transition: transform .12s, box-shadow .12s, background .15s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--aqua) 0%, var(--aqua-dim) 100%);
  color: #042822;
  box-shadow: 0 0 0 1px rgba(120,255,240,.3), 0 8px 26px rgba(40,200,180,.30);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 22px rgba(87,224,207,.5); }
.btn-ghost {
  background: rgba(120,220,220,.08); color: var(--pearl);
  border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(120,220,220,.16); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(6,14,24,.6); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; backdrop-filter: blur(8px);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }
.dot.live { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* =====================================================================
   LANDING — the descent
   ===================================================================== */
.dive { position: relative; min-height: 100vh; overflow: hidden; }
#heroCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg,
    #3A8C97 0%, #1E6478 14%, #124B62 30%, #0C3046 52%, #081E30 74%, #050C16 100%);
}
.dive::after { /* depth darkening + caustic readability */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 22%, rgba(120,230,230,.10), rgba(5,10,18,.0) 40%),
              linear-gradient(180deg, rgba(5,10,18,0) 40%, rgba(5,10,18,.55) 100%);
}

.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px; padding: 18px clamp(16px,4vw,40px);
}
.brand { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: 5px; }
.brand .beta {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 1px; font-weight: 600;
  background: rgba(6,14,24,.5); border: 1px solid var(--line); padding: 3px 6px; border-radius: 6px;
  vertical-align: middle; margin-left: 10px; color: var(--aqua);
}
.nav-links { display: flex; gap: 18px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.nav-links a:hover { color: var(--aqua); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-ico { opacity: .8; font-size: 16px; }
.nav-ico:hover { opacity: 1; color: var(--aqua); }

.hero-center {
  position: relative; z-index: 20; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 24vh 20px 10vh;
}
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: 5px; text-transform: uppercase; color: var(--aqua); margin-bottom: 18px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.eyebrow { animation: rise .7s ease both; }
.hero-title { animation: rise .9s .08s ease both; }
.hero-sub { animation: rise .9s .18s ease both; }
.hero-actions { animation: rise .9s .28s ease both; }
.hero-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(52px, 11vw, 150px); line-height: 1; letter-spacing: clamp(4px, 1.6vw, 18px);
  color: var(--pearl);
  text-shadow: 0 0 40px rgba(87,224,207,.25), 0 6px 30px rgba(0,10,20,.7);
}
.hero-sub {
  margin: 24px auto 32px; max-width: 520px; font-size: clamp(15px,1.5vw,18px); line-height: 1.55;
  color: var(--pearl); text-shadow: 0 2px 16px rgba(0,10,20,.7);
}
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-dive { font-size: 15px; padding: 15px 42px; }
.btn-spectate { font-size: 13px; padding: 15px 28px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.stat-row b { font-family: var(--f-mono); font-size: 13px; color: var(--aqua); }
.ca-chip { cursor: pointer; font-family: var(--f-mono); font-size: 11px; }
.ca-chip:hover { border-color: var(--aqua); }
.ca-chip .copied { color: var(--aqua); }

.countdown { display: flex; gap: 10px; margin-top: 14px; }
.cd-box { background: rgba(6,14,24,.5); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 62px; backdrop-filter: blur(8px); }
.cd-box .num { font-family: var(--f-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--pearl); }
.cd-box .lbl { font-family: var(--f-mono); font-size: 9px; color: var(--pearl-dim); margin-top: 6px; letter-spacing: 1px; }
.cd-when { margin-top: 12px; font-family: var(--f-mono); font-size: 10px; color: var(--pearl-dim); letter-spacing: 1px; }

.scroll-cue {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 20;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 2px; color: var(--aqua); text-align: center;
  animation: sink 2.4s ease-in-out infinite;
}
@keyframes sink { 0%,100%{transform:translateX(-50%) translateY(0);opacity:.6} 50%{transform:translateX(-50%) translateY(8px);opacity:1} }

/* ---------- dive-computer depth HUD (signature) ---------- */
.depth-hud {
  position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 40;
  width: 64px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-mono); pointer-events: none; user-select: none;
}
.depth-read { text-align: center; }
.depth-read .v { font-size: 17px; color: var(--aqua); font-weight: 600; }
.depth-read .u { font-size: 9px; color: var(--pearl-dim); letter-spacing: 1px; }
.depth-bar {
  position: relative; width: 4px; height: 42vh; min-height: 220px;
  background: linear-gradient(180deg, rgba(120,220,220,.25), rgba(120,220,220,.05));
  border-radius: 4px;
}
.depth-ind { position: absolute; left: -5px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--aqua); box-shadow: 0 0 12px var(--aqua); transition: top .15s linear; }
.depth-tick { position: absolute; left: 10px; font-size: 8px; color: var(--pearl-dim); white-space: nowrap; }
.depth-gauges { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.depth-gauges div { font-size: 9px; color: var(--pearl-dim); }
.depth-gauges b { color: var(--pearl); }
@media (max-width: 860px) { .depth-hud { display: none; } }

/* ---------- feature band: deeper you go ---------- */
.band { background: linear-gradient(180deg, #050C16 0%, #07111E 60%, #050A12 100%); padding: 90px 20px; position: relative; }
.band-inner { max-width: 1040px; margin: 0 auto; }
.band h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px,4vw,40px); text-align: center; letter-spacing: 2px; }
.band .lead { text-align: center; color: var(--pearl-dim); max-width: 560px; margin: 14px auto 50px; line-height: 1.6; }
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(238px,1fr)); gap: 18px; }
.card { background: rgba(120,220,220,.035); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--aqua); transform: translateY(-3px); }
.card .ic { font-size: 26px; margin-bottom: 14px; }
.card h3 { font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: 1px; margin-bottom: 10px; }
.card p { color: var(--pearl-dim); font-size: 14px; line-height: 1.6; }
.roadmap-note { margin: 46px auto 0; max-width: 640px; text-align: center; font-size: 13px; color: var(--pearl-dim);
  border: 1px dashed var(--line); border-radius: 12px; padding: 18px; line-height: 1.6; }
.roadmap-note b { color: var(--aqua); }

/* preview block showing the actual seafloor */
.preview { max-width: 1040px; margin: 0 auto 70px; }
.preview-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #07131F; box-shadow: var(--shadow); }
#previewCanvas { width: 100%; height: 340px; display: block; background: linear-gradient(180deg,#0E3346,#07131F); }
.preview-cap { text-align: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: 1px; color: var(--pearl-dim); margin-top: 14px; }

.foot { text-align: center; padding: 30px 20px 40px; font-size: 12px; color: var(--pearl-dim); }
.foot a { color: var(--aqua); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero-center { padding-top: 28vh; }
}

/* =====================================================================
   GAME SHELL
   ===================================================================== */
.game-body { background: var(--abyss); height: 100vh; overflow: hidden; }
#gameCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%; cursor: crosshair;
  background: linear-gradient(180deg, #1E6478 0%, #124B62 26%, #0C3046 60%, #071726 100%);
}

.hud-top { position: fixed; top: 14px; left: 14px; right: 14px; z-index: 30; display: flex; align-items: center; gap: 10px; pointer-events: none; flex-wrap: wrap; }
.hud-top .chip, .hud-top .hud-btn { pointer-events: auto; }
/* oxygen bar */
.o2 { display: flex; align-items: center; gap: 8px; }
.o2 .bar { width: 84px; height: 8px; border-radius: 6px; background: rgba(120,220,220,.15); overflow: hidden; }
.o2 .fill { height: 100%; width: 86%; background: linear-gradient(90deg, var(--aqua), #8FF0E2); }
.o2 .lbl { font-family: var(--f-mono); font-size: 10px; color: var(--pearl-dim); }
.depthchip b, .coin b { font-family: var(--f-mono); }
.coin b { color: var(--gold); }
.hud-spacer { flex: 1; }
.hud-btn { font-family: var(--f-mono); font-size: 11px; letter-spacing: 1px; color: var(--pearl);
  background: rgba(6,14,24,.7); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; cursor: pointer; backdrop-filter: blur(8px); }
.hud-btn:hover { border-color: var(--aqua); color: var(--aqua); }

.hotbar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 8px; background: rgba(6,14,24,.7); border: 1px solid var(--line); padding: 8px; border-radius: 14px; backdrop-filter: blur(10px); }
.slot { width: 48px; height: 48px; border-radius: 10px; background: rgba(120,220,220,.06); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; position: relative; font-size: 22px; }
.slot .key { position: absolute; top: 2px; left: 4px; font-family: var(--f-mono); font-size: 8px; color: var(--pearl-dim); }
.slot.active { border-color: var(--aqua); box-shadow: 0 0 0 2px rgba(87,224,207,.35) inset, 0 0 14px rgba(87,224,207,.25); }

.overlay { position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; background: rgba(3,8,16,.6); backdrop-filter: blur(4px); }
.overlay.open { display: flex; }
.panel { width: min(520px,92vw); max-height: 82vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.panel-head { display: flex; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: 2px; }
.panel-head .x { margin-left: auto; cursor: pointer; font-family: var(--f-mono); font-size: 12px; color: var(--pearl-dim); }
.panel-head .x:hover { color: var(--aqua); }

.inv-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.inv-cell { aspect-ratio: 1; border-radius: 10px; background: rgba(120,220,220,.05); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 22px; position: relative; }
.inv-cell .qty { position: absolute; bottom: 3px; right: 5px; font-family: var(--f-mono); font-size: 9px; color: var(--pearl-dim); }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { font-family: var(--f-mono); font-size: 11px; letter-spacing: 1px; padding: 8px 12px; border-radius: 9px; background: rgba(120,220,220,.05); border: 1px solid var(--line); cursor: pointer; color: var(--pearl-dim); }
.tab.active { color: #042822; background: var(--aqua); border-color: var(--aqua); }

.mkt-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: rgba(120,220,220,.03); }
.mkt-row .icn { font-size: 24px; }
.mkt-row .nm { font-weight: 600; }
.mkt-row .sub { font-size: 12px; color: var(--pearl-dim); }
.mkt-row .price { margin-left: auto; font-family: var(--f-mono); font-size: 12px; color: var(--gold); }
.mkt-row .buy { font-family: var(--f-mono); font-size: 10px; letter-spacing: 1px; padding: 8px 12px; border-radius: 9px; background: var(--aqua); color: #042822; border: none; cursor: pointer; }
.mkt-note { font-size: 12px; color: var(--pearl-dim); margin-top: 12px; line-height: 1.5; }
.mkt-note b { color: var(--aqua); }

.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(6,14,24,.95); border: 1px solid var(--line); color: var(--pearl); padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 60; opacity: 0; transition: all .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
