/* ==========================================================================
   ECTS MINI APP — AUTHENTIC APPLE iOS LIQUID GLASS (NO EMOJIS)
   ========================================================================== */

@font-face {
  font-family: 'Tiny5';
  src: url('tiny5.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --top-safe-offset: 50px;
  
  /* Apple HIG Liquid Glass System (5 Optical Rules) */
  --bg-deep: #050811;
  --bg-liquid-glass: rgba(18, 24, 38, 0.72);
  --glass-backdrop: blur(24px) saturate(190%) contrast(90%);
  --glass-specular: inset 0 1px 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px -4px rgba(0, 0, 0, 0.35);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  
  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Accents */
  --accent-blue: #38bdf8;
  --accent-blue-glow: rgba(56, 189, 248, 0.4);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.4);
  --accent-purple: #c084fc;
  
  /* Rarity Colors */
  --rarity-common: #94a3b8;
  --rarity-rare: #38bdf8;
  --rarity-epic: #c084fc;
  --rarity-legendary: #fbbf24;
  
  /* Timing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap: cubic-bezier(0.25, 1, 0.5, 1);
  
  /* Layout Dimensions */
  --header-h: 48px;
  --nav-h: 58px;
  --font-pixel: 'Tiny5', monospace, sans-serif;
  --font-sans: 'Tiny5', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace, sans-serif;
}

/* BASE RESETS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  display: flex;
  justify-content: center;
  align-items: stretch;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(30, 58, 138, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(15, 23, 42, 0.6) 0%, transparent 50%);
}

button, input, select, textarea {
  font-family: var(--font-pixel);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  padding-top: 0; /* Шапка сама учитывает safe-top */
}

/* SVG ICONS BASE */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}

.svg-coin {
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.35));
}

.svg-star {
  filter: drop-shadow(0 2px 5px rgba(251, 191, 36, 0.45));
}

.svg-lightning {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  flex-shrink: 0;
  height: calc(var(--header-h) + var(--safe-top, 0px) + 10px);
  padding-top: calc(var(--safe-top, 0px) + 10px);
  padding-bottom: 4px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: var(--glass-border);
  box-shadow: var(--glass-specular);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: backdrop-filter, transform;
  z-index: 30;
  position: relative;
}

/* На главном меню (тапалка): монеты НЕ отображать, по центру строго поле с ником */
.app-header.tab-tap .user-chip {
  display: flex;
  margin: 0 auto;
}
.app-header.tab-tap .balance-badge {
  display: none !important;
}

/* В инвентаре и магазине: вместо ника по центру показываем монеты */
.app-header.tab-inventory .user-chip,
.app-header.tab-shop .user-chip {
  display: none !important;
}
.app-header.tab-inventory .balance-badge,
.app-header.tab-shop .balance-badge {
  display: flex;
  margin: 0 auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.user-avatar-icon {
  display: flex;
  align-items: center;
  color: var(--accent-blue);
}

.user-name {
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.balance-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(30, 27, 22, 0.9), rgba(45, 34, 18, 0.8));
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.badge-icon {
  display: flex;
  align-items: center;
}

.balance-val {
  font-family: var(--font-pixel);
  font-size: 18px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.4px;
  font-feature-settings: "tnum";
}

/* ==========================================================================
   MAIN VIEWPORT & TABS
   ========================================================================== */
.app-main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.tab-content {
  display: none;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TAB 1: ТАПАЛКА (CLICKER)
   ========================================================================== */
.tap-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 6px 16px 6px;
  overflow: hidden;
}

/* Верхняя зона: карточка баланса центрируется строго между верхом и кнопкой кликера */
.tap-top-zone {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

/* Статистическая карточка */
.stats-card {
  width: 100%;
  flex-shrink: 0;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--glass-border);
  box-shadow: var(--glass-specular);
  border-radius: 18px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: backdrop-filter, transform;
  position: relative;
}

.stat-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.stat-large {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
  font-feature-settings: "tnum";
}

.coin-stat-icon {
  display: flex;
  align-items: center;
}

.btn-daily {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-daily:active {
  transform: scale(0.96);
  background: rgba(56, 189, 248, 0.15);
}

.btn-daily:disabled {
  opacity: 0.45;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  cursor: not-allowed;
}

/* Кнопка тапалки */
.clicker-wrapper {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: auto 0;
}

.clicker-glow-bg {
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.32) 0%, rgba(56, 189, 248, 0.22) 50%, transparent 70%);
  filter: blur(34px);
  pointer-events: none;
  animation: pulseGlow 3s ease-in-out infinite alternate;
  transition: background 0.5s ease;
}

