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

:root {
  --blood: #8b1a1a;
  --hot: #ff3355;
  --dark: #1a0505;
  --glass: rgba(40, 8, 8, 0.72);
  --border: rgba(255, 60, 80, 0.35);
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--dark);
  font-family: 'JetBrains Mono', monospace;
  color: #e8c4bc;
  cursor: default;
}

#scene-container { position: fixed; inset: 0; }
#scene-container canvas { display: block; }

.hidden { display: none !important; }

/* Enter prompt overlay */
#enter-prompt {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(40,5,5,0.4), rgba(10,2,2,0.88));
  cursor: pointer;
  animation: throb 3s ease-in-out infinite;
}
@keyframes throb {
  0%,100% { background-color: rgba(10,2,2,0.2); }
  50% { background-color: rgba(30,4,4,0.35); }
}
.enter-inner { text-align: center; }
.enter-title {
  font-family: 'Cormorant', serif;
  font-weight: 600; font-size: clamp(2rem, 7vw, 4rem);
  color: var(--hot); letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(255,50,80,0.6);
}
.enter-sub { margin-top: 1rem; font-size: 1.1rem; color: #e8c4bc; letter-spacing: 0.2em; }
.enter-hint { margin-top: 0.6rem; font-size: 0.75rem; opacity: 0.55; letter-spacing: 0.15em; }

/* Control panel */
#panel {
  position: fixed; top: 16px; left: 16px; z-index: 20;
  width: 220px; padding: 16px;
  background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 0 30px rgba(139,26,26,0.4), inset 0 0 20px rgba(255,50,80,0.08);
}
.panel-title {
  font-family: 'Cormorant', serif; font-weight: 600;
  font-size: 1.6rem; color: var(--hot);
  margin-bottom: 12px; letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(255,50,80,0.5);
}
#panel label {
  display: block; font-size: 0.68rem; margin-bottom: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85;
}
#panel label span { color: var(--hot); font-weight: 700; }
#panel input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; margin-top: 6px;
  background: linear-gradient(90deg, #3a0a0a, #8b1a1a);
  border-radius: 5px; outline: none;
}
#panel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--hot);
  box-shadow: 0 0 10px var(--hot); cursor: pointer;
}
#panel input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border: none;
  border-radius: 50%; background: var(--hot);
  box-shadow: 0 0 10px var(--hot); cursor: pointer;
}
#regrow {
  width: 100%; margin-top: 4px; padding: 9px;
  font-family: inherit; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; cursor: pointer;
  background: linear-gradient(135deg, #8b1a1a, #4a0808);
  color: #ffdcd4; border: 1px solid var(--border);
  border-radius: 8px; transition: 0.2s;
}
#regrow:hover { background: linear-gradient(135deg, #b02020, #6a0c0c); box-shadow: 0 0 18px rgba(255,50,80,0.5); }

/* Mode buttons */
#modes {
  position: fixed; top: 16px; right: 16px; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
}
.mode-btn {
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em; padding: 8px 12px; cursor: pointer;
  background: var(--glass); color: #e8c4bc;
  border: 1px solid var(--border); border-radius: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: 0.2s;
}
.mode-btn:hover { border-color: var(--hot); }
.mode-btn.active {
  background: var(--hot); color: var(--dark);
  box-shadow: 0 0 16px rgba(255,50,80,0.6);
}

/* HUD */
#hud {
  position: fixed; bottom: 16px; left: 16px; z-index: 20;
  font-size: 0.7rem; letter-spacing: 0.08em; line-height: 1.7;
  color: #d49088; text-shadow: 0 0 8px rgba(0,0,0,0.8);
  pointer-events: none;
}
#hud span { color: var(--hot); font-weight: 700; }
#hud-flavor {
  margin-top: 6px; font-family: 'Cormorant', serif;
  font-size: 1rem; font-style: italic; color: #ff5570;
  opacity: 0.85;
}

/* Footer */
#footer {
  position: fixed; bottom: 12px; right: 16px; z-index: 20;
}
#footer a {
  font-size: 0.65rem; letter-spacing: 0.1em;
  color: rgba(255,60,80,0.45); text-decoration: none;
}
#footer a:hover { color: var(--hot); }

@media (max-width: 600px) {
  #panel { width: 170px; padding: 12px; top: 10px; left: 10px; }
  .panel-title { font-size: 1.2rem; }
  #panel label { font-size: 0.6rem; }
  #modes { top: 10px; right: 10px; }
  .mode-btn { font-size: 0.65rem; padding: 6px 9px; }
}