/* bot_app/web_app/css/pages/minesweeper-game.css - Adapted for Project */

/* SVG иконка звезды */
.star-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
}

.mines-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Статистика */
.mines-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.stat-box {
    background: var(--primary-color);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg,
        rgba(255, 202, 90, 0.3) 0%,
        rgba(255, 202, 90, 0.1) 50%,
        rgba(255, 202, 90, 0.3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 202, 90, 0.08) 0%, transparent 70%);
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(255, 202, 90, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Специфичные стили для каждого stat-box */
/* Множитель (зелёный) - слева */
.stat-box:nth-child(1) {
    border-color: rgba(40, 167, 69, 0.3);
}

.stat-box:nth-child(1) .stat-value {
    color: var(--success-color);
    text-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.stat-box:nth-child(1)::before {
    background: linear-gradient(135deg,
        rgba(40, 167, 69, 0.4) 0%,
        rgba(40, 167, 69, 0.1) 50%,
        rgba(40, 167, 69, 0.4) 100%);
}

/* Профит (золотой) - по центру */
.stat-box:nth-child(2) {
    border-color: rgba(255, 202, 90, 0.3);
}

.stat-box:nth-child(2) .stat-value {
    color: #FFCA5A;
    text-shadow: 0 0 20px rgba(255, 202, 90, 0.5);
}

/* Мины (красный) - справа */
.stat-box:nth-child(3) {
    border-color: rgba(220, 53, 69, 0.3);
}

.stat-box:nth-child(3) .stat-value {
    color: var(--danger-color);
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

.stat-box:nth-child(3)::before {
    background: linear-gradient(135deg,
        rgba(220, 53, 69, 0.4) 0%,
        rgba(220, 53, 69, 0.1) 50%,
        rgba(220, 53, 69, 0.4) 100%);
}

/* Специальное оформление для блока "Мины" */
.mines-count-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mines-count-box .mines-value {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stat-value .star-icon {
    width: 20px;
    height: 20px;
    margin-left: 0;
}

/* Wrapper для поля и множителей (единый блок) */
.mines-board-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    background: var(--primary-color);
    border-radius: 16px;
    border: 1px solid rgba(255, 202, 90, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.mines-board-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 202, 90, 0.05) 0%, transparent 70%);
    animation: rotateBg 15s linear infinite;
    pointer-events: none;
}

/* Игровое поле 5x5 */
.minesweeper-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 12px;
    border-radius: 16px 16px 0 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Ячейка */
.mines-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: 2px solid #4a5568;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mines-cell::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 202, 90, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.mines-cell:hover::before {
    transform: translateX(100%);
}

.mines-cell:hover:not(.revealed) {
    transform: scale(1.05) translateY(-2px);
    border-color: #FFCA5A;
    box-shadow: 0 0 20px rgba(255, 202, 90, 0.4);
}

.mines-cell:active:not(.revealed) {
    transform: scale(0.98);
}

.cell-icon {
    font-size: 36px;
    animation: iconPop 0.3s ease-out;
}

.cell-gift-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: iconPop 0.3s ease-out, giftGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

@keyframes giftGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9));
    }
}

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

/* Открытая ячейка с алмазом */
.mines-cell.revealed.diamond {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    border-color: #34d399;
    animation: revealSuccess 0.5s ease-out;
}

/* Открытая ячейка с подарком */
.mines-cell.revealed.gift {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #fcd34d;
    animation: revealGift 0.5s ease-out;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

@keyframes revealGift {
    0% {
        transform: scale(0.8) rotateY(0deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(360deg);
        opacity: 1;
    }
}

/* Открытая ячейка с миной */
.mines-cell.revealed.mine {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    border-color: #f87171;
    animation: revealMine 0.5s ease-out;
}

@keyframes revealSuccess {
    0% {
        transform: scale(0.8) rotateY(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotateY(180deg);
    }
    100% {
        transform: scale(1) rotateY(360deg);
        opacity: 1;
    }
}

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

/* Панель управления */
.mines-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-label {
    font-size: 14px;
    color: #888;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

/* Выбор количества мин */
.mines-selector {
    background: var(--primary-color);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 202, 90, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mines-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mines-count-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--text-color);
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mines-count-btn::before {
    content: '💣';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
}

.mines-count-btn:hover:not(:disabled) {
    border-color: #FFCA5A;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 202, 90, 0.4);
}

.mines-count-btn:hover:not(:disabled)::before {
    top: 5px;
    opacity: 0.3;
}

.mines-count-btn.active {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 24px rgba(40, 167, 69, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: pulseGlow 2s ease-in-out infinite;
}

.mines-count-btn.active::before {
    content: '💣';
    top: 5px;
    opacity: 1;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 24px rgba(40, 167, 69, 0.6),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 6px 32px rgba(40, 167, 69, 0.8),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

.mines-count-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Секция ставки */
.bet-section {
    background: var(--primary-color);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 202, 90, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.bet-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 202, 90, 0.05) 0%, transparent 70%);
    animation: rotateBg 15s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bet-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    gap: 12px;
}

.bet-label {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bet-currency-icon {
    font-size: 24px;
    animation: starPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 202, 90, 0.6));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bet-currency-icon .star-icon {
    width: 24px;
    height: 24px;
    margin-left: 0;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(255, 202, 90, 0.6));
    }
    50% {
        transform: scale(1.15) rotate(180deg);
        filter: drop-shadow(0 0 12px rgba(255, 202, 90, 0.9));
    }
}

/* Контейнер ввода ставки */
.bet-input-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.bet-input-wrapper {
    max-width: 280px;
    width: 100%;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--primary-color) 100%);
    border: 3px solid var(--secondary-color);
    border-radius: 18px;
    padding: 6px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.8),
                0 4px 15px rgba(0, 0, 0, 0.4),
                0 0 0 0 rgba(255, 202, 90, 0);
    position: relative;
    overflow: hidden;
}

