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

body {
  background: #0a0a1a;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-align: center;
}

.subtitle {
  color: #888;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.menu-container, .end-container {
  text-align: center;
  max-width: 500px;
  width: 90%;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

#youtube-url {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background: #151528;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#youtube-url:focus {
  border-color: #8338ec;
}

#btn-start, #btn-retry {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff006e, #8338ec);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

#btn-start:hover, #btn-retry:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.hint {
  color: #555;
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

.controls-info {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.key-hint {
  color: #666;
  font-size: 0.85rem;
}

.key {
  display: inline-block;
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  margin-right: 0.3rem;
  font-weight: 700;
  color: #fff;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
  z-index: 10;
}

#hud-bpm {
  color: #8338ec;
}

#timing-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  text-shadow: 0 0 20px currentColor;
  z-index: 10;
}

#youtube-container {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 200px;
  height: 113px;
  opacity: 0.3;
  z-index: 5;
  border-radius: 8px;
  overflow: hidden;
}

.stats {
  margin: 2rem 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #222;
  font-size: 1.2rem;
}

.stat-label {
  color: #888;
}

.stat-value {
  font-weight: 700;
}

.stat-value.green { color: #00ff88; }
.stat-value.yellow { color: #ffdd00; }
.stat-value.red { color: #ff4466; }

#btn-retry {
  margin-top: 1rem;
  padding: 1rem 3rem;
  font-size: 1.2rem;
}