.clicker-glow-bg.lvl-1 {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(250, 204, 21, 0.15) 50%, transparent 70%);
}

.clicker-glow-bg.lvl-2 {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.55) 0%, rgba(234, 88, 12, 0.25) 50%, transparent 70%);
}

.clicker-glow-bg.lvl-3 {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.6) 0%, rgba(59, 130, 246, 0.3) 50%, transparent 70%);
}

.clicker-glow-bg.lvl-4 {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.65) 0%, rgba(236, 72, 153, 0.35) 50%, transparent 70%);
}

.clicker-glow-bg.lvl-5 {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.75) 0%, rgba(245, 158, 11, 0.4) 50%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

.coin-button-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.coin-button {
  position: relative;
  width: min(265px, 35vh);
  height: min(265px, 35vh);
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s var(--ease-spring);
  touch-action: manipulation;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.7));
}

.coin-button:active {
  transform: scale(0.93) translate3d(0, 0, 0);
}

/* Нижняя зона: блок энергии и шкала уровня бобра центрируются строго между кнопкой и низом */
.tap-bottom-zone {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 0;
}

/* Шкала уровня бобра */
.level-container {
  width: 100%;
  flex-shrink: 0;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 8px 14px;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.level-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 7px;
}

.level-row-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.level-row-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.level-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.2px;
}

.level-icon-slot {
  display: flex;
  align-items: center;
}

.level-text {
  font-size: 11px;
  font-weight: 600;
  color: rgba(253, 230, 138, 0.9);
  font-feature-settings: "tnum";
}

.level-bar {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.level-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.level-fill.lvl-4 {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.7);
}

.level-fill.lvl-5 {
  background: linear-gradient(90deg, #f59e0b, #ef4444, #7c3aed);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.85);
}

.coin-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Частицы вылетающих золотых монеток */
.tap-particle {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.75));
  animation: floatUpCoin 0.75s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes floatUpCoin {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.8) rotate(0deg);
  }
  35% {
    transform: translateY(-30px) scale(1.22) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-90px) scale(1.35) rotate(-25deg);
  }
}

/* Энергия */
.energy-container {
  width: 100%;
  flex-shrink: 0;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--glass-border);
  box-shadow: var(--glass-specular);
  border-radius: 14px;
  padding: 8px 14px;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: backdrop-filter, transform;
  position: relative;
}

.energy-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.energy-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-tertiary);
}

.energy-icon-slot {
  display: flex;
  align-items: center;
  color: #38bdf8;
}

.energy-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

.energy-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
  transition: width 0.25s ease-out;
}

/* ==========================================================================
   TAB 2: ИНВЕНТАРЬ
   ========================================================================== */
.inventory-header {
  position: relative;
  z-index: 10;
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  background: linear-gradient(180deg, rgba(5, 8, 17, 0.98) 0%, rgba(5, 8, 17, 0.88) 60%, rgba(5, 8, 17, 0) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: -6px;
}

.inventory-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  margin: 0;
}

.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Постоянная всплывающая подсказка внизу экрана над таб-баром (закрывается крестиком насовсем) */
.inventory-bottom-hint {
  position: fixed;
  bottom: calc(var(--nav-h) + max(14px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px)));
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(18, 24, 38, 0.94);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.15);
  padding: 8px 14px 8px 12px;
  border-radius: 24px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 150;
  white-space: nowrap;
  transition: opacity 0.25s var(--ease-spring), transform 0.25s var(--ease-spring);
}

.inventory-bottom-hint.show {
  display: flex;
  animation: hintSlideUp 0.3s var(--ease-spring) forwards;
}

