/* ==========================================================================
   styles.css - Дизайн-система «Теплый крафт» (v2.2)
   Спецификация: design.md для МБООПЖ «Зоошанс»
   ========================================================================== */

/* 1. БАЗОВЫЕ ТОКЕНЫ И СЕЗОННЫЕ ТЕМЫ (:root И [data-season]) */

:root {
  /* Базовая палитра «Теплый крафт» */
  --bg-app: #FAF6EE;
  --bg-card: #FFFDF9;
  --bg-muted: #F4EFE4;
  --bg-elevated: #EFE8DA;
  --border-subtle: #E5DEC9;
  --border-strong: #D4CBB4;

  /* Типографика */
  --text-primary: #2C302E;
  --text-secondary: #5C605D;
  --text-muted: #78756F;
  --text-inverse: #FAF7F2;

  /* Семантические цвета шкал */
  --color-budget: #15803D;      /* Зеленый BYN */
  --color-mental: #7E22CE;      /* Пурпурный Менталка % */
  --color-energy-free: #059669; /* Изумрудный Доступная энергия ⚡ */
  --color-energy-lock: #D97706; /* Янтарный полосатый Резерв на быт 🔒 */
  --color-health: #E11D48;      /* Розово-красный Жизнь питомца % */
  --color-danger: #DC2626;
  --color-warning: #D97706;
  --color-info: #0284C7;

  /* Сезонный акцент по умолчанию (Лето) */
  --season-accent: #D97706;
  --season-badge-bg: #FEF3C7;
  --season-badge-text: #92400E;

  /* Геометрия и тени */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 2px 6px rgba(44, 48, 46, 0.06);
  --shadow-elevated: 0 6px 16px rgba(44, 48, 46, 0.08);
  --shadow-modal: 0 20px 40px rgba(28, 30, 29, 0.25);

  /* Системный шрифт */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Базовые утилиты скрытия (offline & specificity guard) */
.hidden {
  display: none !important;
}

#actionsDashboard.hidden {
  display: none !important;
}

/* 2. ДИНАМИЧЕСКИЕ СЕЗОННЫЕ ТЕМЫ */

body[data-season="summer"] {
  --bg-app: #FAF6EE;
  --bg-card: #FFFDF9;
  --bg-muted: #F4EFE4;
  --border-subtle: #E5DEC9;
  --season-accent: #D97706;
  --season-badge-bg: #FEF3C7;
  --season-badge-text: #92400E;
}

body[data-season="autumn"] {
  --bg-app: #F9F5F0;
  --bg-card: #FFFAF4;
  --bg-muted: #F3ECE2;
  --border-subtle: #E8DCCF;
  --season-accent: #C2410C;
  --season-badge-bg: #FFEDD5;
  --season-badge-text: #9A3412;
}

body[data-season="winter"] {
  --bg-app: #F3F7FA;
  --bg-card: #FFFFFF;
  --bg-muted: #EAF0F6;
  --border-subtle: #DCE5EE;
  --season-accent: #0284C7;
  --season-badge-bg: #E0F2FE;
  --season-badge-text: #075985;
}

body[data-season="spring"] {
  --bg-app: #F4F8F4;
  --bg-card: #FBFCFA;
  --bg-muted: #EAF2EA;
  --border-subtle: #D8E6D8;
  --season-accent: #15803D;
  --season-badge-bg: #DCFCE7;
  --season-badge-text: #166534;
}

/* 3. БАЗОВАЯ РАЗМЕТКА И ТИПОГРАФИКА */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Стили карточек «Теплый крафт» */
.craft-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Постоянный закрепленный слот управления временем справа в шапке */
#headerTimeControlSlot {
  min-height: 28px;
  min-width: 130px;
  justify-content: flex-end;
}

.craft-card:hover {
  border-color: var(--border-strong);
}

/* Бейджи */
.craft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* 4. ШКАЛЫ И ДВУХСЕГМЕНТНЫЙ БАР ЭНЕРГИИ (GDD 4.1) */

.dual-progress-track {
  width: 100%;
  height: 10px;
  background: #E2D9C8;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
}

.bar-free {
  height: 100%;
  background-color: var(--color-energy-free);
  transition: width 0.3s ease;
}

.bar-lock {
  height: 100%;
  background-color: var(--color-energy-lock);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(255, 255, 255, 0.35) 4px,
    rgba(255, 255, 255, 0.35) 8px
  );
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  transition: width 0.3s ease;
}

/* Прогресс-бары для Менталки и Здоровья */
.stat-progress-track {
  width: 100%;
  height: 8px;
  background: #E2D9C8;
  border-radius: 999px;
  overflow: hidden;
}

.bar-mental {
  height: 100%;
  background: var(--color-mental);
  transition: width 0.3s ease;
}

.bar-health {
  height: 100%;
  background: var(--color-health);
  transition: width 0.3s ease;
}

/* 5. SVG-КОНСТРУКТОР ПИТОМЦА */

.pet-svg-box {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  border: 2px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pet-svg-box.ringworm-glow,
#headerPetAvatar.ringworm-glow,
.ringworm-glow {
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.7);
  border-color: #22C55E !important;
}

#headerPetAvatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cage-overlay-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 12px,
    rgba(100, 116, 139, 0.45) 12px,
    rgba(100, 116, 139, 0.45) 15px
  );
  border: 2px solid rgba(100, 116, 139, 0.5);
  border-radius: var(--radius-lg);
}

.cage-badge-label {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.85);
  color: #F8FAFC;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 6. АДАПТИВНАЯ СЕТКА: MOBILE SPA VS 3-COLUMN DESKTOP (design.md 3) */

.app-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px;
}

/* Десктопный режим (@media >= 1024px) */
@media (min-width: 1024px) {
  html, body {
    height: 100vh;
    overflow: hidden;
  }

  body {
    display: flex;
    flex-direction: column;
  }

  .app-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 340px;
    gap: 16px;
    padding: 12px 16px 14px 16px;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    align-items: stretch;
  }

  .mobile-bottom-nav,
  .mobile-drawer-triggers {
    display: none !important;
  }

  .drawer-left,
  .drawer-right {
    position: static !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    z-index: 1 !important;
    min-height: 0;
  }

  .drawer-left {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 4px;
  }

  .main-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    gap: 10px;
  }

  #actionsDashboard:not(.hidden) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #tabContent_vet,
  #tabContent_zooshans,
  #tabContent_care {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    padding-bottom: 4px;
  }

  .drawer-right {
    overflow: hidden !important;
  }

  #deadlinesRadarBox {
    flex-shrink: 0;
  }

  .drawer-right > div:last-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #chronicleLog {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .drawer-backdrop {
    display: none !important;
  }
}

/* Мобильный режим (< 1024px) */
@media (max-width: 1023px) {
  .drawer-left,
  .drawer-right {
    position: fixed;
    top: 56px;
    bottom: 60px;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-modal);
    z-index: 40;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s ease-in-out;
  }

  .drawer-left {
    left: 0;
    transform: translateX(-105%);
  }

  .drawer-left.open {
    transform: translateX(0);
  }

  .drawer-right {
    right: 0;
    transform: translateX(105%);
  }

  .drawer-right.open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 30, 29, 0.4);
    backdrop-filter: blur(2px);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 30;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  }

  body {
    padding-bottom: 68px;
  }
}

/* 7. МОДАЛЬНЫЕ ОКНА И ОВЕРЛЕИ */

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(28, 30, 29, 0.65);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-card-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Бабблы мессенджера для звонков ручек */
.chat-bubble-caller {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 14px 14px 14px 2px;
  padding: 12px 14px;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  max-width: 90%;
  align-self: flex-start;
}

.chat-bubble-player {
  background: var(--season-badge-bg);
  color: var(--season-badge-text);
  border-radius: 14px 14px 2px 14px;
  padding: 10px 14px;
  max-width: 85%;
  align-self: flex-end;
  font-weight: 500;
}

/* 8. АНИМАЦИИ И ЭФФЕКТЫ */

@keyframes pulseUrgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(225, 29, 72, 0); }
}

.urgent-btn {
  animation: pulseUrgent 1.8s infinite;
}

/* 9. STORIES КАРТОЧКА 9:16 */

.story-card-9-16 {
  aspect-ratio: 9 / 16;
  max-width: 320px;
  margin: 0 auto;
  background: linear-gradient(155deg, #FFFDF9 0%, #FAF4E8 50%, #F5ECDA 100%);
  border: 2px solid var(--season-accent);
  box-shadow: 0 16px 36px rgba(44, 48, 46, 0.15);
  border-radius: var(--radius-xl);
}

/* 10. АККУРАТНЫЙ СКРОЛЛБАР */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 11. СТАНДАРТИЗИРОВАННЫЙ 3-ЗОННЫЙ ШАБЛОН КАРТОЧЕК ДЕЙСТВИЙ (HEADER, BODY, FOOTER) */

.action-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 98px;
  height: 100%;
  border-radius: var(--radius-md);
  padding: 7px 9px;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
  width: 100%;
  overflow: hidden;
}

/* Состояние 1: Доступно (active) */
.action-card.action-active {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.action-card.action-active:hover {
  border-color: var(--season-accent);
  box-shadow: var(--shadow-elevated);
  transform: translateY(-1px);
}

/* Состояние 2: Заблокировано условием (locked) */
.action-card.action-locked {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  opacity: 0.8;
  cursor: not-allowed;
}

/* Состояние 3: Не требуется по показаниям (not-needed) */
.action-card.action-not-needed {
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--border-strong);
  opacity: 0.85;
  cursor: default;
}

/* Состояние 4: Не хватает ресурсов (insufficient) — светлый фон, без сюжетного серого */
.action-card.action-insufficient,
.action-card.action-card--insufficient {
  background: var(--bg-card);
  border: 1px solid #FECACA;
  box-shadow: var(--shadow-card);
  opacity: 0.95;
  cursor: not-allowed;
}
.action-card.action-insufficient:hover,
.action-card.action-card--insufficient:hover {
  border-color: #F87171;
}

