/* =========================================================
   PARK FEVER — core styles
   ========================================================= */
:root {
  --bg-0: #070b16;
  --bg-1: #101a30;
  --bg-2: #17243f;
  --ink: #eaf1ff;
  --ink-dim: #9fb0cc;
  --accent: #ffd23f;
  --accent-2: #ff8a3d;
  --brand: #38e07b;
  --brand-dark: #17a35a;
  --danger: #ff5470;
  --panel: rgba(14, 22, 40, 0.92);
  --panel-brd: rgba(120, 160, 220, 0.22);
  --radius: 18px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: "Trebuchet MS", "Segoe UI", Verdana, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

#root {
  display: none;
}

.pf-app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #1d2c4d 0%, #0a1120 60%, #06090f 100%);
  user-select: none;
  -webkit-user-select: none;
}

#pf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.is-hidden {
  display: none !important;
}

/* ========================= BUTTONS ========================= */
.btn {
  position: relative;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(46, 66, 104, 0.95), rgba(24, 36, 62, 0.95));
  color: var(--ink);
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: clamp(13px, 1.6vw, 16px);
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.btn:hover {
  filter: brightness(1.13);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.btn-primary {
  background: linear-gradient(180deg, #4ff08c, #17a35a);
  border-color: rgba(255, 255, 255, 0.3);
  color: #06220f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 0 #0c6d3b, 0 12px 24px rgba(23, 163, 90, 0.35);
}
.btn-primary:active {
  box-shadow: 0 2px 0 #0c6d3b;
}
.btn-danger {
  background: linear-gradient(180deg, #ff7189, #d3253f);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 6px 0 #8c1327;
}
.btn-danger:active {
  box-shadow: 0 2px 0 #8c1327;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.btn-xl {
  font-size: clamp(17px, 2.4vw, 23px);
  padding: 20px 30px;
}
.btn-block {
  width: 100%;
}
.btn-ico {
  font-size: 1.05em;
}

/* ========================= SCREENS ========================= */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 20;
}
.screen.is-active {
  display: flex;
}
.screen-overlay {
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 18px;
}
.screen-panel {
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(38, 62, 108, 0.85), rgba(6, 10, 20, 0.95)),
    rgba(6, 10, 20, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* ========================= LOADING ========================= */
.screen-loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(90% 70% at 50% 30%, #1b2a4b, #060a13 75%);
  z-index: 60;
}
.loader-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}
.loader-sign {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: linear-gradient(180deg, #3aa0ff, #1462cc);
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 10px 26px rgba(20, 98, 204, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.loader-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 48px);
  letter-spacing: 0.14em;
  font-weight: 900;
}
.loader-bar {
  width: min(360px, 74vw);
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.18s ease;
}
.loader-tip {
  color: var(--ink-dim);
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.06em;
}

/* ========================= MAIN MENU ========================= */
.screen-menu {
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.menu-inner {
  position: relative;
  width: min(560px, 94vw);
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 34px);
  padding: clamp(24px, 4vh, 40px) clamp(20px, 5vw, 42px);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(16, 26, 48, 0.86), rgba(8, 13, 26, 0.92));
  border: 1px solid var(--panel-brd);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
}
.title-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.title-badge {
  font-size: clamp(30px, 7vw, 44px);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}
.game-title {
  margin: 0;
  font-size: clamp(38px, 9vw, 68px);
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff 20%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 24px rgba(255, 180, 40, 0.18);
}
.game-title span {
  display: block;
  background: linear-gradient(180deg, #fff 20%, #57c7ff 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.game-sub {
  margin: 4px 0 0;
  color: var(--ink-dim);
  letter-spacing: 0.24em;
  font-size: clamp(10px, 2.4vw, 13px);
  text-transform: uppercase;
}
.menu-buttons {
  width: 100%;
  display: grid;
  gap: 10px;
}
.menu-stats {
  display: flex;
  gap: 10px;
  width: 100%;
}
.stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}
.stat-value {
  display: block;
  font-size: clamp(16px, 3.4vw, 22px);
  font-weight: 900;
  color: var(--accent);
}
.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  margin-top: 2px;
}

/* ========================= PANELS ========================= */
.panel {
  width: min(1040px, 96vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.panel-narrow {
  width: min(560px, 96vw);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(56, 82, 130, 0.55), rgba(20, 30, 52, 0.2));
  border-bottom: 1px solid var(--panel-brd);
}
.panel-title {
  margin: 0;
  font-size: clamp(16px, 3vw, 24px);
  letter-spacing: 0.16em;
  font-weight: 900;
  text-align: center;
  flex: 1;
}
.panel-head-right {
  min-width: 84px;
  text-align: right;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}
.btn-back {
  padding: 10px 14px;
  font-size: 12px;
}
.panel-body {
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ========================= LEVEL GRID ========================= */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.level-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(58, 86, 138, 0.9), rgba(24, 38, 66, 0.9));
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  font-family: var(--font);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.level-tile:hover:not(.locked) {
  filter: brightness(1.15);
  transform: translateY(-2px);
}
.level-tile:active:not(.locked) {
  transform: translateY(2px);
}
.level-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.level-tile .lv-num {
  font-size: clamp(20px, 4vw, 27px);
  font-weight: 900;
  line-height: 1;
}
.level-tile .lv-name {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.level-tile .lv-stars {
  font-size: 13px;
  letter-spacing: 1px;
  color: #48597a;
}
.level-tile .lv-stars .on {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 210, 63, 0.6);
}
.level-tile.locked {
  background: linear-gradient(180deg, rgba(34, 44, 66, 0.85), rgba(18, 24, 40, 0.85));
  color: #5d6c88;
  cursor: not-allowed;
  box-shadow: none;
}
.level-tile.completed {
  border-color: rgba(56, 224, 123, 0.4);
}
.level-tile .lv-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 11px;
}
.level-tile.current::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  border: 2px solid var(--accent);
  animation: pf-pulse-border 1.4s ease-in-out infinite;
  pointer-events: none;
}

