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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #2d3748;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stars Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 0 0 100px white, 100px 100px white, 200px 50px white,
                300px 300px white, 400px 150px white, 500px 250px white,
                600px 350px white, 700px 100px white, 800px 450px white,
                900px 200px white, 1000px 300px white, 1100px 400px white;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Landing Page */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.logo-icon {
    font-size: 5rem;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.app-title {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.auth-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.features {
    display: flex;
    gap: 3rem;
}

.feature {
    text-align: center;
    color: white;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.feature i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Auth Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

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

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.navbar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
}

.language-switcher .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.language-switcher .btn-icon.active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.dashboard-content {
    padding: 3rem;
    text-align: center;
}

.welcome-text {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.activity-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.activity-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.activity-card:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.activity-card i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.activity-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.activity-card p {
    font-size: 1rem;
    opacity: 0.9;
}

.chat-card { background: linear-gradient(135deg, #56ccf2, #2f80ed); }
.games-card { background: linear-gradient(135deg, #f093fb, #f5576c); }
.quiz-card { background: linear-gradient(135deg, #4facfe, #00f2fe); }

/* Chat Popup */
.popup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.privacy-content {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding-right: 10px;
}

.privacy-content p {
    margin-bottom: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.privacy-content p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #fff;
}

.chat-popup-content h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-popup-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.chat-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.chat-popup.active {
    opacity: 1;
    pointer-events: auto;
}

.chat-popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 20px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.chat-popup.active .chat-popup-content {
    transform: translateY(0);
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.popup-image-container {
    width: 200px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-popup h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-popup p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Chat Page */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-header .back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 1rem;
    margin-right: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.chat-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.chat-header .back-btn i {
    margin-right: 8px;
}

.chat-header h2 {
    flex-grow: 1;
    text-align: center;
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.online-count {
    min-width: 100px;
    text-align: right;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.online-indicator {
    color: #4caf50;
    font-size: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f5f5f5;
}

.message {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.message-username {
    font-weight: 600;
    color: #667eea;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
}

.message-text {
    color: #333;
    line-height: 1.5;
}

.message-input-container {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#messageForm {
    display: flex;
    gap: 1rem;
}

#messageInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Settings Page */
.settings-container {
    min-height: 100vh;
    background: white;
}

.settings-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.settings-content {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: #f5f5f5;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 1.5rem;
}

.settings-item {
    padding: 1rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Placeholder Pages */
.placeholder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: white;
    text-align: center;
    padding: 2rem;
}

.placeholder-icon {
    font-size: 8rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-title {
        font-size: 3rem;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .activity-cards {
        grid-template-columns: 1fr;
    }
}

/* User Stats */
.user-stats {
    margin-bottom: 3rem;
}

.xp-display {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.xp-display i {
    color: gold;
    margin-right: 0.5rem;
}

/* Quiz Page */
.quiz-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    padding: 2rem;
}

.quiz-header {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-stats {
    display: flex;
    gap: 2rem;
    font-weight: 600;
}

.quiz-content {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-start {
    background: rgba(255, 255, 255, 0.95);
    padding: 4rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    margin: 0 auto;
}

.quiz-category-select {
    margin: 2rem 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-category-select label {
    display: block;
    margin-bottom: 0.75rem;
    color: #444;
    font-size: 1.1rem;
    font-weight: 600;
}

.quiz-category-select select {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23444%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.8em auto;
    cursor: pointer;
}

.quiz-category-select select:hover {
    border-color: #4dabf7;
}

.quiz-category-select select:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

.quiz-icon {
    font-size: 5rem;
    color: #4facfe;
    margin-bottom: 2rem;
}

.quiz-start h3 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.quiz-start p {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-category-select {
    margin: 2rem 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-category-select label {
    display: block;
    margin-bottom: 0.75rem;
    color: #444;
    font-size: 1.1rem;
    font-weight: 600;
}

.quiz-category-select select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65em auto;
    cursor: pointer;
}

.quiz-category-select select:hover {
    border-color: #c0c0c0;
}

.quiz-category-select select:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

/* Form control styles for consistency */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.quiz-question-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease;
}

.quiz-question {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    background: #f5f5f5;
    padding: 1.5rem;
    border-radius: 15px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: #333;
}

.quiz-option:hover {
    background: #e8e8e8;
    transform: translateX(10px);
}

.quiz-option.selected {
    border-color: #4facfe;
    background: #e8f4ff;
}

.quiz-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.quiz-option.wrong {
    border-color: #f44336;
    background: #ffebee;
}

.quiz-results {
    background: rgba(255, 255, 255, 0.95);
    padding: 4rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.quiz-results h3 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.final-score {
    font-size: 3rem;
    color: #4facfe;
    margin-bottom: 1rem;
    font-weight: 700;
}

.xp-earned {
    font-size: 1.5rem;
    color: gold;
    margin-bottom: 2rem;
}

.quiz-next-btn {
    margin-top: 2rem;
}

/* Games Page */
.game-container {
    padding: 2rem;
}

.game-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.beta-badge {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-left: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-logo-container {
    position: relative;
    width: 200px;
    height: 150px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}

.game-video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-logo-container:hover .game-logo {
    opacity: 0;
}

.game-logo-container:hover .game-video-preview {
    opacity: 1;
}

.game-iframe {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: #000;
}

@media (max-width: 1000px) {
    .game-iframe {
        width: 100%;
        height: 500px;
    }
}

@media (max-width: 600px) {
    .game-iframe {
        height: 400px;
    }
}

/* Game Preview */
.game-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.game-title {
    margin: 1.5rem 0;
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.quiz-question-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.quiz-progress {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: right;
}

.quiz-question {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.quiz-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-option {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.quiz-option.selected {
    border-color: #4dabf7;
    background: #e7f5ff;
}

.quiz-option.correct {
    background: #ebfbee;
    border-color: #40c057;
    color: #2b8a3e;
}

.quiz-option.incorrect {
    background: #fff5f5;
    border-color: #ff6b6b;
    color: #c92a2a;
}

.quiz-option .option-checkmark {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #40c057;
}

.quiz-option.correct .option-checkmark,
.quiz-option.incorrect .option-checkmark {
    opacity: 1;
}

.quiz-navigation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-next {
    background: linear-gradient(135deg, #4dabf7, #339af0);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0.7;
    pointer-events: none;
}

.quiz-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.3);
}

.quiz-next.active {
    opacity: 1;
    pointer-events: auto;
}

.quiz-next.loading .button-text {
    display: none;
}

.quiz-next.loading .button-icon {
    display: none;
}

.quiz-next.loading .button-loader {
    display: block;
}

.quiz-next .button-loader {
    display: none;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4dabf7;
    width: 0%;
    transition: width 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.play-btn {
    background: linear-gradient(135deg, #00c853, #2e7d32);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.play-btn i {
    margin-right: 10px;
}

/* Game Iframe Container */
.game-iframe-container {
    padding: 2rem;
}

/* Leaderboard styles */
#leaderboard {
    max-width: 800px;
    margin: 30px auto;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
}

#leaderboard h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#leaderboardList {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: leaderboard-counter;
}

#leaderboardList li {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#leaderboardList li::before {
    counter-increment: leaderboard-counter;
    content: counter(leaderboard-counter) ".";
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 30px;
    color: rgba(255, 255, 255, 0.8);
    margin-right: 15px;
}

/* Top 3 ranking highlights */
#leaderboardList li:nth-child(1) {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-left: 4px solid gold;
}

#leaderboardList li:nth-child(2) {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-left: 4px solid silver;
}

#leaderboardList li:nth-child(3) {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-left: 4px solid #cd7f32;
}

#leaderboardList li:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.15);
}

/* Show All Users button */
#showAllBtn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 25px auto 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

#showAllBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Games layout: two cards side-by-side at the top */
.games-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center; /* center under header */
    align-items: flex-start;
    gap: 32px;
    padding: 10px 20px 20px;
}

/* Ensure both game blocks share same card width */
#gamePreview,
.game {
    width: 320px;
    max-width: 90vw;
}

/* Center contents within each card */
#gamePreview,
.game .game-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center game titles for consistency */
.game-title { 
    text-align: center;
    line-height: 1.2;
    min-height: 4.8rem; /* 2 lines at 1.2 line-height with 2rem font-size */
}

/* subtle helper note */
.more-games-note {
    width: 100%;
    margin: 20px auto 0;
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    letter-spacing: .5px;
    font-size: 1rem;
}

/* Back button styling (inline within headers) */
.back-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Ensure back button in game header is not fixed */
.game-header .back-btn {
    position: static;
}

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