/* GassMan — car choice, multiplayer lobby and race standings (matches Heat City's menu style). */

/* Sits on the same line as the start button where there is room (no extra height). */
#gmp-menu { display: inline-flex; flex-wrap: wrap; gap: 10px; margin: 0 0 0 10px; vertical-align: top; }
@media (width <= 800px), (pointer: coarse) { #gmp-menu { display: flex; margin: 10px 0 0; } }
/* Short screens: make room for the extra row by dropping the tagline. */
@media (max-height: 760px) { #menu > p:not(#career-summary) { display: none; } }
@media (max-height: 520px) { #gmp-menu { margin-top: 8px; } #gmp-menu button { min-height: 36px; padding: 8px 12px; font-size: 10px; } }
#gmp-menu button, #gmp-panel button, #gmp-standings button {
  font: 700 11px/1 Arial, sans-serif;
  letter-spacing: 1.5px;
  color: #ece9df;
  background: #142127bf;
  border: 1px solid #ffffff44;
  padding: 14px 16px;
  min-height: 44px;
}
#gmp-menu b, #gmp-panel button b { color: #d4aa5c; margin-left: 6px; }
#gmp-friends { border-color: #d4aa5c !important; }
#gmp-panel button.primary, #gmp-standings button.primary { color: #171b1d; background: #d4aa5c; border-color: #d4aa5c; font-weight: 800; }
#gmp-panel button:disabled { opacity: .45; }
#gmp-panel button[aria-pressed="true"] { background: #d4aa5c; color: #171b1d; border-color: #d4aa5c; }
#gmp-panel button[aria-pressed="true"] b { color: #171b1d; }

body.gmp-open #menu { display: none !important; }
#gmp-panel {
  position: absolute;
  top: 16%;
  left: 6%;
  width: min(560px, 88%);
  z-index: 30;
  text-shadow: 0 2px 12px #0009;
}
#gmp-panel[hidden] { display: none; }
#gmp-panel .eyebrow { font: 700 11px/1.4 Arial, sans-serif; letter-spacing: 2.4px; color: #d9d4c4; }
#gmp-panel .code { color: #d4aa5c; letter-spacing: 3px; }
#gmp-panel h2 { margin: 14px 0; font: italic 800 clamp(42px, 5.5vw, 76px)/.93 'Barlow Condensed', Arial, sans-serif; letter-spacing: -1px; }
#gmp-panel h2 em { color: #d4aa5c; font-style: italic; }
#gmp-panel p { margin: 0 0 14px; color: #d9d4c4; font: 14px/1.6 Arial, sans-serif; }
#gmp-panel label { display: block; font: 700 10px Arial, sans-serif; letter-spacing: 2px; color: #d9d4c4; margin-bottom: 8px; }
#gmp-name {
  width: 100%; max-width: 340px; margin-bottom: 14px; padding: 11px 13px;
  font: 18px Arial, sans-serif; color: #ece9df; background: #10191dcc; border: 1px solid #ffffff55; border-radius: 0;
}
.gmp-actions, .gmp-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.gmp-pill { font: 700 10px Arial, sans-serif; letter-spacing: 1.6px; padding: 12px 14px; border: 1px solid #ffffff33; color: #d9d4c4; }
.gmp-link { font: 11px Arial, sans-serif; color: #b9b4a4; word-break: break-all; margin: 4px 0; }
.gmp-status { font: 700 10px Arial, sans-serif; letter-spacing: 1.8px; color: #d9d4c4; margin: 8px 0; }
.gmp-players { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.gmp-players li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid #ffffff22; font: 14px Arial, sans-serif; white-space: nowrap; overflow: hidden; }
.gmp-players i, #gmp-standings i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px #fff4; }
.gmp-players em { font: normal 700 9px Arial, sans-serif; letter-spacing: 1.4px; color: #d4aa5c; }
.gmp-players em.car { color: #8fc6e8; }
.gmp-players em.away { color: #9aa3a8; }

#gmp-standings:empty { display: none; }
#gmp-standings ol { list-style: none; padding: 0; margin: 10px 0; max-width: 440px; }
#gmp-standings li { display: flex; align-items: center; gap: 11px; padding: 6px 0; border-bottom: 1px solid #ffffff22; font: 14px Arial, sans-serif; }
#gmp-standings li span { width: 18px; color: #b9b4a4; }
#gmp-standings li b { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; }
#gmp-standings li.me { color: #d4aa5c; }
/* A local retry would desync a shared race. */
body.gmp-racing #retry-event { display: none; }

#gmp-toast {
  position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 95;
  display: none; max-width: 92vw; padding: 11px 16px; pointer-events: none;
  font: 700 10px/1.3 Arial, sans-serif; letter-spacing: 1.6px; color: #ece9df; background: #151d20ee; border: 1px solid #ffffff55;
}
#gmp-toast.show { display: block; }

@media (max-height: 520px) {
  #gmp-panel { top: calc(14px + env(safe-area-inset-top, 0px)); width: min(680px, 90%); }
  #gmp-panel h2 { font-size: 38px; margin: 6px 0; }
  #gmp-panel p { margin-bottom: 8px; }
  .gmp-players li { padding: 4px 0; }
  .gmp-actions, .gmp-row { margin: 6px 0; }
  #gmp-panel button, #gmp-menu button { padding: 10px 12px; min-height: 40px; }
}
body.gm-touch #gmp-panel, body.gm-touch #gmp-toast { zoom: var(--uz); }

/* Menu sits near the top of the screen (Heat City placed it at 20%). */
body #menu { top: 5%; scrollbar-width: none; }
/* Phones: never tuck the menu under the header bar. */
@media (pointer: coarse), (width <= 800px) { body #menu { top: max(5%, calc(76px + env(safe-area-inset-top, 0px))); } }
body #menu::-webkit-scrollbar { display: none; }

/* ---------- Garage (car picker) ---------- */
#gmp-garage {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: #090c0ecc;
  backdrop-filter: blur(4px);
}
#gmp-garage[hidden] { display: none; }
.gmp-garage-box {
  width: min(980px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 20px;
  background: #121a1ef2;
  border: 1px solid #ffffff2e;
  box-shadow: 0 20px 60px #000a;
  color: #ece9df;
  font-family: Arial, sans-serif;
}
.gmp-garage-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.gmp-garage-head h2 { margin: 0; font: italic 900 26px/1 "Bebas Neue", Impact, Arial Narrow, sans-serif; letter-spacing: 1px; }
.gmp-garage-head small { flex: 1; font-size: 9px; letter-spacing: 1.6px; color: #ece9df99; }
.gmp-x { width: 40px; height: 40px; color: #ece9df; background: transparent; border: 1px solid #ffffff44; font-size: 16px; cursor: pointer; }
.gmp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gmp-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  color: inherit;
  background: #0d1316;
  border: 1px solid #ffffff26;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.gmp-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #1b2429; }
.gmp-card span { display: block; padding: 9px 11px 11px; }
.gmp-card b { display: block; font-size: 12px; letter-spacing: 1.4px; }
.gmp-card small { display: block; margin-top: 4px; font-size: 9px; letter-spacing: 1.3px; color: #ece9df88; }
.gmp-card:hover, .gmp-card:focus-visible { border-color: #d4aa5c; outline: none; transform: translateY(-2px); }
.gmp-card[aria-pressed="true"] { border-color: #d4aa5c; box-shadow: inset 0 0 0 1px #d4aa5c; }
.gmp-card[aria-pressed="true"] b { color: #d4aa5c; }
.gmp-card[aria-pressed="true"] b::after { content: " ✓"; }
/* Phones: four small cards per row in landscape, two in portrait; image shorter so two rows fit. */
@media (max-height: 520px) {
  .gmp-garage-box { padding: 10px 12px 12px; }
  .gmp-garage-head { margin-bottom: 8px; }
  .gmp-garage-head h2 { font-size: 20px; }
  .gmp-cards { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .gmp-card img { aspect-ratio: 2 / 1; }
  .gmp-card span { padding: 6px 8px 8px; }
  .gmp-card b { font-size: 10px; }
  .gmp-card small { font-size: 8px; }
}
@media (max-width: 520px) {
  .gmp-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gmp-garage-head { flex-wrap: wrap; }
  .gmp-garage-head small { order: 3; flex-basis: 100%; }
  .gmp-garage-head h2 { flex: 1; }
}
body.gm-touch .gmp-garage-box { zoom: var(--uz); }
