/* ===== SITWEY GARDEN TALES WIDGET (DARK SITWEY THEME • 20 LEVELS) ===== */
.swg-demo-cta {
  background: linear-gradient(90deg, #ff6b6b 0%, #f06595 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.swg-demo-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(255, 107, 107, 0.48);
}

/* Плавающий док и авто-приглашение */
.swg-dock {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.swg-floating-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(18, 23, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.38);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(56, 189, 248, 0.16);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: swgDarkPulse 3.2s infinite;
}
.swg-floating-btn:hover {
  transform: translateY(-2px);
  border-color: #ff6b6b;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 107, 107, 0.28);
}
.swg-btn-icon {
  font-size: 18px;
  line-height: 1;
}

@keyframes swgDarkPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 14px rgba(56, 189, 248, 0.15); }
  50% { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 107, 107, 0.3); }
}

/* Всплывающее авто-приглашение в стиле SITWEY */
.swg-invite-bubble {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: 292px;
  background: rgba(18, 23, 38, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.15);
  color: #f8fafc;
  animation: swgSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.swg-invite-bubble::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #ff6b6b;
  filter: blur(45px);
  opacity: 0.22;
  pointer-events: none;
}
.swg-invite-bubble::after {
  content: "";
  position: absolute;
  bottom: -45px;
  right: -35px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #38bdf8;
  filter: blur(45px);
  opacity: 0.2;
  pointer-events: none;
}
#swg-auto-invite.swg-visible {
  display: block !important;
}
@keyframes swgSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.swg-invite-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 24px;
  height: 24px;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.swg-invite-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}
.swg-invite-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.swg-invite-text {
  position: relative;
  z-index: 2;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: #cbd5e1;
}
.swg-invite-text strong {
  color: #ffffff;
  font-weight: 700;
}
.swg-invite-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(90deg, #ff6b6b 0%, #f06595 100%);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.swg-invite-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 107, 107, 0.45);
}

/* Оверлей и модальное окно в фирменном тёмном стиле SITWEY */
.swg-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(7, 10, 19, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.swg-modal {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
  margin: auto;
  background: linear-gradient(180deg, #131826 0%, #0d121d 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  padding: 18px 18px 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(56, 189, 248, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  box-sizing: border-box;
}
.swg-modal::before {
  content: "";
  position: absolute;
  top: -90px;
  left: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: #ff6b6b;
  filter: blur(85px);
  opacity: 0.14;
  pointer-events: none;
}
.swg-modal::after {
  content: "";
  position: absolute;
  bottom: -100px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: #38bdf8;
  filter: blur(85px);
  opacity: 0.14;
  pointer-events: none;
}

/* Шапка */
.swg-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.swg-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 5px 12px;
  border-radius: 999px;
}
.swg-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.swg-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.swg-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
  transform: scale(1.05);
}
.swg-close-btn {
  font-size: 20px;
  font-weight: 600;
  color: #ff8787;
  border-color: rgba(255, 107, 107, 0.25);
}
.swg-close-btn:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffffff;
}

/* Прокручиваемая карта 20 уровней */
.swg-map {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 10px;
  margin-bottom: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) rgba(15, 23, 42, 0.6);
}
.swg-map::-webkit-scrollbar {
  height: 5px;
}
.swg-map::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 99px;
}
.swg-map::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.45);
  border-radius: 99px;
}

.swg-map-node {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  opacity: 0.6;
  padding: 0;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.swg-map-node.unlocked {
  opacity: 1;
  cursor: pointer;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}
.swg-map-node.gift {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.12);
  color: #fecdd3;
}
.swg-map-node.current {
  opacity: 1;
  cursor: pointer;
  background: linear-gradient(135deg, #ff6b6b 0%, #f06595 100%);
  border-color: #ffffff;
  color: #ffffff;
  transform: scale(1.14);
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.5);
}
.swg-map-node small {
  font-size: 8px;
  line-height: 1;
  font-weight: 800;
  color: #fde047;
}

/* Баннер уровня и счётчики */
.swg-level-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 11px 14px;
  margin-bottom: 12px;
}
.swg-level-title {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}
.swg-level-desc {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
#swg-goal-bar {
  background: linear-gradient(90deg, #ff6b6b, #38bdf8) !important;
}
.swg-hud {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.swg-hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.swg-hud-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.4px;
}
.swg-hud-val {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

/* Игровое поле Canvas */
.swg-canvas-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #161d2f;
  border: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(0, 0, 0, 0.35);
}
#swg-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: pointer;
}

/* Панель бустеров */
.swg-boosters {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 2px;
}
.swg-booster-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 9px 6px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.swg-booster-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
}
.swg-booster-btn.active {
  background: rgba(255, 107, 107, 0.18);
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3);
}
.swg-b-icon { font-size: 19px; line-height: 1.1; }
.swg-b-name { font-size: 11px; font-weight: 600; color: #e2e8f0; }

/* Экран результата и салют */
.swg-result {
  position: relative;
  background: rgba(15, 21, 35, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
.swg-result-content {
  position: relative;
  z-index: 2;
  width: 100%;
}
.swg-result-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.swg-result-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}
.swg-result-text {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Карточка промокода */
.swg-promo-card {
  background: rgba(11, 15, 25, 0.85);
  border: 1px dashed rgba(255, 107, 107, 0.55);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}
.swg-promo-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.swg-promo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #131826;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.swg-promo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1.5px;
}
.swg-copy-btn {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.swg-copy-btn:hover {
  background: #38bdf8;
  color: #0b0f19;
}

.swg-tg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ff6b6b 0%, #f06595 100%);
  color: #ffffff;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.3);
}
.swg-tg-btn:hover {
  opacity: 0.94;
}

.swg-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swg-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ff6b6b 0%, #f06595 100%);
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 107, 107, 0.35);
}
.swg-primary-btn:hover {
  opacity: 0.94;
}
.swg-secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.swg-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@media (max-width: 480px) {
  .swg-overlay { padding: 10px 8px; }
  .swg-modal { padding: 14px 12px 16px; border-radius: 20px; }
  .swg-level-banner { flex-direction: column; align-items: stretch; }
  .swg-hud { justify-content: space-between; }
  .swg-hud-pill { flex: 1; }
  .swg-dock { left: 12px; bottom: 12px; }
  .swg-invite-bubble { width: 256px; }
}
