* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  overflow: hidden; 
  background: #000; 
  font-family: 'Press Start 2P', monospace;
  -webkit-user-select: none;
  user-select: none;
}
#scene-container { width: 100vw; height: 100vh; }
#scene-container canvas { display: block; }

#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 10;
}
#hud-left {
  position: absolute;
  top: 12px; left: 12px;
}
#hearts {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
}
.heart {
  width: 20px; height: 20px;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  text-shadow: 1px 1px 2px #000;
}
.heart.full { color: #ff2244; }
.heart.half { color: #ff6688; }
.heart.empty { color: #442222; }
#rupees {
  color: #44ff44;
  font-size: 10px;
  text-shadow: 1px 1px 2px #000;
  margin-bottom: 4px;
}
.rupee-icon { font-size: 12px; }
#key-display {
  color: #ffdd44;
  font-size: 10px;
  text-shadow: 1px 1px 2px #000;
}
#hud-right {
  position: absolute;
  top: 12px; right: 12px;
}
#equipped-item {
  background: rgba(0,0,0,0.7);
  border: 2px solid #888;
  border-radius: 4px;
  width: 50px; height: 50px;
  text-align: center;
  padding: 4px;
}
#equipped-label {
  color: #aaa;
  font-size: 6px;
}
#equipped-icon {
  color: #fff;
  font-size: 18px;
  line-height: 32px;
}
#minimap-container {
  position: fixed;
  bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  border: 2px solid #666;
  border-radius: 4px;
  padding: 2px;
}
#minimap { display: block; image-rendering: pixelated; }

#dialogue-box {
  position: fixed;
  bottom: 40px;
  left: 50%; transform: translateX(-50%);
  width: min(90vw, 600px);
  background: rgba(0,0,20,0.92);
  border: 3px solid #fff;
  border-radius: 4px;
  padding: 16px 20px;
  color: #fff;
  font-size: 11px;
  line-height: 1.8;
  z-index: 20;
}
#dialogue-prompt {
  text-align: right;
  color: #aaa;
  font-size: 8px;
  margin-top: 8px;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

#title-screen {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, #0a1628 0%, #1a2a4a 40%, #2a4a2a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#game-title {
  color: #daa520;
  font-size: clamp(14px, 3vw, 28px);
  text-align: center;
  text-shadow: 0 0 20px rgba(218,165,32,0.5), 2px 2px 0 #000;
  letter-spacing: 2px;
  line-height: 1.6;
}
.title-accent {
  font-size: clamp(24px, 5vw, 48px);
  color: #ffd700;
  display: block;
  letter-spacing: 8px;
}
#game-subtitle {
  color: #8ab4f8;
  font-size: clamp(8px, 1.5vw, 14px);
  margin-top: 8px;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(138,180,248,0.5);
}
#triforce-container {
  margin: 20px 0;
}
#title-menu {
  margin-top: 20px;
}
.menu-option {
  color: #aaa;
  font-size: clamp(10px, 1.5vw, 14px);
  padding: 8px 20px;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s;
}
.menu-option.selected {
  color: #ffd700;
}
.menu-option.selected::before { content: '▶ '; }
.menu-option:hover { color: #ffd700; }
#controls-legend {
  position: absolute;
  bottom: 40px;
  color: #556;
  font-size: 7px;
  text-align: center;
  line-height: 2;
}
#title-footer {
  position: absolute;
  bottom: 12px;
  font-size: 8px;
}
#title-footer a { color: #445; text-decoration: none; }
#title-footer a:hover { color: #668; }

#pause-screen, #death-screen {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#pause-screen h2, #death-screen h2 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 30px;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
#death-screen h2 { color: #ff4444; }

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  gap: 4px;
  margin-bottom: 20px;
}
.inv-slot {
  width: 60px; height: 60px;
  background: rgba(40,40,60,0.9);
  border: 2px solid #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}
.inv-slot.active { border-color: #ffd700; }
.inv-slot:hover { border-color: #aaa; }

#zone-transition {
  position: fixed; inset: 0;
  background: #000;
  z-index: 30;
  transition: opacity 0.3s;
}

#combat-text {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 20px;
  text-shadow: 2px 2px 4px #000;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.3s;
}

#notification {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,20,0.9);
  border: 2px solid #ffd700;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  padding: 16px 24px;
  text-align: center;
  z-index: 25;
  line-height: 1.8;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .heart { width: 16px; height: 16px; font-size: 13px; line-height: 16px; }
  #equipped-item { width: 40px; height: 40px; }
  #equipped-icon { font-size: 14px; line-height: 26px; }
  #minimap-container { display: none; }
}