:root {
  --bg: #0b1026;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --neon: #4dd0ff;
  --neon2: #b388ff;
  --text: #eaf2ff;
  --muted: #8b96b8;
}

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

body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #1b2350 0%, var(--bg) 55%) var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 60% 70%, #fff, transparent),
    radial-gradient(2px 2px at 80% 20%, #9fd8ff, transparent),
    radial-gradient(1px 1px at 35% 85%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, #d6c6ff, transparent),
    radial-gradient(1px 1px at 10% 60%, #fff, transparent);
  opacity: .7;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: .85; } }

#topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: rgba(11, 16, 38, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.balance { font-size: 20px; font-weight: 700; color: var(--neon); text-shadow: 0 0 12px rgba(77, 208, 255, .5); }
.username { color: var(--muted); font-size: 14px; }

main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 12px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.hero { text-align: center; padding: 18px 0 8px; }
.planet { font-size: 72px; display: inline-block; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(179, 136, 255, .45)); }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.row-stats { display: flex; gap: 8px; margin: 10px 0; }
.mini-card {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; text-align: center; font-size: 18px;
}
.mini-card span { display: block; font-size: 11px; color: var(--muted); margin: 2px 0; }
.mini-card b { font-size: 16px; color: var(--neon); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px; margin-bottom: 10px;
}
.section-title { margin: 16px 2px 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.section-head { display: flex; justify-content: space-between; align-items: center; }

.ship-head { font-size: 17px; margin-bottom: 4px; }
.badge {
  font-size: 10px; background: rgba(77, 208, 255, .15); color: var(--neon);
  border: 1px solid rgba(77, 208, 255, .4); border-radius: 8px; padding: 2px 6px; vertical-align: middle;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  border: none; color: #081022;
  box-shadow: 0 0 16px rgba(77, 208, 255, .35);
}
.btn-primary:disabled { opacity: .35; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--muted); }

.countdown { font-size: 22px; font-weight: 700; color: var(--neon); margin-top: 8px; font-variant-numeric: tabular-nums; }

.daily { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.route-item {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 14px; font-size: 16px; cursor: pointer;
}
.route-item:active { border-color: var(--neon); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.grid > div { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; font-size: 13px; color: var(--muted); }
.grid b { display: block; color: var(--text); font-size: 16px; margin-top: 2px; }
.profile-name { font-size: 20px; font-weight: 700; }
.ref-link {
  word-break: break-all; font-size: 12px; color: var(--neon);
  background: rgba(0,0,0,.3); border-radius: 10px; padding: 10px; margin: 10px 0;
}

#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: rgba(11, 16, 38, .92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
#bottomnav button {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 20px; padding: 8px 0 6px; cursor: pointer;
}
#bottomnav button span { display: block; font-size: 10px; margin-top: 2px; }
#bottomnav button.active { color: var(--neon); }

#modal {
  position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
}
#modal.hidden, #toast.hidden { display: none; }
#modal-box {
  background: #131a3a; border: 1px solid var(--border); border-bottom: none;
  border-radius: 20px 20px 0 0; width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto; padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  animation: up .25s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
#modal-box h3 { margin-bottom: 12px; }
#modal-box .btn-ghost { width: 100%; margin-top: 8px; }

#toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: #1c2b4d; border: 1px solid var(--neon); color: var(--text);
  padding: 10px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.error { border-color: #ff6b8a; }

.fatal { text-align: center; margin-top: 40px; }
.fatal h2 { margin-bottom: 10px; }

.wallet-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.wallet-tabs .tab { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.wallet-tabs .tab.active { background: linear-gradient(135deg, var(--neon), var(--neon2)); color: #081022; font-weight: 700; }
.wallet-connect { text-align: center; padding: 30px 16px; }
.wallet-icon { font-size: 48px; margin-bottom: 8px; }
.ref-block { margin: 12px 0; }
.input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,.3); color: var(--text); margin: 8px 0; }
.history-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.badge-pending { color: #ffd166; }
.badge-completed { color: #7dff9b; }
.badge-failed { color: #ff6b8a; }

/* Hero секция */
.hero-container {
  width: 100vw;
  max-width: 480px; /* совпадает с max-width main */
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: -12px;
  margin-bottom: 20px;
  padding: 0;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Сетка статистики */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.1), rgba(179, 136, 255, 0.1));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.05), transparent);
  pointer-events: none;
}

.stat-card:active {
  transform: scale(0.95);
  box-shadow: 0 0 20px rgba(77, 208, 255, 0.3);
}

.stat-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 8px rgba(77, 208, 255, 0.5));
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(77, 208, 255, 0.5);
}

/* Улучшенная карточка рейса */
.flight-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.08), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.flight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.03), transparent);
  pointer-events: none;
}

.flight-ship-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(77, 208, 255, 0.4));
}

.flight-info {
  flex: 1;
  min-width: 0;
}

.flight-ship-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.flight-route {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flight-reward {
  font-size: 13px;
  color: var(--neon);
  font-weight: 600;
}

.flight-timer {
  font-size: 24px;
  font-weight: 700;
  color: var(--neon);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(77, 208, 255, 0.5);
  margin-top: 8px;
}

.flight-timer-icon {
  display: inline-block;
  margin-right: 4px;
}

/* Daily Bonus карточка */
.daily-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-card img {
  width: 32px;
  height: 32px;
}

.daily-card.claimed {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

/* Обновлённый topbar с иконкой денег */
.balance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(77, 208, 255, 0.5);
}

.balance img {
  width: 24px;
  height: 24px;
}

/* Иконки нижнего меню */
.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 2px;
  filter: brightness(0.7);
  transition: filter 0.2s;
}

#bottomnav button.active .nav-icon {
  filter: brightness(1) drop-shadow(0 0 8px rgba(77, 208, 255, 0.6));
}