.inventory-bottom-hint.dismissed {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  pointer-events: none;
}

@keyframes hintSlideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hint-icon {
  display: flex;
  align-items: center;
  color: var(--accent-blue);
}

.hint-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.hint-close-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.hint-close-btn:active {
  color: #fff;
}

/* Кнопка сортировки в инвентаре (на одном уровне справа от заголовка "Мои темы") */
.inv-sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
}
.inv-sort-btn:active {
  background: rgba(51, 65, 85, 0.95);
  transform: scale(0.96);
}

.inv-sort-icon {
  display: flex;
  align-items: center;
  color: var(--accent-blue);
}

.inventory-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px 12px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  min-height: 0;
  mask-image: linear-gradient(to bottom, transparent 0%, black 18px, black calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18px, black calc(100% - 14px), transparent 100%);
}

.inv-card {
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  position: relative;
  touch-action: pan-y;
}

.inv-card:active {
  transform: scale(0.97);
}

/* Свечение и тонированный фон карточек по редкостям (без наплыва на соседние карточки) */
.inv-card[data-cat="common"] {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 10px rgba(148, 163, 184, 0.15);
}
.inv-card[data-cat="common"] .inv-name {
  color: #cbd5e1;
}

.inv-card[data-cat="rare"] {
  background: linear-gradient(160deg, rgba(14, 45, 75, 0.8) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.22);
}
.inv-card[data-cat="rare"] .inv-name {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.inv-card[data-cat="epic"] {
  background: linear-gradient(160deg, rgba(45, 20, 65, 0.8) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(192, 132, 252, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px rgba(192, 132, 252, 0.25);
}
.inv-card[data-cat="epic"] .inv-name {
  color: #c084fc;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.45);
}

.inv-card[data-cat="legendary"] {
  background: linear-gradient(160deg, rgba(55, 40, 10, 0.85) 0%, rgba(20, 15, 5, 0.95) 100%);
  border: 1px solid rgba(251, 191, 36, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 14px rgba(251, 191, 36, 0.28);
}
.inv-card[data-cat="legendary"] .inv-name {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.inv-card.active {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.inv-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
  margin-bottom: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-img-wrap img, .inv-img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.inv-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  align-self: flex-start;
}

.inv-badge.equipped {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.inv-badge.perm {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.inv-badge.expiring {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   TAB 3: МАГАЗИН (КИНЕМАТИЧЕСКАЯ КАРУСЕЛЬ ОТ КРАЯ ДО КРАЯ)
   ========================================================================== */
.shop-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  padding: 6px 14px 10px;
  overflow-x: hidden !important;
  overflow-y: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}

/* Сцена карусели */
.carousel-stage {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: visible;
  touch-action: pan-y;
  overscroll-behavior: none;
  padding: 4px 0;
}

/* Окружающий диффузный неоновый ореол на заднем плане карточки с вращением */
.carousel-ambient-glow {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 115%;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
  animation: ambientSwirl 12s linear infinite;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0.6) 48%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0.6) 48%, transparent 72%);
}

@keyframes ambientSwirl {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.04);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) scale(1);
  }
}

.carousel-ambient-glow.common {
  background: conic-gradient(from 0deg, #64748b, #94a3b8, #cbd5e1, #475569, #94a3b8, #64748b);
  animation-duration: 14s;
}
.carousel-ambient-glow.rare {
  background: conic-gradient(from 0deg, #0284c7, #38bdf8, #06b6d4, #60a5fa, #38bdf8, #0284c7);
  animation-duration: 11s;
}
.carousel-ambient-glow.epic {
  background: conic-gradient(from 0deg, #7c3aed, #a855f7, #c084fc, #e879f9, #a855f7, #7c3aed);
  animation-duration: 9s;
}
.carousel-ambient-glow.legendary {
  background: conic-gradient(from 0deg, #ea580c, #f59e0b, #fbbf24, #fef08a, #f59e0b, #ea580c);
  animation-duration: 8s;
}



/* Видовой экран для свайпа */
.stage-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 4px;
}

/* Главная витринная карточка (Liquid Glass) */
.showcase-card {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--glass-specular);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: backdrop-filter, transform;
  touch-action: pan-y;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Цветовые акценты рамки и глубокое свечение карточки в зависимости от категории */
.showcase-card.common-accent { 
  border-color: rgba(148, 163, 184, 0.55); 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 46px rgba(148, 163, 184, 0.38), inset 0 0 16px rgba(148, 163, 184, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}
.showcase-card.rare-accent { 
  border-color: rgba(56, 189, 248, 0.8); 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 56px rgba(56, 189, 248, 0.52), 0 0 20px rgba(14, 165, 233, 0.4), inset 0 0 18px rgba(56, 189, 248, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}
.showcase-card.epic-accent { 
  border-color: rgba(192, 132, 252, 0.85); 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 62px rgba(192, 132, 252, 0.58), 0 0 24px rgba(168, 85, 247, 0.45), inset 0 0 20px rgba(192, 132, 252, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}
.showcase-card.legendary-accent { 
  border-color: rgba(251, 191, 36, 0.9); 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 68px rgba(251, 191, 36, 0.65), 0 0 28px rgba(245, 158, 11, 0.5), inset 0 0 22px rgba(251, 191, 36, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* 3D Анимации плавного кинематического перелистывания карточек */
.slide-in-right {
  animation: cardSlideInRight 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-in-left {
  animation: cardSlideInLeft 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardSlideInRight {
  0% {
    opacity: 0.15;
    transform: perspective(1000px) translateX(70px) rotateY(-10deg) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translateX(0) rotateY(0deg) scale(1);
  }
}

@keyframes cardSlideInLeft {
  0% {
    opacity: 0.15;
    transform: perspective(1000px) translateX(-70px) rotateY(10deg) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) translateX(0) rotateY(0deg) scale(1);
  }
}

/* Медиа-контейнер темы (без черных полей 100%) */
.card-media-wrapper {
  position: relative;
  width: min(100%, calc(38vh * 800 / 670));
  aspect-ratio: 800 / 670;
  max-height: 38vh;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background-color: #06090e;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: aspect-ratio 0.25s ease, width 0.25s ease;
}

.card-media-wrapper.common,
.card-media-wrapper.rare {
  width: min(100%, calc(38vh * 800 / 670));
  aspect-ratio: 800 / 670;
}

.card-media-wrapper.epic {
  width: min(100%, calc(38vh * 800 / 686));
  aspect-ratio: 800 / 686;
}

.card-media-wrapper.legendary {
  width: min(100%, calc(38vh * 800 / 616));
  aspect-ratio: 800 / 616;
}

.card-image, .card-video, video.cached-media, img.cached-media {
  width: 100%;
  height: 100%;
  max-height: 38vh;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.media-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Бейдж редкости */
.rarity-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2;
}

.rarity-badge.common { background: rgba(15, 23, 42, 0.7); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.rarity-badge.rare { background: rgba(12, 34, 56, 0.75); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.45); }
.rarity-badge.epic { background: rgba(35, 18, 56, 0.75); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.45); }
.rarity-badge.legendary { background: rgba(48, 32, 10, 0.8); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.5); }

/* Метаданные темы */
.card-meta {
  text-align: center;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.card-title.common {
  color: #e2e8f0;
  text-shadow: 0 0 10px rgba(226, 232, 240, 0.4);
}

.card-title.rare {
  color: #38bdf8;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
}

.card-title.epic {
  color: #c084fc;
  text-shadow: 0 0 16px rgba(192, 132, 252, 0.75);
}

.card-title.legendary {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.85), 0 0 32px rgba(245, 158, 11, 0.45);
}

.card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 3px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

/* Сегментированный переключатель периода (30 дней / Навсегда) */
.period-selector-wrapper {
  display: flex;
  justify-content: center;
}

.segmented-control {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  width: 100%;
}

.seg-btn {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.seg-btn.active {
  color: #fff;
}

.seg-pill-backdrop {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--bg-elevated);
  border-radius: 9px;
  border: 1px solid var(--border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s var(--ease-spring);
  pointer-events: none;
  z-index: 1;
}

.segmented-control.perm-active .seg-pill-backdrop {
  transform: translateX(100%);
}

/* Кнопки покупки и применения */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-action {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), opacity 0.15s ease;
}

.btn-action:active {
  transform: scale(0.97);
}

.btn-action-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-action-stars {
  background: linear-gradient(135deg, #b45309, #78350f);
  color: #fef3c7;
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-action-owned {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  justify-content: center;
  gap: 8px;
}

.btn-action-equip {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
  justify-content: center;
  gap: 8px;
}

.price-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-feature-settings: "tnum";
}

/* Единая горизонтальная панель навигации магазина (стрелки и точки на одном уровне) */
.shop-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
  margin-top: 3px;
  margin-bottom: 6px;
  z-index: 10;
  position: relative;
  gap: 8px;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  overscroll-behavior: none !important;
}

.shop-nav-row .stage-nav-pill {
  width: 52px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--glass-border);
  box-shadow: var(--glass-specular);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
  touch-action: manipulation;
}

.shop-nav-row .stage-nav-pill:active {
  transform: scale(0.92);
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.shop-nav-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  overflow: hidden;
}

.dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.25s var(--ease-spring);
  cursor: pointer;
}

.dot.active {
  width: 16px;
  border-radius: 6px;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

.dot.dot-edge {
  transform: scale(0.7);
  opacity: 0.5;
}

.shop-swipe-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.2px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.shop-swipe-hint.dismissed {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.swipe-hint-icon {
  display: flex;
  align-items: center;
  color: var(--accent-blue);
  animation: swipePulse 2s ease-in-out infinite;
}

@keyframes swipePulse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Док категорий внизу магазина (Liquid Glass) */
.shop-categories-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(15, 21, 34, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  overscroll-behavior: none !important;
}

.cat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.25s var(--ease-spring);
}

.cat-tab.active {
  opacity: 1;
  animation: catGlowPulse 2.4s ease-in-out infinite alternate;
}

@keyframes catGlowPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.02); filter: brightness(1.2); }
}

.cat-tab.active[data-cat="common"] {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 24px rgba(148, 163, 184, 0.6), inset 0 0 10px rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  text-shadow: 0 0 10px rgba(148, 163, 184, 0.7);
}

.cat-tab.active[data-cat="rare"] {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.7), inset 0 0 12px rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.85);
}

.cat-tab.active[data-cat="epic"] {
  background: rgba(192, 132, 252, 0.28);
  border-color: rgba(192, 132, 252, 0.9);
  box-shadow: 0 0 34px rgba(192, 132, 252, 0.75), inset 0 0 14px rgba(192, 132, 252, 0.45);
  color: #c084fc;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.9);
}

.cat-tab.active[data-cat="legendary"] {
  background: rgba(251, 191, 36, 0.28);
  border-color: rgba(251, 191, 36, 0.95);
  box-shadow: 0 0 38px rgba(251, 191, 36, 0.8), inset 0 0 14px rgba(251, 191, 36, 0.45);
  color: #fbbf24;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.95);
}

.cat-name {
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR (GLASS DOCK)
   ========================================================================== */
.bottom-nav {
  flex-shrink: 0;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 58px;
  padding-top: 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
  background: var(--bg-liquid-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-top: var(--glass-border);
  box-shadow: var(--glass-specular);
  display: flex;
  justify-content: space-around;
  align-items: center;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: backdrop-filter, transform;
  z-index: 40;
}

.nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding-top: 8px; /* Достаточный отступ сверху, чтобы полоска индикатора не прилипала к иконке */
  padding-bottom: 4px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
}

.nav-item.active {
  color: var(--accent-blue);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 32px;
  height: 3px;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue), 0 0 4px var(--accent-blue);
  border-radius: 0 0 3px 3px;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   TOAST NOTIFICATION (NATIVE GLASS PILL AT BOTTOM)
   ========================================================================== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(16, 20, 29, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-medium);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease-spring);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: pre-line;
  max-width: min(90vw, 360px);
  text-align: center;
  line-height: 1.35;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  align-self: center;
}

.toast-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.toast-text {
  white-space: pre-line;
  text-align: center;
  line-height: 1.35;
  display: inline-block;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   DELETE THEME SHEET (LIQUID GLASS BOTTOM SHEET)
   ========================================================================== */
.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.delete-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.delete-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.delete-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 460px;
  background: rgba(18, 24, 38, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding: 16px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.delete-modal.active .delete-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin-bottom: 16px;
}

.sheet-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.sheet-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.45;
  max-width: 320px;
}

.sheet-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-sheet-cancel {
  flex: 1;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-sheet-cancel:active {
  background: rgba(255, 255, 255, 0.14);
}

.btn-sheet-confirm {
  flex: 1;
  padding: 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transition: transform 0.12s ease;
}

.btn-sheet-confirm:active {
  transform: scale(0.97);
}

/* Дополнительные стили для карточек инвентаря с подсказкой зажатия */
.inv-card {
  position: relative;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.inv-card:active {
  transform: scale(0.96);
}


/* ==========================================================================
   APPLE HIG LIQUID GLASS: RULES 3 & 4 (PHYSICAL GRAIN & REFRACTION SHEEN)
   ========================================================================== */

/* Rule 3: Micro-Texture (Monochromatic Physical Glass Grain) */
.app-header::after,
.stats-card::after,
.energy-container::after,
.showcase-card::after,
.inv-card::after,
.bottom-nav::after,
.shop-categories-dock::after,
.delete-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* Rule 4: Dynamic Liquid Refraction / Tilt Sheen */
.stats-card::before,
.showcase-card::before,
.energy-container::before,
.inv-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle 140px at var(--sheen-x, 50%) var(--sheen-y, 30%), rgba(255, 255, 255, 0.14), transparent 70%);
  opacity: 0.6;
  z-index: 2;
  transition: opacity 0.2s ease;
}

/* Ensure interactive targets always accept pointer events above pseudo-elements */
button, .nav-item, .cat-tab, .btn-action, .btn-daily, .coin-button, .stage-arrow, .inv-card {
  position: relative;
  z-index: 10;
  pointer-events: auto;
  touch-action: manipulation;
}

/* ==========================================================================
   ЕКТС: БОБРОВАЯ ПЛОТИНА — IDLE GAME STYLES v2
   ========================================================================== */

.game-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #050811;
}

