/* =================================================================
   抢车位 · v0.3 — 设计系统
   一份重写后的样式表。配色主题：明亮的午后停车场。
   ================================================================= */

/* ─── Reset & tokens ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --c-primary:        #1565c0;
  --c-primary-2:      #1976d2;
  --c-primary-dark:   #0d47a1;
  --c-accent:         #ff7043; /* coral — for primary CTAs */
  --c-accent-2:       #ff9a76;
  --c-accent-dark:    #e64a19;

  /* Surfaces */
  --c-bg:             #d2ebff;
  --c-bg-2:           #fafdff;
  --c-card:           #ffffff;
  --c-card-warm:      #fff8ef;
  --c-card-soft:      #f4f8ff;
  --c-divider:        #e1eaf5;

  /* Scene */
  --c-grass:          #6bbf72;
  --c-grass-dark:     #4ea05c;
  --c-asphalt:        #4a5662;
  --c-asphalt-2:      #5b6772;
  --c-asphalt-line:   #ffd54f;
  --c-spot-floor:     #607080;

  /* Semantic */
  --c-gold:           #f9a825;
  --c-gold-2:         #fbc02d;
  --c-success:        #2e7d32;
  --c-danger:         #d32f2f;
  --c-warn:           #ed6c02;
  --c-muted:          #607080;

  /* Text */
  --c-text:           #1e293b;
  --c-text-muted:     #64748b;
  --c-text-light:     #94a3b8;

  /* Shadows */
  --sh-1:  0 1px 2px rgba(15, 30, 60, .08), 0 1px 4px rgba(15, 30, 60, .06);
  --sh-2:  0 2px 8px rgba(15, 30, 60, .10), 0 4px 16px rgba(15, 30, 60, .08);
  --sh-3:  0 8px 24px rgba(15, 30, 60, .15), 0 16px 40px rgba(15, 30, 60, .10);
  --sh-button:        inset 0 -3px 0 rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .15);
  --sh-button-press:  inset 0 -1px 0 rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .15);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  /* Layered "sunny lot" sky. Clouds sit in the side gutters (content
     centers at 1100px, leaving wide margins on desktop) and BELOW the
     full-width top bar — earlier they were at the very top and got hidden
     behind the bar/tabs. Plus a warm sun glow, a cool sky wash, and a hint
     of park-green at the bottom, over a sky→white base. */
  background:
    radial-gradient(150px 62px at 7% 30%,  rgba(255,255,255,.66), transparent 70%),
    radial-gradient(110px 48px at 16% 31%, rgba(255,255,255,.50), transparent 72%),
    radial-gradient(135px 56px at 6% 62%,  rgba(255,255,255,.50), transparent 72%),
    radial-gradient(160px 64px at 93% 36%, rgba(255,255,255,.60), transparent 70%),
    radial-gradient(115px 50px at 84% 38%, rgba(255,255,255,.46), transparent 72%),
    radial-gradient(130px 56px at 95% 68%, rgba(255,255,255,.46), transparent 72%),
    radial-gradient(1100px 520px at 88% -120px, rgba(255,231,150,.50), transparent 60%),
    radial-gradient(900px 600px at 2% -20px,    rgba(140,196,255,.40), transparent 58%),
    radial-gradient(1300px 820px at 50% 124%,   rgba(120,198,130,.26), transparent 55%),
    linear-gradient(180deg, #bfe0fb 0%, #d6ecff 38%, #edf6ff 72%, #fbfdff 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--c-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
input, button, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Tabular numerals for coin / score counters */
.tabular { font-variant-numeric: tabular-nums; }

/* =================================================================
   AUTH PANEL
   ================================================================= */
#authPanel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #82baff 0%, transparent 60%),
    linear-gradient(180deg, #1565c0 0%, #0d47a1 100%);
  overflow: hidden;
}
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-cloud {
  position: absolute;
  font-size: 64px;
  opacity: .55;
  filter: blur(.3px);
  animation: floatY 12s ease-in-out infinite;
}
.auth-cloud-1 { top: 8%;  left: 8%;  animation-delay: 0s; }
.auth-cloud-2 { top: 24%; right: 12%; animation-delay: 3s; font-size: 80px; }
.auth-cloud-3 { bottom: 14%; left: 18%; animation-delay: 6s; font-size: 56px; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}

.auth-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: white;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-3);
  z-index: 1;
}
.auth-header {
  background: linear-gradient(180deg, var(--c-primary-2) 0%, var(--c-primary-dark) 100%);
  padding: 36px 24px 28px;
  text-align: center;
  color: white;
  position: relative;
}
.auth-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 16px;
  background: white;
  -webkit-mask: radial-gradient(8px at 8px 50%, transparent 98%, black 100%) -6px 0/16px 16px repeat-x;
          mask: radial-gradient(8px at 8px 50%, transparent 98%, black 100%) -6px 0/16px 16px repeat-x;
}
.auth-logo {
  display: block;
  width: 80px; height: 80px;
  margin: 0 auto 10px;
  border-radius: 20px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
  animation: carBob 2.6s ease-in-out infinite;
}
@keyframes carBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}
.auth-header h1 { margin: 0 0 4px; font-size: 28px; font-weight: 900; letter-spacing: 4px; }
.auth-header p  { margin: 0; font-size: 13px; opacity: .9; }

.invite-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 14px 22px 0;
  background: linear-gradient(135deg, #fff8ef 0%, #fff3d6 100%);
  border: 1.5px solid #ffd180;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.45;
  color: #6d4c00;
  animation: bannerIn .35s cubic-bezier(0.22, 1.36, 0.64, 1);
}
.invite-banner-icon { font-size: 26px; flex-shrink: 0; }
.invite-banner-text strong { font-size: 14px; color: var(--c-accent-dark); }
.invite-banner-text small { color: #8a6d3b; }
@keyframes bannerIn {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.auth-body { padding: 22px 22px 26px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-card-soft);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-weight: 700;
  color: var(--c-text-muted);
  transition: all .15s;
  font-size: 14px;
}
.auth-tab.active {
  background: white;
  color: var(--c-primary);
  box-shadow: var(--sh-1);
}
#authForm { display: flex; flex-direction: column; gap: 10px; }
#authForm input {
  padding: 13px 14px;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  background: var(--c-card-soft);
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
#authForm input:focus {
  outline: none;
  border-color: var(--c-primary-2);
  background: white;
}
.btn-auth {
  margin-top: 6px;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
  color: white;
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--sh-button);
  transition: transform .08s, box-shadow .12s;
}
.btn-auth:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,80,30,.4), var(--sh-button); }
.btn-auth:active { transform: translateY(1px);  box-shadow: var(--sh-button-press); }
.auth-error {
  min-height: 18px;
  text-align: center;
  color: var(--c-danger);
  font-size: 12px;
  margin-top: 4px;
}
.auth-tip {
  margin-top: 14px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 12px;
}