#bottomnav button {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  padding: 8px 0 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#bottomnav button.active {
  color: var(--neon);
}

.nav-emoji {
  font-size: 20px;
  margin-bottom: 2px;
}

/* Иконки планет */
.planet-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.planet-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.planet-emoji {
  font-size: 16px;
}

/* Стилизация кораблей во флоте */
.ship-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.08), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ship-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(77, 208, 255, 0.2);
}

.ship-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ship-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(77, 208, 255, 0.4));
}

.ship-emoji {
  font-size: 48px;
}

.ship-title {
  flex: 1;
}

.ship-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ship-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-item .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-item .stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--neon);
}

.ship-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 14px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.sell-btn {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
}

.starter-badge {
  text-align: center;
  padding: 8px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #ffd700;
}

.ship-status {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
}

.ship-status.flying {
  background: rgba(77, 208, 255, 0.1);
  color: var(--neon);
}

.ship-status.contract {
  background: rgba(179, 136, 255, 0.1);
  color: var(--neon2);
}

/* Магазин */
.shop-title {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.shop-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.1), rgba(179, 136, 255, 0.1));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s;
}

.shop-card:not(.disabled):hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(77, 208, 255, 0.3);
}

.shop-card.disabled {
  opacity: 0.5;
}

.shop-ship-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-ship-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(77, 208, 255, 0.4));
}

.shop-emoji {
  font-size: 56px;
}

.shop-ship-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.shop-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.shop-buy-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

/* Анимации */
@keyframes balancePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.balance-updated {
  animation: balancePulse 0.5s ease;
}

.wallet-connect-card {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.1), rgba(179, 136, 255, 0.1));
}

.wallet-icon-large {
  font-size: 64px;
  margin-bottom: 16px;
}

.wallet-title {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.wallet-description {
  margin-bottom: 24px;
}

.wallet-connect-btn {
  padding: 14px 32px;
  font-size: 16px;
}

.wallet-main-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.08), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.wallet-tabs-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
}

.wallet-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-tab.active {
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  color: #081022;
  font-weight: 600;
}

.wallet-tab-icon {
  font-size: 20px;
}

.wallet-body {
  min-height: 200px;
}

.wallet-address-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.wallet-address-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.wallet-address {
  font-family: monospace;
  font-size: 11px;
  color: var(--neon);
  word-break: break-all;
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.wallet-disconnect-btn {
  width: 100%;
}

.profile-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.1), rgba(179, 136, 255, 0.1));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.profile-header {
  text-align: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 12px;
  border: 3px solid var(--neon);
  box-shadow: 0 0 20px rgba(77, 208, 255, 0.5);
}

.profile-emoji {
  font-size: 64px;
  display: inline-block;
  margin-bottom: 12px;
}

.profile-name-large {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-stat-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.profile-stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.profile-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--neon);
}

.referral-card {
  background: linear-gradient(135deg, rgba(179, 136, 255, 0.1), rgba(77, 208, 255, 0.1));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.referral-title {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.referral-description {
  margin-bottom: 16px;
  font-size: 14px;
}

.ref-link-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-link-text {
  font-family: monospace;
  font-size: 11px;
  color: var(--neon);
  word-break: break-all;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.ref-copy-btn {
  width: 100%;
}

/* ===== Экран «Работа» ===== */

.job-card {
  background: linear-gradient(135deg, rgba(77, 208, 255, 0.08), rgba(179, 136, 255, 0.08));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(77, 208, 255, 0.2);
}

.job-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.job-ship-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(77, 208, 255, 0.4));
}

.job-ship-emoji {
  font-size: 48px;
  flex-shrink: 0;
}

.job-title {
  flex: 1;
  min-width: 0;
}

.job-ship-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.job-owner {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.job-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-bottom: 12px;
}

.job-arrow {
  color: var(--neon);
  font-weight: 700;
}

.job-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-bottom: 12px;
}

.job-stats:last-child {
  margin-bottom: 0;
}

.job-reward-value {
  text-shadow: 0 0 8px rgba(77, 208, 255, 0.5);
}

.job-take-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.job-cancel-btn {
  width: 100%;
}

/* Статус-бейджи контрактов */
.job-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
  margin-top: 4px;
}

.job-status-badge.open {
  background: rgba(77, 208, 255, 0.15);
  color: var(--neon);
  border: 1px solid rgba(77, 208, 255, 0.4);
}

.job-status-badge.taken {
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.4);
}

.job-status-badge.completed {
  background: rgba(125, 255, 155, 0.12);
  color: #7dff9b;
  border: 1px solid rgba(125, 255, 155, 0.35);
}

.job-status-badge.cancelled {
  background: rgba(255, 107, 138, 0.12);
  color: #ff6b8a;
  border: 1px solid rgba(255, 107, 138, 0.35);
}

/* Предупреждение «пилот занят» */
.pilot-busy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(255, 165, 0, 0.06));
  border: 1px solid rgba(255, 209, 102, 0.35);
}

.pilot-busy-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.pilot-busy-title {
  font-weight: 700;
  color: #ffd166;
  margin-bottom: 2px;
}

.pilot-busy-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Пустые состояния */
.jobs-empty {
  text-align: center;
  padding: 30px 16px;
}

.jobs-empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.jobs-empty-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.jobs-empty-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ===== Шапка: LVL бейдж + XP бар ===== */
.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lvl-badge {
  position: relative;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  margin-top: 6px; /* место под подпись LVL */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  color: #081022;
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  box-shadow: 0 0 12px rgba(77, 208, 255, .45);
  font-variant-numeric: tabular-nums;
}


.player-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#topbar .username {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xp-bar {
  width: 110px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--neon), var(--neon2));
  transition: width .4s ease;
}

