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

#unsupported-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  z-index: 9999;
  color: #f0e6d3;
  font-family: monospace;
}
#unsupported-screen h1 { font-size: 1.8rem; margin-bottom: 1.5rem; color: #ffcc66; }
#unsupported-screen p { font-size: 1rem; line-height: 1.6; max-width: 400px; margin-bottom: 0.8rem; }
#unsupported-screen.hidden { display: none; }

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: monospace;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 640px;
  height: 480px;
  border: 4px solid #333;
  border-radius: 8px;
  overflow: hidden;
  image-rendering: pixelated;
}

#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#dialog-box {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: rgba(10, 10, 30, 0.92);
  border: 3px solid #f0e6d3;
  border-radius: 8px;
  padding: 14px 18px;
  color: #f0e6d3;
  font-size: 14px;
  line-height: 1.5;
  z-index: 10;
}

#dialog-box.hidden { display: none; }

#dialog-speaker {
  font-weight: bold;
  color: #ffcc66;
  margin-bottom: 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#dialog-text {
  min-height: 40px;
}

#dialog-prompt {
  text-align: right;
  color: #aaa;
  font-size: 11px;
  margin-top: 6px;
  animation: blink 1s infinite;
}

#dialog-choices {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#dialog-choices.hidden { display: none; }

.dialog-choice {
  padding: 6px 12px;
  background: rgba(255, 204, 102, 0.1);
  border: 2px solid #555;
  border-radius: 4px;
  color: #f0e6d3;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dialog-choice.selected {
  border-color: #ffcc66;
  background: rgba(255, 204, 102, 0.2);
}

.dialog-choice-key {
  color: #ffcc66;
  font-weight: bold;
  margin-right: 8px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#ui-overlay {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}

#flower-count {
  background: rgba(10, 10, 30, 0.8);
  border: 2px solid #f0e6d3;
  border-radius: 6px;
  padding: 4px 10px;
  color: #f0e6d3;
  font-size: 13px;
}

#objective-display {
  background: rgba(10, 10, 30, 0.85);
  border: 2px solid #ffd700;
  border-radius: 6px;
  padding: 4px 12px;
  color: #ffd700;
  font-size: 12px;
  max-width: 240px;
  text-align: center;
}

#objective-display.hidden { display: none; }

#location-name {
  background: rgba(10, 10, 30, 0.8);
  border: 2px solid #f0e6d3;
  border-radius: 6px;
  padding: 4px 10px;
  color: #aed9e0;
  font-size: 13px;
  font-style: italic;
}

#hint-prompt {
  background: rgba(10, 10, 30, 0.7);
  border: 1px solid #ffd700;
  border-radius: 6px;
  padding: 3px 8px;
  color: #ffd700;
  font-size: 12px;
  animation: hint-pulse 2s ease-in-out infinite;
}

#hint-prompt.hidden { display: none; }

#music-toggle {
  position: absolute;
  bottom: -440px;
  right: 0;
  pointer-events: auto;
  background: rgba(10, 10, 30, 0.8);
  border: 2px solid #f0e6d3;
  border-radius: 6px;
  padding: 4px 8px;
  color: #f0e6d3;
  font-size: 14px;
  cursor: pointer;
  font-family: monospace;
}

#music-toggle:hover { border-color: #ffd700; color: #ffd700; }
#music-toggle.muted { opacity: 0.4; }

@keyframes hint-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

#title-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  color: #f0e6d3;
}

#title-screen.hidden { display: none; }

#title-screen h1 {
  font-size: 32px;
  color: #ffcc66;
  text-shadow: 2px 2px 0 #333;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #aed9e0;
  margin-bottom: 40px;
}

.start-prompt {
  font-size: 13px;
  animation: blink 1.2s infinite;
}

#title-art {
  width: 256px;
  height: 192px;
  margin-bottom: 20px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
