/* Embedded game — scoped to #game-container */

#game-container {
  position: relative;
  z-index: 1000;
  isolation: isolate;
  width: 50%;
  aspect-ratio: 9 / 16;
  max-height: 80vh;
  margin-inline: auto;
  border: 2px solid transparent;
  border-radius: 4px;
  background:
    linear-gradient(#0d1224, #0d1224) padding-box,
    linear-gradient(135deg, var(--neon-cyan, #00f5ff), var(--neon-pink, #ff2d95), var(--neon-purple, #7b5cff)) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.15),
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 45, 149, 0.2);
  overflow: hidden;
  touch-action: manipulation;
}

@media (max-width: 900px) {
  #game-container {
    width: 100%;
  }
}

#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD */
#game-container .hud {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 8px;
  justify-content: center;
  width: min(92%, 480px);
  transform: translateX(-50%);
  pointer-events: none;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  color: #f2fbff;
}

#game-container .hud > div {
  min-width: 90px;
  padding: 8px 10px;
  border: 2px solid rgba(116, 216, 255, 0.76);
  background: rgba(8, 10, 16, 0.78);
  box-shadow: 0 0 18px rgba(36, 93, 255, 0.38);
  text-align: center;
}

#game-container .hud .label {
  display: block;
  margin-bottom: 2px;
  color: #9cc7e6;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#game-container .hud strong {
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 3vw, 1.6rem);
  line-height: 1;
}

#game-container .pause-btn {
  display: none;
  place-items: center;
  pointer-events: auto;
  min-width: 42px;
  padding: 6px 8px;
  border: 2px solid rgba(116, 216, 255, 0.76);
  border-radius: 0;
  background: rgba(8, 10, 16, 0.78);
  box-shadow: 0 0 18px rgba(36, 93, 255, 0.38);
  color: #f2fbff;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

@media (max-width: 900px) {
  #game-container .pause-btn {
    display: grid;
  }
  #game-container .pause-hint {
    display: none;
  }
}

/* Overlay screens (ready / game over) */
#game-container .screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 20px;
  background:
    linear-gradient(rgba(5, 8, 22, 0.58), rgba(3, 6, 16, 0.9)),
    radial-gradient(circle, rgba(36, 93, 255, 0.46), transparent 55%);
  text-align: center;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  color: #f2fbff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

#game-container .screen.is-visible {
  opacity: 1;
  visibility: visible;
}

#game-container .album-art {
  width: min(38%, 160px);
  aspect-ratio: 1;
  border: 3px solid #74d8ff;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(36, 93, 255, 0.54);
}

#game-container .eyebrow {
  margin: 0;
  color: #74d8ff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#game-container .screen h1,
#game-container .screen h2 {
  margin: 0;
  color: #f2fbff;
  font-size: clamp(1.6rem, 8vw, 3.4rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 #17244f,
    0 0 18px rgba(255, 55, 95, 0.52);
}

#game-container .screen-copy,
#game-container .final-score {
  max-width: 90%;
  margin: 0;
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  line-height: 1.45;
}

#game-container button,
#game-container .cta {
  min-width: 140px;
  padding: 11px 16px;
  border: 2px solid #74d8ff;
  border-radius: 0;
  background: #ff375f;
  color: #050b1f;
  box-shadow: 4px 4px 0 #17244f;
  cursor: pointer;
  font: 800 0.85rem/1 "Courier New", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#game-container button:hover,
#game-container button:focus-visible,
#game-container .cta:hover,
#game-container .cta:focus-visible {
  filter: brightness(1.12);
  transform: translate(-2px, -2px);
}

#game-container .cta {
  display: inline-block;
  background: transparent;
  color: #f2fbff;
  text-decoration: none;
}
