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

body {
  overflow: hidden;
  background: #0a0510;
  font-family: 'Crimson Text', Georgia, serif;
}

#game {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#fps {
  position: fixed;
  top: 16px;
  right: 16px;
  color: #c9a;
  font-family: monospace;
  font-size: 14px;
  z-index: 100;
}

#title-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #1a0a2e 0%, #0a0510 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

#title-screen h1 {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: 72px;
  color: #f4a261;
  text-shadow: 0 0 20px rgba(244, 162, 97, 0.5);
  margin-bottom: 40px;
}

#title-screen .poem {
  max-width: 500px;
  text-align: center;
  color: #ddd;
  font-style: italic;
  font-size: 20px;
  line-height: 1.8;
  margin-bottom: 40px;
}

#title-screen .poem p {
  margin: 8px 0;
}

#start-btn, #restart-btn {
  padding: 16px 48px;
  background: linear-gradient(180deg, #e76f51 0%, #9b4d3a 100%);
  border: 2px solid #f4a261;
  border-radius: 8px;
  color: #fff;
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#start-btn:hover, #restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(244, 162, 97, 0.5);
}

#title-screen .controls-hint {
  margin-top: 30px;
  color: #888;
  font-size: 14px;
}

#poem-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 5, 16, 0.95);
  padding: 60px 80px;
  border: 2px solid #4a3060;
  border-radius: 12px;
  text-align: center;
  z-index: 150;
  max-width: 600px;
}

#poem-overlay.hidden {
  display: none;
}

#poem-overlay p {
  color: #ddd;
  font-size: 22px;
  line-height: 2;
  font-style: italic;
  margin: 12px 0;
}

#victory-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #2d1b4e 0%, #1a0a2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

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

#victory-screen h1 {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: 48px;
  color: #ffd166;
  text-shadow: 0 0 20px rgba(255, 209, 102, 0.5);
  margin-bottom: 20px;
}

#victory-screen .victory-line {
  font-size: 32px;
  color: #a8dadc;
  font-style: italic;
  margin-bottom: 40px;
}

#health-bar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #e76f51;
  border-radius: 12px;
  overflow: hidden;
  z-index: 100;
}

#health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
  transition: width 0.3s;
}

#health-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
}

#toves-counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: #a8dadc;
  font-size: 16px;
  z-index: 100;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