/* ========================= GARAGE ========================= */
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
}
.veh-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(38, 56, 92, 0.9), rgba(18, 28, 50, 0.9));
  padding: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.1s ease, border-color 0.15s ease;
}
.veh-card:hover {
  transform: translateY(-2px);
}
.veh-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.veh-card.selected {
  border-color: var(--brand);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(56, 224, 123, 0.5) inset;
}
.veh-card.locked {
  opacity: 0.62;
  cursor: not-allowed;
}
.veh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.veh-name {
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 15px;
}
.veh-tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  letter-spacing: 0.08em;
}
.veh-tag.on {
  background: var(--brand);
  color: #06220f;
  font-weight: 900;
}
.veh-canvas {
  width: 100%;
  height: 74px;
  border-radius: 12px;
  background: linear-gradient(180deg, #253654, #16223b);
  display: block;
}
.veh-stats {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-dim);
}
.veh-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.veh-stat b {
  color: var(--accent);
  letter-spacing: 2px;
  font-size: 12px;
}
.veh-desc {
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.35;
}

/* ========================= HOW TO PLAY ========================= */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.card p,
.card li {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #cddaf0;
}
.card-ico {
  font-size: 16px;
}
.tick-list {
  margin: 0;
  padding-left: 18px;
}
.star-legend {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
}
.key-rows {
  display: grid;
  gap: 6px;
}
.key-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #cddaf0;
}
.key-row em {
  font-style: normal;
  color: var(--ink-dim);
  margin-left: auto;
}
.key {
  min-width: 30px;
  padding: 4px 7px;
  text-align: center;
  border-radius: 7px;
  background: linear-gradient(180deg, #eef3ff, #b9c8e4);
  color: #10192c;
  font-weight: 900;
  font-size: 11px;
  box-shadow: 0 2px 0 #6f7f9d;
}
.key-wide {
  min-width: 66px;
}
.touch-demo {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.td-cluster {
  display: flex;
  gap: 6px;
  align-items: center;
}
.td-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 14px;
  font-weight: 900;
}
.td-btn.td-gas {
  background: rgba(56, 224, 123, 0.35);
}
.td-btn.td-brake {
  width: auto;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 10px;
  background: rgba(255, 84, 112, 0.32);
}

/* ========================= SETTINGS ========================= */
.settings-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.setting-name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.setting-desc {
  font-size: 11px;
  color: var(--ink-dim);
  margin-top: 2px;
}
.toggle {
  flex: none;
  width: 62px;
  height: 32px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #33405c;
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
}
.toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dbe6fb;
  transition: transform 0.18s cubic-bezier(0.3, 1.5, 0.6, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.toggle[aria-checked="true"] {
  background: linear-gradient(90deg, #17a35a, #3ce782);
}
.toggle[aria-checked="true"] .toggle-knob {
  transform: translateX(30px);
}
.settings-note {
  color: var(--ink-dim);
  font-size: 12px;
  text-align: center;
  margin: 12px 0 0;
}

/* ========================= MODALS ========================= */
.modal {
  width: min(460px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(22, 34, 60, 0.98), rgba(10, 16, 30, 0.98));
  border: 1px solid var(--panel-brd);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: clamp(18px, 4vw, 28px);
  text-align: center;
  animation: pf-pop 0.28s cubic-bezier(0.2, 1.4, 0.5, 1);
}
.modal-narrow {
  width: min(380px, 92vw);
}
.modal-title {
  margin: 0 0 16px;
  font-size: clamp(22px, 5vw, 32px);
  letter-spacing: 0.16em;
  font-weight: 900;
}
.modal-buttons {
  display: grid;
  gap: 10px;
}
.modal-buttons-row {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.result-banner {
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--brand);
  text-shadow: 0 6px 20px rgba(56, 224, 123, 0.4);
}
.result-banner.fail {
  color: var(--danger);
  text-shadow: 0 6px 20px rgba(255, 84, 112, 0.35);
}
.stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 6px;
}
.star {
  font-size: clamp(34px, 8vw, 52px);
  color: #3b4a68;
  transform: scale(0.6);
  opacity: 0.5;
  transition: none;
}
.star.on {
  color: var(--accent);
  text-shadow: 0 0 22px rgba(255, 210, 63, 0.75);
  animation: pf-star-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
}
.result-grade {
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 12px;
}
.score-lines {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 5px;
  text-align: left;
}
.score-lines li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #c6d5ef;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  animation: pf-slide-in 0.3s ease both;
}
.score-lines li b {
  color: var(--brand);
}
.score-lines li.neg b {
  color: var(--danger);
}
.result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 210, 63, 0.12);
  border: 1px solid rgba(255, 210, 63, 0.3);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.result-total strong {
  font-size: 22px;
  color: var(--accent);
}
.result-best {
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.fail-reason {
  color: #d7e2f5;
  font-size: 15px;
  margin: 10px 0 20px;
}
.confirm-text {
  color: var(--ink-dim);
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ========================= HUD ========================= */
.hud {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 10px
    max(10px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hud-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.hud-chip {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(9, 15, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 12px;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.hud-brand {
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.14em;
}
.hud-brand-p {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #2b8cff;
  color: #fff;
  font-size: 12px;
}
.hud-label {
  color: var(--ink-dim);
  font-size: 10px;
}
.hud-value {
  font-weight: 900;
  font-size: 14px;
}
.hud-chip.warn {
  border-color: rgba(255, 84, 112, 0.8);
  background: rgba(80, 12, 26, 0.8);
  animation: pf-flash 0.7s ease-in-out infinite;
}
.hud-right {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.hud-btn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(9, 15, 28, 0.78);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.hud-btn:active {
  transform: scale(0.94);
}
.hud-btn:focus-visible {
  outline: 3px solid var(--accent);
}
.hud-objective {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(9, 15, 28, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #d6e3f8;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 92vw;
  text-align: center;
}
.hud-park-meter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(150px, 26vh, 260px);
  width: min(300px, 74vw);
  text-align: center;
}
.hud-park-meter.pm-top {
  bottom: auto;
  top: 26%;
}
.park-meter-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.park-meter-bar {
  height: 12px;
  border-radius: 99px;
  background: rgba(6, 10, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.park-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38e07b, #ffd23f);
  transition: width 0.08s linear;
}
.hud-toast-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 34%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 90vw;
}
.toast {
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(9, 15, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: clamp(12px, 3vw, 15px);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #eaf1ff;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: pf-toast 0.35s ease both;
}
.toast.out {
  animation: pf-toast-out 0.3s ease forwards;
}
.hud-popup-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.score-pop {
  position: absolute;
  font-weight: 900;
  font-size: clamp(16px, 3.6vw, 24px);
  color: var(--brand);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
  animation: pf-pop-up 1.05s ease-out forwards;
  white-space: nowrap;
}
.score-pop.neg {
  color: var(--danger);
}

/* ========================= TOUCH CONTROLS ========================= */
.touch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  pointer-events: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(16px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-right));
  touch-action: none;
}
.touch-controls.is-on {
  display: flex;
  pointer-events: none;
}
.tc-cluster {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.tc-right {
  align-items: flex-end;
  gap: 10px;
}
.tc-drive {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.tc-btn {
  pointer-events: auto;
  width: clamp(62px, 17vw, 84px);
  height: clamp(62px, 17vw, 84px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(20, 32, 56, 0.6);
  color: #fff;
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 900;
  display: grid;
  place-items: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.07s ease, background 0.1s ease;
}
.tc-btn.pressed {
  transform: scale(0.9);
  background: rgba(90, 140, 220, 0.8);
}
.tc-gas {
  background: rgba(23, 163, 90, 0.62);
  border-color: rgba(120, 255, 180, 0.5);
}
.tc-gas.pressed {
  background: rgba(56, 224, 123, 0.92);
}
.tc-rev {
  background: rgba(255, 170, 60, 0.5);
  border-color: rgba(255, 210, 130, 0.5);
}
.tc-rev.pressed {
  background: rgba(255, 190, 80, 0.9);
}
.tc-brake {
  width: clamp(58px, 15vw, 76px);
  height: clamp(58px, 15vw, 76px);
  font-size: clamp(10px, 2.6vw, 12px);
  letter-spacing: 0.06em;
  background: rgba(211, 37, 63, 0.55);
  border-color: rgba(255, 140, 160, 0.5);
}
.tc-brake.pressed {
  background: rgba(255, 84, 112, 0.92);
}

/* ========================= ROTATE HINT ========================= */
.rotate-hint {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(6, 10, 20, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: var(--ink-dim);
}
.rotate-hint p {
  margin: 0;
}
