/* ============================================================
   Lucky Drop — Holo redesign (Glitchon)
   Токены + анимации маскота + новые компоненты каркаса/вкладок.
   ============================================================ */
:root{
  /* ---------- Шрифты ---------- */
  --ld-font-display: "Unbounded", system-ui, sans-serif;
  --ld-font-ui:      "Manrope", system-ui, sans-serif;

  /* ---------- Фон ---------- */
  --ld-bg-0: #07060e;
  --ld-bg-1: #0c0a1a;
  --ld-bg-2: #131319;
  --ld-bg-screen: radial-gradient(130% 80% at 50% -6%, #1b1438 0%, #0c0a1a 46%, #07060e 100%);

  /* ---------- Стекло / панели ---------- */
  --ld-panel: linear-gradient(150deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  --ld-panel-border: rgba(140,170,255,.14);
  --ld-hairline: rgba(120,150,255,.10);

  /* ---------- Голографика (основной акцент) ---------- */
  --ld-cyan:    #5FF5DF;
  --ld-cyan-2:  #7BF7E4;
  --ld-blue:    #5BB8FF;
  --ld-violet:  #A98BFF;
  --ld-magenta: #F58BF0;
  --ld-bright:  #E6FEFF;
  --ld-ice:     #6FE9FF;
  --ld-holo: linear-gradient(120deg, #7BF7E4, #5BB8FF 45%, #A98BFF 75%, #F58BF0);
  --ld-holo-ring: conic-gradient(from 200deg, #5FF5DF, #5BB8FF, #A98BFF, #F58BF0, #5FF5DF);
  --ld-on-holo: #06121a;

  /* ---------- Telegram Stars (жёлтая «денежная» зона) ---------- */
  --ld-star: #FFC83A;
  --ld-gold: linear-gradient(135deg, #FFD75A, #FFB200);
  --ld-on-gold: #2a1c00;

  /* ---------- Текст ---------- */
  --ld-text:    #EDEDF6;
  --ld-text-2:  rgba(200,206,230,.82);
  --ld-muted:   rgba(150,158,190,.75);
  --ld-faint:   rgba(150,158,190,.60);

  /* ---------- Радиусы ---------- */
  --ld-r-pill: 999px;
  --ld-r-card: 22px;
  --ld-r-md:   18px;
  --ld-r-btn:  14px;
  --ld-r-medallion: 20px;

  /* ---------- Тени / свечения ---------- */
  --ld-shadow-card: 0 14px 40px rgba(0,0,0,.40);
  --ld-shadow-soft: 0 18px 50px rgba(0,0,0,.45);
  --ld-glow-cyan:   0 0 28px rgba(91,184,255,.18);
  --ld-glow-violet: 0 0 24px rgba(169,139,245,.16);
  --ld-glow-gold:   0 8px 24px rgba(255,180,0,.28);
  --ld-glow-btn:    0 8px 26px rgba(91,184,255,.35);

  /* ---------- Спейсинг (8pt) ---------- */
  --ld-s-1: 6px;  --ld-s-2: 10px; --ld-s-3: 14px;
  --ld-s-4: 18px; --ld-s-5: 24px; --ld-s-6: 32px;
}

/* Голо-текст (названия игр, «СКОРО») */
.ld-holo-text {
  background: var(--ld-holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(120,180,255,.40));
  font-family: var(--ld-font-display);
  font-weight: 800;
  font-style: italic;
}

/* ============================================================
   Glitchon — анимации маскота (покачивание, моргание,
   мерцание осколков, восходящие частицы-данные)
   ============================================================ */
@keyframes gBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}
.gf {
  animation: gBob 6s ease-in-out infinite;
  transform-origin: 160px 260px;
}

@keyframes gDrift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(3px, -5px); }
}
.gdrift {
  animation: gDrift 5s ease-in-out infinite;
}

@keyframes gPulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: .9; }
}
.gpulse rect {
  animation: gPulse 2.4s ease-in-out infinite;
}
.gpulse rect:nth-child(2) { animation-delay: .3s; }
.gpulse rect:nth-child(3) { animation-delay: .6s; }
.gpulse rect:nth-child(4) { animation-delay: .9s; }
.gpulse rect:nth-child(5) { animation-delay: 1.2s; }

