@import url("https://fonts.googleapis.com/css2?family=Audiowide&family=Inter:wght@400;700&display=swap");

:root {
  --bg-color: #050508;
  --panel-bg: rgba(20, 20, 30, 0.9);
  --accent-cyan: #00f3ff;
  --accent-pink: #ff00ff;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-color);
  color: white;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.font-audiowide {
  font-family: "Audiowide", cursive;
}

#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #111122 0%, #050508 100%);
}

#floor {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.5;
}

/* Container to keep HUD and Canvas together */
#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px; /* Space between HUD and Board */
}

canvas {
  z-index: 10;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.ui-layer {
  width: 100%;
  pointer-events: none;
  z-index: 20;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 24px;
  pointer-events: auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  /* HUD width now matches or slightly exceeds the board width for a tighter look */
  max-width: 500px;
  margin: 0 auto;
}

.score-val {
  font-size: 2rem;
  color: var(--accent-cyan);
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
}

.spawn-indicator {
  width: 260px;
  text-align: center;
  margin: 10px auto 0;
}

.bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
  box-shadow: 0 0 15px var(--accent-cyan);
  transition: width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.control-hint {
  margin-top: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0a0a0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 48px;
  border-radius: 32px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.btn-action {
  background: #fff;
  color: #000;
  padding: 16px 48px;
  border-radius: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  width: 100%;
  font-size: 0.9rem;
}
.btn-action:hover {
  background: var(--accent-cyan);
  box-shadow: 0 0 30px var(--accent-cyan);
  transform: translateY(-3px);
}

.tier-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0;
  font-size: 1.4rem;
}
