@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=IBM+Plex+Mono:wght@300;400;700&display=swap');

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

body {
  background: #000;
  overflow: hidden;
  font-family: 'IBM Plex Mono', monospace;
  color: #c8b8a0;
}

/* ── Canvases ── */
canvas { display: block; position: fixed; top: 0; left: 0; }
#game { z-index: 1; }
#fx   { z-index: 2; pointer-events: none; }

/* ── UI layer ── */
#ui {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10; pointer-events: none;
}

/* ── Title screen ── */
#title {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #000;
  cursor: pointer; pointer-events: auto;
}
#title h1 {
  font-family: 'Special Elite', cursive;
  font-size: min(80px, 12vw);
  color: #5a2a1a;
  text-shadow: 0 0 60px rgba(90,42,26,0.3);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}
#title .sub {
  color: #3a2a1a; font-size: 12px;
  letter-spacing: 6px;
  animation: pulse 3s ease-in-out infinite;
}
#title .warn {
  color: #2a1a0a; font-size: 10px;
  letter-spacing: 2px; margin-top: 40px;
  max-width: 300px; text-align: center; line-height: 1.8;
}

/* ── Death screen ── */
#death {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 90; background: #000;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; pointer-events: auto;
}
#death h1 {
  font-family: 'Special Elite', cursive;
  font-size: 36px; color: #4a1a1a;
}
#death p {
  color: #3a1a1a; font-size: 11px;
  margin-top: 16px; letter-spacing: 3px;
}

/* ── Escape screen ── */
#escape {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 90; background: #000;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; pointer-events: auto;
}
#escape h1 {
  font-family: 'Special Elite', cursive;
  font-size: 36px; color: #2a4a2a;
}
#escape p {
  color: #2a3a2a; font-size: 11px;
  margin-top: 16px; letter-spacing: 3px;
}

/* ── End-screen stats ── */
.stats {
  margin: 20px 0;
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 2.2;
  text-align: center;
}
#death .stats { color: #3a1a1a; }
#escape .stats { color: #2a3a2a; }

/* ── Message overlay ── */
#msg {
  position: fixed; bottom: 15%; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: 'Special Elite', cursive;
  font-size: 16px; color: #8a7a6a;
  opacity: 0; transition: opacity 1.5s;
  pointer-events: none; text-align: center;
  max-width: 400px; line-height: 1.6;
}

/* ── Sanity bar ── */
#san {
  position: fixed; bottom: 30px; left: 30px;
  z-index: 20; pointer-events: none;
}
#san .label {
  font-size: 9px; color: #4a3a2a;
  letter-spacing: 3px; margin-bottom: 4px;
}

/* ── Stamina bar ── */
#stamina-wrap {
  position: fixed; bottom: 50px; left: 30px;
  z-index: 20; pointer-events: none;
}
#stamina-wrap .label {
  font-size: 9px; color: #3a3a2a;
  letter-spacing: 3px; margin-bottom: 4px;
}

/* Shared bar styles */
.bar {
  width: 140px; height: 3px;
  background: #1a1a10;
  border: 1px solid #2a2a1a;
}
.fill {
  height: 100%;
  background: #6b4a2a;
  transition: width 0.3s;
}

/* ── Depth indicator ── */
#depth-indicator {
  position: fixed; top: 30px; left: 30px;
  z-index: 20; pointer-events: none;
  font-size: 10px; color: #4a3a2a;
  letter-spacing: 3px;
}

/* ── Inventory ── */
#inv {
  position: fixed; top: 30px; right: 30px;
  z-index: 20; pointer-events: none;
  text-align: right;
  font-size: 10px; color: #5a4a3a;
  line-height: 2;
}

/* ── Hint bar ── */
#hint {
  position: fixed; bottom: 30px; right: 30px;
  z-index: 20; pointer-events: none;
  font-size: 9px; color: #3a3a2a;
  text-align: right; line-height: 2;
  transition: opacity 2s;
}

/* ── Minimap ── */
#minimap {
  position: fixed; bottom: 80px; left: 30px;
  z-index: 20; pointer-events: none;
  border: 1px solid #1a1a10;
  opacity: 0.6;
  image-rendering: pixelated;
}

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.8; }
}