/* =================================================================
   TOPBAR
   ================================================================= */
#gameContainer.hidden { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: white;
  box-shadow: var(--sh-2);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 6px; font-weight: 900; }
.brand-logo { height: 30px; width: auto; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px 8px;
  background: linear-gradient(180deg, #ffd54f, #f9a825);
  color: #4a3000;
  font-weight: 800;
  border-radius: var(--r-pill);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.2);
}
.coin-pill .coin-icon { font-size: 16px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.coin-pill .coin-num  { font-size: 14px; font-variant-numeric: tabular-nums; }
.coin-pill.flash      { animation: coinFlash .6s ease; }
@keyframes coinFlash {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(255, 213, 79, .5); }
  100% { transform: scale(1); }
}

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border: none;
  background: rgba(255,255,255,.18);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .12s, transform .12s;
}
.icon-btn:hover  { background: rgba(255,255,255,.32); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.pulse  { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 79, .8); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 213, 79, 0); }
}
.dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 9px; height: 9px;
  background: #ff5252;
  border: 2px solid white;
  border-radius: 50%;
}
.badge-num {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ff5252, #c62828);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: var(--r-pill);
  color: white;
  font-weight: 600;
  transition: background .12s;
}
.user-pill:hover { background: rgba(255,255,255,.32); }
.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd180, #ff7043);
  color: white;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.user-name { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdown panels */
.dropdown {
  position: absolute;
  top: calc(100% - 4px);
  right: 14px;
  width: 340px;
  max-width: calc(100vw - 28px);
  background: white;
  color: var(--c-text);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  border: 1px solid var(--c-divider);
  z-index: 110;
}
.user-dropdown { width: 180px; }
.dropdown-header {
  padding: 12px 16px;
  font-weight: 800;
  background: linear-gradient(180deg, #f4f8ff, #e8eefb);
  border-bottom: 1px solid var(--c-divider);
  color: var(--c-primary-dark);
}
.dropdown-list { max-height: 380px; overflow-y: auto; }
.dropdown-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: none;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  border-bottom: 1px solid #f4f6fa;
  transition: background .1s;
}
.dropdown-row:hover { background: var(--c-card-soft); }
.dropdown-row:last-child { border-bottom: none; }

/* Notification rows */
.notif-row {
  padding: 12px 16px;
  border-bottom: 1px solid #f4f6fa;
  font-size: 13px;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { background: linear-gradient(90deg, #fffaeb, #fffefa); }
.notif-text { color: var(--c-text); line-height: 1.5; }
.notif-time { color: var(--c-text-muted); font-size: 11px; margin-top: 4px; }

/* =================================================================
   TABS
   ================================================================= */
.tabs {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: white;
  border-bottom: 1px solid var(--c-divider);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.tabs-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 1;
  min-width: 80px;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color .15s;
}
.tab-icon {
  width: 26px; height: 26px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform .2s;
}
/* Painted tab icons (parity with wx-game). Inactive by default; the
   .active variant swaps to the bright/raised art. */
.tab[data-tab="mine"]    .tab-icon { background-image: url(images/tabs/parking_inactive.png); }
.tab[data-tab="quests"]  .tab-icon { background-image: url(images/tabs/tasks_inactive.png); }
.tab[data-tab="friends"] .tab-icon { background-image: url(images/tabs/friends_inactive.png); }
.tab[data-tab="garage"]  .tab-icon { background-image: url(images/tabs/garage_inactive.png); }
.tab[data-tab="shop"]    .tab-icon { background-image: url(images/tabs/shop_inactive.png); }
.tab[data-tab="trophy"]  .tab-icon { background-image: url(images/tabs/trophy_inactive.png); }
.tab[data-tab="mine"].active    .tab-icon { background-image: url(images/tabs/parking_active.png); }
.tab[data-tab="quests"].active  .tab-icon { background-image: url(images/tabs/tasks_active.png); }
.tab[data-tab="friends"].active .tab-icon { background-image: url(images/tabs/friends_active.png); }
.tab[data-tab="garage"].active  .tab-icon { background-image: url(images/tabs/garage_active.png); }
.tab[data-tab="shop"].active    .tab-icon { background-image: url(images/tabs/shop_active.png); }
.tab[data-tab="trophy"].active  .tab-icon { background-image: url(images/tabs/trophy_active.png); }
.tab.active { color: var(--c-primary); }
.tab.active .tab-icon { transform: translateY(-2px); }
.tab.active::after {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 28px; height: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-2));
  border-radius: 3px 3px 0 0;
}
.tab-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid white;
}

/* =================================================================
   MAIN LAYOUT
   ================================================================= */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 14px 80px;
}
.view { display: none; animation: fadeIn .25s ease-out; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-header { margin: 18px 0 12px; }
.section-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--c-primary-dark);
  letter-spacing: 1px;
}
.section-subtitle {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 3px;
}
.empty-hint {
  padding: 10px;
  color: var(--c-text-muted);
  font-size: 12px;
  text-align: center;
}
.hint-box {
  margin-top: 14px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #fff8e1, #fffde7);
  border: 1px solid #ffe082;
  border-radius: var(--r-md);
  color: #6d4c00;
  font-size: 13px;
  line-height: 1.6;
}

/* =================================================================
   QUEST STRIP (top of My Lot view)
   ================================================================= */
