#laylines-board {
  position: relative;
  overflow: hidden;
}

.laylines-cell {
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.laylines-node {
  width: 40%;
  height: 40%;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
}

.laylines-hunter {
  width: 80%;
  height: 80%;
  background: var(--rose);
  border-radius: 4px;
  box-shadow: 0 0 15px var(--rose);
  z-index: 2;
}

.laylines-phantom {
  width: 80%;
  height: 80%;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--purple);
  opacity: 0.6; /* Phantom sees themselves as translucent */
  z-index: 2;
}

/* For when Phantom dashes or collects a node, seen by hunter */
.laylines-ping {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  border: 2px solid var(--purple);
  animation: laylinesPingAnim 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}

@keyframes laylinesPingAnim {
  0% { transform: scale(0.5); opacity: 1; border-width: 3px; }
  100% { transform: scale(2.5); opacity: 0; border-width: 1px; }
}

/* Stun pulse visual */
.laylines-stun {
  position: absolute;
  inset: -200%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225,29,72,0.6) 0%, rgba(225,29,72,0) 70%);
  animation: stunPulseAnim 0.4s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes stunPulseAnim {
  0% { transform: scale(0.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}


.laylines-wall {
  width: 100%;
  height: 100%;
  background-color: var(--card-bg-hover, #2a2a3e);
  border: 1px solid var(--border-color, #4a4a5e);
  border-radius: 2px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
}

.laylines-trap {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(245,158,11,0.8) 0%, rgba(245,158,11,0.2) 70%);
  border: 1px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(245,158,11,0.6);
  animation: trapPulse 1.5s infinite alternate;
}

@keyframes trapPulse {
  0% { transform: scale(0.85); box-shadow: 0 0 5px rgba(245,158,11,0.4); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(245,158,11,0.8); }
}

#laylines-stun-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  background: rgba(0,0,0,0.8);
  border: 1px solid var(--rose);
  padding: 10px;
  border-radius: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.laylines-stun-bar-bg {
  width: 100%;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
}

.laylines-stun-bar-fill {
  width: 100%;
  height: 100%;
  background: var(--rose);
  animation: stunDrain 2s linear forwards;
}

@keyframes stunDrain {
  0% { width: 100%; }
  100% { width: 0%; }
}

/* Mobile Controls */
.laylines-dpad {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.laylines-dpad-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.laylines-dpad-btn {
  width: 50px;
  height: 50px;
  background: var(--panel-soft);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 20px;
  user-select: none;
  cursor: pointer;
  transition: background 0.1s;
}
.laylines-dpad-btn:active, .laylines-dpad-btn.pressed {
  background: var(--purple);
}
.laylines-dpad-btn.empty {
  background: transparent;
  border: none;
  pointer-events: none;
}

.laylines-action-pad {
  display: flex;
  gap: 15px;
}
.laylines-action-btn {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  user-select: none;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.laylines-action-btn:active, .laylines-action-btn.pressed {
  transform: translateY(2px);
  box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}
.laylines-action-btn.stun-btn {
  background: var(--cyan);
  border: 2px solid #06b6d4;
}
.laylines-action-btn.trap-btn {
  background: var(--orange);
  border: 2px solid #d97706;
}

@media (max-width: 760px) {
  .laylines-grid-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    max-width: 100% !important;
    justify-items: center !important;
  }

  .laylines-grid-container > div:first-child {
    width: min(100%, calc(100vw - 56px)) !important;
    height: auto !important;
  }

  #laylines-board {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  #laylines-mobile-controls {
    display: flex;
    max-width: 100% !important;
    padding: 0 !important;
    gap: 14px;
  }

  .laylines-dpad-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .laylines-action-pad {
    gap: 10px;
  }

  .laylines-action-btn {
    width: 56px;
    height: 56px;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .laylines-grid-container > div:first-child {
    width: min(100%, calc(100vw - 40px)) !important;
  }

  .laylines-dpad-btn {
    width: 40px;
    height: 40px;
  }

  .laylines-action-btn {
    width: 52px;
    height: 52px;
  }
}