/* HUD */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px;
  background: rgba(8, 12, 26, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  min-height: 44px;
  gap: 6px;
}

.game-hud-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 13px;
  color: #f0f0f0;
}

.game-hud-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.game-hud-icon svg { display: block; }

.game-hud-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-hud-dam {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

#gameDamInfo {
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Canvas */
.game-canvas-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  touch-action: manipulation;
}

/* Подсказка буста — скрыта по умолчанию, видна только когда буст готов */
.game-boost-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(252, 211, 77, 0.5);
  border-radius: 20px;
  padding: 5px 16px;
  color: #FCD34D;
  font-size: 12px;
  font-family: var(--font-pixel);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: opacity 0.4s ease;
  white-space: nowrap;
  animation: boostHintPulse 2s ease-in-out infinite;
}

@keyframes boostHintPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Панель улучшений */
.game-upgrades-panel {
  flex-shrink: 0;
  max-height: 36%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(6, 10, 22, 0.97);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.game-upgrades-panel::-webkit-scrollbar { width: 2px; }
.game-upgrades-panel::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.25); border-radius: 2px; }

.game-upgrades-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.game-upgrades-title svg { opacity: 0.6; }

.game-workers-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Строка рабочего */
.game-worker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.game-worker-row + .game-worker-row {
  border-top: 1px solid rgba(255,255,255,0.03);
}

