:root {
  --ink: #2f261f;
  --ink-soft: #6a584c;
  --ink-faint: #9a8676;
  --cream: #f6efe6;
  --cream-2: #efe4d6;
  --paper: #fffcf7;
  --teal: #2b9d8f;
  --teal-deep: #1d7a6e;
  --teal-soft: #d5f0eb;
  --warn: #e08a45;
  --warn-soft: #fde8d4;
  --danger: #c75b4a;
  --ok: #3fa06a;
  --ok-soft: #d9f3e4;
  --shadow: 0 18px 50px rgba(47, 38, 31, 0.28);
  --shadow-sm: 0 6px 18px rgba(47, 38, 31, 0.14);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.no-select,
.no-select * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.no-select input,
.no-select textarea,
.no-select [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* Themed scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b9d8f #efe4d6;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #efe4d6;
  border-radius: 99px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #35b0a1, #1d7a6e);
  border-radius: 99px;
  border: 2px solid #efe4d6;
}

*::-webkit-scrollbar-thumb:hover {
  background: #2b9d8f;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  width: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #1a1410;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--teal-soft);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: #1a1410;
}

@media (max-width: 700px) {
  #app {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}

/* —— HUD —— */
.hud {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(246, 239, 230, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.hud-money {
  min-width: 118px;
}

.hud-energy {
  margin-left: auto;
}

.energy-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 70px;
}

.energy-bar {
  height: 5px;
  background: rgba(138, 87, 50, 0.15);
  border-radius: 99px;
  overflow: hidden;
}

.energy-bar i {
  display: block;
  height: 100%;
  width: 78%;
  background: linear-gradient(90deg, #62d48a, #3fa06a);
  border-radius: inherit;
  transition: width 0.35s var(--ease);
}

.hud-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.hud-icon.coin {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff3a8, #f0c43a 45%, #d49200);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.hud-icon.battery {
  border-radius: 5px;
  background: linear-gradient(180deg, #7ae09a, #3fa06a);
  position: relative;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.hud-icon.battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 8px;
  width: 3px;
  height: 10px;
  background: #3fa06a;
  border-radius: 0 2px 2px 0;
}

.hud-pause {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(246, 239, 230, 0.95);
  color: #8a5732;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), background 0.15s;
}

.hud-pause:hover {
  transform: scale(1.05);
  background: #fff;
}

.hud-pause svg {
  fill: currentColor;
}

/* —— Scenes —— */
.scene {
  position: absolute;
  inset: 0;
}

.scene[hidden] {
  display: none !important;
}

.scene-overlay {
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(24, 16, 10, 0.48);
  backdrop-filter: blur(5px);
  padding: 58px 18px 18px;
  animation: fade-in 0.22s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* —— Photo backgrounds —— */
.photo-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.photo-room {
  background-image: url("../assets/bg-main-room.png");
  background-position: center center;
  background-size: cover;
}

/* —— Room interactions (aligned to art) —— */
.scene-room {
  background: #7ea8b8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hotspot {
  position: absolute;
  z-index: 15;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.hotspot:hover,
.hotspot:focus,
.hotspot:focus-visible {
  outline: none;
  background: transparent;
  box-shadow: none;
}

/* Whole laptop: lid + base */
.hotspot-laptop {
  left: 40.5%;
  top: 35%;
  width: 19%;
  height: 28%;
  border-radius: 8px;
}

/* Sticky note — opens plan modal */
.hotspot-plan {
  left: 46%;
  top: 64%;
  width: 13%;
  height: 18%;
  border-radius: 4px;
}

.panel-plan {
  width: min(400px, 100%);
}

.plan-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 1.5px solid #e0d5c5;
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.plan-item:hover {
  border-color: var(--teal);
  background: #fff;
}

.plan-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink-soft);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}

.plan-list li.done .plan-box {
  background: var(--ok);
  border-color: var(--ok);
}

.plan-list li.done .plan-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(40deg);
}

.plan-list li.done .plan-text b {
  text-decoration: line-through;
  color: var(--ok);
}

.plan-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-text b {
  font-size: 15px;
}

.plan-text small {
  color: var(--ink-faint);
  font-weight: 600;
}

.btn-garage-nav {
  position: absolute;
  top: 72px;
  right: 16px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #35b0a1, var(--teal));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--teal-deep), 0 8px 20px rgba(43, 157, 143, 0.35);
  transition: transform 0.15s var(--ease), filter 0.15s;
}

.btn-garage-nav:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-garage-nav:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--teal-deep);
}

.btn-shop-nav {
  position: absolute;
  top: 72px;
  right: 132px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #e8a04a, #c47a28);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a5418, 0 8px 20px rgba(196, 122, 40, 0.35);
  transition: transform 0.15s var(--ease), filter 0.15s;
}

.btn-shop-nav:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-shop-nav:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8a5418;
}

.panel-shop {
  width: min(440px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  text-align: left;
}

.panel-shop h2 {
  margin: 0 28px 4px 0;
  font-size: 1.7rem;
  text-align: center;
}

.shop-lead {
  text-align: center;
  margin: 0 0 14px;
  font-size: 13px;
}

.skill-card {
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.skill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 14px;
}

.skill-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(47, 38, 31, 0.12);
  overflow: hidden;
}

.skill-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #35b0a1, #2b9d8f);
  border-radius: inherit;
}

