/* VPN Kovalenko Game */

/* Background particles animation */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: fly-out infinite linear;
    top: 50%;
    left: 50%;
    will-change: transform, opacity;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

@keyframes fly-out {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    98% {
        opacity: 0.3;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.8);
        opacity: 0;
    }
}

/* Individual particles with varied directions for full screen coverage */
.particle-1 {
    width: 4px;
    height: 4px;
    --dx: 0px;
    --dy: -650px;
    animation-duration: 7s;
    animation-delay: 0s;
}

.particle-2 {
    width: 5px;
    height: 5px;
    --dx: 550px;
    --dy: -400px;
    animation-duration: 8s;
    animation-delay: 1.5s;
    background: rgba(173, 216, 230, 0.5);
}

.particle-3 {
    width: 3px;
    height: 3px;
    --dx: -700px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 3s;
}

.particle-4 {
    width: 4px;
    height: 4px;
    --dx: 650px;
    --dy: 350px;
    animation-duration: 7.5s;
    animation-delay: 4.5s;
    background: rgba(255, 255, 255, 0.6);
}

.particle-5 {
    width: 3px;
    height: 3px;
    --dx: 0px;
    --dy: 650px;
    animation-duration: 8.5s;
    animation-delay: 6s;
}

.particle-6 {
    width: 5px;
    height: 5px;
    --dx: 700px;
    --dy: 0px;
    animation-duration: 7s;
    animation-delay: 0.8s;
    background: rgba(200, 230, 255, 0.5);
}

.particle-7 {
    width: 3px;
    height: 3px;
    --dx: -450px;
    --dy: 500px;
    animation-duration: 9s;
    animation-delay: 2.3s;
}

.particle-8 {
    width: 4px;
    height: 4px;
    --dx: 200px;
    --dy: -700px;
    animation-duration: 8s;
    animation-delay: 3.8s;
    background: rgba(255, 255, 255, 0.6);
}

.particle-9 {
    width: 3px;
    height: 3px;
    --dx: -650px;
    --dy: -200px;
    animation-duration: 7.5s;
    animation-delay: 5.3s;
}

.particle-10 {
    width: 5px;
    height: 5px;
    --dx: 300px;
    --dy: 600px;
    animation-duration: 8.5s;
    animation-delay: 6.8s;
    background: rgba(240, 248, 255, 0.5);
}

.particle-11 {
    width: 3px;
    height: 3px;
    --dx: -600px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 1.2s;
}

.particle-12 {
    width: 4px;
    height: 4px;
    --dx: 0px;
    --dy: -600px;
    animation-duration: 7s;
    animation-delay: 2.7s;
}

.particle-13 {
    width: 3px;
    height: 3px;
    --dx: 500px;
    --dy: 0px;
    animation-duration: 8s;
    animation-delay: 4.2s;
    background: rgba(255, 255, 255, 0.5);
}

.particle-14 {
    width: 5px;
    height: 5px;
    --dx: 0px;
    --dy: 700px;
    animation-duration: 7.5s;
    animation-delay: 5.7s;
}

.particle-15 {
    width: 3px;
    height: 3px;
    --dx: -550px;
    --dy: -100px;
    animation-duration: 8.5s;
    animation-delay: 7.2s;
}

.particle-16 {
    width: 4px;
    height: 4px;
    --dx: 450px;
    --dy: 550px;
    animation-duration: 9s;
    animation-delay: 0.4s;
    background: rgba(220, 240, 255, 0.5);
}

.particle-17 {
    width: 3px;
    height: 3px;
    --dx: -200px;
    --dy: -650px;
    animation-duration: 7s;
    animation-delay: 1.9s;
}

.particle-18 {
    width: 5px;
    height: 5px;
    --dx: 650px;
    --dy: -100px;
    animation-duration: 8s;
    animation-delay: 3.4s;
    background: rgba(255, 255, 255, 0.6);
}

.particle-19 {
    width: 3px;
    height: 3px;
    --dx: -100px;
    --dy: 650px;
    animation-duration: 7.5s;
    animation-delay: 4.9s;
}