.quest-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 10px;
}
.quest-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #f6fafe);
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  padding: 10px 11px 12px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.quest-card.done {
  border-color: #a5d6a7;
  background: linear-gradient(180deg, #f1f8e9, #ffffff);
}
.quest-card.claimed {
  opacity: .6;
}
.quest-card-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.quest-card-title .quest-emoji { font-size: 14px; }
.quest-card-desc {
  font-size: 11px;
  color: var(--c-text-muted);
  line-height: 1.4;
  min-height: 30px;
}
.quest-progress-bar {
  position: relative;
  height: 8px;
  background: #eef2f8;
  border-radius: 4px;
  overflow: hidden;
}
.quest-progress-bar > span {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--c-accent-2), var(--c-accent));
  border-radius: 4px;
  transition: width .35s ease;
}
.quest-progress-text {
  font-size: 11px;
  color: var(--c-text-muted);
}
.quest-card-claim {
  align-self: stretch;
  padding: 7px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #fff, #f0f4fa);
  color: var(--c-text-muted);
  font-weight: 700;
  font-size: 12px;
  cursor: not-allowed;
}
.quest-card.done .quest-card-claim {
  background: linear-gradient(180deg, #66bb6a, #2e7d32);
  color: white;
  cursor: pointer;
  box-shadow: var(--sh-button);
  animation: pulse 1.5s ease-in-out infinite;
}

/* =================================================================
   DAILY ACTIONS PANEL (任务 tab)
   ================================================================= */
.daily-actions-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.daily-action-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.da-emoji { font-size: 28px; text-align: center; }
.da-info .da-name { font-weight: 800; font-size: 14px; color: var(--c-primary-dark); }
.da-info .da-desc { font-size: 11.5px; color: var(--c-text-muted); line-height: 1.5; margin-top: 2px; }
.da-info strong { color: var(--c-gold); }
.da-counter {
  font-weight: 900;
  font-size: 16px;
  color: var(--c-accent-dark);
  font-variant-numeric: tabular-nums;
  padding: 6px 12px;
  background: var(--c-card-soft);
  border-radius: var(--r-pill);
}

/* =================================================================
   PARKING SCENE
   ================================================================= */
.parking-scene {
  position: relative;
  background: linear-gradient(180deg, #8ecbff 0%, #c4e3ff 50%, var(--c-grass) 50%, var(--c-grass) 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-2);
  border: 1px solid #c1d6ef;
}
.scene-sky {
  position: relative;
  height: 70px;
  overflow: hidden;
}
.cloud {
  position: absolute;
  font-size: 30px;
  opacity: .85;
  filter: drop-shadow(0 2px 3px rgba(255,255,255,.5));
  animation: cloudDrift 28s linear infinite;
}
.cloud-a { top: 10px; left: -15%; }
.cloud-b { top: 30px; left: -30%; animation-duration: 38s; font-size: 22px; }
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(150vw); }
}
.sun {
  position: absolute;
  top: 4px; right: 14px;
  font-size: 38px;
  filter: drop-shadow(0 0 14px rgba(255,193,7,.6));
  animation: sunPulse 4s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(20deg); }
}

.scene-frontage {
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 16px 6px;
  background: linear-gradient(180deg, transparent 0%, rgba(106, 191, 105, .3) 70%, var(--c-grass) 100%);
  height: 56px;
}
.frontage-tree { font-size: 30px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); }
.frontage-sign {
  position: relative;
  text-align: center;
}
.frontage-sign .sign-board {
  background: linear-gradient(180deg, #ffca28, #ff8f00);
  border: 2px solid #6d4c00;
  color: #4a3000;
  padding: 3px 9px;
  font-weight: 800;
  font-size: 11px;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 2px 4px rgba(0,0,0,.25);
  white-space: nowrap;
}
.frontage-sign-alt .sign-board {
  background: linear-gradient(180deg, #ef5350, #c62828);
  color: white;
  border-color: #4a0000;
}
.frontage-sign .sign-pole {
  width: 4px;
  height: 14px;
  background: linear-gradient(90deg, #6d4c00, #4a3000);
  margin: 0 auto;
}

.scene-floor {
  position: relative;
  background:
    /* sparse darker speckle to feel like asphalt */
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.025) 1px, transparent 2px),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.06) 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.02) 1px, transparent 2px),
    linear-gradient(180deg, #4f5d6e 0%, #3d4a59 100%);
  background-size: 80px 80px, 60px 60px, 100px 100px, 100% 100%;
  padding: 22px 14px 20px;
}
.scene-floor::before {
  /* top-of-lot curb line */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,.25), transparent);
  pointer-events: none;
}
.lot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.lot-grid.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lot-grid.cols-5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lot-grid.cols-6 { grid-template-columns: repeat(6, 1fr); gap: 6px; }

