:root {
  --bg: #05070a;
  --panel: rgba(13, 17, 24, 0.94);
  --panel-2: rgba(20, 25, 34, 0.8);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f4f5f7;
  --muted: #8b94a3;
  --yellow: #ffc400;
  --yellow-soft: #ffd84d;
  --red: #ff4d4d;
  --blue: #53a7ff;
  --green: #57e389;
  --orange: #ff9b42;
  --display: "Arial Black", "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #0a0d12;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.28) 74%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 18%, transparent 80%, rgba(0, 0, 0, 0.3));
}

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* ======================= HUD ======================= */

#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  animation: hudIn 0.5s 0.1s ease forwards;
}

@keyframes hudIn {
  to { opacity: 1; }
}

.hud-top-left {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.brand {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  color: #fff;
}

.brand span {
  color: var(--yellow);
  margin-left: 5px;
}

.rank {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 11px;
}

.bar {
  position: relative;
  width: 176px;
  height: 13px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.13);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
}

.bar i {
  position: absolute;
  inset: 1px;
  width: 100%;
  transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 2px;
}

.bar.health i {
  background: linear-gradient(90deg, #c81d2b, #ff4d58);
  box-shadow: 0 0 10px rgba(255, 60, 75, 0.4);
}

.bar.armor i {
  background: linear-gradient(90deg, #2469c7, #61b2ff);
  box-shadow: 0 0 10px rgba(80, 160, 255, 0.35);
  transform: scaleX(0);
}

.bar-icon {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px #000;
}

.bar b {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px #000;
}

.hud-top-right {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  text-align: right;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.65));
}

.money {
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
}

.money span {
  color: var(--yellow);
  font-size: 0.75em;
}

.clockline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

.clockline em {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.stars {
  margin-top: 6px;
  height: 16px;
  font-size: 15px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.stars .on {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 196, 0, 0.55);
  animation: starPulse 1.3s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.top-actions {
  position: absolute;
  top: max(96px, calc(env(safe-area-inset-top) + 96px));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  gap: 7px;
  pointer-events: auto;
  opacity: 0.75;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 11, 16, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.icon-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  transform: translateY(-1px);
}

.icon-btn.muted {
  color: #69707c;
}

.objective {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  min-width: 250px;
  max-width: min(420px, 60vw);
  padding: 10px 18px 9px;
  background: linear-gradient(100deg, rgba(9, 12, 17, 0.9), rgba(9, 12, 17, 0.66));
  border: 1px solid rgba(255, 196, 0, 0.22);
  border-left: 3px solid var(--yellow);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  text-align: left;
  animation: objIn 0.35s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

@keyframes objIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.obj-kicker {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--yellow);
}

.obj-title {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.obj-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}

.obj-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.obj-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
  transition: width 0.2s linear;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(140px, calc(env(safe-area-inset-bottom) + 140px));
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 40px;
  background: rgba(7, 10, 15, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: hintIn 0.2s ease;
}

@keyframes hintIn {
  from { opacity: 0; transform: translate(-50%, 5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hint kbd,
.help-card kbd {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 20px;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.hint .key {
  color: var(--yellow);
  font-weight: 800;
}

.hud-bottom-left {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
}

.map-frame {
  position: relative;
  width: 208px;
  height: 156px;
  padding: 5px;
  background: rgba(7, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.map-frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

#minimap {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.map-north {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 7px;
  font-weight: 800;
  color: var(--yellow);
}

.map-scan {
  position: absolute;
  left: 5px;
  right: 5px;
  top: 5px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 0, 0.4), transparent);
  animation: scan 6s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(146px); opacity: 0; }
}

.map-caption {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
}

.map-caption span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
}

.hud-bottom-right {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
}

.speedo {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(7, 10, 15, 0.65);
  backdrop-filter: blur(8px);
  animation: speedIn 0.25s ease;
}

@keyframes speedIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.speed-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 11, 16, 0.95) 54%, transparent 56%),
    conic-gradient(var(--yellow) 0deg, var(--yellow) 120deg, rgba(255, 255, 255, 0.09) 120deg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 20px rgba(255, 196, 0, 0.08);
}

.speed-ring b {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.speed-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-bottom: 4px;
}

.speed-unit {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.car-hp {
  position: relative;
  width: 56px;
  height: 9px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.car-hp i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ff9b42, #ffd84d);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.car-hp span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #0b0d11;
  z-index: 1;
}

.toast-wrap {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: min(420px, 80vw);
  pointer-events: none;
}

.toast {
  padding: 9px 15px;
  border-radius: 4px;
  background: rgba(8, 11, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 2px solid var(--yellow);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  animation: toastIn 0.3s ease;
}

.toast.pay { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--red); }
.toast.job { border-left-color: var(--blue); }

.toast.out {
  animation: toastOut 0.35s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-7px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-5px); }
}

