/* =============================================================
   ARCADE · maze.css
   ============================================================= */

.game-page--maze {
  --accent: var(--cyan);
  --accent-soft: rgba(77, 225, 255, 0.14);
  --board-w: 640px;
}

/* -------------------------------------------------------------
   Canvas
   ------------------------------------------------------------- */
.maze-canvas {
  display: block;
  width: min(100%, 640px);
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0b0f16;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}


/* -------------------------------------------------------------
   Toolbar
   ------------------------------------------------------------- */
.maze-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 680px;
}

.maze-toolbar .hint {
  font-size: 0.78rem;
  color: var(--dim);
}

.maze-toolbar .hint b {
  color: var(--muted);
  font-weight: 600;
}

.maze-toolbar__btns {
  display: flex;
  gap: 0.55rem;
}

.maze-toolbar .btn {
  padding: 0.55rem 1.05rem;
  font-size: 0.82rem;
}

/* -------------------------------------------------------------
   Touch d-pad
   ------------------------------------------------------------- */
.maze-dpad {
  display: none;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 56px);
  gap: 8px;
  margin-top: 0.25rem;
}

.maze-dpad button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.02)
  );
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.1s var(--ease);
}

.maze-dpad button svg {
  width: 22px;
  height: 22px;
}

.maze-dpad button:active {
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(0.94);
}

.maze-dpad button[data-dir="up"] { grid-column: 2; grid-row: 1; }
.maze-dpad button[data-dir="left"] { grid-column: 1; grid-row: 2; }
.maze-dpad button[data-dir="down"] { grid-column: 2; grid-row: 2; }
.maze-dpad button[data-dir="right"] { grid-column: 3; grid-row: 2; }

@media (hover: none) and (pointer: coarse) {
  .maze-dpad {
    display: grid;
  }
}

/* -------------------------------------------------------------
   Responsive / motion
   ------------------------------------------------------------- */
@media (max-width: 560px) {
  .maze-toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .maze-toolbar__btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .maze-toolbar .hint {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maze-dpad button {
    transition: none;
  }
}