@keyframes gBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  96%           { transform: scaleY(.08); }
}
.gblink {
  animation: gBlink 4.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes gTwinkle {
  0%, 100% { opacity: .35; transform: scale(.85) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.15) rotate(10deg); }
}
.gtw {
  animation: gTwinkle 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes gRise {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-170px) scale(.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gf, .gdrift, .gpulse rect, .gblink, .gtw, .grise circle {
    animation: none !important;
  }
}

/* ============================================================
   Шапка — пилюля пользователя + пилюля Stars
   ============================================================ */
.ld-user-pill {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(120,150,255,.12);
  border-radius: var(--ld-r-pill);
  padding: 4px 16px 4px 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ld-avatar-ring {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--ld-holo-ring);
  padding: 2px;
  display: flex; align-items: center; justify-content: center;
}
.ld-avatar-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: #0d0c17;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ld-font-display); font-weight: 800; font-size: 14px;
  color: var(--ld-text);
}
.ld-avatar-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-user-name {
  font-family: var(--ld-font-ui); font-weight: 700; font-size: 16px;
  color: var(--ld-text); letter-spacing: .2px; white-space: nowrap;
}

.ld-stars-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,200,58,.07);
  border: 1px solid rgba(255,200,58,.45);
  border-radius: var(--ld-r-pill);
  padding: 8px 16px;
  box-shadow: 0 0 18px rgba(255,180,0,.12);
}
.ld-stars-chip .star-icon { font-size: 18px; line-height: 1; }
.ld-stars-chip .val {
  font-family: var(--ld-font-ui); font-weight: 800; font-size: 16px;
  color: var(--ld-star);
}

/* ============================================================
   Вкладка HAVEN
   ============================================================ */
.haven-screen {
  display: flex; flex-direction: column;
  height: 100%; overflow-y: auto;
}
.haven-screen-hero {
  min-height: 220px;
  background:
    linear-gradient(160deg, rgba(8,6,24,.10) 0%, rgba(8,6,24,.65) 100%),
    url('../assets/Game_pre/Haven.jpg?v=2') center / cover no-repeat;
  background-color: #0d0f1a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0;
}
.haven-screen-logo {
  font-family: var(--ld-font-display); font-weight: 900; font-style: italic;
  font-size: 64px; line-height: 1;
  background: linear-gradient(120deg, #FFF8DC 0%, #FFC83A 45%, #FF9A1A 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 24px rgba(255,180,30,.65));
}
.haven-screen-tag {
  font-family: var(--ld-font-ui); font-weight: 800; font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,200,58,.70);
}
.haven-screen-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.haven-wip {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.haven-wip-icon { font-size: 44px; }
.haven-wip-title {
  font-family: var(--ld-font-display); font-weight: 800; font-style: italic;
  font-size: 20px; color: #fff;
}
.haven-wip-sub {
  font-family: var(--ld-font-ui); font-size: 13px;
  color: rgba(255,255,255,.45); line-height: 1.5;
  max-width: 260px;
}
.haven-back-btn {
  margin-top: 12px;
  padding: 12px 24px;
  border: 1px solid rgba(255,200,58,.30);
  border-radius: var(--ld-r-btn, 14px);
  background: rgba(255,200,58,.08);
  color: rgba(255,200,58,.80);
  font-family: var(--ld-font-display); font-weight: 700; font-style: italic;
  font-size: 13px; letter-spacing: .05em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.haven-back-btn:active { background: rgba(255,200,58,.16); }

/* ============================================================
   Вкладка ИГРЫ — неон-сетка
   ============================================================ */
#tab-games.active {
  display: flex;
  flex-direction: column;
}
.ld-games-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 90px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.ld-watermark {
  position: absolute;
  top: 36px; right: -70px;
  width: 300px; height: 412px;
  opacity: .11;
  pointer-events: none;
  z-index: 0;
}
.ld-watermark svg { width: 100%; height: 100%; display: block; }

.ld-tile {
  position: relative; z-index: 1;
  border-radius: var(--ld-r-card);
  padding: 18px 20px;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s;
}
.ld-tile:active { transform: scale(.98); }
.ld-tile::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 1px 0 rgba(255,255,255,.10);
  pointer-events: none;
  z-index: 3;
}

/* ── Название игры — плавает поверх картинки в углу ─────── */
.ld-tile-title-float {
  position: absolute;
  top: 12px; left: 14px;
  z-index: 2;
  font-family: var(--ld-font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.ld-tile-case .ld-tile-title-float,
.ld-tile-starfall .ld-tile-title-float { font-size: 14px; top: 10px; left: 11px; }
.ld-tile-starfall .ld-tile-title-float { font-size: 13px; }
.ld-tile-safe .ld-tile-title-float { font-size: 15px; top: 10px; left: 12px; }

/* ── Нижняя плашка: только кнопка "Играть" ─────── */
.ld-tile-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(0deg, rgba(7,6,14,.92) 0%, rgba(7,6,14,.7) 55%, transparent 100%);
}
.ld-tile-bar-play {
  flex-shrink: 0;
  font-family: var(--ld-font-ui);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ld-on-holo);
  background: var(--ld-holo);
  border-radius: var(--ld-r-pill);
  padding: 6px 14px;
  white-space: nowrap;
}

