/* ============================================================
   Parking Jam — game-specific styles
   ============================================================ */

.rh-toolbar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

/* --- Level select --- */
#level-select-view {
  width: 100%;
}

.rh-intro {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 0 22px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.level-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 4px 0 rgba(34, 49, 74, 0.12);
  transition: transform 0.1s ease;
}
.level-btn:hover:not(:disabled) { transform: translateY(-2px); }
.level-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(34,49,74,0.12); }

.level-btn.completed {
  background: var(--simon-green);
  color: #fff;
  border-color: var(--ink);
}
.level-btn .best {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 800;
  opacity: 0.9;
}

.level-btn .diff-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.diff-easy   { background: var(--simon-green); }
.diff-medium { background: var(--yellow-deep); }
.diff-hard   { background: var(--pink-deep); }
.diff-expert { background: var(--purple-deep); }

.rh-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.rh-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rh-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* --- Gameplay header --- */
.rh-play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}
.rh-level-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.difficulty-chip {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.pill-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(34, 49, 74, 0.12);
}
.pill-btn:hover { transform: translateY(-1px); }
.pill-btn:active { transform: translateY(1px); box-shadow: none; }

/* --- Board --- */
.rh-board-wrap {
  position: relative;
  width: min(420px, 82vw);
  aspect-ratio: 1;
  margin: 6px auto 0;
}
.rh-board {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background-color: var(--bg-soft);
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 6) calc(100% / 6);
  overflow: visible;
}

.rh-exit {
  position: absolute;
  top: calc(100% / 6 * 2);
  right: -40px;
  width: 40px;
  height: calc(100% / 6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.rh-exit-sign {
  background: var(--simon-green);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.55rem;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.rh-exit-arrow {
  color: var(--simon-green);
  font-size: 1rem;
  line-height: 1;
}

.rh-vehicle {
  position: absolute;
  border-radius: 8px;
  border: 2px solid var(--ink);
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12);
  overflow: visible;
}
.rh-vehicle:active { cursor: grabbing; }
.rh-vehicle.target {
  background: var(--simon-red);
  z-index: 5;
}
.rh-vehicle.dragging {
  z-index: 10;
  box-shadow: 0 6px 14px rgba(34,49,74,0.25);
}

.vh-headlight {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFD93D;
  border: 1px solid rgba(34, 49, 74, 0.5);
  pointer-events: none;
  z-index: 2;
}
.vh-taillight {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(34, 49, 74, 0.5);
  pointer-events: none;
  z-index: 2;
}
.vh-wheel-well {
  position: absolute;
  background: #22314A;
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}
.vh-mirror {
  position: absolute;
  background: #22314A;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.vh-roof {
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  pointer-events: none;
}
.vh-bed {
  position: absolute;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  pointer-events: none;
}
.vh-cab {
  position: absolute;
  background: rgba(34, 49, 74, 0.75);
  border-radius: 6px;
  pointer-events: none;
}
.vh-seam {
  position: absolute;
  background: rgba(34, 49, 74, 0.55);
  pointer-events: none;
}
.vh-seam-thin {
  position: absolute;
  background: rgba(34, 49, 74, 0.32);
  pointer-events: none;
}

/* --- Scoreboard (shared .scoreboard/.score-chip styles live in game-common.css) --- */

.instructions.rh {
  margin-top: 4px;
}

/* --- Win overlay --- */
.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 49, 74, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.win-overlay[hidden] {
  display: none;
}
.win-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 3px solid var(--ink);
  padding: 32px 28px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 16px 0 rgba(34,49,74,0.18);
}
.win-card h2 {
  font-family: var(--font-display);
  margin: 0 0 10px;
  font-size: 1.5rem;
}
.win-card p {
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 0 22px;
}
.win-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  background: var(--simon-green);
  color: #fff;
}
.cta-btn.secondary {
  background: var(--surface);
  color: var(--ink);
}
.cta-btn:hover { filter: brightness(1.08); }
.cta-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* --- Fullscreen mode --- */
#game-stage:fullscreen {
  border-radius: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  justify-content: center;
  background: var(--bg-soft);
  overflow-y: auto;
}
#game-stage:fullscreen .rh-board-wrap {
  width: min(70vh, 82vw);
}

@media (max-width: 480px) {
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
  .level-btn { font-size: 0.9rem; }
}
