main {
  padding: 0;
  width: 100%;
}

.header-wrapper {
  padding: 20px 0px 20px 20px;
  box-shadow: 0px 0px 19px 25px var(--background-secondary);
}

#gesture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  touch-action: none;
  background: transparent;
  /* pointer-events: auto; */
  display: block;
}

/* Область для сетки */
.grid-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #182140;
  touch-action: none !important; /* Строго запрещаем системный скролл */
  user-select: none;
  -webkit-user-drag: none;
  -webkit-overflow-scrolling: auto;
  -webkit-user-select: none; /* Запрещаем выделение текста при свайпе */
  -webkit-touch-callout: none;
  pointer-events: auto;
}
/* Обёртка для сетки – размеры и позиция задаются напрямую */
.grid-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  transform-origin: 0 0;
  /* contain: layout size; */
  backface-visibility: hidden;
  transform: translateZ(0);
  pointer-events: auto; /* Явно разрешаем события */
  touch-action: none !important; 
  user-select: none;
  -webkit-user-drag: none;
}
/* Контейнер для ячеек */
.grid {
  position: relative;
  backface-visibility: hidden;
  touch-action: none !important; 
  user-select: none;
  -webkit-user-drag: none;
}

/* Базовый класс ячейки – используется только для позиционирования */
.cell {
  position: absolute;
  cursor: pointer;
  /* overflow: hidden; */
}

/* ===== Стили лотерейной ячейки ===== */
.lottery-cell.sell{
  background: #440000eb;
}

.lottery-special .lottery-cell-wrapper {
  display: inline-block;
  padding: 3px; /* толщина градиентной рамки */
  border-radius: 24px;
  width: 100%;
  height: 100%;
}

.lottery-special {
  /* Убирает лишние расчеты при наложении слоев */
  isolation: isolate;
}
.lottery-cell {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  height: 100%;
  background: #131822;
  border-radius: 20px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.lottery-cell svg {
  width: 100%;
  height: 100%;
}

.zoom-level-4 .lottery-special .lottery-cell-wrapper,
.zoom-level-5 .lottery-special .lottery-cell-wrapper {
  background: linear-gradient(45deg, #ffd700, #b08a3b, #ffd700);
}

@media (hover: none) and (pointer: coarse) {
  .lottery-cell:hover,
  .lottery-cell:active,
  .lottery-cell:focus {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    transition: none !important;
  }
}

.zoom-level-5 .lottery-special .lottery-cell:hover {
  transform: scale(1.040);
  border-radius: 24px;
}
.zoom-level-4 .lottery-special .lottery-cell:hover {
  transform: scale(1.050);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.8);
}
.zoom-level-3 .lottery-special .lottery-cell:hover {
  transform: scale(1.07);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.8);
}

/* Естественный блеск (шиммер) */
.zoom-level-5 .lottery-special .lottery-cell::after, 
.zoom-level-4 .lottery-special .lottery-cell::after,
.zoom-level-3 .lottery-special .lottery-cell::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,215,0,0.3) 50%, transparent 100%);
  transform: translateX(-150%) rotate(25deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoom-level-5 .lottery-special .lottery-cell:hover::after, 
.zoom-level-4 .lottery-special .lottery-cell:hover::after, 
.zoom-level-3 .lottery-special .lottery-cell:hover::after {
  opacity: 1;
  animation: shimmer 1.5s forwards;
}

@keyframes shimmer {
  0%   { transform: translateX(-150%) rotate(25deg); opacity: 0; }
  50%  { transform: translateX(0) rotate(25deg); opacity: 0.4; }
  100% { transform: translateX(150%) rotate(25deg); opacity: 0; }
}
.lottery-special .big-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-align: center;
  transition: color 0.3s ease;
}

.lottery-special .lottery-cell:hover .big-number {
  color: #ffd700;
}

.lottery-special .cell-id-wrapper {
  width: 100%;
  padding: 4px;
  border-radius: 12px;
  border: solid 2px #ffd7007d;
  transition: background 0.3s ease;
}
.lottery-special .cell-id {
  padding: 6px 16px;
  background: #1a1f2b;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  color: #ccb848;
  transition: color 0.3s ease, background 0.3s ease;
}