.scene-road {
  height: 22px;
  background: linear-gradient(180deg, var(--c-asphalt-2) 0%, var(--c-asphalt) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.road-dash {
  width: 30px; height: 3px;
  background: var(--c-asphalt-line);
  border-radius: 2px;
}

/* =================================================================
   PARKING SLOT — painted asphalt tile in iso-ish look
   ================================================================= */
.slot {
  --line: rgba(255, 230, 80, .9);    /* painted yellow line */
  --bay-bg-1: #586a7d;
  --bay-bg-2: #43525f;
  position: relative;
  /* Asphalt floor with painted parking lines: two side lines + bottom curb */
  background:
    /* left painted line */
    linear-gradient(var(--line), var(--line)) left 6% top 10% / 4px 80% no-repeat,
    /* right painted line */
    linear-gradient(var(--line), var(--line)) right 6% top 10% / 4px 80% no-repeat,
    /* faint speckle for asphalt texture */
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.05) 1px, transparent 2px) 0 0 / 40px 40px,
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.08) 1px, transparent 2px) 0 0 / 30px 30px,
    /* base asphalt gradient */
    linear-gradient(180deg, var(--bay-bg-1) 0%, var(--bay-bg-2) 100%);
  border-radius: 4px 4px var(--r-md) var(--r-md);
  padding: 16px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 170px;
  transition: transform .15s, box-shadow .2s;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -8px 12px rgba(0,0,0,.18),
    0 2px 4px rgba(0,0,0,.18);
}
/* "stopper" curb at the back of the bay */
.slot::after {
  content: '';
  position: absolute;
  left: 22%; right: 22%;
  top: 6px;
  height: 4px;
  background: linear-gradient(180deg, #ffc107, #ff8f00);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.slot.occupied {
  /* occupied: tile gets lighter so the car contrasts well */
  --bay-bg-1: #d2dae3;
  --bay-bg-2: #b3bec9;
  --line: rgba(255, 255, 255, .9);
  color: var(--c-text);
  box-shadow: var(--sh-2), inset 0 -8px 12px rgba(0,0,0,.10);
}
.slot.locked {
  --bay-bg-1: #ffcc80;
  --bay-bg-2: #ffa726;
}
.slot.locked::before {
  content: '🔒';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
  z-index: 1;
}
.slot:hover { transform: translateY(-1px); }

.slot-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #fff, #f0f4fa);
  border: 1px solid var(--c-divider);
  color: var(--c-text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}
.slot.occupied .slot-tag {
  background: linear-gradient(180deg, var(--c-primary-2), var(--c-primary));
  color: white;
  border-color: var(--c-primary-dark);
}
.slot-lv {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold));
  color: #4a3000;
  border: 1px solid #b97a00;
  font-weight: 900;
  letter-spacing: .5px;
}
/* Spot-level visual treatment on the slot itself */
.slot.lv-1::after { background: linear-gradient(180deg, #ffe082, #ffa726); }
.slot.lv-2::after { background: linear-gradient(180deg, #fb8c00, #e65100); }
.slot.lv-3::after { background: linear-gradient(180deg, #ef5350, #c62828); height: 5px; }
.slot.lv-4::after { background: linear-gradient(180deg, #ab47bc, #6a1b9a); height: 5px; box-shadow: 0 0 6px rgba(171,71,188,.7); }
.slot-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: 1px;
  margin-top: 4px;
}
.slot.occupied .slot-title { color: var(--c-text-muted); }

.slot-car {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.slot .empty-p {
  font-size: 42px;
  font-weight: 900;
  color: rgba(255,255,255,.42);
  text-shadow: 0 2px 3px rgba(0,0,0,.35);
  user-select: none;
  letter-spacing: 6px;
  font-family: Georgia, 'Times New Roman', serif;
}
.slot .car-label {
  font-size: 11px;
  color: var(--c-text);
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
}
.slot .owner {
  font-size: 11px;
  padding: 2px 8px;
  background: linear-gradient(180deg, #b3e5fc, #81d4fa);
  color: #01579b;
  border-radius: var(--r-pill);
  font-weight: 700;
  border: 1px solid #4fc3f7;
}
.slot .badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.slot .mini-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: #f4f8ff;
  color: var(--c-text-muted);
  font-weight: 700;
  border: 1px solid var(--c-divider);
}
.slot .mini-badge.boost { background: #fff3d6; color: #b26a00; border-color: #ffd180; }
.slot .mini-badge.shield { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }
.slot .mini-badge.danger { background: #ffebee; color: #c62828; border-color: #ef9a9a; }

.slot-actions {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: center;
}

.slot.arriving {
  animation: slotArrive .55s ease-out;
}

.slot.dirty .slot-car { position: relative; }
.dirty-overlay {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-12deg);
  font-size: 26px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45));
  pointer-events: none;
  z-index: 5;
  animation: adWiggle 2.2s ease-in-out infinite;
}
@keyframes adWiggle {
  0%, 100% { transform: translateX(-50%) rotate(-12deg); }
  50%      { transform: translateX(-50%) rotate(-6deg); }
}
.slot.dirty { box-shadow: var(--sh-2), 0 0 0 2px #ff8a65; }
@keyframes slotArrive {
  0%   { transform: translateY(-30px); opacity: 0; }
  60%  { transform: translateY(4px);   opacity: 1; }
  100% { transform: translateY(0);     opacity: 1; }
}

/* =================================================================
   ISO CAR (SVG)
   ================================================================= */
.iso-car {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25));
  max-width: 100%;
  height: auto;
  animation: carIdle 3.4s ease-in-out infinite;
}
.iso-car[width="132"] { animation-duration: 4s; }
@keyframes carIdle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.car-card-visual .iso-car { transform-origin: center; }

/* =================================================================
   PAINTED LOT SCENE (art parity with wx-game subpkg-lot/)
   Overrides the CSS-painted scene above: real sky band + tiled asphalt
   + per-spot lv0..lv4 tiles. Placed after the originals so cascade order
   wins; per-spot tile chosen via the --tile custom property.
   ================================================================= */
.parking-scene { background: #bfe0fb; }
.scene-sky {
  height: 92px;
  background: url(images/lot/sky.jpg) center top / cover no-repeat;
}
.scene-sky .cloud, .scene-sky .sun { display: none; }
.scene-frontage { display: none; }
.scene-floor {
  background: url(images/lot/ground.jpg) top left / 200px auto repeat;
  padding: 18px 14px 18px;
}
.slot {
  --tile: url(images/lot/lv0.png);
  background:
    /* legibility scrim so labels/buttons stay readable on any tile */
    linear-gradient(to top, rgba(10, 16, 28, .42) 0%, rgba(10, 16, 28, .05) 38%, transparent 60%),
    var(--tile) center / cover no-repeat;
}
.slot.lv-1 { --tile: url(images/lot/lv1.png); }
.slot.lv-2 { --tile: url(images/lot/lv2.png); }
.slot.lv-3 { --tile: url(images/lot/lv3.png); }
.slot.lv-4 { --tile: url(images/lot/lv4.png); }
/* The painted tiles carry their own bay/curb art — drop the CSS curb. */
.slot::after { display: none; }
/* …and the painted empty bay already shows its own "P", so hide the
   CSS text "P" overlay to avoid a doubled letter on empty spots. */
.slot .empty-p { display: none; }

/* Painted empty-state illustration + celebration mascot */
.empty-img {
  display: block;
  width: 120px; height: 120px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .15));
}
.celebration-mascot {
  display: block;
  width: 132px; height: 132px;
  object-fit: contain;
  margin: 8px auto -8px;
  position: relative;
  z-index: 1;
}

/* Hand-painted car PNGs (parity with the wx-game art). Square images,
   sized by height so they drop into the same containers the SVG sprites
   used. Containers use min-height (a floor), so the taller painted art
   simply grows the cell instead of being clipped. */
.car-img {
  display: block;
  margin: 0 auto;
  height: 58px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .28));
  animation: carIdle 3.4s ease-in-out infinite;
  -webkit-user-drag: none;
  user-select: none;
}
.car-img.big { height: 74px; animation-duration: 4s; }

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 14px;
  border: none;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--c-primary-2), var(--c-primary));
  color: white;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--sh-button);
  transition: transform .08s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: var(--sh-button-press); }
.btn:disabled {
  opacity: .55;
  filter: grayscale(.4);
  cursor: not-allowed;
  transform: none;
}
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.tiny  { padding: 4px 8px;  font-size: 11px; border-radius: var(--r-sm); }

