body {
    font-family: 'Segoe UI' !important;
    direction: rtl !important;
    background: var(--gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    overflow: hidden;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.game-container {
    width: 100%;
    min-width: 360px;
    max-width: 450px;
    height: 100%;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media (min-width: 451px) {
    body {
        padding: 20px;
    }
    
    .game-container {
        width: 450px;
    }
}

.header {
    background: var(--gradient);
    padding: clamp(20px, 5vw, 25px) clamp(15px, 4vw, 25px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(10px, 3vw, 15px);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    filter: blur(30px);
}

.header h1 {
    flex: 1;
    font-size: clamp(18px, 5vw, 24px);
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 2lh;
}

.header h1 span {
    display: block;
    margin-top: 6px;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 400;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(15px, 4vw, 20px);
    padding-bottom: clamp(10px, 3vw, 15px);
    border-bottom: 2px solid #e2e8f0;
}

.modal-header h2 {
    font-size: clamp(20px, 5vw, 24px);
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: clamp(42px, 10vw, 50px);
    height: clamp(42px, 10vw, 50px);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
    font-size: clamp(20px, 5vw, 24px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: clamp(15px, 4vw, 20px);
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: clamp(15px, 4vw, 20px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: clamp(15px, 4vw, 20px);
    padding: clamp(20px, 5vw, 30px);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close-btn {
    width: clamp(30px, 8vw, 35px);
    height: clamp(30px, 8vw, 35px);
    border-radius: 50%;
    background: #e2e8f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 5vw, 20px);
    color: #4a5568;
}

.theme-selector {
    background: #f7fafc;
    padding: clamp(14px, 3.5vw, 18px);
    border-radius: clamp(10px, 3vw, 15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2vw, 10px);
}

.theme-option {
    aspect-ratio: 1;
    border-radius: clamp(8px, 2vw, 10px);
    cursor: pointer;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.theme-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.theme-option::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--theme-gradient);
    color: rgba(61, 204, 64, 0.8);
}