/* Lantern — Manu Arcade. Game-specific CSS only; the candlelit chrome
   (masthead, hud, gauges, seal, toggles, board-frame, overlay, colophon)
   comes from ../_shared/palette.css. No em dashes in on-screen copy. */

/* The candle gauge glyph reads gold, not oxblood, to match its meaning. */
.candle-glyph { color: var(--gold-deep); }

/* Keep the canvas dark-friendly: the maze itself is a gloom the lantern lifts. */
#board {
  display: block;
  cursor: pointer;
  border-radius: 8px;
  max-width: 100%;
  touch-action: none; /* we own swipe + dpad gestures */
  background: #1a140f;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, .55);
}

.board-frame {
  /* A deeper, lamp-lit frame so the parchment border glows around the gloom. */
  background:
    radial-gradient(120% 100% at 50% -10%, rgba(217, 148, 65, .22), rgba(217, 148, 65, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(0, 0, 0, .08)),
    var(--parchment-deep);
}

/* ---- On-screen dpad ----------------------------------------------------- */
.dpad {
  position: absolute;
  right: clamp(8px, 2.5vw, 18px);
  bottom: clamp(8px, 2.5vw, 18px);
  width: 132px;
  height: 132px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  opacity: .92;
  pointer-events: none; /* only the buttons take input */
}
.dpad-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: var(--gold-bright);
  background:
    radial-gradient(circle at 38% 30%, rgba(122, 34, 40, .92), rgba(61, 15, 18, .92) 70%);
  border: 1px solid rgba(200, 156, 58, .45);
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(227, 183, 84, .3),
    0 3px 8px rgba(26, 20, 16, .45);
  transition: transform .1s var(--ease), filter .12s var(--ease), background .12s var(--ease);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.dpad-btn:hover { filter: brightness(1.12); }
.dpad-btn:active { transform: scale(.9); filter: brightness(1.25); }
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

/* A faint compass dot in the dead centre of the pad. */
.dpad::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(227, 183, 84, .4);
  font-size: 13px;
  pointer-events: none;
}

/* Hint line under the board. */
.hint {
  text-align: center;
  color: var(--ink-light);
  font-size: 14px;
  line-height: 1.45;
  max-width: 560px;
  margin: 2px auto 0;
  transition: opacity .5s var(--ease);
}
.hint p { margin: 0; }
.hint strong { color: var(--oxblood); font-weight: 600; }
.hint.gone { opacity: 0; pointer-events: none; }

/* On a wide pointer-capable screen the dpad is a nicety; on touch it is vital.
   Keep it visible everywhere but a touch smaller on tiny phones. */
@media (max-width: 400px) {
  .dpad { width: 108px; height: 108px; right: 6px; bottom: 6px; }
  .dpad-btn { font-size: 14px; border-radius: 8px; }
}

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