.bet-input-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 202, 90, 0.15), transparent);
    transition: left 0.6s ease;
}

.bet-input-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(255, 202, 90, 0.6));
    animation: starFloat 3s ease-in-out infinite;
}

@keyframes starFloat {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.15);
    }
}

.bet-input-wrapper:focus-within::before {
    left: 100%;
}

.bet-input-wrapper:focus-within {
    border-color: #FFCA5A;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.8),
                0 4px 15px rgba(0, 0, 0, 0.4),
                0 0 0 4px rgba(255, 202, 90, 0.2),
                0 0 25px rgba(255, 202, 90, 0.3);
    transform: translateY(-2px);
}

.bet-input-wrapper:focus-within::after {
    animation: starPulseFocus 0.8s ease-in-out infinite;
}

@keyframes starPulseFocus {
    0%, 100% {
        transform: translateY(-50%) scale(1) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(255, 202, 90, 0.6));
    }
    50% {
        transform: translateY(-50%) scale(1.25) rotate(180deg);
        filter: drop-shadow(0 0 15px rgba(255, 202, 90, 1));
    }
}

.bet-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #FFCA5A;
    font-size: 36px;
    font-weight: 900;
    padding: 14px 50px 14px 50px;
    outline: none;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 202, 90, 0.5),
                 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
}

.bet-input:disabled {
    opacity: 0.5;
}

/* Скрыть стрелки в number input */
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bet-input[type=number] {
    -moz-appearance: textfield;
}

/* Быстрый выбор */
.quick-bet-section {
    position: relative;
    z-index: 1;
}

.quick-bet-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

.quick-bet-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.quick-bet-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--text-color);
    border: 2px solid #374151;
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.quick-bet-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: all 0.4s ease;
}

.quick-bet-btn:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.2;
}

.quick-bet-btn:hover {
    border-color: #FFCA5A;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 202, 90, 0.4);
    background: linear-gradient(135deg, #374151 0%, var(--secondary-color) 100%);
}

.quick-bet-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(255, 202, 90, 0.3);
}

