* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 20px;
    overflow: hidden;
}

/* Экран загрузки */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f2027, #203a43);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.loading-screen h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #00b4db;
    text-align: center;
}

.loading-bar-container {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #00b09b, #96c93d);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Основной контейнер */
.container {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.container.show {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    margin-bottom: 20px;
    font-size: 2.2rem;
    font-weight: 600;
    background: linear-gradient(to right, #00b4db, #0083b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.country-name {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: white;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Таймер */
.top-timer {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.top-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 1s linear;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: 0;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 auto 20px;
    max-width: 400px;
}

.options-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.flag-option {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 120px;
    width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.flag-option img {
    max-height: 100%;
    max-width: 100%;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
}

.flag-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.flag-option:hover img {
    transform: scale(1.05);
}

.flag-option.correct {
    background: linear-gradient(135deg, #56ab2f, #a8e063);
    border-color: rgba(86, 171, 47, 0.5);
    box-shadow: 0 4px 8px rgba(86, 171, 47, 0.3);
}

.flag-option.wrong {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    border-color: rgba(255, 65, 108, 0.5);
    box-shadow: 0 4px 8px rgba(255, 75, 43, 0.3);
}

.stats {
    display: flex;
    justify-content: space-between;
    margin: 0 auto 20px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
}

.pause-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
    color: white;
    backdrop-filter: blur(5px);
    position: absolute;
    top: 20px;
    right: 20px;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

.pause-menu.show {
    opacity: 1;
    pointer-events: all;
}

.pause-menu button {
    background: linear-gradient(to right, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin: 10px 0;
    width: 200px;
    text-align: center;
}

.pause-menu button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border-radius: 25px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    backdrop-filter: blur(5px);
    text-align: center;
}

.game-over.show {
    opacity: 1;
    pointer-events: all;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, #ff8a00, #da1b60);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-over p {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.restart-btn {
    background: linear-gradient(to right, #ff8a00, #da1b60);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(218, 27, 96, 0.3);
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(218, 27, 96, 0.4);
}

.high-score {
    margin-top: 15px;
    font-size: 1.3rem;
    color: #FFD700;
    font-weight: 600;
}

@media (max-width: 500px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .country-name {
        font-size: 1.5rem;
        min-height: 50px;
    }
    
    .flag-option {
        height: 100px;
        width: 130px;
    }
    
    .game-over h2 {
        font-size: 1.8rem;
    }
}