.arrow-game {
  --lane-left: 30%;
  --lane-up: 40%;
  --lane-down: 60%;
  --lane-right: 70%;

  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

@media (pointer: coarse) {
  .arrow-game {
    --lane-left: 12.5%;
    --lane-up: 37.5%;
    --lane-down: 62.5%;
    --lane-right: 87.5%;
  }
}

/* Score */
.ag-score {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.ag-score-perfect { color: #00ff6a; }
.ag-score-good { color: #ffe600; }
.ag-score-miss { color: #ff2222; }
.ag-combo {
  color: #ff44aa;
  font-size: 22px;
  margin-top: 4px;
}

/* Judgment flash */
.ag-judgment {
  position: absolute;
  font-family: system-ui, sans-serif;
  font-size: 72px;
  font-weight: 900;
  z-index: 3;
  animation: judgment-stamp 0.6s ease-out forwards;
  text-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
  letter-spacing: 0.05em;
}

.ag-judgment-perfect { color: #00ff6a; }
.ag-judgment-good { color: #ffe600; }
.ag-judgment-miss { color: #ff2222; }

@keyframes judgment-stamp {
  0% { opacity: 1; scale: 2.5; }
  15% { opacity: 1; scale: 1; }
  60% { opacity: 0.9; scale: 1.05; }
  100% { opacity: 0; scale: 1; }
}

/* Target zone */
.ag-targets {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
}

.ag-target {
  position: absolute;
  top: 8%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  opacity: 0.5;
  color: white;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 4px;
}

@media (pointer: coarse) {
  .ag-target {
    border: none;
    padding: 0;
  }
}

.ag-target-pulse {
  animation: target-beat 0.3s ease-out;
}

@keyframes target-beat {
  0% { transform: translateX(-50%) scale(1); opacity: 0.5; filter: drop-shadow(0 0 0px white); }
  30% { transform: translateX(-50%) scale(1.4); opacity: 1; filter: drop-shadow(0 0 20px white); }
  100% { transform: translateX(-50%) scale(1); opacity: 0.35; filter: drop-shadow(0 0 0px white); }
}

/* Scrolling arrows */
.ag-arrow {
  position: absolute;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  animation: arrow-scroll linear forwards;
}

.ag-arrow-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Lane colors */
[data-dir="left"]  { color: #ff1493; }
[data-dir="up"]    { color: #00e5ff; }
[data-dir="down"]  { color: #00ff6a; }
[data-dir="right"] { color: #ffe600; }

.ag-arrow-active {
  opacity: 1;
  filter: drop-shadow(0 0 14px currentColor) drop-shadow(0 0 28px currentColor) drop-shadow(0 0 6px white);
}

.ag-arrow-perfect {
  animation: arrow-scroll linear forwards, arrow-hit-perfect 0.5s ease-out forwards;
}

.ag-arrow-good {
  animation: arrow-scroll linear forwards, arrow-hit-good 0.5s ease-out forwards;
}

.ag-arrow-miss {
  animation: arrow-scroll linear forwards, arrow-miss 0.5s ease-out forwards;
}

@keyframes arrow-scroll {
  from { top: 95%; }
  to { top: 8%; }
}

@keyframes arrow-hit-perfect {
  0% { opacity: 1; filter: drop-shadow(0 0 8px currentColor); }
  50% { opacity: 1; filter: drop-shadow(0 0 30px #ffdd44) brightness(2); transform: translateX(-50%) scale(1.4); }
  100% { opacity: 0; filter: drop-shadow(0 0 0px transparent); transform: translateX(-50%) scale(1.6); }
}

@keyframes arrow-hit-good {
  0% { opacity: 1; }
  50% { opacity: 0.8; filter: drop-shadow(0 0 20px #44ddff) brightness(1.5); transform: translateX(-50%) scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.3); }
}

@keyframes arrow-miss {
  0% { opacity: 0.6; }
  100% { opacity: 0; color: #ff4466; transform: translateX(-50%) translateY(20px); }
}
