/* RakibDigital — Rickshaw Race game page */
.game-wrap { padding: 150px 0 60px; }
.game-hero p { color: var(--muted); max-width: 640px; }
.game-hero .crumb { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.game-hero .crumb a { color: var(--acc2); }

.game-shell {
  max-width: 560px;
  margin: 28px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 16px 20px;
}

/* ---- HUD ---- */
.hud {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}
.hud-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}
.hud-card .hud-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hud-card .hud-score { font-family: var(--font-d); font-weight: 800; font-size: 1.45rem; line-height: 1.15; color: var(--acc2); }
.hud-card .hud-sub { font-size: .78rem; color: var(--muted); }
.hud-shield {
  display: none; align-items: center; justify-content: center; gap: 4px;
  font-size: .8rem; font-weight: 700; color: #85c1e9; margin-top: 2px;
}
.hud-shield.on { display: inline-flex; }

.speed-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; margin-bottom: 14px;
  font-weight: 600; font-size: .92rem;
}
.speed-bar .speed-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--acc1);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }

/* ---- Road / canvas ---- */
.race-zone { position: relative; width: 100%; max-width: 480px; margin: 0 auto; }
#raceCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  background: #23262f;
}
#raceCanvas.dragging { cursor: grabbing; }

/* message line */
.game-msg {
  min-height: 26px; text-align: center; color: var(--acc2);
  font-weight: 600; margin-top: 12px; font-size: .98rem;
}

/* controls */
.game-controls {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px;
}
.game-controls .btn { min-height: 46px; padding: 0 22px; font-size: .98rem; }
.btn-sound[aria-pressed="false"] { opacity: .65; }

/* hint */
.game-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; line-height: 1.6; }
.game-hint kbd {
  background: var(--bg2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; font-family: inherit; font-size: .82rem; color: var(--white);
}

/* ---- Rules modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,8,18,.78);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  max-width: 520px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.modal-card h3 { font-family: var(--font-d); font-size: 1.35rem; margin-bottom: 12px; }
.modal-card h3 span { color: var(--acc2); }
.modal-card ol { margin: 0 0 6px 20px; color: #d6dcee; line-height: 1.75; font-size: .95rem; }
.modal-card .btn { margin-top: 16px; width: 100%; }

/* ---- Start / game-over / pause overlays (over the road) ---- */
.race-overlay {
  position: absolute; inset: 0; border-radius: 10px;
  background: rgba(6,10,22,.82);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; z-index: 5; padding: 20px;
}
.race-overlay.open { display: flex; }
.race-overlay .ov-emoji { font-size: 3rem; line-height: 1; }
.race-overlay h2 { font-family: var(--font-d); font-size: 1.8rem; }
.race-overlay h2 span { color: var(--acc2); }
.race-overlay p { color: var(--muted); max-width: 340px; }
.race-overlay .btn { margin-top: 10px; min-width: 200px; }
.ov-stats { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.ov-stat {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; min-width: 110px;
}
.ov-stat .ov-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ov-stat .ov-val { font-family: var(--font-d); font-weight: 800; font-size: 1.35rem; color: var(--acc2); }
.new-best {
  display: none; background: var(--grad); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 5px 16px; font-size: .85rem;
}

@media (max-width: 560px) {
  .game-wrap { padding-top: 120px; }
  .game-shell { padding: 10px 10px 14px; border-radius: 14px; }
  .hud-card .hud-score { font-size: 1.2rem; }
  .hud-card { padding: 7px 6px; }
  .game-controls .btn { flex: 1 1 40%; padding: 0 10px; }
  .race-overlay h2 { font-size: 1.45rem; }
  /* the floating WhatsApp button would cover the road on phones — hide it
     on this page only (contact links stay in the footer and Hire Me) */
  .wa-float { display: none; }
}
