@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

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

body, html {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: url('background.jpg') no-repeat center center fixed; 
    background-size: cover;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 500px;
}

h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

#username-form {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#username-input {
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #3498db;
    border-radius: 25px 0 0 25px;
    width: 70%;
    outline: none;
}

#start-quiz-btn {
    padding: 12px 20px;
    font-size: 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-quiz-btn:hover {
    background-color: #2980b9;
}

#user-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
    background-color: #f1f8ff;
    padding: 10px 15px;
    border-radius: 15px;
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.timer-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #e74c3c;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#timer {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

#question-container {
    margin-bottom: 20px;
}

.question h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.question button {
    width: 100%;
    padding: 15px;
    margin-bottom: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question button.selected {
    background-color: #2ecc71;
    font-weight: bold;
}

#submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#submit-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#progress-bar {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

#progress {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease-in-out;
}

#set-info {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

#leaderboard {
    margin-top: 30px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#leaderboard h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

#leaderboard-list {
    list-style-type: none;
    padding: 0;
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

#leaderboard-list li:last-child {
    border-bottom: none;
}

.rank {
    font-weight: bold;
    color: #e74c3c;
}

#score-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.popup-content h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.popup-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #34495e;
}

.popup-content button {
    padding: 12px 25px;
    font-size: 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-content button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    #username-input, #start-quiz-btn {
        font-size: 0.9rem;
    }

    .question h2 {
        font-size: 1.1rem;
    }

    .question button, #submit-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

#leaderboard-trigger {
    cursor: pointer;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s;
}

#leaderboard-trigger:hover {
    background-color: #e9ecef;
}

#product-page-button {
    cursor: pointer;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s;
}

#product-page-button:hover {
    background-color: #e9ecef;
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    width: 400px;
    max-height: 80%;
    overflow-y: auto;
}

#close-leaderboard {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#close-leaderboard:hover {
    background-color: #2980b9;
}
#score-popup button {
    margin: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#score-popup button:nth-child(2) {
    background-color: #25D366;
    color: white;
}

#score-popup button:nth-child(2):hover {
    background-color: #128C7E;
}

#telegram-link {
    text-align: center;
    margin-top: 20px;
}

#telegram-link a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0088cc; /* Telegram's brand color */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#telegram-link a:hover {
    background-color: #006699;
}