.game-worker-row.can-buy {
  border-left-color: rgba(56,189,248,0.45);
  background: rgba(56,189,248,0.03);
}

.game-worker-row.is-max { opacity: 0.45; }

.game-dam-upgrade {
  border-left-color: rgba(245,158,11,0.5) !important;
  background: rgba(245,158,11,0.04) !important;
}

.game-dam-upgrade.can-buy {
  border-left-color: rgba(74,222,128,0.65) !important;
  background: rgba(74,222,128,0.06) !important;
}

.game-worker-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* SVG иконка рабочего */
.game-worker-svgicon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.game-worker-svgicon svg { display: block; }

.game-worker-name {
  font-family: var(--font-pixel);
  font-size: 16.5px;
  font-weight: 700;
  color: #e0e8f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dam-upgrade-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: normal;
  line-height: 1.15;
}

.dam-upgrade-prefix {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.dam-upgrade-target {
  font-size: 15px;
  color: #38bdf8;
  font-weight: 700;
}

.game-worker-count {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
}

.game-worker-res {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.game-worker-res svg { display: inline-block; vertical-align: middle; opacity: 0.7; }

/* Кнопка покупки */
.game-buy-btn {
  font-family: var(--font-pixel);
  font-size: 13.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-buy-btn svg { display: block; flex-shrink: 0; }

.game-buy-btn.ready {
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.4);
  color: #38bdf8;
}

.game-buy-btn.ready:active {
  transform: scale(0.93);
  background: rgba(56,189,248,0.25);
}

.game-buy-btn.green-btn {
  background: rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.45);
  color: #4ade80;
  animation: greenPulse 1.8s ease-in-out infinite;
}

@keyframes greenPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(74,222,128,0.15); }
  50% { box-shadow: 0 0 16px rgba(74,222,128,0.4); }
}