.btn.primary { background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent)); }
.btn.success { background: linear-gradient(180deg, #66bb6a, var(--c-success)); }
.btn.danger  { background: linear-gradient(180deg, #ef5350, var(--c-danger)); }
.btn.gold    { background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold)); color: #4a3000; }
.btn.ghost   {
  background: white;
  color: var(--c-text);
  box-shadow: inset 0 0 0 1px var(--c-divider);
}
.btn.ghost:hover { background: var(--c-card-soft); }

/* =================================================================
   FRIEND PANEL / SWITCHER / FRIEND LOT
   ================================================================= */
/* Personal invite-link card */
.invite-card {
  background: linear-gradient(135deg, #fff8ef 0%, #fff 100%);
  border: 1.5px solid #ffd180;
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.invite-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.invite-card-emoji { font-size: 18px; }
.invite-card-title { font-weight: 800; color: var(--c-primary-dark); font-size: 14px; }
.invite-card-help {
  margin-left: auto;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: #ffe082;
  color: #4a3000;
  border-radius: 50%;
  font-weight: 800;
  font-size: 11px;
  cursor: help;
}
.invite-card-body {
  display: flex;
  align-items: center;
  gap: 8px;
}
.invite-link {
  flex: 1;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 12px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-sm);
  color: var(--c-text);
  word-break: break-all;
  user-select: all;
}

.friend-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-card {
  background: white;
  border-radius: var(--r-md);
  border: 1px solid var(--c-divider);
  padding: 14px;
  box-shadow: var(--sh-1);
}
.panel-card-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--c-primary-dark);
  margin-bottom: 10px;
}
.form-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.form-row input {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  font-size: 13px;
  background: var(--c-card-soft);
}
.form-row input:focus { outline: none; border-color: var(--c-primary-2); background: white; }

.result-list { display: flex; flex-direction: column; gap: 5px; }
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--c-card-soft);
  border-radius: var(--r-sm);
  border: 1px solid #eef2f8;
  font-size: 13px;
}

