:root {
    --tg-theme-bg-color: #111111;
    --tg-theme-text-color: #ffffff;
    --tg-theme-button-color: #ff3333;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #222222;
    --tg-theme-section-bg-color: #1a1a1a;
    
    /* Динамические тайминги для анимаций */
    --spin-duration: 3000ms;
    --result-delay: 500ms;
    --celebration-duration: 2000ms;
    --accent-color: #ff3333;
    --red-color: #ff3333;
    --green-color: #00cc00;
    --secondary-bg-color: #222222;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--tg-theme-bg-color, #111111);
    color: var(--tg-theme-text-color, #ffffff);
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, 
                              rgba(255, 51, 51, 0.1) 0%, 
                              rgba(255, 51, 51, 0) 70%);
    pointer-events: none;
    animation: pulseBackground 10s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes pulseBackground {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.5; }
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 8px; /* Уменьшаем верхний отступ для рекламы */
}

/* Рекламный блок */
.ad-banner {
    width: calc(100% - 40px); /* Подгонка ширины к окну 'Выберите игру' */
    height: 30px; /* Очень тонкий баннер */
    margin: 16px auto; /* Центрируем и добавляем отступы */
    padding: 0; /* Убираем внутренние отступы для полного заполнения */
    background: linear-gradient(135deg, #ff3333, #ff6666);
    border-radius: 6px; /* Меньший радиус для тонкого баннера */
    box-shadow: 0 2px 8px rgba(255, 51, 51, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.ad-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    will-change: transform;
    animation: shine 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.ad-text {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 15px;
}

.vip-label {
    font-weight: bold;
    font-size: 20px;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ad-message {
    font-size: 14px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ad-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.ad-gif:hover {
    transform: scale(1.02);
}

/* Стили для текста рекламы удалены, теперь используется GIF */

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px; /* Меньший отступ сверху */
    margin-bottom: 16px; /* Меньший отступ снизу */
    padding-top: 12px; /* Меньший отступ сверху */
    padding-bottom: 12px; /* Меньший отступ снизу */
    border-bottom: 1px solid rgba(255, 51, 51, 0.3);
}

.header h1 {
    margin-bottom: 8px; /* Уменьшили отступ */
    font-size: 24px; /* Уменьшили размер шрифта */
    color: var(--accent-color);
    text-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.attempts {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(255, 51, 51, 0.2);
    border-radius: 16px;
    font-size: 14px;
}

#attempts-count {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 4px;
}

/* Анимации переходов между играми */
.section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--secondary-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 51, 51, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.section.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.section.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 22px;
    color: var(--accent-color);
}

.hidden {
    display: none;
}

.games-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.game-card {
    width: calc(50% - 8px);
    padding: 16px;
    background: rgba(255, 51, 51, 0.1);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    will-change: transform, background;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 51, 51, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
    background: rgba(255, 51, 51, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.game-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.game-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--accent-color);
}

.game-desc {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

/* Кнопки */
button {
    background: var(--tg-theme-button-color, #ff3333);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

button:hover, button:active {
    background: rgba(255, 51, 51, 0.8);
}

.buy-btn {
    background: var(--accent-color);
    margin-top: 16px;
}

.buy-btn:hover, .buy-btn:active {
    background: rgba(255, 51, 51, 0.8);
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    margin-top: 16px;
    border: 1px solid rgba(255, 51, 51, 0.3);
}

.back-btn:hover, .back-btn:active {
    background: rgba(255, 51, 51, 0.2);
}

.action-btn {
    background: var(--accent-color);
    margin-bottom: 16px;
}

.action-btn:hover, .action-btn:active {
    background: rgba(255, 51, 51, 0.8);
}

/* Рулетка */
.roulette-container {
    position: relative;
    width: min(80vw, 280px);
    height: min(80vw, 280px);
    margin: 20px auto; /* центрируем */
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

.roulette-animation {
    width: 70vw;
    max-width: 360px;
    min-width: 240px;
    aspect-ratio: 1 / 1; /* сохраняем круг */
    margin-bottom: 16px; /* чуть меньше отступ */
    position: relative;
}

.roulette-result {
    display: none !important;
}

.result-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
}

.result-text {
    margin-top: 8px;
    color: var(--tg-theme-hint-color);
}

/* Печенька (Мины) */
.mines-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.mines-field {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 16px;
}

/* Стиль для ячеек игры "Печенька" */
.mines-cell {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #333, #222);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 51, 51, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* === Новое: контейнер Lottie внутри клетки === */
.mines-cell .cell-lottie {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.mines-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 51, 51, 0.4);
    background: linear-gradient(135deg, #444, #333);
}

.mines-cell:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 51, 51, 0.2);
}

.mines-cell.safe {
    background: linear-gradient(135deg, #006600, #004400);
    border-color: rgba(0, 204, 0, 0.5);
    pointer-events: none;
}

.mines-cell.mine {
    background: linear-gradient(135deg, #660000, #440000);
    border-color: rgba(255, 0, 0, 0.5);
    pointer-events: none;
    animation: explosion 0.5s ease-out;
}

.mines-cell.mine-revealed {
    background: linear-gradient(135deg, #660000, #440000);
    border-color: rgba(255, 0, 0, 0.5);
    opacity: 0.7;
    pointer-events: none;
}

@keyframes explosion {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Старые стили для .mine-cell можно удалить или оставить для обратной совместимости */
.mine-cell {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #333, #222);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 51, 51, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mines-info {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 10px;
    background: rgba(255, 51, 51, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid rgba(255, 51, 51, 0.3);
}

.mines-info span {
    margin: 0 5px;
}

.mines-result {
    padding: 16px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

.mines-result.win {
    background: rgba(0, 204, 0, 0.2);
    color: var(--green-color);
    border: 1px solid rgba(0, 204, 0, 0.5);
}

.mines-result.lose {
    background: rgba(255, 51, 51, 0.2);
    color: var(--red-color);
    border: 1px solid rgba(255, 51, 51, 0.5);
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Стили для анимаций Lottie */
.lottie-animation {
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Отображение числа на экране */
.random-number-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    z-index: 100;
}

/* Стили для отображения результатов анимаций */
.result-number {
    font-size: 3rem;
    font-weight: bold;
    display: block;
    margin: 10px 0;
    color: #e74c3c;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

#cookie-lottie-animation, 
#bomb-lottie-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    z-index: 105;
}

#random-number-lottie-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    z-index: 110;
}

.lottie-animation.hidden {
    display: none;
}

/* Анимация для колеса рулетки */
.roulette-wheel {
    width: 100%;
    height: 100%;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.17, 0.67, 0.83, 0.67);
    transition-duration: var(--spin-duration);
}

/* Класс для отложенного показа результата */
.delayed-result {
    transition-delay: var(--result-delay);
}

/* Праздничная анимация */
.celebration {
    animation: celebrate var(--celebration-duration) ease-in-out;
}

@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Стили для видео рулетки */
.roulette-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    overflow: hidden;
    display: block;
    position: relative;
    z-index: 1;
}

/* Скрываем старые контейнеры анимации */
#roulette-lottie-animation,
#roulette-fallback {
    display: none !important;
}

/* Fallback CSS анимация рулетки */
.roulette-fallback {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roulette-fallback .roulette-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        #dc3545 0deg 10deg,
        #000 10deg 20deg,
        #dc3545 20deg 30deg,
        #000 30deg 40deg,
        #dc3545 40deg 50deg,
        #000 50deg 60deg,
        #dc3545 60deg 70deg,
        #000 70deg 80deg,
        #dc3545 80deg 90deg,
        #000 90deg 100deg,
        #dc3545 100deg 110deg,
        #000 110deg 120deg,
        #dc3545 120deg 130deg,
        #000 130deg 140deg,
        #dc3545 140deg 150deg,
        #000 150deg 160deg,
        #dc3545 160deg 170deg,
        #000 170deg 180deg,
        #dc3545 180deg 190deg,
        #000 190deg 200deg,
        #dc3545 200deg 210deg,
        #000 210deg 220deg,
        #dc3545 220deg 230deg,
        #000 230deg 240deg,
        #dc3545 240deg 250deg,
        #000 250deg 260deg,
        #dc3545 260deg 270deg,
        #000 270deg 280deg,
        #dc3545 280deg 290deg,
        #000 290deg 300deg,
        #dc3545 300deg 310deg,
        #000 310deg 320deg,
        #dc3545 320deg 330deg,
        #000 330deg 340deg,
        #dc3545 340deg 350deg,
        #000 350deg 360deg
    );
    border: 3px solid #ffd700;
    position: relative;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

/* Оптимизация анимации рулетки */
.roulette-wheel.spinning {
    will-change: transform;
    animation: spin-wheel 3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Анимация вращения для всех типов рулеток */
@keyframes spin-wheel {
    from { transform: rotate(0deg); }
    to { transform: rotate(var(--spin-degrees, 360deg)); }
}

/* Сохраняем совместимость со старым кодом */
@keyframes spin-fallback {
    from { transform: rotate(0deg); }
    to { transform: rotate(var(--spin-degrees, 1440deg)); }
}

/* ===== In-app confirm overlay ===== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.visible {
    opacity: 1;
}

.confirm-dialog {
    background-color: var(--tg-theme-secondary-bg-color, #222222);
    border-radius: 12px;
    padding: 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 51, 51, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.confirm-dialog.visible {
    transform: scale(1);
    opacity: 1;
}

.confirm-dialog p {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--tg-theme-text-color, #ffffff);
}

.confirm-dialog .btn-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.confirm-dialog .btn-group button {
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

/* Стили для таймера обратного отсчета */
.countdown-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.countdown-timer.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: countdownPulse 1s infinite alternate;
}

.countdown-number {
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
    animation: numberPop 1s infinite;
}

@keyframes countdownPulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px rgba(255, 51, 51, 0.5); }
    100% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 25px rgba(255, 51, 51, 0.8); }
}

/* Анимации для результата рулетки */
@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px var(--green-color); }
    100% { transform: scale(1); }
}

@keyframes losePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px var(--red-color); }
    100% { transform: scale(1); }
}

@keyframes scaleIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes numberPop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Стили для отображения результата */
.result-display {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: 100;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.result-display.visible {
    display: flex;
    opacity: 1;
}

.result-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-text {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Анимации для Lottie */
#treasure-lottie-animation,
#bomb-lottie-animation {
    width: 100%;
    height: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Обновлённые стили для кнопок */
.action-btn {
    background: var(--accent-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

/* Обновлённые стили для игрового поля */
.roulette-container {
    position: relative;
    width: min(80vw, 280px);
    height: min(80vw, 280px);
    margin: 20px auto; /* центрируем */
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

.roulette-video.hidden-video {
    display: none;
}

.roulette-container.with-glow {
    position: relative;
}

.roulette-container.with-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(255, 51, 51, 0.8) 0%,
        rgba(255, 51, 51, 0) 70%
    );
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.roulette-container.with-glow.spinning::after {
    opacity: 1;
    animation: glowPulse 1s infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.3; transform: scale(0.95); }
    100% { opacity: 0.8; transform: scale(1.05); }
}

/* Улучшенные стили для кнопок */
.action-btn, .back-btn, .buy-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-btn:active, .back-btn:active, .buy-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Эффект пульсации для кнопок */
@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.action-btn {
    animation: buttonPulse 2s infinite;
}

/* Эффект волны при клике */
.btn-wave {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Стили для кнопки управления звуком */
.sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.sound-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-toggle:active {
    transform: scale(0.95);
}

.mines-cell.empty {
    background: linear-gradient(135deg, #333333, #222222);
    border-color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.mines-result.win {
    color: #00cc00;
    background-color: rgba(0, 204, 0, 0.2);
}

.mines-result.lose {
    color: #ff3333;
    background-color: rgba(255, 51, 51, 0.2);
}

.result-display.win {
    border-color: #00cc00;
    background-color: rgba(0, 204, 0, 0.2);
}

.result-display.lose {
    border-color: #ff3333;
    background-color: rgba(255, 51, 51, 0.2);
}

/* ===== Анимация вращения кнопки «Крутить» ===== */
@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#spin-roulette {
    animation: none !important;
}

/* Стили для приветственных экранов */
.welcome-animation {
    width: 100%;
    height: 200px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.welcome-text {
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    margin: 20px 0;
    color: var(--tg-theme-text-color);
    padding: 0 15px;
}

/* ---------- Один большой сундук на приветственном экране "Печенька" ---------- */
#bomb-welcome-lottie {
    width: 320px;          /* фиксированная ширина контейнера */
    height: 320px;         /* квадрат для предсказуемости */
    max-width: 90vw;
    overflow: hidden;      /* отсекаем лишнее */
    margin: 0 auto;        /* центрируем в блоке приветствия */
    position: relative;
}

#bomb-welcome-lottie svg {
    width: 100%;
    height: 100%;
    transform: translateX(-25%) scale(1.7); /* подгоняем: сундук в центре */
    transform-origin: center;
}

/* Отменяем предыдущее скрытие, если оно было */
#bomb-welcome-lottie svg > g:first-child {
    display: block !important;
}

/* Скрываем первый дубликат SVG, оставляем второй */
#bomb-welcome-lottie svg:first-of-type {
    display: none !important;
}

/* ---------- Адаптивный layout ---------- */
@media (min-width: 768px) {
    .games-container {
        display: flex;
        gap: 24px;
    }
    .game-card {
        flex: 1 1 200px;
    }
    .mines-container {
        max-width: 600px;
        margin: 0 auto 20px;
    }
    .roulette-container {
        max-width: 600px;
        margin: 0 auto 20px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    #bomb-welcome-lottie {
        width: 90vw;
        height: auto;
        clip-path: inset(0 0 0 0); /* показываем целый svg */
    }
    #bomb-welcome-lottie svg {
        transform: scale(1.2) translateX(-10%);
    }
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background-color: var(--bg-color);
    border-radius: 15px;
    padding: 20px;
    max-width: 80%;
    width: 350px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideIn 0.3s ease-in-out;
}

.modal h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.modal p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.phone-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.phone-buttons button {
    width: 48%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Стили для блокировки интерфейса */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.interface-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-in-out;
}

.overlay-message {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    font-size: 1.2em;
    font-weight: bold;
    animation: pulseMessage 2s infinite;
}

@keyframes pulseMessage {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.prize-fields {
  max-height: 50vh;
  overflow-y: auto;
  margin: 10px 0;
}
.prize-field {
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.prize-field input {
  flex: 1 1 120px;
  border-radius: 8px;
  padding: 6px;
  border: 1px solid #888;
}
.prize-field .drag-handle {
  cursor: grab;
  font-size: 18px;
  user-select: none;
}

/* модальное hidden уже есть, используем классы */
.hidden { display: none !important; }

.lang-wrapper { position: relative; display:inline-block; margin-left:8px; }
.lang-toggle { width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,0.2);border:none;font-size:20px;color:#fff;cursor:pointer; }
.lang-menu { position:absolute; top:45px; right:0; background:rgba(0,0,0,0.8); padding:6px 8px; border-radius:8px; display:flex; flex-direction:column; gap:4px; z-index:999; }
.lang-menu.hidden { display:none; }
.lang-option { background:none; border:none; font-size:20px; cursor:pointer; }
.lang-option:hover { transform:scale(1.1); }

.tabs { display:flex; border-bottom:1px solid #444; margin-bottom:12px; }
.tab-link { background:none; border:none; color:#aaa; padding:8px 12px; cursor:pointer; }
.tab-link.active { color:#fff; border-bottom:2px solid var(--accent-color); }
.tab-content { display:none; }
.tab-content.active { display:block; }

.winner-item{padding:4px 0;border-bottom:1px solid rgba(255,255,255,0.1);}