.game-buy-btn.maxed {
  background: rgba(74,222,128,0.06);
  border-color: rgba(74,222,128,0.2);
  color: #4ade80;
}

.game-hud-daynight {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.game-hud-daynight svg {
  display: block;
  flex-shrink: 0;
}

/* Лимит склада в HUD */
.game-hud-max {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-pixel);
  margin-left: 1px;
}

/* Разделители секций в панели плотины */
.game-section-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-section-title svg { opacity: 0.8; }

/* Карточка статуса плотины */
.game-dam-card {
  margin: 6px 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-dam-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.game-dam-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-family: var(--font-pixel);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-dam-pill.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.game-dam-next-hint {
  font-size: 10px;
  color: #94a3b8;
  font-family: var(--font-pixel);
  line-height: 1.35;
}

/* Карточка Биржи стройматериалов */
.game-market-card {
  margin: 6px 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-market-desc {
  font-family: var(--font-pixel);
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.game-market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.market-trade-btn {
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
  text-align: center;
}

.market-trade-btn.can-trade {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde047;
  cursor: pointer;
}

.market-trade-btn.can-trade:active {
  transform: scale(0.96);
  background: rgba(245, 158, 11, 0.28);
}

.market-trade-btn.combo {
  grid-column: span 2;
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}

.market-trade-btn.combo.can-trade {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(234, 179, 8, 0.2) 100%);
  border-color: rgba(234, 179, 8, 0.5);
  color: #fef08a;
}

.market-trade-btn.sell-all {
  grid-column: span 2;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.market-trade-btn.sell-all.can-trade {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.market-trade-cost {
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 700;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #f1f5f9;
}

.market-trade-gain {
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Док-панель из 3 кнопок внизу экрана игры */
.game-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 10px;
  background: rgba(8, 12, 26, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 10;
}

.game-dock-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.game-dock-btn:active {
  transform: scale(0.95);
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.game-dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.game-dock-icon svg { display: block; }

.game-dock-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.game-dock-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

.game-dock-sub {
  font-family: var(--font-pixel);
  font-size: 9.5px;
  color: #38bdf8;
  white-space: nowrap;
}

/* Модальное всплывающее окно (Liquid Glass Sheet) */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.game-modal.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.game-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  height: 490px;
  max-height: 82vh;
  background: rgba(13, 19, 33, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.game-modal.active .game-sheet {
  transform: translateY(0);
}

.game-sheet .sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 12px;
  cursor: pointer;
}

/* Вкладки в заголовке модального окна */
.game-sheet-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.game-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-pixel);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.game-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.game-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.game-tab-icon svg { display: block; }

.game-sheet-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.game-sheet-content::-webkit-scrollbar {
  width: 2px;
}

.game-sheet-content::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 2px;
}

.game-dock-bar.single {
  padding: 8px 12px 10px;
}

.single-dock-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  touch-action: manipulation;
}

.single-dock-btn:active {
  transform: scale(0.98);
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(30, 41, 59, 0.98);
}

.single-dock-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.single-dock-btn .game-dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.single-dock-btn .game-dock-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.single-dock-btn .game-dock-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.single-dock-btn .game-dock-sub {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.2;
}

/* Вертикальный столбик характеристик плотины */
.game-dam-stat-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 8px;
}

.dam-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.dam-stat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dam-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #38bdf8;
  flex-shrink: 0;
}

.dam-stat-title {
  font-family: var(--font-pixel);
  font-size: 13.5px;
  color: #cbd5e1;
  font-weight: 600;
}

.dam-stat-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  font-weight: 800;
  color: #f1f5f9;
}