/* ── HAVEN HUB — маленькая полоска "скоро" ──────────────── */
.ld-tile-haven-strip {
  position: relative;
  flex: 0 0 auto;
  min-height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
}
.ld-tile-haven-strip-title {
  font-family: var(--ld-font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 15px;
  color: rgba(235,238,250,.85);
}
.ld-tile-haven-strip-badge {
  font-family: var(--ld-font-ui);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(220,222,232,.7);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--ld-r-pill);
  padding: 6px 14px;
  white-space: nowrap;
}
.ld-tile-haven-strip.haven-locked { cursor: default; opacity: .7; }

/* ── Разделитель перед Haven («дальше — будущее платформы») ── */
.ld-games-divider {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 0;
}
.ld-games-divider-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,200,58,.4));
}
.ld-games-divider-line.right {
  background: linear-gradient(90deg, rgba(255,200,58,.4), transparent);
}
.ld-games-divider-text {
  font-family: var(--ld-font-ui); font-weight: 700; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,214,120,.8);
  white-space: nowrap;
}
.haven-badge {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--ld-font-ui); font-weight: 900; font-size: 9px;
  letter-spacing: .22em; text-transform: uppercase;
  background: linear-gradient(120deg, #FFC83A, #FF9A1A);
  color: #0d0f1a;
  border-radius: var(--ld-r-pill);
  padding: 4px 10px;
  box-shadow: 0 2px 12px rgba(255,200,58,.5);
}
.haven-logo {
  position: relative; z-index: 1;
  font-family: var(--ld-font-display); font-weight: 900; font-style: italic;
  font-size: 44px; line-height: 1;
  letter-spacing: -.01em;
  background: linear-gradient(120deg, #FFF8DC 0%, #FFC83A 45%, #FF9A1A 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 16px rgba(255,180,30,.55));
}
.haven-sub {
  position: relative; z-index: 1;
  font-family: var(--ld-font-ui); font-weight: 700; font-size: 11px;
  letter-spacing: .04em;
  color: rgba(255,220,140,.80);
}
.haven-arrow {
  position: absolute; bottom: 18px; right: 18px; z-index: 1;
  font-size: 22px;
  color: rgba(255,200,58,.65);
  line-height: 1;
}
.ld-tile-haven-wip {
  cursor: default;
  pointer-events: none;
}
.ld-tile-haven-wip:active { transform: none; }
.haven-wip-chip {
  position: absolute; bottom: 14px; right: 14px; z-index: 1;
  font-family: var(--ld-font-ui); font-weight: 800; font-size: 9px;
  letter-spacing: .16em; text-transform: uppercase;
  background: rgba(255,200,58,.10);
  border: 1px solid rgba(255,200,58,.28);
  color: rgba(255,200,58,.60);
  border-radius: var(--ld-r-pill);
  padding: 3px 9px;
}

.ld-tile-crash {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  flex: 0 0 auto;
  min-height: 148px;
  border-radius: 22px;
  background: url('../assets/Game_pre/rocket.jpg?v=4') center / cover no-repeat;
  border: 1px solid rgba(255,215,0,.45);
  box-shadow: 0 0 28px rgba(255,200,58,.22), inset 0 0 0 1px rgba(255,215,0,.15);
}
.ld-chip-hit {
  align-self: flex-start;
  font-family: var(--ld-font-ui); font-weight: 800; font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--ld-holo); color: var(--ld-on-holo);
  border-radius: var(--ld-r-pill);
  padding: 4px 10px;
  margin-bottom: 4px;
}
.ld-tile-title {
  font-family: var(--ld-font-display); font-weight: 800; font-style: italic;
  line-height: 1.15;
}
.ld-tile-crash .ld-tile-title { font-size: 34px; }
.ld-tile-case .ld-tile-title,
.ld-tile-starfall .ld-tile-title { font-size: 22px; }
.ld-tile-sub {
  font-family: var(--ld-font-ui); font-weight: 700; font-size: 12px;
  letter-spacing: .03em;
  color: rgba(210,216,238,.9);
}
.ld-tile-crash .ld-tile-sub {
  color: var(--ld-cyan);
  text-shadow: 0 0 10px rgba(95,245,223,.45);
}
.ld-tile-case .ld-tile-sub {
  color: #C9A8FF;
  text-shadow: 0 0 10px rgba(169,139,245,.4);
}
.ld-tile-starfall .ld-tile-sub {
  color: var(--ld-cyan-2);
  text-shadow: 0 0 10px rgba(123,247,228,.4);
}
.ld-tile-safe .ld-tile-sub {
  color: var(--ld-star);
  text-shadow: 0 0 10px rgba(255,200,58,.4);
}