/* ======================= TOUCH ======================= */

.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.joystick {
  position: absolute;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(10, 13, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: auto;
  touch-action: none;
  backdrop-filter: blur(5px);
}

.joy-ring {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 196, 0, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.touch-buttons {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px));
  display: flex;
  align-items: flex-end;
  gap: 13px;
  pointer-events: auto;
}

.round-btn {
  width: 67px;
  height: 67px;
  border-radius: 50%;
  background: rgba(10, 13, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  touch-action: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.round-btn:active {
  transform: scale(0.94);
  background: rgba(255, 196, 0, 0.18);
  border-color: var(--yellow);
}

.round-btn.action {
  width: 78px;
  height: 78px;
  border-color: rgba(255, 196, 0, 0.5);
  color: var(--yellow);
  font-family: var(--display);
}

.round-btn.small {
  width: 54px;
  height: 54px;
  font-size: 15px;
}

/* ======================= SCREENS ======================= */

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.overlay {
  background: rgba(3, 5, 8, 0.7);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.title-screen {
  justify-content: space-between;
  align-items: stretch;
  background:
    linear-gradient(180deg, rgba(3, 5, 8, 0.72) 0%, rgba(3, 5, 8, 0.3) 35%, rgba(3, 5, 8, 0.55) 72%, rgba(3, 5, 8, 0.92) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(0, 0, 0, 0.25) 70%);
}

.title-screen::before {
  content: "";
  position: absolute;
  left: -10%;
  top: 24%;
  width: 120%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 0, 0.35), transparent);
  transform: rotate(-6deg);
  pointer-events: none;
}

.title-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.title-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.55);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.3);
}

.ghost-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.title-content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 6vh 0 4vh;
}

.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--yellow);
}

.title-content .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-content .eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--yellow);
}

.logo {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(64px, 11.5vw, 158px);
  line-height: 0.82;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.55));
}

.logo-black {
  color: #f5f6f8;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
}

.logo-yellow {
  color: var(--yellow);
  margin-left: clamp(38px, 7vw, 92px);
  letter-spacing: -0.045em;
  text-shadow: 0 0 60px rgba(255, 196, 0, 0.15);
}

.title-sub {
  margin-top: 26px;
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.66);
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.btn {
  min-height: 46px;
  padding: 0 19px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(13, 17, 23, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  justify-content: space-between;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, color 0.2s;
}

.btn i {
  font-style: normal;
  font-size: 14px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.btn:hover {
  border-color: rgba(255, 196, 0, 0.65);
  background: rgba(255, 196, 0, 0.08);
  transform: translateY(-1px);
}

.btn:hover i {
  transform: translateX(2px);
  opacity: 1;
  color: var(--yellow);
}

.btn.primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #090b0f;
  box-shadow: 0 8px 32px rgba(255, 196, 0, 0.16);
}

.btn.primary:hover {
  background: var(--yellow-soft);
  color: #090b0f;
}

.btn.primary i {
  color: #090b0f;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgba(255, 77, 77, 0.3);
  color: #ff8a8a;
}

.btn.danger:hover {
  background: rgba(255, 77, 77, 0.1);
  border-color: rgba(255, 77, 77, 0.6);
}

.btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.title-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
}