/* Кнопки действий */
.mines-action-btn {
    width: 100%;
    border: none;
    border-radius: 20px;
    padding: 20px;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.mines-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.mines-action-btn:active:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

.mines-action-btn.primary {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    color: white;
    box-shadow: 0 6px 24px rgba(40, 167, 69, 0.5),
                0 0 40px rgba(40, 167, 69, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(40, 167, 69, 0.5);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 6px 24px rgba(40, 167, 69, 0.5),
                    0 0 40px rgba(40, 167, 69, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(40, 167, 69, 0.7),
                    0 0 60px rgba(40, 167, 69, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* Убрали эмодзи бриллианта */

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
}

.mines-action-btn.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    color: white;
    box-shadow: 0 6px 24px rgba(40, 167, 69, 0.5),
                0 0 40px rgba(40, 167, 69, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(40, 167, 69, 0.5);
}

/* Убрали эмодзи мешка с деньгами */

.mines-action-btn .star-icon {
    width: 20px;
    height: 20px;
    margin-left: 4px;
}

.mines-action-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    filter: brightness(1.1);
}

.mines-action-btn.primary:hover:not(:disabled) {
    box-shadow: 0 10px 40px rgba(40, 167, 69, 0.7),
                0 0 60px rgba(40, 167, 69, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mines-action-btn.success:hover:not(:disabled) {
    box-shadow: 0 10px 40px rgba(40, 167, 69, 0.7),
                0 0 60px rgba(40, 167, 69, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mines-action-btn:active:not(:disabled) {
    transform: translateY(-2px) scale(0.98);
}

.mines-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
    filter: grayscale(0.5);
}

/* Модальное окно результата */
.mines-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.mines-modal.show {
    display: flex;
}

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

.mines-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: overlayFade 0.3s ease-out;
}

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

.mines-modal-content {
    position: relative;
    background: var(--primary-color);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 2px solid rgba(255, 202, 90, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.mines-modal-icon {
    font-size: 120px;
    margin-bottom: 20px;
    animation: iconBounce 0.8s ease-out 0.3s;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mines-modal-title {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #FFCA5A 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 0.6s ease-out 0.5s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.mines-modal-amount {
    font-size: 48px;
    font-weight: 900;
    color: #FFCA5A;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: amountCount 0.8s ease-out 0.7s backwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mines-modal-amount .star-icon {
    width: 36px;
    height: 36px;
    margin-left: 0;
}

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

.mines-modal-multiplier {
    font-size: 24px;
    color: #888;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out 0.9s backwards;
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mines-modal-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
    animation: fadeInUp 0.6s ease-out 1.1s backwards;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mines-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(40, 167, 69, 0.6);
}

.mines-modal-btn:active {
    transform: translateY(-1px);
}

/* Вариации для проигрыша */
.mines-modal.loss .mines-modal-content {
    border-color: rgba(220, 53, 69, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mines-modal.loss .mines-modal-icon {
    animation: iconExplode 0.8s ease-out 0.3s;
}

@keyframes iconExplode {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1.5) rotate(20deg);
    }
    60% {
        transform: scale(0.8) rotate(-20deg);
    }
    80% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mines-modal.loss .mines-modal-title {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mines-modal.loss .mines-modal-amount {
    color: var(--danger-color);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Вариация для недостаточно средств */
.mines-modal.insufficient .mines-modal-content {
    border-color: rgba(255, 202, 90, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mines-modal.insufficient .mines-modal-icon {
    animation: iconShake 0.8s ease-out 0.3s;
}

@keyframes iconShake {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        transform: scale(1.2) rotate(-10deg);
    }
    20% {
        transform: scale(1.2) rotate(10deg);
    }
    30% {
        transform: scale(1.2) rotate(-10deg);
    }
    40% {
        transform: scale(1.2) rotate(10deg);
    }
    50% {
        transform: scale(1.2) rotate(-5deg);
    }
    60% {
        transform: scale(1.2) rotate(5deg);
    }
    70% {
        transform: scale(1.1) rotate(-3deg);
    }
    80% {
        transform: scale(1.1) rotate(3deg);
    }
    90% {
        transform: scale(1) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mines-modal.insufficient .mines-modal-title {
    background: linear-gradient(135deg, #FFCA5A 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insufficient-message {
    margin: 20px 0 30px;
}

.insufficient-details {
    background: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 16px;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out 0.7s backwards;
}

.insufficient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.insufficient-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.insufficient-label {
    font-size: 16px;
    color: #888;
    font-weight: 600;
}

.insufficient-value {
    font-size: 24px;
    font-weight: 900;
    color: #FFCA5A;
    text-shadow: 0 0 20px rgba(255, 202, 90, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.insufficient-value .star-icon {
    width: 20px;
    height: 20px;
    margin-left: 0;
}

.insufficient-value.balance {
    color: var(--danger-color);
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

/* Частицы (опционально) */
.mines-modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 202, 90, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: particles 20s linear infinite;
    pointer-events: none;
}

@keyframes particles {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Индикаторы множителей */
.multipliers-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid rgba(255, 202, 90, 0.1);
    width: 100%;
    position: relative;
    z-index: 1;
}

.multiplier-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: 2px solid #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-color);
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.multiplier-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 202, 90, 0.15),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.multiplier-circle:hover::before {
    transform: translateX(100%);
}

.multiplier-circle:hover {
    transform: scale(1.15) translateY(-2px);
    border-color: #FFCA5A;
    box-shadow: 0 0 20px rgba(255, 202, 90, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.4);
}

.multiplier-circle.active {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
    border-color: #34d399;
    color: #fff;
    box-shadow: 0 0 25px rgba(40, 167, 69, 0.6),
                0 4px 12px rgba(0, 0, 0, 0.4);
    animation: multiplierPulse 2s ease-in-out infinite;
}

.multiplier-circle.active::before {
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
}

@keyframes multiplierPulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(40, 167, 69, 0.6),
                    0 4px 12px rgba(0, 0, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 35px rgba(40, 167, 69, 0.9),
                    0 6px 16px rgba(0, 0, 0, 0.5);
        transform: scale(1.1);
    }
}

.multiplier-circle.highlighted {
    background: linear-gradient(135deg, #FFCA5A 0%, #FFA500 100%);
    border-color: #FFCA5A;
    color: #000;
    box-shadow: 0 0 30px rgba(255, 202, 90, 0.8),
                0 4px 12px rgba(0, 0, 0, 0.4);
    animation: multiplierGlow 1.5s ease-in-out infinite;
}

@keyframes multiplierGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 202, 90, 0.8),
                    0 4px 12px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 202, 90, 1),
                    0 6px 16px rgba(0, 0, 0, 0.5);
    }
}

/* Адаптивность */
@media (max-width: 500px) {
    .mines-container {
        padding: 15px;
    }

    .minesweeper-board {
        gap: 6px;
        padding: 10px;
    }

    .cell-icon {
        font-size: 28px;
    }

    .cell-gift-image {
        width: 40px;
        height: 40px;
    }

    .stat-box {
        padding: 14px 10px;
    }

    .stat-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 20px;
    }

    .mines-buttons {
        gap: 6px;
    }

    .mines-count-btn {
        padding: 8px 14px;
        font-size: 14px;
        min-width: 45px;
    }

    .quick-bet-buttons {
        gap: 6px;
    }

    .quick-bet-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Поле ввода ставки на мобильных */
    .bet-input-wrapper {
        max-width: 240px;
    }

    .bet-input {
        font-size: 32px;
        padding: 12px 45px 12px 12px;
    }

    .bet-input-wrapper::after {
        width: 20px;
        height: 20px;
        right: 12px;
    }

    /* Модальное окно на мобильных */
    .mines-modal-content {
        padding: 30px 20px;
        width: 85%;
    }

    .mines-modal-icon {
        font-size: 100px;
    }

    .mines-modal-title {
        font-size: 28px;
    }

    .mines-modal-amount {
        font-size: 40px;
    }

    .mines-modal-multiplier {
        font-size: 20px;
    }

    .mines-modal-btn {
        font-size: 18px;
        padding: 16px;
    }

    /* Модальное окно недостаточно средств на мобильных */
    .insufficient-label {
        font-size: 14px;
    }

    .insufficient-value {
        font-size: 20px;
    }

    .insufficient-details {
        padding: 16px;
    }

    /* Кнопки действий на мобильных */
    .mines-action-btn {
        padding: 18px;
        font-size: 18px;
        letter-spacing: 1px;
    }

    .mines-action-btn.primary::after,
    .mines-action-btn.success::after {
        right: 20px;
        font-size: 20px;
    }

    /* Индикаторы множителей на мобильных */
    .multipliers-display {
        gap: 6px;
        padding: 10px;
    }

    .multiplier-circle {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .mines-stats {
        grid-template-columns: 1fr;
    }

    .minesweeper-board {
        gap: 4px;
        padding: 8px;
    }

    .cell-icon {
        font-size: 24px;
    }

    .cell-gift-image {
        width: 35px;
        height: 35px;
    }

    /* Индикаторы множителей на маленьких экранах */
    .multipliers-display {
        gap: 4px;
        padding: 8px;
    }

    .multiplier-circle {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
}

/* ==================== GIFT BETTING STYLES ==================== */

/* Стили для выбора валюты */
.currency-selector {
    margin-bottom: 16px;
}

.currency-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.currency-type-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.currency-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Стили для списка подарков */
.gifts-selector {
    margin-bottom: 16px;
}

.gifts-selector.hidden {
    display: none;
}

.gifts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.gift-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.gift-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.gift-emoji {
    font-size: 24px;
}

.gift-name {
    flex: 1;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.gift-price {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 14px;
}

.no-gifts {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ==================== GIFT MODE TOGGLE (400+) ==================== */

/* Красивый переключатель "Подарок при 400+" */
.gift-mode-container {
    background: var(--primary-color);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 202, 90, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gift-mode-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.gift-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.gift-mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.gift-mode-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gift-mode-switch input:checked + .gift-mode-slider {
    background: linear-gradient(135deg, #28a745, #218838);
    border-color: #28a745;
}

.gift-mode-switch input:checked + .gift-mode-slider:before {
    transform: translateX(20px);
}

.gift-mode-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    user-select: none;
}

.gift-mode-switch input:checked ~ .gift-mode-label {
    color: rgba(255, 255, 255, 0.95);
}