.lottery-special .lottery-cell:hover .cell-id {
  color: #ffd700;
}
/* Декоративные элементы */
.lottery-special .decor-elements {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  pointer-events: none;
}
.lottery-special .star {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #b08a3b;
  transform: rotate(45deg);
  top: 40px;
  left: 30px;
  transition: background 0.3s ease;
}
.lottery-special .lottery-cell:hover .star {
  background: #ffd700;
}
.lottery-special .star::before,
.lottery-special .star::after {
  content: "";
  position: absolute;
  background: inherit;
  transition: background 0.3s ease;
}
.lottery-special .star::before {
  width: 10px;
  height: 2px;
  top: 4px;
  left: -4px;
}
.lottery-special .star::after {
  width: 2px;
  height: 10px;
  top: -4px;
  left: 4px;
}
.lottery-special .rect-number {
  width: 35px;
  height: 35px;
  background: #1a1f2b;
  border-radius: 20px;
  font-weight: bold;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccb848;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.5);
  transition: color 0.3s ease, box-shadow 0.3s ease;
}
.lottery-special .lottery-cell:hover .rect-number {
  color: #ffd700;
}

/* ===== Стили для разных уровней зума ===== */
/* На минимальном уровне – скрываем почти всё */

.zoom-level-1 #grid {
  /* Форсирует создание аппаратного слоя в Chrome */
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  /* Убирает мерцание и дырки при трансформациях */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* overflow: hidden; */
}

.zoom-level-1 .lottery-cell {
  padding: 35px;
  border-radius: 50%;
}
.zoom-level-1 .lottery-special .goldenEther{
  display: flex;
  height: 100%;
}

.zoom-level-1 .cell {
  contain: strict;
}

/* .zoom-level-2 .lottery-special .cell-id-wrapper,
.zoom-level-2 .lottery-special .decor-elements {
  display: none;
} */

.zoom-level-3 .lottery-special .lottery-cell-wrapper,
.zoom-level-2 .lottery-special .lottery-cell-wrapper {
  background: #c1a400;
}
/* Уровень 2 – показываем только центральный номер (уменьшенный размер) */
.zoom-level-2 .lottery-special .big-number {
  font-size: 25px;
}

/* Уровень 3 – показываем номер и ID */
.zoom-level-3 .lottery-special .big-number {
  font-size: 35px;
}

/* Уровень 4 – показываем номер, ID и декоративные элементы (умеренная детализация) */
.zoom-level-4 .lottery-cell {
  padding: 10px;
}
.zoom-level-4 .lottery-special .big-number {
  font-size: 35px;
}
/* .zoom-level-4 .lottery-special .cell-id-wrapper {
  display: block;
} */
.zoom-level-4 .lottery-special .decor-elements {
  opacity: 0.7;
}
.zoom-level-4 .lottery-special .rect-number {
  width: 30px;
  height: 30px;
}
.zoom-level-4 .lottery-special .cell-id {
  font-size: 14px;
  padding: 6px;
}
/* Уровень 5 – полный набор эффектов */
.zoom-level-5 .lottery-cell {
  padding: 15px;
}
.zoom-level-5 .lottery-special .big-number {
  font-size: 60px;
}
/* .zoom-level-5 .lottery-special .cell-id-wrapper {
  display: block;
} */
.zoom-level-5 .lottery-special .decor-elements {
  opacity: 1;
}

@media(max-width: 768px) {
  .header-wrapper {
    padding: 15px 15px 0px 15px;
  }
  .grid-container {
    padding-top: 20px;
  }
  .lottery-special .big-number {
    font-size: 45px;
  }
  .zoom-level-5 .lottery-special .big-number {
    font-size: 45px;
  }
  .zoom-level-3 .lottery-special .big-number {
    font-size: 30px;
  }
  .lottery-special .rect-number.n1 {
    top: 12px;
    left: 12px;
  }
  .lottery-special .rect-number.n2 {
    top: 12px;
    right: 12px;
  }
  .lottery-special .cell-id {
    padding: 6px 6px;
    font-size: 14px;
  }
}