/* =====================================================================
   MotionQ — "Service Rush" game page
   Uses the design tokens from styles.css (loaded first).
   ===================================================================== */

.game-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;                     /* fit the visible area on mobile */
  overflow: hidden;
  background: #000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#game {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  touch-action: none;                 /* no scroll / pinch over the canvas */
}

/* Burger menu (top-right) — reuses .menu-btn / .menu from styles.css */
.game-menu-btn {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  z-index: 12;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
}
.game-menu {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  z-index: 12;
}
.game-menu button {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.game-menu button:hover { background: var(--grey-50); }

/* Warning strip (slides in from the top when a service is due) */
.warn {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  padding: 10px 16px;
  background: var(--warning);
  color: var(--ink);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform .3s var(--ease);
}
.warn.show { transform: none; }

/* Transient message */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  z-index: 5;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 10, 11, .9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* On-screen controls.
   Anchored to the *visible* viewport (svh) so mobile browser bars can't
   hide them, plus safe-area padding for notches / home indicators. */
.controls {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(100vh - 108px);                                   /* fallback */
  top: calc(100svh - 108px - env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  justify-content: space-between;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  pointer-events: none;                /* only the buttons are interactive */
}
.ctrl {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  padding: 18px 28px;
  border: 0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-float);
}
.ctrl--gas   { background: var(--ink); color: #fff; }
.ctrl--brake { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.ctrl:active { transform: translateY(1px); }

/* Start / game-over overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(244, 244, 245, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay.show { display: grid; }
.card {
  width: 100%;
  max-width: 420px;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: #fff;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.card h1 { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.card > p { margin: 0 0 18px; color: var(--muted); }
.card ul {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  color: #3F3F46;
}
.game-best { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.game-link { display: inline-block; margin-top: 14px; color: var(--muted); font-size: 14px; }

@media (max-width: 520px) {
  .ctrl { min-width: 128px; padding: 18px 24px; font-size: 16px; text-align: center; }
  .card { padding: 26px 22px; }
}
