/* MOLTING 3D — style.css
   Fullscreen canvas, no scroll, HUD overlay in Nyx look, mobile friendly. */

:root {
  --turquoise: #2ec4b6;
  --pink: #ff5da2;
  --deep: #04212b;
  --deep2: #072e3a;
  --ink: #d8f6f2;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--deep);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  padding: env(safe-area-inset-top, 12px) 14px 14px;
}

#hud-top {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.hud-block {
  background: rgba(4, 33, 43, 0.55);
  border: 1px solid rgba(46, 196, 182, 0.4);
  border-radius: 12px;
  padding: 6px 14px;
  min-width: 74px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.hud-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--turquoise);
  opacity: 0.85;
}

.hud-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(46, 196, 182, 0.6);
}

#combo .hud-value { color: var(--pink); text-shadow: 0 0 10px rgba(255, 93, 162, 0.7); }

/* stress bar */
#stress-wrap {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 22px;
  max-width: 520px;
  margin: 0 auto;
}

#stress-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--turquoise);
  margin-bottom: 4px;
  text-shadow: 0 1px 4px #000;
}

#stress-bar-bg {
  height: 16px;
  border-radius: 10px;
  background: rgba(4, 33, 43, 0.7);
  border: 1px solid rgba(46, 196, 182, 0.5);
  overflow: hidden;
}

#stress-bar {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--turquoise), #6ee7dc);
  transition: width 0.12s linear, background 0.2s;
}

#stress-bar.warn { background: linear-gradient(90deg, #ffb347, #ff5da2); }
#stress-bar.danger { background: linear-gradient(90deg, #ff5da2, #ff2e63); animation: pulse 0.5s infinite alternate; }

@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }

/* cave indicator */
#cave-indicator {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(4, 33, 43, 0.55);
  border: 1px solid rgba(255, 93, 162, 0.5);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 6px;
}

#cave-arrow {
  display: inline-block;
  font-size: 16px;
  transition: transform 0.1s linear;
}

/* molt hint */
#molt-hint {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  background: rgba(46, 196, 182, 0.18);
  border: 1px solid var(--turquoise);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  text-align: center;
  animation: pulse 0.7s infinite alternate;
}
#molt-hint b { color: var(--pink); }

/* ---------- joystick (mobile) ---------- */
#joystick {
  position: absolute;
  left: 26px;
  bottom: 70px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(46, 196, 182, 0.1);
  border: 2px solid rgba(46, 196, 182, 0.35);
  z-index: 12;
  touch-action: none;
}
#joystick-knob {
  position: absolute;
  left: 35px;
  top: 35px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(46, 196, 182, 0.5);
  border: 2px solid var(--turquoise);
  box-shadow: 0 0 14px rgba(46, 196, 182, 0.6);
}

#molt-btn {
  position: absolute;
  right: 26px;
  bottom: 90px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--pink);
  background: rgba(255, 93, 162, 0.22);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  z-index: 12;
  box-shadow: 0 0 18px rgba(255, 93, 162, 0.5);
}
#molt-btn:active { transform: scale(0.94); }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(7, 46, 58, 0.82), rgba(2, 18, 24, 0.95));
  backdrop-filter: blur(3px);
  text-align: center;
  padding: 24px;
}

.overlay-inner {
  max-width: 480px;
  width: 100%;
}

.title {
  font-size: clamp(46px, 12vw, 88px);
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 24px rgba(46, 196, 182, 0.8), 0 0 48px rgba(255, 93, 162, 0.4);
  line-height: 0.95;
}
.title-3d {
  display: inline-block;
  margin-left: 8px;
  color: var(--pink);
  font-size: 0.55em;
  vertical-align: super;
  text-shadow: 0 0 20px rgba(255, 93, 162, 0.9);
}
.title.over { color: var(--pink); text-shadow: 0 0 24px rgba(255, 93, 162, 0.8); }

.tag {
  color: var(--turquoise);
  letter-spacing: 2px;
  margin: 8px 0 20px;
  font-size: 14px;
}

.how {
  text-align: left;
  background: rgba(4, 33, 43, 0.5);
  border: 1px solid rgba(46, 196, 182, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.7;
}
.how b { color: var(--turquoise); }

.big-btn {
  background: linear-gradient(135deg, var(--turquoise), #1fa89b);
  color: #04212b;
  border: none;
  border-radius: 40px;
  padding: 16px 54px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(46, 196, 182, 0.5);
  transition: transform 0.1s;
}
.big-btn:active { transform: scale(0.95); }

.foot {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(216, 246, 242, 0.5);
}

.scores {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 20px 0 26px;
}
.big-num {
  font-size: 46px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 14px rgba(46, 196, 182, 0.6);
}

/* loading pulse for canvas before start */
#over-reason { min-height: 18px; }
