/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

/* Login Page Styles */
.container {
    max-width: 500px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

/* Login Title */
.container h1 {
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #2c3e50;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Login Button */
#loginButton {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#loginButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

#loginButton:active {
    transform: translateY(0);
}

#loginButton::before {
    content: "🔐";
    margin-right: 10px;
    font-size: 1.2em;
}

/* Game Info Section */
.game-info {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Loading State */
#loginButton.loading {
    background: #bdc3c7;
    pointer-events: none;
}

#loginButton.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Login Page */
@media (max-width: 480px) {
    .container {
        margin: 20px;
        padding: 30px 20px;
    }

    .container h1 {
        font-size: 1.8em;
    }

    #loginButton {
        padding: 12px 25px;
        font-size: 1em;
    }
}


/* Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 24px;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
}

.game-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Game Panel */
.game-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.status-item {
    text-align: center;
}

.status-label {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.status-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

/* Game Play Area */
.game-play-area {
    text-align: center;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.guess-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.guess-input:focus {
    border-color: #3498db;
    outline: none;
}

.game-message {
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    margin-top: 20px;
}

/* Leaderboard */
.leaderboard-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leaderboard-container {
    margin: 0;
    padding: 0;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.leaderboard-table th {
    padding: 15px;
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
    text-align: left;
}

.leaderboard-table td {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #f1f1f1;
}

.top-score {
    background: linear-gradient(45deg, #fff9c4, #fff59d) !important;
}

.second-score td {
    background: #fafafa;
}

.third-score td {
    background: #f5f5f5;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-outline {
    border: 2px solid #3498db;
    color: #3498db;
    background: transparent;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.btn-submit {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-section {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .game-status {
        flex-direction: column;
        gap: 15px;
    }

    .input-group {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-panel, .leaderboard-section {
    animation: fadeIn 0.5s ease-out;
}

/* Game Message Styles */
.game-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.game-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.game-message.info {
    background: #cce5ff;
    color: #004085;
    border-left: 4px solid #0d6efd;
}

/* Medal Icons */
.rank-1::before {
    content: "🥇";
    margin-right: 8px;
}

.rank-2::before {
    content: "🥈";
    margin-right: 8px;
}

.rank-3::before {
    content: "🥉";
    margin-right: 8px;
}