.particle-20 {
    width: 4px;
    height: 4px;
    --dx: 200px;
    --dy: -550px;
    animation-duration: 8.5s;
    animation-delay: 6.4s;
}

/* Additional particles for density */
.particle-21 {
    width: 3px;
    height: 3px;
    --dx: -400px;
    --dy: 0px;
    animation-duration: 8s;
    animation-delay: 0.6s;
}

.particle-22 {
    width: 4px;
    height: 4px;
    --dx: 0px;
    --dy: 550px;
    animation-duration: 7.5s;
    animation-delay: 2.1s;
    background: rgba(200, 230, 255, 0.4);
}

.particle-23 {
    width: 3px;
    height: 3px;
    --dx: 400px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 3.6s;
}

.particle-24 {
    width: 5px;
    height: 5px;
    --dx: 0px;
    --dy: -500px;
    animation-duration: 8.5s;
    animation-delay: 5.1s;
    background: rgba(255, 255, 255, 0.5);
}

.particle-25 {
    width: 3px;
    height: 3px;
    --dx: -350px;
    --dy: 450px;
    animation-duration: 7s;
    animation-delay: 6.6s;
}

.particle-26 {
    width: 4px;
    height: 4px;
    --dx: 350px;
    --dy: -450px;
    animation-duration: 8s;
    animation-delay: 0.9s;
    background: rgba(240, 248, 255, 0.4);
}

.particle-27 {
    width: 3px;
    height: 3px;
    --dx: -250px;
    --dy: 0px;
    animation-duration: 7.5s;
    animation-delay: 2.4s;
}

.particle-28 {
    width: 4px;
    height: 4px;
    --dx: 250px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 3.9s;
}

.particle-29 {
    width: 3px;
    height: 3px;
    --dx: 0px;
    --dy: 450px;
    animation-duration: 8.5s;
    animation-delay: 5.4s;
    background: rgba(220, 240, 255, 0.4);
}

.particle-30 {
    width: 5px;
    height: 5px;
    --dx: 0px;
    --dy: -450px;
    animation-duration: 7.5s;
    animation-delay: 6.9s;
}

/* Additional particles 31-60 for doubled density */
.particle-31 {
    width: 3px;
    height: 3px;
    --dx: -500px;
    --dy: 0px;
    animation-duration: 8s;
    animation-delay: 0.3s;
}

.particle-32 {
    width: 4px;
    height: 4px;
    --dx: 0px;
    --dy: 500px;
    animation-duration: 7.5s;
    animation-delay: 1.8s;
    background: rgba(200, 230, 255, 0.4);
}

.particle-33 {
    width: 3px;
    height: 3px;
    --dx: 500px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 3.3s;
}

.particle-34 {
    width: 5px;
    height: 5px;
    --dx: 0px;
    --dy: -550px;
    animation-duration: 8.5s;
    animation-delay: 4.8s;
    background: rgba(255, 255, 255, 0.5);
}

.particle-35 {
    width: 3px;
    height: 3px;
    --dx: -450px;
    --dy: 350px;
    animation-duration: 7s;
    animation-delay: 6.3s;
}

.particle-36 {
    width: 4px;
    height: 4px;
    --dx: 450px;
    --dy: -350px;
    animation-duration: 8s;
    animation-delay: 7.8s;
    background: rgba(240, 248, 255, 0.4);
}

.particle-37 {
    width: 3px;
    height: 3px;
    --dx: -150px;
    --dy: 0px;
    animation-duration: 7.5s;
    animation-delay: 0.7s;
}

.particle-38 {
    width: 4px;
    height: 4px;
    --dx: 150px;
    --dy: 0px;
    animation-duration: 9s;
    animation-delay: 2.2s;
}

.particle-39 {
    width: 3px;
    height: 3px;
    --dx: 0px;
    --dy: 350px;
    animation-duration: 8.5s;
    animation-delay: 3.7s;
    background: rgba(220, 240, 255, 0.4);
}

.particle-40 {
    width: 5px;
    height: 5px;
    --dx: 0px;
    --dy: -350px;
    animation-duration: 7.5s;
    animation-delay: 5.2s;
}