.dam-stat-value.highlight {
  color: #fde047;
}

/* Зеленая индикация доступности покупки */
.game-worker-row.can-buy .game-worker-svgicon {
  background: rgba(34, 197, 94, 0.15) !important;
  border: 1px solid rgba(34, 197, 94, 0.5) !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25) !important;
}

.game-buy-btn.green-btn {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  color: #ffffff !important;
  border: 1px solid #4ade80 !important;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.45) !important;
  font-weight: 800;
}

.game-buy-btn.green-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.65) !important;
}

/* ==========================================================================
   INTERACTIVE ONBOARDING TOUR (ОБУЧЕНИЕ ДЛЯ НОВИЧКА)
   ========================================================================== */
.header-help-btn {
  position: absolute;
  right: 14px;
  top: calc(var(--safe-top, 0px) + 12px);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-blue);
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 800;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 35;
}

.header-help-btn:active {
  transform: scale(0.92);
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-overlay.show {
  opacity: 1;
}

.tour-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

.tour-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.84),
              0 0 0 3px rgba(56, 189, 248, 0.95),
              0 0 26px rgba(56, 189, 248, 0.6);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  animation: tourGlowPulse 2.2s infinite ease-in-out;
}

@keyframes tourGlowPulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.84),
                0 0 0 3px rgba(56, 189, 248, 0.9),
                0 0 22px rgba(56, 189, 248, 0.45);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.84),
                0 0 0 4px rgba(56, 189, 248, 1),
                0 0 34px rgba(56, 189, 248, 0.85);
  }
}