.skill-card .muted {
  margin: 6px 0 0;
  font-size: 12px;
}

.skill-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
}

.shop-section-title {
  margin: 12px 0 8px;
  font-size: 13px;
  font-family: var(--display);
}

.shop-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(47, 38, 31, 0.08);
  border-radius: 12px;
  align-items: center;
}

.shop-item-main {
  grid-column: 1;
}

.shop-item b {
  display: block;
  font-size: 14px;
}

.shop-item small {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.35;
}

.shop-item .btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 12px;
}

.shop-item.owned {
  opacity: 0.72;
}

.toast {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(47, 38, 31, 0.94);
  color: #fff;
  padding: 11px 20px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  z-index: 80;
  box-shadow: var(--shadow-sm);
  animation: toast-in 0.28s var(--ease);
  max-width: calc(100% - 32px);
  text-align: center;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* —— Browser —— */
.browser {
  width: min(900px, 100%);
  max-height: calc(100% - 8px);
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: panel-up 0.28s var(--ease);
}

.browser-sm {
  width: min(460px, 100%);
}

@keyframes panel-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.browser-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 10px 0;
  background: #e8dfd2;
  min-height: 40px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--paper);
  border-radius: 10px 10px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.tab.ghost {
  background: transparent;
  color: var(--ink-faint);
  font-size: 18px;
  padding: 4px 10px;
}

.tab-ico {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--teal), #6bb3d4);
}

.browser-tabs .browser-close {
  margin-left: auto;
  margin-bottom: 6px;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--paper);
  border-bottom: 1px solid #ebe3d8;
}

.nav-btns {
  display: flex;
  gap: 6px;
}

.nav-btns span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e08a45;
}

.nav-btns span:nth-child(2) {
  background: #e6b84d;
}

.nav-btns span:nth-child(3) {
  background: #3fa06a;
}

.browser-url {
  flex: 1;
  background: var(--cream);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lock {
  width: 10px;
  height: 12px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 3px;
  display: inline-block;
  position: relative;
}

.lock::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 1px;
  width: 5px;
  height: 5px;
  border: 1.5px solid var(--ink-faint);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.browser-close {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.browser-close:hover {
  background: var(--cream-2);
}

.browser-body {
  padding: 18px 20px 16px;
  overflow: auto;
  scrollbar-color: #c99562 var(--cream);
}

.browser-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ebe3d8;
}

.market-toolbar h1,
.listing-form h2,
.garage-header h1,
.panel h2,
.details-body h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.75rem;
}

.market-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.search-field {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e0d5c5;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink-faint);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.search-field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  outline: none;
  min-width: 0;
}