.ld-tile-grid {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  overflow: hidden;
}
.ld-tile-case,
.ld-tile-starfall {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 212px;
  border-radius: 20px;
  max-width: 100%;
  min-width: 0;
}
.ld-tile-case {
  background: url('../assets/Game_pre/case.jpg?v=4') center / cover no-repeat;
  border: 1px solid rgba(255,215,0,.45);
  box-shadow: 0 0 24px rgba(255,200,58,.2);
}
.ld-tile-starfall {
  background: url('../assets/Game_pre/zvezdopad.png?v=1') center / cover no-repeat;
  border: 1px solid rgba(255,215,0,.45);
  box-shadow: 0 0 24px rgba(255,200,58,.2);
}
.ld-tile-icon { width: 26px; height: 26px; }
.ld-tile-case .ld-tile-icon { color: #C9A8FF; }
.ld-tile-starfall .ld-tile-icon { color: #7BF7E4; }

/* Safe tile — spans full width, golden/vault theme */
.ld-tile-safe {
  position: relative;
  grid-column: span 2;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 130px;
  border-radius: 20px;
  background: url('../assets/Game_pre/vault.jpeg?v=4') center / cover no-repeat;
  border: 1px solid rgba(255,215,0,.45);
  box-shadow: 0 0 24px rgba(255,200,58,.2);
}
.ld-tile-safe .ld-tile-title { font-size: 22px; }
.ld-tile-safe .ld-tile-icon { color: #FFC83A; }

/* Top row: icon + title + sub */
.safe-tile-top {
  display: flex; align-items: center; gap: 10px;
}
.safe-tile-top .ld-tile-icon { flex-shrink: 0; }
.safe-tile-text { display: flex; flex-direction: column; gap: 2px; }

/* Digit preview row */
.safe-tile-digits {
  display: flex; gap: 5px; margin-top: 2px;
}
.safe-tile-digit {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255,200,58,.28);
  background: rgba(255,200,58,.07);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ld-font-display, 'Unbounded', sans-serif);
  font-size: 10px; font-weight: 800;
  color: rgba(255,200,58,.75);
  flex-shrink: 0;
}

/* Info chip: "3 попытки" */
.safe-tile-info {
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.safe-tile-chip {
  font-family: var(--ld-font-ui, sans-serif);
  font-size: 9px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--ld-r-pill, 999px);
  background: rgba(255,200,58,.15);
  color: rgba(255,200,58,.85);
  border: 1px solid rgba(255,200,58,.25);
  white-space: nowrap;
}

/* ============================================================
   Вкладка МАГАЗИН — заглушка «СКОРО»
   ============================================================ */
.ld-shop-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 65vh; padding: 32px; text-align: center;
}
.ld-shop-placeholder svg { width: 236px; height: 308px; }
.ld-shop-title {
  font-size: 40px; letter-spacing: .04em; margin-top: 8px;
  padding: 4px 24px;
}
.ld-shop-caption {
  font-family: var(--ld-font-ui); font-weight: 500; font-size: 15px;
  color: rgba(190,196,225,.78);
  max-width: 280px; margin-top: 14px; line-height: 1.5;
}

/* ============================================================
   Переключатель языка интерфейса (Профиль)
   ============================================================ */
.lang-switch {
  display: flex; gap: 8px;
}
.lang-btn {
  flex: 1; padding: 11px 14px;
  background: var(--ld-panel);
  border: 1px solid var(--ld-panel-border);
  border-radius: var(--ld-r-btn);
  color: var(--ld-text-2);
  font-family: var(--ld-font-display); font-weight: 800;
  font-size: 14px; letter-spacing: 1px;
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.lang-btn:active { transform: scale(.97); }
.lang-btn.active {
  background: var(--ld-holo);
  color: var(--ld-on-holo);
  border-color: transparent;
  box-shadow: var(--ld-glow-btn);
}