.particle-41 {
    width: 3px;
    height: 3px;
    --dx: -480px;
    --dy: -450px;
    animation-duration: 8s;
    animation-delay: 1.4s;
}

.particle-42 {
    width: 4px;
    height: 4px;
    --dx: 550px;
    --dy: 520px;
    animation-duration: 7.5s;
    animation-delay: 1.9s;
    background: rgba(200, 230, 255, 0.5);
}

.particle-43 {
    width: 3px;
    height: 3px;
    --dx: -420px;
    --dy: 480px;
    animation-duration: 9s;
    animation-delay: 2.4s;
}

.particle-44 {
    width: 5px;
    height: 5px;
    --dx: 450px;
    --dy: -580px;
    animation-duration: 8.5s;
    animation-delay: 2.9s;
    background: rgba(255, 255, 255, 0.6);
}

.particle-45 {
    width: 3px;
    height: 3px;
    --dx: -580px;
    --dy: 350px;
    animation-duration: 7s;
    animation-delay: 3.4s;
}

.particle-46 {
    width: 4px;
    height: 4px;
    --dx: 420px;
    --dy: 550px;
    animation-duration: 8s;
    animation-delay: 0.3s;
    background: rgba(240, 248, 255, 0.4);
}

.particle-47 {
    width: 3px;
    height: 3px;
    --dx: -350px;
    --dy: -520px;
    animation-duration: 7.5s;
    animation-delay: 0.8s;
}

.particle-48 {
    width: 4px;
    height: 4px;
    --dx: 620px;
    --dy: -450px;
    animation-duration: 9s;
    animation-delay: 1.3s;
}

.particle-49 {
    width: 3px;
    height: 3px;
    --dx: -450px;
    --dy: 620px;
    animation-duration: 8.5s;
    animation-delay: 1.8s;
    background: rgba(220, 240, 255, 0.4);
}

.particle-50 {
    width: 5px;
    height: 5px;
    --dx: 380px;
    --dy: 480px;
    animation-duration: 7.5s;
    animation-delay: 2.3s;
}

.particle-51 {
    width: 3px;
    height: 3px;
    --dx: -520px;
    --dy: -420px;
    animation-duration: 8s;
    animation-delay: 2.8s;
}

.particle-52 {
    width: 4px;
    height: 4px;
    --dx: 580px;
    --dy: 450px;
    animation-duration: 7.5s;
    animation-delay: 3.3s;
    background: rgba(200, 230, 255, 0.5);
}

.particle-53 {
    width: 3px;
    height: 3px;
    --dx: -380px;
    --dy: 520px;
    animation-duration: 9s;
    animation-delay: 0.5s;
}

.particle-54 {
    width: 5px;
    height: 5px;
    --dx: 480px;
    --dy: -620px;
    animation-duration: 8.5s;
    animation-delay: 1.0s;
    background: rgba(255, 255, 255, 0.5);
}

.particle-55 {
    width: 3px;
    height: 3px;
    --dx: -650px;
    --dy: 420px;
    animation-duration: 7s;
    animation-delay: 1.5s;
}

.particle-56 {
    width: 4px;
    height: 4px;
    --dx: 350px;
    --dy: 680px;
    animation-duration: 8s;
    animation-delay: 2.0s;
    background: rgba(240, 248, 255, 0.4);
}

.particle-57 {
    width: 3px;
    height: 3px;
    --dx: -420px;
    --dy: -580px;
    animation-duration: 7.5s;
    animation-delay: 2.5s;
}

.particle-58 {
    width: 4px;
    height: 4px;
    --dx: 650px;
    --dy: -380px;
    animation-duration: 9s;
    animation-delay: 3.0s;
}

.particle-59 {
    width: 3px;
    height: 3px;
    --dx: -480px;
    --dy: 550px;
    animation-duration: 8.5s;
    animation-delay: 3.5s;
    background: rgba(220, 240, 255, 0.4);
}

