@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Crimson+Pro:ital,wght@0,400;1,400&display=swap");

:root {
  --bg: hsl(240 12% 8%);
  --foreground: hsl(40 20% 92%);
  --card: hsl(240 10% 12%);
  --muted: hsl(240 8% 18%);
  --muted-foreground: hsl(240 5% 62%);
  --primary: hsl(32 95% 55%);
  --primary-hover: hsl(32 95% 50%);
  --primary-foreground: hsl(240 12% 8%);
  --secondary: hsl(340 60% 55%);
  --border: hsl(240 8% 20%);
  --radius: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--foreground);
  font-family: "Space Grotesk", sans-serif;
}

.screen {
  position: relative;
  min-height: 100vh;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bg-disc {
  position: absolute;
  color: var(--foreground);
  fill: none;
  stroke-width: 1;
  animation: spin linear infinite;
}

.falling-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.falling-item {
  position: absolute;
  top: -50px;
  font-size: 1.5rem;
  user-select: none;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

.disc-one {
  top: -8rem;
  right: -8rem;
  width: 31.25rem;
  height: 31.25rem;
  opacity: 0.04;
  animation-duration: 20s;
}

.disc-two {
  bottom: -6rem;
  left: -6rem;
  width: 25rem;
  height: 25rem;
  opacity: 0.03;
  animation-duration: 30s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  z-index: 1;
}

.brand-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: color-mix(in hsl, var(--primary) 15%, transparent);
  border: 1px solid color-mix(in hsl, var(--primary) 22%, transparent);
  animation: note-wiggle 5s ease-in-out infinite;
}

.note-icon {
  width: 1.75rem;
  height: 1.75rem;
  stroke-width: 2;
}

.title {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.title span {
  color: var(--primary);
}

.panel {
  width: 100%;
  max-width: 34rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 28px 56px -22px color-mix(in hsl, var(--primary) 24%, transparent);
  position: relative;
  z-index: auto;
}

.panel-head, .hint-box, .step, .result {
  position: relative;
  z-index: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.panel-head-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.progress {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in hsl, var(--muted-foreground) 55%, transparent);
}

.dot.active {
  background: var(--primary);
}

.hint-box {
  padding: 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in hsl, var(--border) 70%, transparent);
  background: color-mix(in hsl, var(--muted) 70%, transparent);
}

.hint-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.hint {
  margin: 0;
  font-family: "Crimson Pro", serif;
  font-size: clamp(1.2rem, 3.4vw, 1.65rem);
  line-height: 1.45;
  font-style: italic;
  color: color-mix(in hsl, var(--foreground) 90%, transparent);
}

.hint-line {
  display: block;
}

.hint-line + .hint-line {
  margin-top: 0.45rem;
}

.step {
  margin: 0.65rem 0 1.3rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.guess-box {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
  position: relative;
  z-index: 3;
}

.guess-label {
  font-size: 0.76rem;
  color: var(--muted-foreground);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.guess-input {
  width: 100%;
  border: 1px solid color-mix(in hsl, var(--border) 70%, transparent);
  background: color-mix(in hsl, var(--muted) 75%, transparent);
  color: var(--foreground);
  border-radius: 0.75rem;
  padding: 0.72rem 0.85rem;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guess-input:focus {
  border-color: color-mix(in hsl, var(--primary) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in hsl, var(--primary) 20%, transparent);
}

.guess-input.error {
  border-color: hsl(0 72% 54%);
  box-shadow: 0 0 0 2px hsl(0 72% 54% / 0.2);
}

.guess-input.success {
  border-color: hsl(152 61% 40%);
  box-shadow: 0 0 0 2px hsl(152 61% 40% / 0.2);
}

.guess-input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.controls {
  display: grid;
  gap: 0.75rem;
  position: relative;
  z-index: 3;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background-color 0.2s ease, transform 0.06s ease, opacity 0.2s ease;
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-muted {
  background: color-mix(in hsl, var(--muted) 90%, transparent);
  color: var(--foreground);
  border: 1px solid color-mix(in hsl, var(--border) 70%, transparent);
}

.btn-muted:hover:not(:disabled) {
  background: color-mix(in hsl, var(--muted) 85%, white);
}

.btn-primary {
  background: color-mix(in hsl, var(--primary) 90%, transparent);
  color: var(--primary-foreground);
  border: 1px solid color-mix(in hsl, var(--primary) 70%, transparent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

#nextHintButton {
  background: color-mix(in hsl, hsl(218 85% 56%) 90%, transparent);
  color: hsl(0 0% 100%);
  border: 1px solid color-mix(in hsl, hsl(218 75% 48%) 70%, transparent);
}

#nextHintButton:hover:not(:disabled) {
  background: hsl(218 85% 50%);
}

#giveUpButton {
  background: color-mix(in hsl, hsl(0 78% 56%) 90%, transparent);
  color: hsl(0 0% 100%);
  border: 1px solid color-mix(in hsl, hsl(0 72% 46%) 70%, transparent);
}

#giveUpButton:hover:not(:disabled) {
  background: hsl(0 78% 50%);
}

#resetButton {
  background: color-mix(in hsl, hsl(0 0% 100%) 90%, transparent);
  color: hsl(240 12% 8%);
  border: 1px solid color-mix(in hsl, hsl(0 0% 85%) 70%, transparent);
}

#resetButton:hover:not(:disabled) {
  background: hsl(0 0% 94%);
}

.result {
  margin: 0 0 1.2rem;
  padding: 1.2rem;
  border-radius: 0.8rem;
  background: color-mix(in hsl, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in hsl, var(--primary) 28%, transparent);
  text-align: center;
}

.result-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
}

.song {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.artist {
  margin: 0.2rem 0 0;
  color: var(--secondary);
  font-size: 1.05rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

.footnote {
  margin: 1.8rem 0 0;
  font-size: 0.76rem;
  color: var(--muted-foreground);
  z-index: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes note-wiggle {
  0% {
    transform: rotate(0deg) scale(1);
  }
  8% {
    transform: rotate(-10deg) scale(1.1);
  }
  16% {
    transform: rotate(10deg) scale(1.05);
  }
  24% {
    transform: rotate(-10deg) scale(1.1);
  }
  32% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@media (max-width: 620px) {
  .screen {
    padding: 2rem 1rem;
  }

  .brand {
    margin-bottom: 1.5rem;
  }

  .panel {
    padding: 1rem;
  }

  .footnote {
    text-align: center;
  }
}
