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

body {
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(180deg, #1a1030 0%, #2a1848 40%, #ffcc22 120%);
  overflow: hidden;
  height: 100vh;
}

#cm-app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

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

#cm-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 5;
}

#cm-score { font-weight: 600; font-size: 1.2rem; }
#cm-combo { opacity: 0.85; }
#cm-tune { color: #90ee90; }
#cm-tune.cm-bad { color: #ff8080; animation: cm-shake 0.3s; }

@keyframes cm-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.cm-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: rgba(20, 10, 40, 0.88);
  z-index: 20;
  color: #fff;
}

.cm-screen.active { display: flex; }

.cm-brand {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

#cm-start h1, #cm-over h2 {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: #ffcc22;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.cm-tagline {
  font-size: 1.1rem;
  color: #88bbff;
  margin-bottom: 1rem;
}

.cm-sub {
  max-width: 26rem;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.cm-controls {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  opacity: 0.55;
}

.cm-controls kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

#cm-play-btn, #cm-retry-btn {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  background: #2266cc;
  color: #ffcc22;
  border: 3px solid #ffcc22;
  border-radius: 999px;
  cursor: pointer;
}

#cm-play-btn:hover, #cm-retry-btn:hover {
  background: #1144aa;
}

#cm-over p {
  max-width: 22rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  opacity: 0.9;
}

.cm-exit, .cm-hub {
  position: absolute;
  bottom: 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  z-index: 25;
}

.cm-exit { left: 12px; }
.cm-hub { right: 12px; }

.cm-exit:hover, .cm-hub:hover { color: #fff; }