.particle-60 {
    width: 5px;
    height: 5px;
    --dx: 420px;
    --dy: 520px;
    animation-duration: 7.5s;
    animation-delay: 0.7s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: radial-gradient(circle at center, #2B6CBE 0%, #1B457D 100%);
    color: var(--tg-theme-text-color, #ffffff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px;
    line-height: 1.4;
    overflow-x: hidden;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
}

.rules-screen,
.game-container {
    position: relative;
    /* background: rgba(255, 255, 255, 0.98); */
    border-radius: 16px;
    padding: 20px;
    /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); */
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #333;
}

/* Browser warning for non-Telegram users */
.browser-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.browser-warning-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    max-width: 350px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.browser-warning h2 {
    color: #ff3b30;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
}

.browser-warning p {
    color: #333;
    margin-bottom: 24px;
    line-height: 1.6;
}

.browser-warning .tg-link {
    background: #007aff;
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.header {
    margin-bottom: 5px;
    flex-shrink: 0;
}

.title,
.rules-title,
.game-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

.title {
    color: #333;
    background: linear-gradient(45deg, #007aff, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rules-title,
.game-title {
    color: #ffffff;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 800;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.game-title {
    font-size: 2.6rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 50%, #e6f3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.4),
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 16px;
    font-weight: 500;
}

.brand-subtitle {
    color: #ffffff;
    font-size: 0.85rem;
    margin-bottom: 16px;
    font-weight: 500;
    opacity: 0.8;
}

.rules-content {
    text-align: left;
    margin-bottom: 24px;
    flex: 1;
    overflow-y: auto;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 6px;
    flex-shrink: 0;
}

.info-item {
    background: #f8f9fa;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    flex: 1;
    min-width: 60px;
    text-align: center;
    border: 1px solid #e9ecef;
    line-height: 1.2;
}

.info-item .label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 2px;
}

.info-item .value {
    display: block;
    font-size: 0.85rem;
    color: #007aff;
    font-weight: 700;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    flex: 1;
    align-content: center;
    padding: 0 8px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.cell {
    aspect-ratio: 1;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    min-height: 60px;
    min-width: 60px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.cell:focus {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

/* Flip animation */
.cell.flipping {
    animation: flipCell 0.6s ease-in-out;
}

.cell.selected {
    border-color: #007aff;
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    background: #f8f9fa;
}

.cell.revealed {
    border-color: #28a745;
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    background: #f8f9fa;
}

.cell.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.cell.moving {
    transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
}

.cell.shuffling {
    z-index: 100;
    transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

@keyframes flipCell {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: 16px;
    padding-bottom: 8px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.hint-btn {
    background: #ffc107;
    color: #212529;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    min-width: 160px;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.hint-btn.disabled {
    background: #6c757d;
    color: #ffffff;
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: #007aff;
    color: #ffffff;
    min-width: 140px;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-primary {
    background: #007aff;
    color: #ffffff;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #ff3b30;
    padding: 16px 32px;
    border: 2px solid #ff3b30;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    width: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #ff3b30;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.3);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: #ffffff;
    padding: 40px 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 350px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    text-align: -webkit-center;
}

.modal-actions .btn-primary {
    background: #007aff;
    color: #ffffff;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.modal-actions .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.modal-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.modal h2 {
    margin-bottom: 20px;
    font-size: 1.6rem;
    color: #333;
    font-weight: 700;
}

.contact-instruction {
    margin-top: 16px;
    font-size: 1rem;
    color: #007aff;
    font-weight: 600;
    background: rgba(0, 122, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.contact-instruction.hidden {
    display: none;
}

/* .modal.win h2 {
    background: linear-gradient(45deg, #4ecdc4, #26a69a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
} */

.modal.lose h2 {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal.no-subscription h2 {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prize-display {
    margin-bottom: 20px;
}

.prize-icon {
    font-size: 4rem;
    margin-bottom: 0px;
    display: block;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
}

.rules-list {
    list-style: none;
    padding: 0;
}

.rules-list li {
    background: #f8f9fa;
    margin: 12px 0;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #007aff;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rules-list li strong {
    color: #333;
    font-weight: 700;
}

.prizes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prizes-list li {
    background: #f8f9fa;
    margin: 8px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.prizes-list .prize-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stats-section {
    margin-top: 32px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.stats-section h4 {
    color: #666;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #007aff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.start-game-btn {
    background: #28a745;
    color: #ffffff;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    min-height: 56px;
    margin-top: auto;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.brand-footer {
    margin-top: auto;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.brand-footer p {
    color: #ffffff;
    font-size: 0.75rem;
    margin: 2px 0;
    font-weight: 400;
}

.brand-footer p:first-child {
    font-weight: 600;
}

.tg-main-button-active .start-game-btn {
    display: none;
}

.notification {
    position: fixed;
    top: 130px;
    left: 20px;
    right: 20px;
    background: #007aff;
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 1001;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification.success {
    background: #28a745;
}

.notification.warning {
    background: #dc3545;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.notification.info {
    background: linear-gradient(45deg, #ffa726, #ff9800);
    box-shadow: 0 8px 25px rgba(255, 167, 38, 0.3);
}

.hidden {
    display: none;
}

.hint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    border-radius: 16px;
    z-index: 2;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #2B6CBE 0%, #1B457D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-container {
    text-align: center;
    color: white;
}

.loader-logo {
    margin-bottom: 40px;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.logo-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

.loader-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 20px auto;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.1s;
    opacity: 0.7;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.2s;
    opacity: 0.4;
}

.loader-text {
    font-size: 0.9rem;
    margin-top: 20px;
    opacity: 0.8;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Специальные стили для модального окна предупреждения о подсказке */
.modal.hint-warning .modal-content {
    max-width: 320px;
    padding: 32px 24px;
}

.modal.hint-warning h2 {
    color: #ff9500;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.modal.hint-warning p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal.hint-warning .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.modal.hint-warning .btn-secondary {
    background: rgba(255, 149, 0, 0.1);
    color: #ff9500;
    border: 2px solid #ff9500;
    padding: 12px 20px;
    font-size: 0.95rem;
    margin-top: 0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.modal.hint-warning .btn-secondary:hover {
    background: #ff9500;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.modal.hint-warning .btn-primary {
    background: #007aff;
    color: #ffffff;
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    max-width: none;
    width: 100%;
}

.modal.hint-warning .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.modal.hint-warning .prize-icon {
    font-size: 3rem;
    color: #ff9500;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 6px;
    }
    
    .game-container,
    .rules-screen {
        padding: 20px;
        margin: 0px;
        border-radius: 20px;
        max-width: 100%;
    }
    
    .title,
    .rules-title,
    .game-title {
        font-size: 2.6rem;
    }
    
    .game-board {
        gap: 8px;
        padding: 0 4px;
    }
    
    .cell {
        font-size: 2.4rem;
        border-radius: 12px;
        min-height: 60px;
        min-width: 60px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .btn,
    .hint-btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .game-info {
        flex-direction: row;
        gap: 6px;
    }

    .info-item {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: 55px;
    }
    
    .rules-list li {
        padding: 14px;
        font-size: 0.9rem;
        margin: 10px 0;
    }
    
    .prizes-list li {
        font-size: 0.9rem;
        margin: 8px 0;
        padding: 12px 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 10px 8px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 32px 24px;
        max-width: 320px;
    }
}

@media (max-height: 600px) {
    .game-container,
    .rules-screen {
        margin-top: 8px;
    }
    
    .header {
        margin-bottom: 0px;
    }
    
    .game-info {
        margin-bottom: 16px;
    }
    
    .game-board {
        margin-bottom: 16px;
    }
    
    .stats-section {
        margin-top: 20px;
        padding: 16px;
    }
}

@media (max-width: 360px) {
    .info-item {
        font-size: 0.7rem;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .cell {
        min-height: 50px;
        min-width: 50px;
        font-size: 1.6rem;
    }
    
    .title,
    .rules-title,
    .game-title {
        font-size: 1.3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .cell,
    .btn,
    .hint-btn,
    .start-game-btn {
        border-width: 1px;
    }
}

.tg-viewport {
    height: 100vh;
    overflow: hidden;
}

.game-board,
.game-controls,
.game-info {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, select, textarea {
    font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}