/* Состояние 5: Выполнено (completed) — светло-зеленый контур */
.action-card.action-completed,
.action-card.action-card--completed {
  background: #F0FDF4;
  border: 1px solid #A7F3D0;
  box-shadow: var(--shadow-card);
  cursor: default;
}

/* Состояние 6: Таймер повтора / Кулдаун (cooldown) */
.action-card.action-cooldown,
.action-card.action-card--cooldown {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  box-shadow: var(--shadow-card);
  cursor: default;
}

.action-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
}

.action-card__title {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  word-break: break-word;
}

.action-card__body {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-secondary);
  word-break: break-word;
}

.action-card__footer {
  margin-top: auto;
  padding-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 22px;
  flex-shrink: 0;
  border-top: 1px solid rgba(229, 222, 201, 0.5);
  flex-wrap: nowrap !important;
}

.action-card__cost-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
}

.action-card__status-group {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 55%;
  text-align: right;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
}

/* Бейджи ресурсов и цен в футере карточек */
.badge-resource {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 4px;
  line-height: 1.2;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.badge-resource-byn {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.badge-resource-voucher {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.badge-resource-energy {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.badge-resource-muted {
  background: #E2E8F0;
  color: #64748B;
  border: 1px solid #CBD5E1;
}

.badge-resource-insufficient {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border: 1px solid #FCA5A5 !important;
}

.badge-status-locked {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 1.5px 5px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.2;
}

.badge-status-insufficient {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #B91C1C;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  padding: 1.5px 5px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.2;
}

.badge-status-completed {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #065F46;
  background: #D1FAE5;
  border: 1px solid #A7F3D0;
  padding: 1.5px 5px;
  border-radius: 4px;
  display: inline-block;
  line-height: 1.2;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.badge-status-cooldown {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 1.5px 5px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.2;
}

.badge-status-done {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #065F46;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 1.5px 5px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.2;
}

.badge-stage-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4.5px;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* 12. СЕКЦИЯ 7: МОДАЛЬНЫЕ ОКНА «ОТБОР РУЧЕК» И «АЛЬБОМ СПАСЕННЫХ ХВОСТОВ» */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 32, 34, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-window {
  background: #FAF8F5;
  border: 1px solid #E5E0D5;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Цветовая маркировка слотов собеседования ручек */
.flag--green {
  background: #E8F5EE !important;
  color: #158055 !important;
  border: 1px solid #A7F3D0 !important;
}

.flag--yellow {
  background: #FEF3C7 !important;
  color: #B45309 !important;
  border: 1px solid #FDE68A !important;
}

.flag--red {
  background: #FEE2E2 !important;
  color: #B91C1C !important;
  border: 1px solid #FCA5A5 !important;
}

/* Табы в модальном окне Альбома */
.album-tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.album-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.album-tab-btn:not(.active) {
  background: transparent;
  color: var(--text-secondary);
}
.album-tab-btn:not(.active):hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Карточки альбома (2 колонки) */
.album-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .album-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* ================= ИНТЕРАКТИВНЫЕ ПОДСКАЗКИ РЕСУРСОВ (HUD И СНАБЖЕНИЕ) ================= */
.resource-widget {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.resource-widget:hover {
  border-color: var(--season-accent, #10b981);
}

.resource-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 290px;
  max-width: min(320px, calc(100vw - 28px));
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.18), 0 6px 12px -2px rgba(0, 0, 0, 0.08);
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-primary);
  pointer-events: auto;
  text-align: left;
  animation: tooltipFadeIn 0.18s ease-out;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Выравнивание по правому краю для правых карточек */
.resource-tooltip.align-right {
  left: auto;
  right: 0;
}

@media (max-width: 1024px) {
  /* В 2-колоночной сетке HUD на мобильных правые виджеты ровняем вправо */
  .grid-cols-2 > .resource-widget:nth-child(even) .resource-tooltip {
    left: auto;
    right: 0;
  }
}

@media (min-width: 1024px) {
  /* В 4-колоночной сетке HUD на десктопе 3 и 4 колонки выравниваем по правому краю */
  .lg\:grid-cols-4 > .resource-widget:nth-child(3) .resource-tooltip,
  .lg\:grid-cols-4 > .resource-widget:nth-child(4) .resource-tooltip {
    left: auto;
    right: 0;
  }
}

/* Показ по hover на десктопах */
@media (hover: hover) and (pointer: fine) {
  .resource-widget:hover > .resource-tooltip {
    display: block;
  }
}

/* Принудительный показ по клику/тапу (для тач-устройств и десктопа) */
.resource-tooltip.show {
  display: block !important;
}

/* Стилизация внутренних секций тултипа */
.resource-tooltip-header {
  font-weight: 800;
  font-size: 12px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resource-tooltip-section {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-subtle);
}

.resource-tooltip-title {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.resource-tooltip-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 10.5px;
  margin-top: 2px;
}

.resource-tooltip-item .bullet {
  flex-shrink: 0;
  font-weight: 700;
}

.resource-tooltip-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}