.market-controls select,
.listing-form input,
.listing-form select,
.listing-form textarea {
  border: 1.5px solid #e0d5c5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.market-controls select:focus,
.listing-form input:focus,
.listing-form select:focus,
.listing-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.car-card {
  background: #fff;
  border: 1px solid #ebe3d8;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.car-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(47, 38, 31, 0.1);
}

.car-art {
  height: 118px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(165deg, #e8f4f8 0%, #cfe4ec 100%);
  overflow: hidden;
}

.car-art::before {
  content: "";
  position: absolute;
  inset: auto 10% 18% 10%;
  height: 10px;
  background: rgba(47, 38, 31, 0.08);
  border-radius: 50%;
  filter: blur(2px);
}

.car-svg {
  width: 140px;
  height: 70px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink-soft);
  backdrop-filter: blur(4px);
}

.badge.bad {
  background: var(--warn-soft);
  color: #b85a20;
}

.badge.ok {
  background: var(--ok-soft);
  color: #2a7a4e;
}

.car-card .meta {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.car-card h3,
.garage-slot h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.car-card .price,
.garage-slot .price {
  font-weight: 800;
  color: var(--teal-deep);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.car-card .cond,
.garage-slot .cond {
  font-size: 12px;
  color: var(--ink-faint);
}

/* —— Buttons —— */
.btn {
  border: none;
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s var(--ease), filter 0.12s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-accent {
  background: linear-gradient(180deg, #35b0a1, var(--teal));
  color: #fff;
  box-shadow: 0 3px 0 var(--teal-deep);
}

.btn-accent:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-warn {
  background: linear-gradient(180deg, #eba05c, var(--warn));
  color: #fff;
  box-shadow: 0 3px 0 #b85a28;
}

.btn-ghost {
  background: var(--cream-2);
  color: var(--ink);
}

.btn-ghost:hover {
  background: #e5d8c6;
}

.btn-soft {
  background: rgba(255, 252, 247, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.listing-form {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* —— Garage —— */
.scene-garage {
  background: #3a434c;
}

.garage-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.garage-ceiling {
  position: absolute;
  inset: 0 0 55% 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 210, 140, 0.12), transparent 55%),
    linear-gradient(180deg, #2a3138, #4a5560);
}

.garage-wall {
  position: absolute;
  left: 0;
  right: 0;
  top: 28%;
  height: 22%;
  background: repeating-linear-gradient(90deg, #5a6570 0 18px, #4e5964 18px 36px);
  opacity: 0.55;
}

.garage-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  background: linear-gradient(180deg, #6a727a 0%, #8a9098 40%, #9aa0a6 100%);
  display: flex;
  justify-content: center;
  gap: 4%;
  padding: 8% 8% 0;
}

.stall {
  flex: 1;
  max-width: 180px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  position: relative;
}

.stall::after {
  content: attr(data-n);
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 42px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--display);
}

.garage-parked {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 46%;
  height: 24%;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  pointer-events: none;
  z-index: 2;
}

.parked-car {
  width: 28%;
  max-width: 200px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}

.parked-car .car-svg {
  width: 100%;
  height: auto;
}

.garage-header {
  position: absolute;
  top: 64px;
  left: 18px;
  right: 18px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.garage-header h1 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  margin: 0;
}

.garage-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  top: 48%;
  z-index: 10;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(20, 24, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  overflow: auto;
}

.garage-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.garage-slot {
  background: rgba(255, 252, 247, 0.96);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
  box-shadow: var(--shadow-sm);
}

.garage-slot:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.garage-slot .car-art {
  border-radius: 12px;
  margin-bottom: 10px;
}

.garage-slot .enter-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-deep);
}

.garage-empty {
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  margin: 24px 0 0;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.garage-empty[hidden] {
  display: none !important;
}

.empty-ico {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  position: relative;
}

.empty-ico::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  opacity: 0.6;
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
}

.seller-warn {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--warn-soft);
  color: #9a4e18;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

/* —— Chat —— */
.panel-chat {
  width: min(860px, 100%);
  height: min(620px, calc(100vh - 72px));
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--cream);
  border-bottom: 1px solid #ebe3d8;
}

.chat-head-main { min-width: 0; }

.chat-head h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.chat-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 600;
}

.chat-head .panel-x {
  position: static;
  flex-shrink: 0;
}

.chat-log {
  overflow: hidden;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background: #f3ebe0;
  min-height: 0;
}

.bubble {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  flex-shrink: 0;
}

.bubble.them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #ebe3d8;
  border-bottom-left-radius: 4px;
}

.bubble.me {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.sys {
  align-self: center;
  background: transparent;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
  max-width: 100%;
  padding: 2px 6px;
}

.chat-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  padding: 14px 18px 16px;
  border-top: 1px solid #ebe3d8;
  overflow: hidden;
}

.chat-side-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.chat-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: hidden;
  align-content: start;
}

.chat-choice {
  width: 100%;
  min-height: 48px;
  text-align: center;
  border: 1.5px solid #e0d5c5;
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.chat-choice:hover:not(:disabled) {
  border-color: var(--teal);
  background: #fff;
}

.chat-choice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-choice.danger {
  border-color: #f0c4b8;
  background: #fdf0ec;
  color: var(--danger);
}

.chat-choice.wide {
  grid-column: 1 / -1;
}

.car-card { cursor: pointer; }

.car-card .enter-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-deep);
}

.scene-modal { z-index: 55; }

.panel-offer {
  width: min(400px, 100%);
  text-align: left;
}

.panel-offer h2 { margin: 0 0 8px; }

.offer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 12px 0;
}

.offer-field input {
  border: 1.5px solid #e0d5c5;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 800;
  background: #fff;
}