/* Big friend cards — replaces the tiny chip switcher */
.friends-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.friend-card {
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: white;
  border: 2px solid var(--c-divider);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  text-align: left;
}
.friend-card:hover {
  transform: translateY(-1px);
  border-color: var(--c-primary-2);
  box-shadow: var(--sh-2);
}
.friend-card.active {
  background: linear-gradient(135deg, #e3f2fd 0%, #fff 100%);
  border-color: var(--c-primary);
}
.friend-card-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd180, #ff7043);
  color: white;
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.friend-card.active .friend-card-avatar {
  background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary-dark));
}
.friend-card-info { min-width: 0; }
.friend-card-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-card-coins {
  font-size: 12px;
  color: var(--c-gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.friend-card-arrow {
  font-size: 18px;
  font-weight: 900;
  color: var(--c-text-muted);
}
.friend-card.active .friend-card-arrow {
  color: var(--c-success);
}

/* Legacy chip — kept for the friend-search results inline only */
.chip {
  background: white;
  border: 1.5px solid var(--c-divider);
  color: var(--c-text);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.friend-street-header {
  font-weight: 900;
  font-size: 15px;
  color: var(--c-primary-dark);
  margin: 12px 0 8px;
  padding-left: 6px;
  border-left: 4px solid var(--c-accent);
}

.friend-tools {
  margin-top: 14px;
  text-align: center;
}
.link-danger {
  background: none;
  border: none;
  color: var(--c-danger);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline dotted;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.link-danger:hover { background: #ffebee; }

.empty-state {
  background: white;
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  box-shadow: var(--sh-1);
}
.empty-title { font-weight: 800; font-size: 16px; color: var(--c-text); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; color: var(--c-text-muted); line-height: 1.6; max-width: 320px; margin: 0 auto; }

/* =================================================================
   GARAGE
   ================================================================= */
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.car-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.car-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.car-card.parked {
  background: linear-gradient(180deg, #fffaf0, white);
  border-color: #ffd180;
}
.car-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.car-card-title {
  font-weight: 900;
  font-size: 16px;
  color: var(--c-primary-dark);
}
.car-level-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold));
  color: #4a3000;
  border-radius: var(--r-pill);
  border: 1px solid #b97a00;
}
.car-card-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  background:
    /* painted parking lines on a showroom tile */
    linear-gradient(rgba(255, 230, 80, .85), rgba(255, 230, 80, .85)) left 18% top 14% / 4px 70% no-repeat,
    linear-gradient(rgba(255, 230, 80, .85), rgba(255, 230, 80, .85)) right 18% top 14% / 4px 70% no-repeat,
    radial-gradient(ellipse at center bottom, rgba(0,0,0,.18) 0%, transparent 60%),
    linear-gradient(180deg, #d9e3ee 0%, #b9c7d6 100%);
  border-radius: var(--r-md);
  padding: 10px 6px 12px;
  overflow: hidden;
}
.car-card-visual::before {
  /* curb at top of the showroom tile */
  content: '';
  position: absolute;
  top: 6px; left: 28%; right: 28%;
  height: 4px;
  background: linear-gradient(180deg, #ffc107, #ff8f00);
  border-radius: 2px;
}
.stat-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-chip {
  font-size: 11px;
  padding: 3px 9px;
  background: var(--c-card-soft);
  border: 1px solid var(--c-divider);
  border-radius: var(--r-pill);
  color: var(--c-text);
  font-weight: 700;
}
.stat-chip.parked  { background: linear-gradient(180deg, #ffe082, #ffb300); color: #4a3000; border-color: #b97a00; }
.stat-chip.idle    { background: #e0f2f1; color: #00695c; border-color: #80cbc4; }
.stat-chip.boost   { background: #fff3d6; color: #b26a00; border-color: #ffd180; }
.stat-chip.shield  { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }

.car-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.car-card-actions .btn { flex: 1; }

/* =================================================================
   SHOP
   ================================================================= */
.shop-section { margin-bottom: 22px; }
.shop-section-title {
  font-weight: 900;
  font-size: 14px;
  color: var(--c-primary-dark);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.shop-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.shop-card-emoji {
  font-size: 42px;
  line-height: 1;
  margin: 4px auto 2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}
.shop-card-name { font-weight: 900; font-size: 15px; color: var(--c-text); }
.shop-card-desc { font-size: 11.5px; color: var(--c-text-muted); line-height: 1.5; min-height: 32px; }
.shop-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.shop-card-have {
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 700;
}
.shop-card-price {
  font-weight: 900;
  font-size: 14px;
  color: var(--c-gold);
}

.car-shop-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.shop-car-card {
  position: relative;
  background: white;
  border-radius: var(--r-lg);
  padding: 14px 12px 12px;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: center;
  transition: transform .15s, box-shadow .15s;
}
.shop-car-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.shop-car-card.owned { opacity: .65; filter: grayscale(.2); }
.shop-car-tag {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
  color: white;
  border-radius: var(--r-pill);
  letter-spacing: 1px;
}
.shop-car-card.owned .shop-car-tag {
  background: #b0bec5;
}
.shop-car-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  background:
    linear-gradient(rgba(255, 230, 80, .85), rgba(255, 230, 80, .85)) left 18% top 14% / 4px 70% no-repeat,
    linear-gradient(rgba(255, 230, 80, .85), rgba(255, 230, 80, .85)) right 18% top 14% / 4px 70% no-repeat,
    radial-gradient(ellipse at center bottom, rgba(0,0,0,.18) 0%, transparent 60%),
    linear-gradient(180deg, #d9e3ee, #b9c7d6);
  border-radius: var(--r-md);
  padding: 6px;
}
.shop-car-name { font-weight: 900; font-size: 15px; color: var(--c-primary-dark); }
.shop-car-desc { font-size: 11.5px; color: var(--c-text-muted); line-height: 1.45; min-height: 32px; }

/* Spot-upgrade grid (one card per spot) */
.spot-upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.spot-upgrade-card {
  background: white;
  border: 1.5px solid var(--c-divider);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spot-upgrade-card.lv-1 { border-color: #ffa726; background: linear-gradient(180deg, #fff8ef, #fff); }
.spot-upgrade-card.lv-2 { border-color: #fb8c00; background: linear-gradient(180deg, #fff3e0, #fff); }
.spot-upgrade-card.lv-3 { border-color: #ef5350; background: linear-gradient(180deg, #ffebee, #fff); }
.spot-upgrade-card.lv-4 { border-color: #ab47bc; background: linear-gradient(180deg, #f3e5f5, #fff); }
.spot-upgrade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.spot-upgrade-title { font-weight: 800; font-size: 14px; color: var(--c-primary-dark); }
.spot-upgrade-lv {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold));
  color: #4a3000;
}
.spot-upgrade-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c-text-muted);
}
.spot-upgrade-row strong { color: var(--c-accent-dark); font-size: 13px; }
.spot-upgrade-next { color: var(--c-success); font-weight: 700; }
.spot-upgrade-max {
  text-align: center;
  padding: 8px;
  color: var(--c-success);
  font-weight: 800;
  font-size: 13px;
  border-radius: var(--r-sm);
  background: #e8f5e9;
}

.shop-row-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.shop-row-info { flex: 1; }
.shop-row-title { font-weight: 900; font-size: 14px; }
.shop-row-desc  { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }

/* =================================================================
   ACHIEVEMENTS
   ================================================================= */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.ach-card {
  background: linear-gradient(180deg, #fff, #f7faff);
  border-radius: var(--r-md);
  padding: 12px 10px 10px;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
  text-align: center;
  position: relative;
  opacity: .6;
  filter: grayscale(.5);
  transition: opacity .2s, filter .2s, transform .15s;
}
.ach-card.unlocked {
  opacity: 1;
  filter: none;
  background: linear-gradient(180deg, #fffaeb, #fff);
  border-color: #ffd180;
}
.ach-card.unclaimed { animation: pulse 1.8s ease-in-out infinite; }
.ach-icon {
  font-size: 30px;
  margin-bottom: 4px;
  line-height: 1;
}
.ach-title { font-weight: 900; font-size: 13px; color: var(--c-text); margin-bottom: 2px; }
.ach-desc  { font-size: 10.5px; color: var(--c-text-muted); margin-bottom: 6px; line-height: 1.4; }
.ach-progress-bar {
  height: 6px;
  background: #eef2f8;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.ach-progress-bar > span {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--c-gold-2), var(--c-gold));
  border-radius: 3px;
  transition: width .35s ease;
}
.ach-progress-text { font-size: 10.5px; color: var(--c-text-muted); margin-top: 4px; }
.ach-reward {
  margin-top: 6px;
  padding: 4px 8px;
  background: linear-gradient(180deg, #fff, #f0f4fa);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 700;
}
.ach-card.unclaimed .ach-reward {
  background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold));
  color: #4a3000;
  cursor: pointer;
}
.ach-ribbon {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 14px;
}

/* =================================================================
   LEADERBOARD
   ================================================================= */
.leaderboard {
  background: white;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-divider);
  box-shadow: var(--sh-1);
}
.lb-row {
  display: grid;
  grid-template-columns: 36px 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f4fa;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.is-me { background: linear-gradient(90deg, #fffaeb, transparent); }
.lb-rank {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  font-size: 13px;
  color: var(--c-text-muted);
}
.lb-rank.r1 { background: linear-gradient(180deg, #ffd54f, #f9a825); color: #4a3000; font-size: 16px; }
.lb-rank.r2 { background: linear-gradient(180deg, #e0e0e0, #9e9e9e); color: white; font-size: 16px; }
.lb-rank.r3 { background: linear-gradient(180deg, #ffab91, #d84315); color: white; font-size: 16px; }
.lb-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #82b1ff, #1565c0);
  color: white;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
  font-size: 14px;
}
.lb-name { font-weight: 800; font-size: 13px; }
.lb-name .me-tag { font-size: 10px; background: var(--c-accent); color: white; padding: 1px 6px; border-radius: var(--r-pill); margin-left: 4px; font-weight: 700; }
.lb-title { font-size: 11px; color: var(--c-text-muted); margin-top: 1px; }
.lb-coins { font-weight: 900; color: var(--c-gold); font-variant-numeric: tabular-nums; }

/* =================================================================
   FEED TIMELINE (动态)
   ================================================================= */
.feed-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  background: white;
  border: 1px solid var(--c-divider);
  border-left-width: 4px;
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--sh-1);
  transition: transform .12s, box-shadow .12s;
}
.feed-card:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.feed-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 16px;
  background: linear-gradient(135deg, #82b1ff, #1565c0);
  color: white;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.feed-avatar.is-self {
  background: linear-gradient(135deg, #ffd180, #ff7043);
  font-size: 13px;
}
.feed-body { min-width: 0; }
.feed-line {
  font-size: 13.5px;
  color: var(--c-text);
  line-height: 1.5;
}
.feed-line strong { color: var(--c-primary-dark); }
.feed-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.feed-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--c-card-soft);
  color: var(--c-text-muted);
  border: 1px solid var(--c-divider);
}
.feed-time {
  font-size: 11px;
  color: var(--c-text-light);
}
.feed-amount {
  font-weight: 900;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.feed-amount.pos { color: var(--c-gold); }
.feed-amount.neg { color: var(--c-danger); }

/* Left-border accents by event type */
.feed-card.kind-arrived       { border-left-color: #4fc3f7; }
.feed-card.kind-returned,
.feed-card.kind-self-returned { border-left-color: #9e9e9e; }
.feed-card.kind-collected-me,
.feed-card.kind-self-collected { border-left-color: var(--c-gold); }
.feed-card.kind-ticketed-me   { border-left-color: var(--c-danger); }
.feed-card.kind-self-ticketed { border-left-color: var(--c-accent); }
.feed-card.kind-friend-joined { border-left-color: #ab47bc; }
.feed-card.kind-dirtied       { border-left-color: var(--c-warn); }
.feed-card.kind-cleaned       { border-left-color: #26a69a; }
.feed-card.kind-ticketed-me .feed-tag { background: #ffebee; color: var(--c-danger); border-color: #ef9a9a; }
.feed-card.kind-self-ticketed .feed-tag { background: #fff3e0; color: var(--c-accent-dark); border-color: #ffcc80; }
.feed-card.kind-self-collected .feed-tag,
.feed-card.kind-collected-me .feed-tag { background: #fff3d6; color: #6d4c00; border-color: #ffd180; }
.feed-card.kind-friend-joined .feed-tag { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.feed-card.kind-dirtied .feed-tag { background: #fff3e0; color: var(--c-warn); border-color: #ffb74d; }
.feed-card.kind-cleaned .feed-tag { background: #e0f2f1; color: #00695c; border-color: #80cbc4; }

@media (max-width: 520px) {
  .feed-card { padding: 8px 12px; gap: 10px; }
  .feed-line { font-size: 12.5px; }
}

/* =================================================================
   MODAL
   ================================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 60, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 16px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease-out;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  background: white;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-3);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  animation: modalIn .25s cubic-bezier(0.22, 1.36, 0.64, 1);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(180deg, var(--c-primary-2), var(--c-primary));
  color: white;
}
.modal-close {
  width: 26px; height: 26px;
  border: none;
  background: rgba(255,255,255,.2);
  color: white;
  border-radius: 50%;
  font-weight: 700;
}
.modal-close:hover { background: rgba(255,255,255,.32); }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--c-divider);
}
.modal-foot .badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--c-card-soft);
  color: var(--c-text-muted);
  font-weight: 700;
}
.overlay-cars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.pick-car-card {
  background: var(--c-card-soft);
  border-radius: var(--r-md);
  padding: 10px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.pick-car-card:hover { border-color: var(--c-primary-2); transform: translateY(-1px); }
.pick-car-card.selected { border-color: var(--c-accent); background: #fff8ef; }
.pick-car-title { font-weight: 800; font-size: 13px; }
.pick-car-card .car-card-visual {
  background: transparent;
  min-height: 50px;
}

.overlay-items {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overlay-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  background: white;
  transition: border-color .12s, background .12s;
}
.overlay-item-row.disabled {
  opacity: .55;
  background: #f8fafd;
}
.overlay-item-row.selected {
  border-color: var(--c-accent);
  background: #fff8ef;
}
.overlay-item-emoji { font-size: 24px; line-height: 1; }
.overlay-item-info { flex: 1; font-size: 12px; }
.overlay-item-info strong { font-size: 13px; }
.overlay-item-have {
  font-size: 11px;
  color: var(--c-text-muted);
  font-weight: 700;
  padding: 3px 8px;
  background: var(--c-card-soft);
  border-radius: var(--r-pill);
}
.overlay-confirm-row {
  display: flex;
  padding: 0 14px 14px;
  gap: 8px;
}
.overlay-confirm-row .btn { flex: 1; }

/* =================================================================
   DAILY MODAL
   ================================================================= */
.daily-card { max-width: 380px; }
.daily-body { padding: 18px; text-align: center; }
.daily-streak-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.daily-day {
  position: relative;
  background: var(--c-card-soft);
  border-radius: var(--r-sm);
  padding: 8px 4px 6px;
  border: 1px solid var(--c-divider);
  font-size: 10px;
  color: var(--c-text-muted);
}
.daily-day.done {
  background: linear-gradient(180deg, #fff3d6, #ffd180);
  border-color: #ffa726;
  color: #4a3000;
}
.daily-day.today {
  background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
  color: white;
  border-color: var(--c-accent-dark);
  box-shadow: 0 0 0 2px rgba(230,80,30,.3);
  animation: pulse 1.5s ease-in-out infinite;
}
.daily-day-label { font-weight: 700; }
.daily-day-reward { font-weight: 900; margin-top: 2px; }
.daily-summary {
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 6px 0 14px;
}
.daily-cta {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 900;
  border-radius: var(--r-md);
  border: none;
  background: linear-gradient(180deg, var(--c-accent-2), var(--c-accent));
  color: white;
  box-shadow: var(--sh-button);
  transition: transform .08s;
}
.daily-cta:hover  { transform: translateY(-1px); }
.daily-cta:active { transform: translateY(1px); box-shadow: var(--sh-button-press); }
.daily-cta:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* =================================================================
   ONBOARDING
   ================================================================= */
.onboarding-body {
  padding: 18px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
  color: var(--c-text);
}

/* =================================================================
   TOASTS
   ================================================================= */
.toasts {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}
.toast {
  background: rgba(20, 30, 60, .92);
  color: white;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  max-width: min(440px, 90vw);
  backdrop-filter: blur(6px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-warn { background: rgba(190, 50, 50, .94); }
.toast-info { background: rgba(20, 70, 130, .94); }
.toast-success { background: rgba(40, 130, 60, .94); }

/* =================================================================
   COIN-FLY FX LAYER
   ================================================================= */
.fx-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1800;
}
.fly-coin {
  position: fixed;
  font-size: 28px;
  z-index: 1900;
  pointer-events: none;
  animation: flyToCoin .9s cubic-bezier(0.22, 1.36, 0.64, 1) forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
@keyframes flyToCoin {
  0% { transform: scale(.6) translateY(0); opacity: 0; }
  20% { transform: scale(1.2) translateY(-10px); opacity: 1; }
  100% {
    transform: scale(.6) translate(var(--dx, 0), var(--dy, -300px));
    opacity: 0;
  }
}

/* =================================================================
   BOTTOM BAR
   ================================================================= */
.bottombar {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.7);
  text-align: center;
  padding: 6px;
  color: var(--c-text-muted);
  font-size: 11px;
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--c-divider);
}

/* =================================================================
   ONBOARDING — banner (My Lot) + checklist (Tasks)
   ================================================================= */
.onboarding-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #fff3e0, #ffe9d6);
  border: 1px solid #ffcc80;
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.onboarding-banner:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.onboarding-banner.has-claim {
  background: linear-gradient(135deg, #fff8e1, #ffe082);
  border-color: #ffb300;
  animation: pulseBanner 1.8s ease-in-out infinite;
}
@keyframes pulseBanner {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, .35); }
  50%      { box-shadow: 0 0 0 5px rgba(255, 179, 0, 0); }
}
.onboarding-banner-emoji { font-size: 24px; line-height: 1; }
.onboarding-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.onboarding-banner-text strong { font-size: 14px; color: #6d4c00; }
.onboarding-banner-text span { font-size: 12px; color: #8d6e30; }
.onboarding-banner-cta {
  font-size: 12px;
  font-weight: 800;
  color: var(--c-accent-dark);
  white-space: nowrap;
}

.onboarding-section { margin-bottom: 6px; }
.onboarding-tasks { display: flex; flex-direction: column; gap: 8px; }
.onboarding-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: white;
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.onboarding-task.done { background: #e8f5e9; border-color: #81c784; }
.onboarding-task.claimed { background: #eceff1; }
.onboarding-task-info { flex: 1; min-width: 0; }
.onboarding-task-title { font-size: 14px; font-weight: 800; color: var(--c-text); }
.onboarding-task.claimed .onboarding-task-title { color: var(--c-text-muted); }
.onboarding-task-desc { font-size: 11px; color: var(--c-text-muted); margin-top: 3px; }
.onboarding-task-reward { color: #b97a00; font-weight: 800; }
.onboarding-task-state {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.onboarding-task-state.claimed { background: #cfd8dc; color: var(--c-muted); }
.onboarding-task-state.todo { color: var(--c-text-light); }

/* Section header with a right-aligned action button (一键领) */
.section-header-action {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.section-header-action .btn { flex: 0 0 auto; margin-bottom: 2px; }

/* =================================================================
   LOT ACTION BAND (一键收 / 一键贴)
   ================================================================= */
.lot-action-band {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.lot-action-band .btn { flex: 1; }

/* =================================================================
   GARAGE / SHOP — upgrade preview + time-to-cap
   ================================================================= */
.stat-gain { color: #00897b; font-weight: 800; }
.stat-chip.cap-chip { background: #fff8e1; border-color: #ffe082; color: #b26a00; }
.shop-car-cap {
  font-size: 11px;
  font-weight: 700;
  color: #b26a00;
  text-align: center;
  margin-top: 2px;
}

/* =================================================================
   ANNOUNCEMENTS MODAL
   ================================================================= */
.announce-card { max-width: 420px; }
.announce-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  min-height: 0; /* allow the list to shrink + scroll inside the flex card */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.announce-entry {
  border: 1px solid var(--c-divider);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--c-card-soft);
}
.announce-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.announce-entry-title { font-weight: 900; font-size: 14px; color: var(--c-primary-dark); }
.announce-entry-date { font-size: 11px; color: var(--c-text-light); white-space: nowrap; }
.announce-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.announce-items li {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--c-text);
}
.announce-tag {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.announce-tag.feat { background: var(--c-success); }
.announce-tag.fix  { background: var(--c-primary-2); }
.announce-tag.note { background: var(--c-muted); }

/* =================================================================
   PARK-DETAIL MODAL
   ================================================================= */
.park-detail-card { max-width: 360px; }
.park-detail-body { padding: 16px 18px 20px; }
.pd-sub { font-size: 12px; color: var(--c-text-muted); margin-bottom: 12px; }
.pd-elapsed { font-size: 13px; font-weight: 800; color: var(--c-text); margin-bottom: 8px; }
.pd-bar {
  height: 12px;
  border-radius: 6px;
  background: #e1eaf5;
  overflow: hidden;
}
.pd-bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--c-gold-2), var(--c-gold));
  transition: width .4s ease-out;
}
.pd-earned { font-size: 12px; font-weight: 800; color: var(--c-accent-dark); margin: 8px 0 12px; }
.pd-detail { display: flex; flex-direction: column; gap: 7px; }
.pd-line { font-size: 12.5px; color: var(--c-text); line-height: 1.5; }
.pd-line.muted { font-size: 11.5px; color: var(--c-text-muted); }
.pd-danger { color: var(--c-danger); font-weight: 800; }
.slot-car.tappable { cursor: pointer; }

/* =================================================================
   CELEBRATION MODAL (achievement unlocked)
   ================================================================= */
.celebration-modal { overflow: hidden; }
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -16px;
  width: 9px; height: 14px;
  border-radius: 2px;
  opacity: .95;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: .9; }
}
.celebration-card {
  max-width: 340px;
  position: relative;
  text-align: center;
  overflow: visible;
}
.celebration-banner {
  padding: 18px;
  font-size: 19px;
  font-weight: 900;
  color: #4a3000;
  background: linear-gradient(180deg, #ffd54f, var(--c-gold));
}
.celebration-body { padding: 20px 22px 8px; }
.celebration-title { font-size: 21px; font-weight: 900; color: var(--c-primary-dark); }
.celebration-desc { font-size: 13px; color: var(--c-text-muted); margin-top: 6px; }
.celebration-reward {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 900;
  color: #4a3000;
  background: linear-gradient(180deg, #fff3a3, var(--c-gold));
  box-shadow: var(--sh-1);
}
.celebration-actions {
  display: flex;
  gap: 10px;
  padding: 16px 22px 22px;
}
.celebration-actions .btn { flex: 1; }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 720px) {
  main { padding: 10px 10px 80px; }
  .friend-panel { grid-template-columns: 1fr; }
  .section-header h2 { font-size: 15px; }
  .lot-grid.cols-7 { grid-template-columns: repeat(4, 1fr); }
  .quest-strip { grid-template-columns: 1fr; }
  .quest-card-desc { min-height: 0; }
  .topbar-inner { padding: 8px 10px; }
  .user-name { display: none; }
}
@media (max-width: 520px) {
  .lot-grid { grid-template-columns: repeat(2, 1fr); }
  .lot-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .lot-grid.cols-7 { grid-template-columns: repeat(3, 1fr); }
  .tab { font-size: 11px; padding: 8px 6px; }
  .tab-icon { font-size: 20px; }
  .frontage-sign { display: none; }
  .lb-row { grid-template-columns: 30px 30px 1fr auto; padding: 8px 12px; }
  .dropdown { right: 8px; width: calc(100vw - 16px); }
  .coin-pill .coin-icon { font-size: 14px; }
}