.xp-text {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ===== Баннер слотов рейсов ===== */
.slots-banner {
  margin: 0 2px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(77, 208, 255, .08);
  border: 1px solid rgba(77, 208, 255, .25);
  font-size: 13px;
}

.slots-banner.full {
  background: rgba(255, 209, 102, .08);
  border-color: rgba(255, 209, 102, .35);
}

.slots-banner b {
  color: var(--neon);
}

/* ===== Grace period ===== */
.grace-note {
  margin-top: 6px;
  font-size: 11px;
  color: #ffd166;
  font-variant-numeric: tabular-nums;
}

.job-grace-hint {
  margin: -4px 0 10px;
}

/* ===== Прочность корабля ===== */
.durability {
  margin: 10px 0 12px;
}

.durability-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.durability-label .dur-ok   { color: #7dff9b; }
.durability-label .dur-warn { color: #ffd166; }
.durability-label .dur-bad  { color: #ff6b8a; }

.dur-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.dur-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}

.dur-fill.dur-ok   { background: linear-gradient(90deg, #4ade80, #22c55e); }
.dur-fill.dur-warn { background: linear-gradient(90deg, #ffd166, #f59e0b); }
.dur-fill.dur-bad  { background: linear-gradient(90deg, #ff6b8a, #ef4444); }

.ship-status.broken {
  background: rgba(255, 107, 138, 0.12);
  color: #ff6b8a;
  border: 1px solid rgba(255, 107, 138, 0.35);
  margin-bottom: 8px;
}

/* ===== Выбор маршрута (карточки) ===== */
.route-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}

.route-card:active {
  border-color: var(--neon);
  transform: scale(.98);
}

.route-card-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  margin-bottom: 10px;
}

.route-card-path .route-arrow {
  color: var(--neon);
  font-weight: 700;
}

.route-card-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip-mult   { color: var(--neon2); }
.chip-wear   { color: #ffd166; }
.chip-reward { color: var(--neon); font-weight: 700; }

/* ===== Кнопки в заголовке флота ===== */
.fleet-head-actions { display: flex; gap: 8px; }
#open-calc { white-space: nowrap; font-size: 13px; padding: 10px 12px; }

/* ===== Калькулятор доходности ===== */
.calc-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 12px 0 6px;
}

.calc-ships {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.calc-ship {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text);
}

.calc-ship.active {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(77, 208, 255, .25);
}

.calc-ship-emoji { font-size: 20px; }
.calc-ship-name  { font-size: 9px; color: var(--muted); }
.calc-ship-price { font-size: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.calc-ship.active .calc-ship-name { color: var(--neon); }

.calc-owned-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, .8);
}

.calc-modes { display: flex; gap: 6px; }

.calc-mode {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 4px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.calc-mode.active {
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  color: #081022;
  font-weight: 700;
  border: none;
}

/* ===== Маршруты в калькуляторе: иконка слева, название, множитель под названием ===== */
.calc-routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calc-route {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color .15s;
}

.calc-route:active { transform: scale(.97); }

.calc-route.active {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(77, 208, 255, .25);
}

.calc-route-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(77, 208, 255, .3));
}

.calc-route-emoji { font-size: 22px; flex-shrink: 0; }

.calc-route-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.calc-route-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-route-mult {
  font-size: 11px;
  color: var(--neon);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.calc-card {
  margin-top: 14px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 12px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.calc-row:last-child { border-bottom: none; }
.calc-row span { color: var(--muted); }
.calc-row b { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

.calc-row-total b {
  color: var(--neon);
  font-size: 15px;
  text-shadow: 0 0 8px rgba(77, 208, 255, .4);
}

.calc-bad { color: #ff6b8a; }

/* Картинки в калькуляторе */
.calc-ship-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(77, 208, 255, .4));
}

/* Планеты внутри чипов маршрутов — чуть компактнее стандартных 30px */
.calc-route .planet-icon {
  width: 20px;
  height: 20px;
}

.chip-time { color: var(--muted); }

/* ===== Вкладки профиля ===== */
.profile-tabs-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
}

.profile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.profile-tab.active {
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  color: #081022;
  font-weight: 600;
}

.profile-tab-icon { font-size: 20px; }

/* ===== Реферальная система ===== */
.ref-invite-btn { width: 100%; margin-top: 8px; }

.ref-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 10px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
}

.ref-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.ref-tab.active {
  background: linear-gradient(135deg, var(--neon), var(--neon2));
  color: #081022;
}

.ref-tab-count { opacity: 0.7; font-weight: 400; }

.ref-level-summary {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.ref-level-summary b { color: var(--neon); }

.ref-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
}

.ref-user-name { font-size: 14px; font-weight: 600; }
.ref-user-username { font-size: 11px; color: var(--muted); }

.ref-user-earned {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ref-user-earned.zero { color: var(--muted); font-weight: 400; }

.ref-empty {
  text-align: center;
  padding: 20px 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Переключатель языка ===== */
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

#lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
  letter-spacing: .04em;
}

#lang-btn:active { transform: scale(.95); }

.lang-list { display: flex; flex-direction: column; gap: 8px; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}

.lang-option:active { transform: scale(.98); }

.lang-option.active {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(77, 208, 255, .25);
}

.lang-flag { font-size: 20px; }
.lang-check { margin-left: auto; color: var(--neon); font-weight: 700; }

/* ===== Обучение (tutorial) ===== */
#tut-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

.tut-mask {
  position: fixed;
  background: rgba(5, 8, 20, .72);
  z-index: 90;
  pointer-events: none;   /* клики проходят к подсвеченным элементам */
  transition: all .3s ease;
}
#tut-tip { pointer-events: auto; } /* блокируем только текстовую плашку */
.tut-mask.light { background: rgba(5, 8, 20, .35); }

#tut-ring {
  position: fixed;
  z-index: 91;
  pointer-events: none;           /* клики проходят к элементу */
  border: 2px solid var(--neon);
  border-radius: 14px;
  transition: all .3s ease;
  animation: tutPulse 1.2s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(77, 208, 255, .35); }
  50%      { box-shadow: 0 0 26px rgba(77, 208, 255, .85); }
}

#tut-tip {
  position: fixed;
  left: 12px; right: 12px;
  max-width: 456px;
  margin: 0 auto;
  z-index: 92;
  pointer-events: auto;
  background: #131a3a;
  border: 1px solid var(--neon);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6), 0 0 20px rgba(77, 208, 255, .25);
}
#tut-tip.bottom { bottom: calc(88px + env(safe-area-inset-bottom)); animation: tutUp .3s ease; }
/* ★ НОВОЕ: плашка в верхней части экрана */
#tut-tip.top { top: calc(12px + env(safe-area-inset-top)); animation: tutDown .3s ease; }
#tut-tip.center { top: 50%; transform: translateY(-50%); animation: tutFade .3s ease; }
#tut-tip h3 { margin-bottom: 8px; font-size: 17px; }
#tut-tip p { font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
#tut-tip .btn { width: 100%; }
#tut-tip .lang-list { margin-top: 4px; }

@keyframes tutUp { from { opacity: 0; transform: translateY(12px); } }
/* ★ НОВОЕ: анимация появления сверху */
@keyframes tutDown { from { opacity: 0; transform: translateY(-12px); } }
@keyframes tutFade { from { opacity: 0; } }

/* ===== Главная: Daily Bonus + кнопка заданий ===== */
.home-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}
.home-row #daily-card { flex: 1; min-width: 0; display: flex; }
.home-row .daily-card { margin-bottom: 0; flex: 1; }

.tasks-open-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(179, 136, 255, .35);
  background: linear-gradient(135deg, rgba(179, 136, 255, .15), rgba(77, 208, 255, .1));
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tasks-open-btn:active { transform: scale(.95); }
.tasks-open-icon { font-size: 26px; filter: drop-shadow(0 0 8px rgba(179, 136, 255, .5)); }

/* ===== Карточки заданий в модалке ===== */
.task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.task-card.completed { opacity: .8; border-color: rgba(125, 255, 155, .3); }
.task-logo {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(77, 208, 255, .4);
}
.task-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: rgba(0,0,0,.25);
}
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; }
.task-reward { font-size: 12px; color: var(--neon); font-weight: 700; margin-top: 2px; }
.task-actions { display: flex; flex-direction: column; gap: 6px; }
.task-actions .btn { padding: 7px 12px; font-size: 12px; white-space: nowrap; }
.task-done-badge { color: #7dff9b; font-size: 13px; font-weight: 700; white-space: nowrap; }

/* Задания: прогресс реферальных вех */
.task-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0;
}
.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #00cec9);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ═══ Бейдж невыполненных заданий ═══ */
.tasks-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3b5c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badgePulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255,59,92,.7);
  z-index: 2;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: .65; }
}

