/* =============================================================
   GAME: Desert Runner
   ============================================================= */
.board-desertrunner { display: flex; flex-direction: column; align-items: center; gap: 10px; outline: none; width: 100%; max-width: 100%; }
.dr-stage { position: relative; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; max-width: 100%; }
.dr-canvas {
  display: block; width: 480px; height: 240px; max-width: 100%; border-radius: 14px; background: #140a24;
  box-shadow: 0 0 0 2px #ff9a3d, 0 0 26px rgba(255, 154, 61, .35);
}
.board-desertrunner:focus-visible .dr-canvas { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(255, 154, 61, .55); }
.dr-msg {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: max-content; max-width: 86%;
  padding: 8px 14px; border-radius: 12px; background: rgba(26, 10, 32, .84); color: #fff1e0; font-weight: 700; font-size: .92rem; text-align: center;
  box-shadow: 0 0 0 1px rgba(255, 154, 61, .6); pointer-events: none;
}
.dr-msg[hidden] { display: none; }
.dr-pop {
  position: absolute; left: 0; right: 0; top: 18%; text-align: center; pointer-events: none; opacity: 0;
  font: 800 1.4rem var(--font-head, system-ui); color: #fff; text-shadow: 0 0 12px #ff9a3d, 0 0 26px #ff5f3d;
}
.dr-pop.show { animation: drPop 1.1s ease-out forwards; }
@keyframes drPop { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .dr-pop.show { animation: drFade 1.1s linear forwards; } }
@keyframes drFade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.dr-num { color: #ffc27a; font-variant-numeric: tabular-nums; }

/* on-screen buttons: phones and tablets only */
.dr-pad { display: none; align-items: center; gap: 10px; width: min(100%, 460px); touch-action: none; }
.dr-key {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 64px; border: 0; border-radius: 16px; cursor: pointer;
  color: #ffc27a; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(255, 154, 61, .5), 0 4px 0 rgba(0, 0, 0, .35);
  font: 800 .95rem var(--font-head, system-ui); text-transform: uppercase; letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.dr-key svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.dr-key-jump, .dr-key-duck { flex: 1; min-width: 0; }
.dr-key-duck { color: #c9a6ff; box-shadow: inset 0 0 0 1px rgba(196, 107, 255, .5), 0 4px 0 rgba(0, 0, 0, .35); }
.dr-key-pause { width: 52px; height: 52px; flex: none; color: var(--ink); border-radius: 50%; }
.dr-key-pause svg { width: 20px; height: 20px; }
.dr-key.down, .dr-key:active { background: #3a1d10; transform: translateY(2px); box-shadow: inset 0 0 0 1px #ff9a3d, 0 2px 0 rgba(0, 0, 0, .35); }
@media (pointer: coarse) { .dr-pad { display: flex; } }

/* crash: a short shake of the frame (off when motion is reduced) */
.dr-crash .dr-canvas { box-shadow: 0 0 0 2px #ff3d5e, 0 0 30px rgba(255, 61, 94, .55); transition: box-shadow .3s; }
.dr-crash { animation: drShake .4s cubic-bezier(.36, .07, .19, .97); }
@keyframes drShake { 15%, 55% { translate: -5px 0; } 35%, 75% { translate: 5px 0; } 90% { translate: -2px 0; } }
@media (prefers-reduced-motion: reduce) { .dr-crash { animation: none; } }
