/* Play Parking — games.css : game shell, HUD, overlays, touch controls */

.game-shell {
  --g-bg: #0f1318;
  --g-panel: #171d25;
  --g-line: #2a333f;
  --g-text: #eef2f6;
  --g-muted: #a9b4c1;
  background: var(--g-bg);
  color: var(--g-text);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  border: 1px solid var(--g-line);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.game-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 1px;
  background: var(--g-line);
  border-bottom: 1px solid var(--g-line);
}
.hud-item { background: var(--g-panel); padding: 6px 10px; min-width: 0; }
.hud-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--g-muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-value { display: block; font: 800 1.05rem/1.2 ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-item[data-warn="true"] .hud-value { color: #ff7b7b; }
.hud-status {
  grid-column: 1 / -1;
  background: #111820;
  padding: 7px 12px;
  font-weight: 750;
  font-size: .95rem;
  color: #ffd35a;
  display: flex; align-items: center; gap: 8px;
  min-height: 36px;
}
.hud-status::before { content: "●"; font-size: .7rem; color: #ffc21a; }
.hud-status[data-ok="true"] { color: #6ff0a6; }
.hud-status[data-ok="true"]::before { content: "✔"; color: #6ff0a6; font-size: .85rem; }

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 74vh;
  background: #16191e;
  touch-action: none;
}
.game-canvas { width: 100%; height: 100%; touch-action: none; }
.game-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 14px;
  background: rgba(8, 11, 15, .72);
  overflow-y: auto;
}
.ov-box {
  width: 100%; max-width: 520px; background: #151b23; border: 1px solid #2d3743; border-radius: 14px;
  padding: 18px 20px; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  -webkit-user-select: text; user-select: text;
}
.ov-title { color: #ffc21a; font-size: 1.5rem; margin: 0 0 6px; }
.ov-text { color: #dfe6ee; margin: 0 0 10px; font-size: .98rem; }
.ov-note { color: var(--g-muted); font-size: .88rem; margin: 6px 0; }
.ov-keys { color: var(--g-muted); font-size: .78rem; margin: 10px 0 0; }
.ov-best { color: #6ff0a6; font-weight: 800; margin: 6px 0; }
.ov-big { font-size: 1.3rem; font-weight: 800; color: #fff; margin: 6px 0 10px; }
.ov-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.ov-box .btn-ghost { color: #eef2f6; border-color: #3a4655; }
.ov-box .btn-ghost:hover { background: #222b36; color: #fff; }
.ov-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .9rem; }
.ov-table th { text-align: left; font-weight: 600; color: #cdd6e0; padding: 4px 6px; }
.ov-table td { text-align: right; font-family: ui-monospace, Consolas, monospace; padding: 4px 6px; color: #fff; }
.ov-table tr + tr { border-top: 1px solid #26303b; }
.ov-total th, .ov-total td { font-weight: 800; color: #ffc21a; }
.ov-levels { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0; }
.lvl-btn {
  min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid #3a4655; background: #1f2832; color: #fff;
  font-weight: 800; cursor: pointer;
}
.lvl-btn:hover:not([disabled]) { background: #2b3642; }
.lvl-btn[disabled] { opacity: .35; cursor: not-allowed; }
.ov-share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.ov-share-msg { min-height: 1.2em; color: #6ff0a6; font-size: .88rem; margin: 6px 0 0; }
.ov-copy { width: 100%; min-height: 60px; margin-top: 6px; background: #0f1318; color: #fff; border: 1px solid #3a4655; border-radius: 8px; padding: 8px; font: .85rem var(--font); }

.game-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; background: var(--g-panel); border-top: 1px solid var(--g-line);
}
.tool-btn {
  min-height: 40px; padding: 6px 12px; border-radius: 9px; border: 1px solid #334050; background: #1f2832; color: #eef2f6;
  font: 700 .88rem var(--font); cursor: pointer;
}
.tool-btn:hover:not([disabled]) { background: #2b3642; }
.tool-btn[disabled] { opacity: .45; cursor: not-allowed; }
.tool-btn[aria-pressed="false"] { color: #a9b4c1; }

.touch-controls {
  display: flex; justify-content: space-between; align-items: stretch; gap: 12px;
  padding: 10px; background: #121820; border-top: 1px solid var(--g-line);
  touch-action: none;
}
.tc-group { display: flex; gap: 10px; }
.tc-btn {
  min-width: 72px; min-height: 64px; padding: 6px 12px; border-radius: 14px;
  border: 2px solid #3a4655; background: #222c38; color: #fff; cursor: pointer;
  font: 900 1rem/1.1 var(--font); letter-spacing: .03em; touch-action: none;
  display: grid; place-items: center; text-align: center;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.tc-btn .tc-ico { font-size: 1.5rem; line-height: 1; }
.tc-btn.is-pressed { background: #33455a; border-color: #ffc21a; transform: translateY(1px); }
.tc-gas { background: #1d5c3a; border-color: #2e8a58; min-width: 96px; }
.tc-gas.is-pressed { background: #26784c; }
.tc-brake { background: #6b2229; border-color: #963640; min-width: 96px; }
.tc-brake.is-pressed { background: #85303a; }
.tc-hint { text-align: center; font-size: .78rem; color: var(--g-muted); padding: 0 10px 8px; background: #121820; margin: 0; }

.game-shell.is-fullscreen { display: flex; flex-direction: column; height: 100vh; border-radius: 0; }
.game-shell.is-fullscreen .game-stage { flex: 1; aspect-ratio: auto; max-height: none; }

.game-noscript { padding: 20px; background: #3a1d1d; color: #fff; }

/* game page layout */
.game-page-intro { max-width: 70ch; }
.game-actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.controls-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.controls-table th, .controls-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.controls-table th { width: 42%; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.info-card h2 { font-size: 1.25rem; }
.info-card ol, .info-card ul { margin: 0; }
.info-card li { margin-bottom: .4em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 8px 0 0; }

/* keep the HUD clear of the sticky header when the game scrolls into view */
.game-shell { scroll-margin-top: 76px; }
@media (max-width: 420px) { .hud-label { letter-spacing: .02em; font-size: .62rem; } }