.tour-card {
  position: absolute;
  left: 14px;
  right: 14px;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.93);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25),
              0 18px 45px -8px rgba(0, 0, 0, 0.75),
              0 0 25px rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 16px 18px 14px;
  color: var(--text-primary);
  z-index: 10000;
  transition: top 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              bottom 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease;
}

.tour-card-header {
  margin-bottom: 10px;
}

.tour-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tour-step-badge {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 8px;
  border-radius: 8px;
}

.tour-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
}
.tour-close-btn:active {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.tour-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  transition: width 0.32s ease;
  border-radius: 4px;
}

.tour-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-pixel);
  color: #fde047;
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.tour-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 6px #fde047;
}

.tour-card-title {
  font-family: var(--font-pixel);
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.25;
}

.tour-card-text {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.tour-tip-box {
  background: rgba(30, 41, 59, 0.65);
  border-left: 3px solid #38bdf8;
  border-radius: 0 8px 8px 0;
  padding: 6px 10px;
  margin-bottom: 12px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #94a3b8;
}

.tour-tip-label {
  font-family: var(--font-pixel);
  font-weight: 700;
  color: #38bdf8;
  margin-right: 4px;
}

.tour-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-nav-btn {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-btn-prev {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}
.tour-btn-prev:active {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(0.96);
}

.tour-btn-prev:disabled {
  opacity: 0.28;
  pointer-events: none;
}

.tour-btn-next {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
  color: #ffffff;
}
.tour-btn-next:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.6);
}

.tour-skip-link {
  background: none;
  border: none;
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.tour-skip-link:hover, .tour-skip-link:active {
  color: #94a3b8;
}