.panel {
  width: min(680px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 26px 28px;
  background:
    linear-gradient(160deg, rgba(22, 27, 36, 0.97), rgba(9, 12, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  animation: panelIn 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-head h2 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.close-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  transition: 0.2s;
}

.close-btn:hover {
  color: #fff;
  border-color: var(--yellow);
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 0;
}

.help-card {
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.help-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(255, 196, 0, 0.1);
  border: 1px solid rgba(255, 196, 0, 0.2);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
}

.help-card h3 {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.help-card p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--muted);
}

.panel-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  background: #0c1016;
}

.stat span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat b {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.stat b:empty::after {
  content: "—";
}

.pause-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pause-actions .btn {
  flex: 1 1 40%;
  justify-content: center;
  gap: 8px;
}

.save-note {
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
}

.busted-screen {
  background: radial-gradient(ellipse at center, rgba(40, 5, 8, 0.32), rgba(2, 3, 5, 0.88));
  backdrop-filter: grayscale(0.6) blur(5px);
  animation: fadeIn 0.35s ease;
}

.busted-card {
  text-align: center;
  max-width: 500px;
}

.busted-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--red);
}

.busted-card h2 {
  margin: 12px 0 8px;
  font-family: var(--display);
  font-size: clamp(34px, 7vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.busted-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.busted-bar {
  width: 180px;
  height: 2px;
  margin: 28px auto 10px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.busted-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
  transform-origin: left;
  transition: transform 0.1s linear;
}

.busted-hint {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

/* ======================= RESPONSIVE ======================= */

@media (max-width: 760px), (pointer: coarse) {
  .brand { font-size: 14px; }
  .bars { margin-top: 8px; }
  .bar { width: 130px; height: 11px; }
  .rank { font-size: 8px; }
  .objective {
    top: max(84px, calc(env(safe-area-inset-top) + 84px));
    bottom: auto;
    min-width: 210px;
    max-width: 72vw;
    padding: 8px 12px 7px;
  }
  .obj-title { font-size: 12px; }
  .obj-sub { font-size: 9px; }
  .hint {
    bottom: max(320px, calc(env(safe-area-inset-bottom) + 310px));
    font-size: 10px;
    padding: 7px 12px;
    max-width: 86vw;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
  }
  .hud-bottom-left {
    left: max(18px, env(safe-area-inset-left));
    bottom: max(162px, calc(env(safe-area-inset-bottom) + 152px));
  }
  .map-frame { width: 150px; height: 112px; }
  @keyframes scan { 0% { transform: translateY(0); } 100% { transform: translateY(102px); } }
  .map-caption { font-size: 6px; }
  .hud-bottom-right { bottom: max(155px, calc(env(safe-area-inset-bottom) + 155px)); }
  .speed-ring { width: 44px; height: 44px; }
  .speed-ring b { font-size: 15px; }
  .toast-wrap { top: max(160px, calc(env(safe-area-inset-top) + 150px)); }
  .toast { font-size: 10px; padding: 7px 11px; }
  .money { font-size: 21px; }
  .stars { font-size: 12px; letter-spacing: 2px; }
  .clockline { font-size: 8px; }
  .top-actions {
    top: max(86px, calc(env(safe-area-inset-top) + 76px));
    left: max(13px, env(safe-area-inset-left));
    right: auto;
    bottom: auto;
    flex-direction: column;
    opacity: 0.55;
  }
  .help-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 18px; }
  .title-content { padding: 3vh 0; }
  .logo { font-size: clamp(54px, 17vw, 90px); }
  .logo-yellow { margin-left: 16px; }
  .title-sub { margin-top: 16px; font-size: 11px; }
  .menu { margin-top: 22px; gap: 7px; }
  .btn { min-height: 42px; padding: 0 14px; font-size: 9.5px; gap: 14px; }
  .title-footer { flex-direction: column; gap: 7px; font-size: 6.5px; line-height: 1.5; }
  .title-footer div:last-child { display: none; }
  .title-content .eyebrow { font-size: 7px; letter-spacing: 0.22em; }
  .hud-top-left { left: max(13px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
  .hud-top-right { right: max(13px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 15px; }
}

@media (max-width: 390px) {
  .objective { max-width: 82vw; }
  .map-frame { width: 132px; height: 99px; }
  .hud-bottom-left { bottom: max(146px, calc(env(safe-area-inset-bottom) + 136px)); }
  .hint { bottom: max(280px, calc(env(safe-area-inset-bottom) + 270px)); }
  .joystick { width: 108px; height: 108px; }
  .joy-knob { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .round-btn { width: 59px; height: 59px; }
  .round-btn.action { width: 69px; height: 69px; }
}

@media (orientation: portrait) and (max-width: 760px), (orientation: portrait) and (pointer: coarse) {
  .menu { flex-direction: column; align-items: stretch; width: min(100%, 340px); }
  .menu .btn { width: 100%; justify-content: space-between; }
}

@media (max-height: 500px) {
  .title-content { padding: 1vh 0; }
  .logo { font-size: clamp(44px, 10vw, 80px); }
  .title-sub { margin-top: 10px; }
  .menu { margin-top: 14px; }
  .title-footer { display: none; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .brand { font-size: 13px; }
  .rank { font-size: 7px; }
  .bars { margin-top: 6px; }
  .bar { width: 108px; height: 10px; }
  .money { font-size: 18px; }
  .clockline { font-size: 8px; }
  .stars { font-size: 10px; letter-spacing: 2px; }
  .objective {
    top: max(10px, env(safe-area-inset-top));
    bottom: auto;
    min-width: 170px;
    max-width: min(340px, 40vw);
    padding: 7px 12px 6px;
  }
  .obj-kicker { font-size: 7px; }
  .obj-title { font-size: 12px; }
  .obj-sub { font-size: 8px; margin-top: 2px; }
  .toast-wrap {
    top: max(84px, calc(env(safe-area-inset-top) + 74px));
    width: min(400px, 60vw);
  }
  .toast { font-size: 9px; padding: 6px 10px; }
  .hint {
    bottom: max(165px, calc(env(safe-area-inset-bottom) + 155px));
    max-width: 44vw;
    padding: 6px 10px;
    font-size: 9.5px;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
  .hud-bottom-left {
    top: max(78px, calc(env(safe-area-inset-top) + 68px));
    bottom: auto;
    left: max(12px, env(safe-area-inset-left));
  }
  .map-frame { width: 100px; height: 75px; padding: 4px; }
  .map-caption { display: none; }
  .top-actions {
    top: max(78px, calc(env(safe-area-inset-top) + 68px));
    right: max(12px, env(safe-area-inset-right));
    left: auto;
    bottom: auto;
    flex-direction: row;
    opacity: 0.55;
  }
  .panel {
    width: min(680px, 94vw);
    max-height: calc(100vh - 16px);
    padding: 14px 20px;
  }
  .panel-head { padding-bottom: 10px; }
  .panel-head h2 { font-size: clamp(20px, 3.4vw, 30px); }
  .help-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 0;
  }
  .help-card { padding: 10px 12px; }
  .help-card h3 { margin: 7px 0 4px; }
  .help-card p { font-size: 9.5px; line-height: 1.6; }
  .stats-grid { margin: 10px 0; }
  .stat { padding: 8px 12px; }
  .stat b { font-size: 16px; }
  .pause-actions { gap: 6px; }
  .pause-actions .btn,
  .panel-foot .btn { min-height: 34px; padding: 0 14px; font-size: 9px; }
  .save-note { margin-top: 8px; }
}

@media (max-height: 500px) and (pointer: coarse) {
  .hud-bottom-right { bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); }
}