/* Кнопка заданий должна быть relative, чтобы бейдж позиционировался от неё */
.tasks-open-btn {
  position: relative;
}

/* ===== Промо-акция выходных (Shuttle → Voyager) ===== */
#promo-modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 8, 20, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#promo-modal.hidden { display: none; }

.promo-card {
  position: relative;
  width: 100%; max-width: 360px;
  background: linear-gradient(160deg, #1b2350, #0b1026);
  border: 1px solid rgba(255, 209, 102, .45);
  border-radius: 20px;
  padding: 26px 18px 18px;
  text-align: center;
  overflow: hidden;
  animation: promoUp .3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 40px rgba(255, 209, 102, .15);
}
@keyframes promoUp { from { transform: translateY(30px) scale(.95); opacity: 0; } }

.promo-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 24px; cursor: pointer; z-index: 2; line-height: 1;
}

.promo-glow {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255, 209, 102, .25), transparent 70%);
  pointer-events: none;
}

.promo-title {
  font-size: 22px; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(90deg, #ffd166, #ff9f45);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 4px;
}
.promo-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.promo-exchange {
  display: flex; align-items: center; justify-content: space-around;
  margin-bottom: 18px;
}
.promo-ship { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.promo-ship-icon { width: 64px; height: 64px; object-fit: contain; }
.promo-ship-old { filter: grayscale(.4); opacity: .85; }
.promo-glow-icon { filter: drop-shadow(0 0 14px rgba(255, 209, 102, .65)); animation: promoFloat 3s ease-in-out infinite; }
@keyframes promoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.promo-ship-name { font-size: 13px; font-weight: 700; }
.promo-ship-status { font-size: 11px; color: var(--muted); }
.promo-discount { color: #7dff9b; font-weight: 800; }
.promo-arrow { font-size: 26px; color: var(--neon); }

.promo-desc { font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.promo-desc s { color: var(--muted); }
.promo-btn { width: 100%; margin-bottom: 8px; font-size: 15px; }
.promo-later { width: 100%; font-size: 13px; }

/* Плашка «сломан навсегда» для стартового Shuttle */
.promo-dead {
  background: rgba(255, 107, 138, .12);
  color: #ff6b8a;
  border: 1px solid rgba(255, 107, 138, .35);
}

/* Акционный ценник в магазине */
.shop-card { position: relative; }
.promo-price-note {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: linear-gradient(90deg, #ffd166, #ff9f45);
  color: #081022; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 8px;
  box-shadow: 0 0 10px rgba(255, 209, 102, .5);
}

/* Предупреждение о скорой поломке стартового Shuttle */
.starter-warning {
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(255, 107, 138, 0.12);
  border: 1px solid rgba(255, 107, 138, 0.4);
  border-radius: 10px;
  color: #ff6b8a;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  animation: pulseWarn 2s ease-in-out infinite;
}

@keyframes pulseWarn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.starter-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.08);
  border: 1px dashed rgba(255, 209, 102, 0.45);
  border-radius: 8px;
}
.refuel-banner {
  margin: 8px 0 6px;
  padding: 8px 10px;
  font-size: 12px; line-height: 1.4;
  color: #7dd3fc;
  background: rgba(125, 211, 252, .08);
  border: 1px solid rgba(125, 211, 252, .35);
  border-radius: 8px;
}
.refuel-timer { font-weight: 700; }

/* ===== Лотерея ===== */
.hero-container { position: relative; }

/* Кнопка поверх hero — правый верхний угол */
.lottery-fab {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(145deg, #ffd166, #ff9f45);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #081022; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 20px rgba(255, 165, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
  cursor: pointer;
  animation: lotPulse 2.2s ease-in-out infinite;
}
.lottery-fab span {
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  margin-top: 3px; text-transform: uppercase;
}
.lottery-fab:active { transform: scale(.92); }
@keyframes lotPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(255, 165, 0, .5), inset 0 1px 0 rgba(255,255,255,.5); }
  50%      { box-shadow: 0 6px 30px rgba(255, 209, 102, .9), inset 0 1px 0 rgba(255,255,255,.5); }
}

/* Шапка модалки с призом */
.lot-hero { text-align: center; padding: 4px 0 14px; }
.lot-hero-ship {
  width: 96px; height: 96px; object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 209, 102, .55));
  animation: promoFloat 3s ease-in-out infinite;
}
.lot-hero-emoji { font-size: 64px; display: block; }
.lot-hero-title {
  font-size: 20px; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(90deg, #ffd166, #ff9f45);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lot-hero-round { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.lot-hero-prize { font-size: 14px; }
.lot-hero-income { font-size: 13px; font-weight: 700; color: #7dff9b; margin-top: 2px; }

/* Прогресс-бар */
.lot-progress-card {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; margin-bottom: 12px;
}
.lot-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.lot-progress-head b { font-size: 15px; color: #ffd166; font-variant-numeric: tabular-nums; }
.lot-progress {
  height: 12px; border-radius: 8px; background: rgba(255, 255, 255, .08); overflow: hidden;
}
.lot-progress-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, #ffd166, #ff9f45);
  box-shadow: 0 0 12px rgba(255, 165, 0, .6);
  transition: width .5s ease;
}

/* Статус-баннер */
.lot-status { margin-top: 10px; font-size: 12px; padding: 8px 10px; border-radius: 10px; line-height: 1.4; }
.lot-status.active  { background: rgba(77, 208, 255, .08);  border: 1px solid rgba(77, 208, 255, .3);  color: var(--neon); }
.lot-status.drawing { background: rgba(255, 209, 102, .1);  border: 1px solid rgba(255, 209, 102, .4); color: #ffd166; }
.lot-status.done    { background: rgba(125, 255, 155, .08); border: 1px solid rgba(125, 255, 155, .3); color: #7dff9b; }

/* Шаги «как участвовать» */
.lot-steps { display: flex; gap: 6px; margin-bottom: 12px; }
.lot-step {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 6px; text-align: center;
  font-size: 10px; line-height: 1.3; color: var(--muted);
}
.lot-step-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.lot-step b { color: var(--text); }

/* Кнопка депозита */
.lot-deposit-btn { width: 100%; font-size: 15px; padding: 13px; margin-bottom: 14px; }

/* Мои билеты */
.lot-my {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; margin-bottom: 12px;
}
.lot-my-head {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.lot-tickets { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; }
.lot-chip {
  background: rgba(77, 208, 255, .12); border: 1px solid rgba(77, 208, 255, .4);
  color: var(--neon); border-radius: 8px; padding: 4px 9px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.lot-remainder { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Победитель */
.lot-winner {
  margin-bottom: 12px; padding: 12px; border-radius: 12px; text-align: center;
  background: rgba(125, 255, 155, .1); border: 1px solid rgba(125, 255, 155, .35);
  color: #7dff9b; font-size: 14px; font-weight: 700;
}

/* Админ-блок */
.lot-admin {
  border: 1px dashed rgba(255, 209, 102, .4); border-radius: 14px;
  padding: 12px; background: rgba(255, 209, 102, .05);
}
.lot-admin-title {
  font-size: 11px; color: #ffd166; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.lot-admin .btn { width: 100%; margin-bottom: 6px; }
.lot-draw-row { display: flex; gap: 6px; margin-bottom: 6px; }
.lot-draw-row .input { flex: 1; margin: 0; }
.lot-draw-row .btn { width: auto; white-space: nowrap; }

/* ===== Лидерборд ===== */
.lb-pool-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 209, 102, .12), rgba(255, 165, 0, .05));
  border: 1px solid rgba(255, 209, 102, .35);
}
.lb-pool-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lb-pool-value { font-size: 32px; font-weight: 800; color: #ffd166; text-shadow: 0 0 16px rgba(255, 209, 102, .5); margin: 4px 0; }
.lb-pool-timer { font-size: 12px; color: var(--muted); }
.lb-pool-timer b { color: var(--neon); font-variant-numeric: tabular-nums; }

.lb-prizes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}
.lb-prize {
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 16px;
}
.lb-prize b {
  display: block;
  width: 100%;
  text-align: center;
  color: #ffd166;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.lb-prize-pct { font-size: 10px; color: var(--muted); }

.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
}
.lb-row + .lb-row { border-top: 1px solid rgba(255, 255, 255, .05); }
.lb-row.me {
  background: rgba(77, 208, 255, .08);
  border: 1px solid rgba(77, 208, 255, .35);
  margin-top: 6px;
}
.lb-rank { min-width: 32px; text-align: center; font-weight: 700; color: var(--muted); }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-points { color: var(--neon); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 14px 8px; }
.lb-note { margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.lb-mywin { margin-top: 8px; font-size: 13px; color: #7dff9b; font-weight: 700; }

/* Подпись про удержание 5% в пул лидерборда */
.lb-fee-note {
  font-size: 11px;
  line-height: 1.4;
}

.lb-players { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.lb-players b { color: var(--text); }

/* ===== Автопилоты ===== */
.shop-tabs { margin-bottom: 14px; }

.ap-panel {
  background: rgba(179, 136, 255, .08);
  border: 1px solid rgba(179, 136, 255, .35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.ap-panel-title { font-size: 13px; font-weight: 700; color: var(--neon2); }
.ap-panel-route { font-size: 12px; color: var(--muted); margin-top: 2px; }

.ap-check {
  display: flex; align-items: center; gap: 8px;
  width: 100%; margin-top: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; color: var(--text); font-size: 13px; cursor: pointer;
}
#promo-modal2 {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5, 8, 20, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#promo-modal2.hidden { display: none; }

/* ═══════════ Этап 1: планеты, ячейки, соты ═══════════ */

/* Кнопки Инвентарь/Рынок поверх hero (внизу, в один ряд) */
.hero-actions {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 3;
  display: flex; gap: 10px; justify-content: center;
}
.hero-action-btn {
  padding: 10px 18px; border-radius: 12px;
  border: 1px solid rgba(77, 208, 255, .45);
  background: rgba(11, 16, 38, .78); backdrop-filter: blur(6px);
  color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 0 14px rgba(77, 208, 255, .25);
}
.hero-action-btn:active { transform: scale(.95); }

/* Плавающая кнопка «Планеты» внизу экрана */
.planets-fab {
  position: fixed; right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 9;
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #4dd0ff, #b388ff);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #081022; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 20px rgba(77, 208, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
  cursor: pointer;
  animation: lotPulse 2.2s ease-in-out infinite;
}
.planets-fab span {
  font-size: 9px; font-weight: 800; letter-spacing: .05em;
  margin-top: 3px; text-transform: uppercase;
}
.planets-fab:active { transform: scale(.92); }

/* Карточки планет */
.planet-card {
  display: flex; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; margin-bottom: 10px; cursor: pointer; color: var(--text);
  align-items: center; transition: border-color .15s, transform .15s;
}
.planet-card:active { transform: scale(.98); border-color: var(--neon); }
.planet-card-img {
  width: 64px; height: 64px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(77, 208, 255, .35));
}
.planet-card-emoji { font-size: 48px; flex-shrink: 0; width: 64px; text-align: center; }
.planet-card-info { flex: 1; min-width: 0; }
.planet-card-name { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.planet-card-desc { font-size: 11px; color: var(--muted); line-height: 1.35; margin-bottom: 6px; }
.planet-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.planet-card-dom { color: var(--neon2); display: flex; align-items: center; gap: 4px; }
.planet-card-cells { color: var(--neon); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Легенда сетки */
.pcells-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pcells-chip {
  font-size: 11px; padding: 4px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.chip-free { color: #4ade80; }
.chip-taken { color: #ff6b8a; }
.chip-mine { color: var(--neon); }

/* Пчелиные соты: ряды по 7, чётные сдвинуты, вертикальный нахлёст */
/* ═══ Пчелиные соты: pointy-top (остриё вверх/вниз), ряды по 7 со сдвигом ═══
   Геометрия: W=40, H=46 (≈W×2/√3), шаг в ряду 42px (gap 2),
   шаг рядов 36px (нахлёст 10px = 25% высоты), сдвиг ряда 21px (полшага) */
.pcells-wrap {
  width: 314px;               /* 7×40 + 6×2 + сдвиг 21 + 1px запас */
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 0 14px;
  display: flex; flex-direction: column;
}
.pcell-row { display: flex; gap: 2px; margin-top: -10px; }
.pcell-row:first-child { margin-top: 0; }
.pcell-row:nth-child(even) { margin-left: 21px; }   /* сдвиг чётных рядов = полшага */
/* Рамка ячейки = фон внешнего шестиугольника, внутренний чуть меньше */
.pcell {
  width: 40px; height: 46px; padding: 2px; flex-shrink: 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  cursor: pointer; transition: transform .12s, filter .12s;
}
.pcell:active { transform: scale(.9); }
.pcell-in {
  width: 100%; height: 100%;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #131a3a;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.pcell-in img { display: block; }

.pcell-free  { background: #22c55e; }
.pcell-free:hover  { filter: drop-shadow(0 0 6px rgba(34, 197, 94, .8)); }
.pcell-taken { background: #ef4444; }
.pcell-mine  { background: #4dd0ff; }
.pcell-mine .pcell-in { background: rgba(77, 208, 255, .18); }
.pcell-mine:hover { filter: drop-shadow(0 0 6px rgba(77, 208, 255, .8)); }

/* Окно покупки ячейки */
.pcell-buy-grid {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px 12px; margin-top: 12px;
}
.pcell-buy-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.pcell-buy-row:last-child { border-bottom: none; }
.pcell-buy-row span { color: var(--muted); }
.pcell-buy-row b { font-variant-numeric: tabular-nums; text-align: right; }
.pcell-price { color: var(--neon); font-size: 15px; }

.tier-common    { color: #9ca3af; }
.tier-uncommon  { color: #4ade80; }
.tier-rare      { color: #4dd0ff; }
.tier-epic      { color: #b388ff; }
.tier-legendary { color: #ffd166; }

/* ═══════════ Этап 3: добывающие станции ═══════════ */
.pcell-in { position: relative; }
.pcell-dot {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffd166; box-shadow: 0 0 4px rgba(255, 209, 102, .9);
}
.station-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.station-head img { filter: drop-shadow(0 0 8px rgba(77, 208, 255, .4)); }
.station-name { font-weight: 700; font-size: 16px; }
.station-lvl { color: var(--neon); }

.station-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; color: var(--text); cursor: pointer;
}
.station-pick:active { transform: scale(.98); border-color: var(--neon); }
.station-pick-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.station-pick-price { font-size: 12px; color: var(--neon); font-weight: 700; white-space: nowrap; }

.station-hangar-row { display: flex; gap: 10px; align-items: center; }
.station-hangar-row img { flex-shrink: 0; }

/* ═══════════ Этап 4: заводы и верфи ═══════════ */
.factory-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.factory-icon { object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(77, 208, 255, .35)); }
.factory-emoji { font-size: 36px; }
.factory-name { font-weight: 700; font-size: 15px; }
.factory-tier { font-size: 11px; color: var(--muted); margin-top: 2px; }

.recipe-row {
  background: rgba(0, 0, 0, .22); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; margin-bottom: 8px;
}
.recipe-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 13px; }
.recipe-arrow { color: var(--neon); font-weight: 700; }
.recipe-meta { font-size: 11px; color: var(--muted); margin: 8px 0; font-variant-numeric: tabular-nums; }
.recipe-btn { width: 100%; padding: 9px; font-size: 13px; }
.recipe-btn:disabled { opacity: .55; }

.io-item {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px 8px; font-size: 12px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.io-lack { border-color: rgba(255, 107, 138, .55); color: #ff6b8a; }

.io-item.craftable-ing {
  cursor: pointer;
  border-color: var(--neon);
  background: rgba(77, 208, 255, 0.12);
  transition: all 0.15s;
}
.io-item.craftable-ing:hover {
  background: rgba(77, 208, 255, 0.22);
  transform: translateX(2px);
  box-shadow: 0 0 8px rgba(77, 208, 255, 0.25);
}

.factory-job {
  background: rgba(77, 208, 255, .08); border: 1px solid rgba(77, 208, 255, .3);
  border-radius: 12px; padding: 12px; text-align: center;
}
.factory-job-timer { font-size: 20px; font-weight: 700; color: var(--neon); font-variant-numeric: tabular-nums; }

/* ═══════════ Этап 5: инвентарь и рынок ═══════════ */
.inv-cat { margin-bottom: 14px; }
.inv-cat-title {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px;
}
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.inv-item {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 4px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.inv-qty { font-size: 13px; font-weight: 700; color: var(--neon); font-variant-numeric: tabular-nums; }
.inv-name { font-size: 9px; color: var(--muted); line-height: 1.2; }

.box-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.box-icon { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(255, 209, 102, .4)); }
.box-emoji { font-size: 34px; flex-shrink: 0; }
.box-info { flex: 1; min-width: 0; }
.box-open-btn { white-space: nowrap; }

.market-res-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; color: var(--text); cursor: pointer;
}
.market-res-row:active { transform: scale(.98); border-color: var(--neon); }
.market-res-info { flex: 1; min-width: 0; }
.market-res-price { font-size: 13px; font-weight: 700; color: var(--neon); white-space: nowrap; font-variant-numeric: tabular-nums; }

.lot-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; margin-bottom: 8px;
}
.lot-main { flex: 1; min-width: 0; }
.lot-buy { display: flex; gap: 6px; align-items: center; }
.lot-input { width: 74px !important; margin: 0 !important; padding: 8px !important; text-align: center; }
.lot-buy-btn { white-space: nowrap; padding: 8px 10px; font-size: 12px; }

select.input option { background: #131a3a; color: var(--text); }

/* ═══ Фиксы 30.08 ═══ */
/* Эмодзи-фолбэк в нижнем меню (перебивался правилом #bottomnav button span) */
#bottomnav button span.nav-emoji { font-size: 22px; line-height: 1; margin-bottom: 0; }

/* Кнопки Инвентарь/Рынок — ниже по hero */
.hero-actions { bottom: 6px; }

/* «Снять» в лотах рынка — больше не на всю ширину */
#modal-box .lot-row .btn-ghost,
#modal-box .box-row .btn-ghost { width: auto; margin-top: 0; flex-shrink: 0; padding: 8px 14px; }

/* Строки лотов не дают кнопкам расползаться */
.lot-row .btn { white-space: nowrap; }

/* ═══ Технические работы ═══ */
.maintenance-screen{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:#0b1026;padding:20px}
.maint-card{text-align:center;max-width:360px}
.maint-icon{font-size:56px;margin-bottom:12px}
.maint-window{margin:14px 0;padding:12px 14px;border:1px solid rgba(76,154,255,.4);border-radius:12px;background:rgba(76,154,255,.08);font-weight:600}
#maint-banner{margin:8px 12px;padding:8px 12px;border-radius:10px;background:rgba(255,196,0,.12);border:1px solid rgba(255,196,0,.35);font-size:13px;text-align:center}

/* ═══ Два баланса в шапке ═══ */
.header-balances {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.bal{display:flex;align-items:center;gap:4px;font-weight:700;padding:4px 10px;border-radius:10px}
.bal-cr{background:rgba(255,196,0,.10);border:1px solid rgba(255,196,0,.3)}
.bal-wr{background:rgba(76,154,255,.10);border:1px solid rgba(76,154,255,.35);cursor:pointer}
.profile-lang-btn{width:100%;margin-top:12px}

.shop-stock { font-size: 12px; color: #8a93a6; margin: 6px 0; }
.shop-stock.low { color: #ffb347; font-weight: 600; }          /* ≤10% осталось */
.shop-stock.out { color: #ff5c5c; font-weight: 700; }
.shop-card.sold-out { opacity: .55; }
.shop-card.sold-out .shop-ship-icon img { filter: grayscale(1); }

/* строка-заголовок завода кликабельна */
.factory-head-toggle { cursor: pointer; user-select: none; }
.factory-head-toggle:active { opacity: .8; }

/* стрелка свернуть/развернуть */
.factory-chevron {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  opacity: .7;
  pointer-events: none;
}

/* скрытое тело карточки */
.factory-body-hidden { display: none; }

/* панель "свернуть/развернуть все" */
.fac-collapse-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.fac-collapse-bar .btn { padding: 4px 12px; font-size: 12px; }

/* ===== Фильтр и сортировка рынка работы ===== */
.jobs-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.jobs-filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.jobs-filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, box-shadow .15s;
}
.filter-chip:active { transform: scale(.95); }
.filter-chip.active {
  background: linear-gradient(135deg, rgba(77, 208, 255, .18), rgba(179, 136, 255, .18));
  border-color: var(--neon);
  color: var(--text);
  box-shadow: 0 0 10px rgba(77, 208, 255, .25);
}
.filter-chip-icon { width: 22px; height: 22px; object-fit: contain; }
.filter-chip-emoji { font-size: 18px; }
.filter-chip-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  color: var(--neon);
  font-variant-numeric: tabular-nums;
}

.jobs-sort-select {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
}

/* ═══ Splash Screen (Admin only) ═══ */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#splash-screen.hidden { display: none !important; }

#splash-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Фон с картинкой — изначально скрыт полностью */
#splash-bg {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none; /* скрыт до времени */
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

/* Когда готовы показать — убираем hidden, добавляем visible */
#splash-bg.visible {
  display: flex;
  opacity: 1;
}

#splash-bg.hidden {
  display: none !important;
}

.splash-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.splash-overlay {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Прижимаем книзу */
  align-items: center;
  padding-bottom: 5vh; /* Отступ от низа экрана */
  pointer-events: none; /* Через JS включим когда фон появится */
}

#splash-bg.visible .splash-overlay {
  pointer-events: auto;
}

#splash-bg.visible .splash-buttons {
  animation: fadeInUp 0.6s ease 0.3s both;
}

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

/* Контейнер кнопок */
.splash-buttons {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

/* Обертка кнопки для позиционирования свечения */
.splash-btn-wrapper {
  position: relative;
  width: 260px;
  height: 80px;
}

/* Анимированное неоновое свечение вокруг кнопки */
.splash-btn-glow {
  position: absolute;
  inset: 1px;
  border-radius: 45px;
  z-index: 1;
  overflow: hidden;
  opacity: 0.8;
}

.splash-btn-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--glow-color) 60deg,
    transparent 120deg,
    transparent 180deg,
    var(--glow-color) 240deg,
    transparent 300deg,
    transparent 360deg
  );
  animation: glow-rotate 2.5s linear infinite;
}

/* Цвета свечения */
.splash-btn-glow.blue {
  --glow-color: #00d4ff;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.6), inset 0 0 20px rgba(0, 212, 255, 0.2);
}

.splash-btn-glow.green {
  --glow-color: #00ff88;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), inset 0 0 20px rgba(0, 255, 136, 0.2);
}

@keyframes glow-rotate {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Сама кнопка — использует вашу картинку */
.splash-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/ui/button-main.png') center center no-repeat;
  background-size: 100% 100%;
  border: none;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.5);
  font-family: inherit;
  transition: transform 0.15s ease, filter 0.2s;
}

.splash-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.02);
}

.splash-btn:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* ═══ Вкладки флота ═══ */
.fleet-tabs {
  gap: 6px !important;
  margin-bottom: 12px;
}

.fleet-tabs .wallet-tab {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: visible;
}

/* Бейдж с количеством кораблей */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  background: var(--accent, #7dff9b);
  color: #000;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.2px;
  box-shadow: 0 0 8px rgba(125, 255, 155, 0.35);
  vertical-align: middle;
  transition: transform 0.15s;
}

/* На активной вкладке бейдж инвертируется */
.fleet-tabs .wallet-tab.active .tab-badge {
  background: #000;
  color: var(--accent, #7dff9b);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

/* ═══ Адаптив для узких экранов ═══ */
@media (max-width: 380px) {
  .fleet-tabs .wallet-tab {
    font-size: 11px;
    padding: 6px 8px;
  }
  .tab-badge {
    min-width: 20px;
    height: 18px;
    font-size: 11px;
    margin-left: 4px;
    padding: 0 5px;
  }
}

.guild-btn {
  position: absolute;
  top: 76px;      /* под кнопкой лотереи; подбери значение по факту */
  left: 10px;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 6;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
  transition: transform .15s ease;
}

.guild-btn:active { transform: scale(.92); }

.guild-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.guild-help-btn {
  position: absolute; right: 12px; top: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  color: var(--neon); font-weight: 900; font-size: 15px;
  cursor: pointer; z-index: 3;
}
.guild-help-btn:active { transform: scale(.92); }

/* Значок буста гильдии */
.chip-boost {
  color: #ffd166;
  border-color: rgba(255, 209, 102, .45);
  background: rgba(255, 209, 102, .10);
}
.boost-icon {
  color: #ffd166;
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, .6));
}

/* Каталог гильдий: строка эффектов и активных бустов */
.guild-fx-line {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--neon);
  font-variant-numeric: tabular-nums;
}
.guild-boost-line {
  margin-top: 4px;
  font-size: 11px;
  color: #ffd166;
}

/* PNG-логотипы гильдий */
.guild-logo-img {
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 8px rgba(77, 208, 255, .35));
}
.guild-logo-pick {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══ CDT: виджет курса и кнопка покупки в кошельке ═══ */
.cdt-market-widget {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cdt-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  font-weight: 700;
  text-decoration: none;
}

.cdt-chart-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}