.offer-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.offer-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.offer-presets button {
  border: 1.5px solid #e0d5c5;
  background: var(--cream);
  border-radius: 10px;
  padding: 8px 4px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.offer-presets button:hover {
  border-color: var(--teal);
  background: #fff;
}

@media (max-width: 560px) {
  .chat-choices { grid-template-columns: 1fr; }
  .panel-chat {
    width: 100%;
    height: min(680px, calc(100vh - 48px));
  }
}

/* —— Panels —— */
.panel {
  position: relative;
  background: var(--paper);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  width: min(540px, 100%);
  animation: panel-up 0.28s var(--ease);
}

.panel-details,
.panel-repair,
.panel-cabin {
  width: min(780px, 100%);
}

.panel-cabin {
  padding: 18px;
}

.cabin-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 16px;
  align-items: start;
}

.cabin-view {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cabin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.cabin-actions .btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

.cabin-actions .btn:last-child {
  grid-column: 1 / -1;
}

.diag-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.diag-actions .btn {
  width: 100%;
  min-height: 42px;
  justify-content: center;
}

.cabin-dash {
  height: 220px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -40px 60px rgba(0, 0, 0, 0.35);
}

.cabin-dash::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  height: 28%;
  background: linear-gradient(180deg, #2a3038, #1a1e24);
  border-radius: 8px 8px 40% 40%;
  opacity: 0.9;
}

.cabin-dash .car-svg {
  width: 200px;
  height: 95px;
  z-index: 1;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.cabin-label {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cabin-info h2 {
  margin: 0 0 6px;
}

.cabin-note {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
}

.cabin-overall {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}

.cabin-bar {
  height: 8px;
  background: #e0d5c5;
  border-radius: 99px;
  overflow: hidden;
}

.cabin-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--warn), var(--ok));
  border-radius: inherit;
  transition: width 0.3s var(--ease);
}

.cabin-sub {
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cabin-parts {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cabin-parts li {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.cabin-part-bar {
  height: 7px;
  background: #e0d5c5;
  border-radius: 99px;
  overflow: hidden;
}

.cabin-part-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--warn), var(--ok));
  border-radius: inherit;
}

.cabin-parts b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .cabin-layout {
    grid-template-columns: 1fr;
  }

  .cabin-dash {
    height: 160px;
  }
}

.panel-x {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: var(--cream-2);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-soft);
  z-index: 2;
}

.panel-x:hover {
  background: #e5d8c6;
}

.panel-pause {
  width: min(300px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-pause h2 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.panel-settings {
  width: min(420px, 100%);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-settings h2 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 1.75rem;
}

.settings-block {
  margin-top: 4px;
  padding: 12px;
  background: var(--cream);
  border-radius: 14px;
}

.settings-block h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: var(--display);
}

.settings-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.test-grid .btn {
  padding: 10px 8px;
  font-size: 12px;
}

.car-hero {
  height: 150px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, #e8f4f8, #c5dce6);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.car-hero .car-svg {
  width: 220px;
  height: 100px;
}

.stats {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stats li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: 10px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

.stats li b {
  font-variant-numeric: tabular-nums;
}

.repair-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .repair-layout {
    grid-template-columns: 1fr;
  }

  .hotspot-laptop {
    left: 38%;
    width: 24%;
    height: 26%;
  }

  .hotspot-plan {
    left: 44%;
    width: 16%;
    height: 16%;
  }

  .btn-garage-nav {
    top: auto;
    bottom: 16px;
    right: 16px;
  }

  .btn-shop-nav {
    top: auto;
    bottom: 16px;
    right: auto;
    left: 16px;
  }

  .btn-race-nav {
    top: auto;
    bottom: 64px;
    right: 16px;
  }
}

.parts-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parts-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  background: var(--cream);
  padding: 10px 12px;
  border-radius: 12px;
}

.parts-list .part-name {
  font-weight: 800;
  font-size: 13px;
}

.parts-list .part-bar {
  grid-column: 1 / -1;
  height: 7px;
  background: #e0d5c5;
  border-radius: 99px;
  overflow: hidden;
}

.parts-list .part-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--warn), var(--ok));
  border-radius: inherit;
  transition: width 0.3s var(--ease);
}

.muted {
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* —— Laptop hub —— */
.laptop-shell {
  width: min(720px, 100%);
  animation: laptop-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes laptop-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92) rotateX(8deg);
  }
}

.laptop-bezel {
  background: linear-gradient(165deg, #2a3238, #1a1f24);
  border-radius: 18px 18px 10px 10px;
  padding: 14px 14px 18px;
  box-shadow: 0 24px 50px rgba(20, 12, 6, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.laptop-top {
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  align-items: center;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.72);
}

.laptop-dots {
  display: flex;
  gap: 6px;
}

.laptop-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  display: block;
}

.laptop-dots i:nth-child(2) {
  background: #febc2e;
}

.laptop-dots i:nth-child(3) {
  background: #28c840;
}

.laptop-title {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.laptop-top .browser-close {
  justify-self: end;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hub-tile {
  appearance: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 18px 14px;
  border-radius: 16px;
  color: #1f1712;
  background: linear-gradient(160deg, #fff8ef, #f0e4d4);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18), 0 12px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s var(--ease), box-shadow 0.18s, filter 0.18s;
  animation: hub-tile-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hub-tile:nth-child(1) {
  animation-delay: 0.05s;
}
.hub-tile:nth-child(2) {
  animation-delay: 0.12s;
}
.hub-tile:nth-child(3) {
  animation-delay: 0.19s;
}

@keyframes hub-tile-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
}

.hub-tile:hover {
  transform: translateY(-4px);
  filter: brightness(1.03);
}

.hub-tile:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.hub-market {
  background: linear-gradient(160deg, #dff7f2, #b8e8de);
}
.hub-bank {
  background: linear-gradient(160deg, #e8f0ff, #c9daf8);
}
.hub-credit {
  background: linear-gradient(160deg, #fff0d8, #f5d4a0);
}

.hub-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  color: #2a221c;
}

.hub-ico svg {
  width: 40px;
  height: 40px;
}

.hub-tile b {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.hub-tile small {
  color: rgba(47, 38, 31, 0.7);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
}

.laptop-base {
  height: 14px;
  margin: 0 40px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #3a4248, #252b30);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Finance panels —— */
.panel-finance {
  width: min(480px, 100%);
  max-height: min(88vh, 740px);
  overflow: auto;
}

.fin-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
}

.fin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 28px;
}

.fin-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.fin-balance {
  text-align: right;
  background: var(--cream);
  padding: 10px 14px;
  border-radius: 14px;
  animation: balance-pulse 2.4s ease-in-out infinite;
}

@keyframes balance-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(43, 157, 143, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(43, 157, 143, 0.12);
  }
}

.fin-balance span {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 700;
}

.fin-balance b {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  color: var(--teal-deep);
}

.fin-section {
  margin: 8px 0 10px;
  font-size: 13px;
  font-family: var(--display);
}

.fin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ledger {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow: visible;
}

.ledger li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 12px;
  animation: ledger-in 0.35s var(--ease) both;
}

@keyframes ledger-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}

.ledger li b {
  font-size: 13px;
}

.ledger li small {
  grid-column: 1;
  color: var(--ink-faint);
  font-size: 11px;
}

.ledger .amt-in {
  color: #1f8a5a;
  font-weight: 800;
}

.ledger .amt-out {
  color: #c45c4a;
  font-weight: 800;
}

.ledger-empty {
  text-align: center;
  padding: 24px;
  color: var(--ink-faint);
  font-weight: 600;
}

.credit-gauge-wrap {
  position: relative;
  height: 130px;
  margin: 0 auto 8px;
  max-width: 220px;
}

.credit-gauge {
  width: 100%;
  height: auto;
}

.gauge-track {
  stroke: rgba(47, 38, 31, 0.12);
}

.gauge-fill {
  stroke: url(#none);
  stroke: #2b9d8f;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s;
}

.credit-gauge-label {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  text-align: center;
}

.credit-gauge-label b {
  display: block;
  font-size: 2rem;
  font-family: var(--display);
  line-height: 1;
}

.credit-gauge-label span {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.credit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.credit-stats > div {
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.credit-stats span {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 4px;
}

.credit-stats b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.credit-take label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.credit-take input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.credit-take-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.credit-take-row b {
  font-size: 1.4rem;
  font-family: var(--display);
}

.credit-hint {
  font-size: 12px;
  margin-bottom: 12px;
}

/* PIN */
.panel-pin {
  width: min(320px, 100%);
  text-align: center;
  animation: pin-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pin-pop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
}

.pin-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(47, 38, 31, 0.25);
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.pin-dots i.filled {
  background: var(--teal);
  border-color: var(--teal);
  transform: scale(1.15);
}

.pin-dots.shake {
  animation: pin-shake 0.4s ease;
}

@keyframes pin-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pin-pad button {
  height: 52px;
  border: none;
  border-radius: 14px;
  background: var(--cream);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.pin-pad button:active {
  transform: scale(0.94);
  background: #e5d8c6;
}

.pin-pad .pin-ok {
  background: linear-gradient(180deg, #35b0a1, var(--teal));
  color: #fff;
}

.pin-pad .pin-ghost {
  color: var(--ink-soft);
}

/* Inbound toast */
.inbound {
  position: absolute;
  top: 70px;
  right: 16px;
  z-index: 70;
  width: min(260px, calc(100% - 32px));
}

.inbound[hidden] {
  display: none !important;
}

.inbound-card {
  position: relative;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  padding: 14px 16px 14px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1f2930, #2c3a44);
  color: #fff;
  box-shadow: 0 12px 32px rgba(15, 20, 28, 0.45);
  animation: inbound-slide 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes inbound-slide {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.94);
  }
}

.inbound-pulse {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #35b0a1;
  animation: inbound-glow 1.2s ease-in-out infinite;
}

@keyframes inbound-glow {
  0%,
  100% {
    opacity: 0.4;
    box-shadow: 0 0 0 0 rgba(53, 176, 161, 0.5);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px 2px rgba(53, 176, 161, 0.55);
  }
}

.inbound-kind {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
  font-weight: 800;
  margin-bottom: 4px;
}

.inbound-card b {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.inbound-card small {
  opacity: 0.75;
  font-size: 12px;
}

.inbound-card.call .inbound-pulse {
  background: #febc2e;
  animation-name: inbound-ring;
}

@keyframes inbound-ring {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Listing pro */
.browser-listing {
  width: min(720px, 100%);
  max-height: calc(100% - 8px);
  overflow: auto;
}

.listing-form-pro {
  gap: 14px;
  padding: 20px 24px 24px;
}

.listing-hero-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(145deg, #eef6f4, #f6efe6);
  border-radius: 16px;
  margin-bottom: 2px;
}

.listing-car-art {
  height: 72px;
  display: grid;
  place-items: center;
}

.listing-car-art .car-svg {
  width: 100px;
  height: 48px;
}

.listing-hero-card h2 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.listing-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.listing-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.claim-grid,
.markup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.claim-opt,
.markup-opt {
  border: 1px solid rgba(47, 38, 31, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.claim-opt:hover,
.markup-opt:hover {
  transform: translateY(-1px);
}

.claim-opt.active,
.markup-opt.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.listing-price-line {
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 15px;
}

.listing-price-line b {
  font-size: 1.4rem;
  font-family: var(--display);
  color: var(--teal-deep);
}

#listing-desc[readonly] {
  background: var(--cream);
  resize: none;
  min-height: 96px;
}

@media (max-width: 640px) {
  .listing-grid-2 {
    grid-template-columns: 1fr;
  }

  .browser-listing {
    width: min(100%, 100%);
  }

  .panel-chat {
    width: 100%;
    height: min(680px, calc(100vh - 48px));
  }
}

/* —— Gate / tutorial / ads / plates / race / upgrades —— */
.scene-gate {
  z-index: 90;
  background: rgba(18, 12, 8, 0.72);
}

.panel-gate,
.panel-tutorial,
.panel-ad {
  width: min(400px, 100%);
  text-align: center;
  animation: pin-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  margin: 14px 0 16px;
}

.gate-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #e0d5c5;
  background: #fff;
}

.tut-text {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 600;
}

.tut-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.tut-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d5c8b8;
  display: block;
}

.tut-dots i.on {
  background: var(--teal);
  transform: scale(1.2);
}

.panel-ad {
  width: min(420px, 100%);
}

.ad-creative {
  padding: 22px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1f2930, #3a4a56);
  color: #fff;
  margin: 12px 0 16px;
  text-align: left;
  min-height: 120px;
  animation: ad-shine 2.5s ease-in-out infinite;
}

@keyframes ad-shine {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(53, 176, 161, 0.2);
  }
  50% {
    box-shadow: 0 0 24px 4px rgba(53, 176, 161, 0.25);
  }
}

.ad-creative b {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-family: var(--display);
}

.ad-creative p {
  margin: 0;
  opacity: 0.85;
  font-size: 14px;
  line-height: 1.4;
}

.hud-nick {
  font-weight: 800;
  font-size: 13px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-grid-wide {
  grid-template-columns: repeat(3, 1fr);
}

.hub-plates {
  background: linear-gradient(160deg, #e8ecef, #c5d0d8);
}

.hub-race {
  background: linear-gradient(160deg, #ffe0d4, #f5b89a);
}

@media (max-width: 640px) {
  .hub-grid-wide {
    grid-template-columns: 1fr 1fr;
  }
}

.plate-preview {
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 16px;
  margin: 12px 0 16px;
  background: #fff;
  border: 3px solid #1a1a1a;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #c45c4a;
}

.panel-race {
  width: min(760px, 100%);
}

#race-canvas {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #2a333a;
  display: block;
  margin-bottom: 10px;
}

.race-hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.race-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.race-controls .btn {
  flex: 1;
}

.panel-upgrades {
  width: min(920px, 96vw);
  max-height: none;
  overflow: visible;
  padding: 20px 22px 18px;
}

.upgrade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-right: 28px;
}

.upgrade-head h2 {
  margin: 0 0 4px;
}

.upgrade-head .muted {
  margin: 0;
  font-size: 13px;
  max-width: 42ch;
}

.upgrade-stat-pill {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, var(--cream));
  border: 1px solid rgba(47, 38, 31, 0.08);
  min-width: 96px;
}

.upgrade-stat-pill span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}

.upgrade-stat-pill b {
  font-size: 1.2rem;
  font-family: var(--display);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.upgrade-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(160deg, #fff, var(--cream));
  border: 1px solid rgba(47, 38, 31, 0.08);
  border-radius: 16px;
  min-height: 128px;
}

.upgrade-card.owned {
  opacity: 0.82;
  background: linear-gradient(160deg, var(--ok-soft), var(--cream));
}

.upgrade-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(43, 157, 143, 0.18);
}

.upgrade-ico svg {
  width: 40px;
  height: 40px;
}

.upgrade-tag {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.upgrade-body b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.upgrade-body p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  font-weight: 600;
}

.upgrade-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.upgrade-meta span {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
}

.upgrade-side {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
}

.upgrade-card .btn {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  min-height: 52px;
}

.upgrade-card .btn small {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.9;
}

.upgrade-owned {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: #1f6b42;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 720px) {
  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .panel-upgrades {
    max-height: min(90vh, 900px);
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .cabin-actions,
  .diag-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.unknown-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--warn-soft);
  color: #8a4a18;
  font-size: 11px;
  font-weight: 800;
}

.hud-level {
  font-weight: 800;
  gap: 4px;
}

.hud-lvl-label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: lowercase;
}

.btn-race-nav {
  position: absolute;
  top: 128px;
  right: 16px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff7a5c, #d94a2e);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a2e1c, 0 8px 20px rgba(217, 74, 46, 0.35);
}

.btn-race-nav:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.plate-reel {
  margin: 12px 0 16px;
}

.plate-preview {
  min-height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 16px;
  background: #fff;
  border: 3px solid #1a1a1a;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #c45c4a;
}

.plate-preview.spinning {
  animation: plate-blur 0.08s linear infinite;
  color: var(--ink-soft);
}

@keyframes plate-blur {
  0% {
    filter: blur(0);
    transform: translateY(0);
  }
  50% {
    filter: blur(1.5px);
    transform: translateY(-2px);
  }
  100% {
    filter: blur(0);
    transform: translateY(0);
  }
}

.plate-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.plate-actions .btn {
  flex: 1;
}

.panel-race-menu {
  width: min(420px, 100%);
  text-align: center;
}

.tacho-sweet {
  opacity: 0.55;
  transition: opacity 0.15s, filter 0.15s;
}

.tacho-sweet.hot {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(46, 204, 113, 0.85));
}

.race-launch-hint {
  position: absolute;
  bottom: 6%;
  font-size: 9px;
  opacity: 0.7;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.race-launch-hint.on {
  color: #2ecc71;
  opacity: 1;
  text-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.panel-race-leaders {
  width: min(420px, 100%);
  text-align: left;
}

.race-leader-list {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.race-leader-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  font-weight: 700;
}

.race-leader-list li small {
  grid-column: 2 / -1;
  font-size: 11px;
  opacity: 0.65;
}

.race-lb-rank {
  font-family: var(--display);
  color: var(--teal-deep);
}

.race-lb-pts {
  font-weight: 800;
  color: var(--teal-deep);
}

.race-net-status {
  margin: 0 0 10px;
  font-size: 12px;
}

.panel-race-howto {
  width: min(440px, 100%);
  text-align: left;
}

.race-howto-list {
  margin: 0 0 16px;
  padding-left: 1.1em;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 600;
}

.race-howto-list b {
  color: var(--ink);
}

.race-diff-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
}

.race-diff-label select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
  font-weight: 700;
}

.race-keys-hint {
  font-size: 12.5px;
  margin-bottom: 14px;
}

.race-lobby-box {
  margin-top: 12px;
  text-align: left;
}

.race-lobby-players {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.race-room-code-line {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.race-lobby-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cream);
  font-size: 12px;
}

.race-lobby-row b {
  grid-column: 1;
}

.race-lobby-row span {
  grid-column: 1;
  color: var(--ink-soft);
}

.race-lobby-row em {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-style: normal;
  font-weight: 800;
  color: var(--ink-faint);
}

.race-lobby-row.ready em {
  color: var(--teal-deep);
}

.race-shell {
  width: min(960px, 100%);
  background: #1a1c20;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  animation: panel-up 0.28s var(--ease);
}

.race-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 44px 8px 14px;
  background: #12141a;
  color: #ddd;
  font-size: 13px;
  font-weight: 700;
}

.race-hud-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.race-hud-meta b {
  color: #fff;
  font-family: var(--display);
}

.race-pause-btn {
  width: 40px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #2a2e38;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 1px;
}

.race-pause-btn:hover {
  background: #3a4050;
}

.race-progress {
  padding: 0 14px 8px;
  background: #12141a;
}

.race-progress-track {
  position: relative;
  height: 14px;
  border-radius: 99px;
  background: #2a2e36;
  overflow: hidden;
}

.race-prog-player,
.race-prog-rival {
  position: absolute;
  top: 2px;
  width: 12px;
  height: 10px;
  border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.05s linear;
}

.race-prog-player {
  left: 8%;
  background: #f0c040;
  box-shadow: 0 0 8px rgba(240, 192, 64, 0.6);
  z-index: 2;
}

.race-prog-rival {
  left: 5%;
  background: #e05555;
  z-index: 1;
}

.race-prog-fin {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
}

.race-controls-hint {
  margin: 0;
  padding: 6px 14px;
  background: #1a1c22;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid #2a2e36;
}

.race-controls-hint[hidden] {
  display: none !important;
}

.race-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.72);
  padding: 20px;
}

.race-overlay[hidden] {
  display: none !important;
}

.race-overlay-card {
  width: min(320px, 100%);
  background: #1e222a;
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.race-overlay-card h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-family: var(--display);
}

.race-overlay-card .muted {
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 16px;
}

.race-overlay-card .btn {
  margin-top: 8px;
}

.race-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.race-setup {
  padding: 28px 24px;
  color: #fff;
  background: linear-gradient(160deg, #2a3238, #1a1f24);
}

.race-setup h2 {
  margin: 0 0 12px;
  color: #fff;
}

.race-setup label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.race-setup input,
.race-setup select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.race-view {
  position: relative;
  background: #111;
}

#race-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.race-banner {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 3rem;
  font-family: var(--display);
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  font-weight: 800;
}

.race-dash {
  display: grid;
  grid-template-columns: 90px 1fr 1.2fr 80px 140px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px 16px;
  background:
    linear-gradient(180deg, #2a2a2e, #151518),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px);
  border-top: 2px solid #3a3a40;
}

.race-pedal {
  height: 88px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #6a6a70, #3a3a40);
  color: #ddd;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 6px 0 #1a1a1a;
}

.race-pedal:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), 0 2px 0 #1a1a1a;
  background: linear-gradient(180deg, #4a4a50, #2a2a30);
}

.race-gauge {
  position: relative;
  display: grid;
  place-items: center;
  color: #ccc;
  font-size: 10px;
  font-weight: 700;
}

.race-gauge svg {
  width: 100%;
  max-width: 120px;
  height: auto;
}

.race-speedo b,
.tacho-gear {
  position: absolute;
  font-size: 1.1rem;
  color: #fff;
  font-family: var(--display);
}

.race-speedo b {
  top: 42%;
}

.race-speedo span,
.race-tacho span {
  position: absolute;
  bottom: 8%;
  font-size: 9px;
  opacity: 0.7;
}

.tacho-gear {
  top: 48%;
  background: #1a4a8a;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 1.2rem;
}

.race-nos {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #3a7bd5;
  background: radial-gradient(circle at 35% 30%, #6ab0ff, #1a4a8a);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(58, 123, 213, 0.45);
}

.race-nos:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.race-shifter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.race-shifter button {
  height: 36px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #2a2a30;
  color: #eee;
  font-weight: 800;
  cursor: pointer;
}

.race-shifter button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

@media (max-width: 720px) {
  .race-dash {
    grid-template-columns: 70px 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .race-nos,
  .race-shifter {
    grid-column: span 1;
  }
  .race-hud-meta {
    gap: 8px;
    font-size: 12px;
  }
  .race-controls-hint {
    font-size: 11px;
    padding: 8px 10px;
  }
  .race-banner {
    font-size: 2.2rem;
  }
}

.btn-soft {
  background: linear-gradient(180deg, #e8d4b8, #d4b896);
  color: #4a3828;
  border: none;
  box-shadow: 0 3px 0 #a88868;
}
