/* Basic Setup - New Spelling Bee Theme Colors */
:root {
    --bg-color: #f7f3e8; /* Very light yellow/cream */
    --primary-color: #ffc107; /* Vibrant Yellow/Gold (Bee color) */
    --secondary-color: #007bff; /* Deep Blue (Contrast color) */
    --correct-color: #28a745; /* Green */
    --wrong-color: #dc3545; /* Red */
    --card-bg: #ffffff;
    --text-color: #333;
    --shadow: 0 8px 30px rgba(0,0,0,0.1); /* Deeper shadow */
}

/* Background Fix and Theme Implementation */
body {
    font-family: 'Mulish', sans-serif;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;

    /* Spelling Bee Theme: Fun letters and baby bees background */
    background-color: var(--bg-color);
    background-image: 
        /* Baby bees scattered around */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ctext x='10' y='30' font-size='24' opacity='0.15'%3E🐝%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ctext x='10' y='30' font-size='20' opacity='0.12'%3E🐝%3C/text%3E%3C/svg%3E"),
        /* Fun letters A-Z scattered */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='28' fill='%23ffc107' opacity='0.1' transform='rotate(15 25 25)'%3EA%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='24' fill='%2348dbfb' opacity='0.1' transform='rotate(-10 25 25)'%3EB%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='26' fill='%23ff6b6b' opacity='0.1' transform='rotate(20 25 25)'%3EC%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='22' fill='%2354a0ff' opacity='0.1' transform='rotate(-15 25 25)'%3EZ%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='25' fill='%23feca57' opacity='0.1' transform='rotate(12 25 25)'%3ES%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ctext x='15' y='40' font-family='Comic Sans MS' font-size='23' fill='%23ff9ff3' opacity='0.1' transform='rotate(-8 25 25)'%3EP%3C/text%3E%3C/svg%3E"),
        /* Honeycomb pattern overlay */
        repeating-linear-gradient(
            -45deg,
            rgba(255, 193, 7, 0.03),
            rgba(255, 193, 7, 0.03) 15px,
            transparent 15px,
            transparent 30px
        ),
        repeating-linear-gradient(
            45deg,
            rgba(0, 123, 255, 0.02),
            rgba(0, 123, 255, 0.02) 15px,
            transparent 15px,
            transparent 30px
        );
    background-position: 
        20px 30px,
        150px 200px,
        50px 80px,
        200px 150px,
        300px 50px,
        100px 250px,
        250px 120px,
        180px 300px,
        0 0,
        0 0;
    background-size: 
        100px 100px,
        100px 100px,
        80px 80px,
        80px 80px,
        80px 80px,
        80px 80px,
        80px 80px,
        80px 80px,
        auto,
        auto;
    background-repeat: repeat;
    animation: floatBackground 60s linear infinite;
}

@keyframes floatBackground {
    0% {
        background-position: 
            20px 30px,
            150px 200px,
            50px 80px,
            200px 150px,
            300px 50px,
            100px 250px,
            250px 120px,
            180px 300px,
            0 0,
            0 0;
    }
    100% {
        background-position: 
            20px 130px,
            150px 300px,
            50px 180px,
            200px 250px,
            300px 150px,
            100px 350px,
            250px 220px,
            180px 400px,
            0 0,
            0 0;
    }
}

/* Authentication Bar */
#auth-bar {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    background: transparent;
}

.btn-auth {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ffc107;
    background: white;
}

.btn-auth img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ffc107 0%, #ffdb4d 100%);
    border-radius: 25px;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

#user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#user-info span {
    color: #333;
    font-weight: 700;
}

/* Game Container - Fun and Welcoming */
.game-container {
    background: linear-gradient(to bottom, #ffffff, #fffef8);
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 4px var(--primary-color);
    width: 90%;
    max-width: 550px;
    padding: 2rem;
    padding-top: 4rem;
    overflow: visible;
    text-align: center;
    position: relative;
    border: 4px solid var(--primary-color);
    animation: containerEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Screen Management */
.screen {
    display: none;
    position: relative;
}
.screen.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
    opacity: 1; /* Ensure opacity is 1 after animation */
}

/* Welcome greeting styling */
.welcome-greeting {
    font-size: 1.2rem;
    color: #9b59b6;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

/* Add top margin to first heading in screens with exit button */
.screen > h1:first-of-type,
#daily-game-screen > h1 {
    margin-top: 3rem;
}

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

h1, h2 {
    color: var(--secondary-color);
    font-weight: 900;
}

/* Button Styling (Fixed & Enhanced) */
.btn {
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: var(--text-color);
    padding: 14px 28px;
    border: 3px solid white;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 10px 5px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: linear-gradient(135deg, #ff9800, #ff6f00);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
    transform: translateY(-3px) scale(1.05);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4);
}

#submit-btn {
    min-width: 100px;
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    padding: 8px 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: 10px 5px;
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
}

.btn-icon {
    background: linear-gradient(135deg, var(--secondary-color), #0056b3);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    margin: 20px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    min-width: 140px;
    height: auto;
    font-weight: 700;
    border: 2px solid white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-icon:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.btn-icon:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}

#pronounce-btn {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(0, 123, 255, 0.6); }
}

/* Input Styling - Fun and Engaging */
#user-name-input, #spelling-input {
    flex-grow: 1;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    padding: 14px 18px;
    font-size: 1.15rem;
    font-family: 'Mulish', sans-serif;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(to bottom, #ffffff, #fffef8);
    transition: all 0.3s ease;
    font-weight: 600;
}
#spelling-input {
    text-align: left;
    margin-bottom: 0;
}
#user-name-input:focus, #spelling-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2), 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
    background: white;
}
#user-name-input::placeholder, #spelling-input::placeholder {
    color: #aaa;
    font-weight: 500;
}

/* Stats Bar - Kid-Friendly Badge Style */
#stats-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin-bottom: 25px;
    flex-wrap: wrap;
    position: relative;
}
#score, #level, #progress {
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

#word-image {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    height: 200px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    animation: float 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
}

#word-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Etymology Section Styles */
.etymology-section {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.15), rgba(52, 152, 219, 0.15));
    border-left: 4px solid #9b59b6;
    border-radius: 12px;
    animation: etymologyFadeIn 0.6s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.etymology-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #9b59b6;
}

.etymology-icon {
    font-size: 1.4rem;
    animation: etymologyIconBounce 1s ease-in-out infinite;
}

.etymology-story {
    color: #ecf0f1;
    line-height: 1.7;
    font-size: 1.05rem;
    margin: 0;
    animation: etymologySlideUp 0.7s ease-out 0.2s both;
}

/* Etymology Animations */
@keyframes etymologyFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Language origin badges */
.language-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 5px 5px 5px 0;
    background: rgba(155, 89, 182, 0.3);
    border: 1px solid rgba(155, 89, 182, 0.5);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    animation: badgePop 0.4s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

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

#sentence {
    font-size: 1.3rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 1.5rem;
    min-height: 50px;
    line-height: 1.6;
    padding: 10px 15px;
    background: linear-gradient(120deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 15px;
    border: 2px dashed var(--secondary-color);
    opacity: 0;
    animation: slideIn 0.5s ease forwards 0.3s;
}

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

.input-area {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-top: 10px;
}

/* Feedback Animations - More Playful */
#input-feedback {
    font-weight: 800;
    margin-top: 15px;
    height: 30px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.correct {
    color: var(--correct-color);
    animation: celebrate 0.6s ease;
}
.wrong {
    color: var(--wrong-color);
    animation: wiggle 0.6s ease;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
}
@keyframes wiggle {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px) rotate(-3deg); }
    20%, 40%, 60%, 80% { transform: translateX(8px) rotate(3deg); }
}

/* Detailed Feedback Screen */
.detailed-feedback {
    text-align: left;
    background-color: var(--bg-color); /* Use light yellow theme color */
    border-left: 5px solid var(--primary-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}
.detailed-feedback h4 {
    margin-top: 0;
    color: var(--primary-color);
}
.detailed-feedback p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

/* Music Info in Level Up Screen */
.music-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff8e1; /* Light yellow for music theme */
    border: 1px solid #ffecb3;
    border-radius: 8px;
}
.music-info h4 {
    color: #ff9800;
}

/* Confetti Effect */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 2s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Three-Star Celebration Animation */
.celebration-star {
    position: absolute;
    font-size: 8rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: starCelebration 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 100;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

.celebration-star:nth-child(1) {
    left: 30%;
}

.celebration-star:nth-child(2) {
    left: 50%;
}

.celebration-star:nth-child(3) {
    left: 70%;
}

@keyframes starCelebration {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    40% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
        opacity: 1;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.3) rotate(270deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.3) rotate(360deg);
        opacity: 0;
    }
}

/* Dashboard Screen - Modern & Kid-Friendly */
#dashboard-screen {
    text-align: center;
    max-width: 650px;
    width: 95%;
    padding: 2.5rem;
}

/* Dashboard Screen - Modern & Kid-Friendly */
#dashboard-screen {
    text-align: center;
    max-width: 650px;
    width: 95%;
    padding: 2.5rem;
}

.dashboard-greeting {
    font-family: 'Mulish', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.greeting-text {
    display: block;
    animation: fadeInUp 0.6s ease;
}

.user-name-highlight {
    color: var(--primary-color);
    font-weight: 900;
    text-transform: capitalize;
    position: relative;
}

.user-name-highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #ff9800);
    border-radius: 2px;
}

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

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-btn {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Leaderboard Styling */
#leaderboard-container {
    max-height: 450px;
    overflow-y: auto;
    padding: 0 10px 10px 0;
    margin-bottom: 25px;
}

.leaderboard-card {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.leaderboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

.leaderboard-card.current-user {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rank-badge {
    font-size: 2rem;
    font-weight: 900;
    min-width: 60px;
    text-align: center;
}

.player-info {
    flex-grow: 1;
}

.player-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.player-stats-summary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.score-display {
    color: var(--primary-color);
    font-weight: 700;
}

.percentage-display {
    color: var(--correct-color);
    font-weight: 700;
}

.time-display {
    color: var(--secondary-color);
    font-weight: 600;
}

.expand-btn {
    background: linear-gradient(135deg, var(--secondary-color), #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.expand-btn.expanded {
    background: linear-gradient(135deg, var(--primary-color), #ff9800);
}

.leaderboard-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #ddd;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.level-breakdown-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1rem;
}

.level-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.level-breakdown-item {
    background: white;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    text-align: center;
    font-size: 0.85rem;
}

.level-num {
    display: block;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.level-score {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
}

#dashboard-screen h2:not(.dashboard-welcome) {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#dashboard-user-message:not(.dashboard-greeting) {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    font-weight: 600;
}

#level-stats-container {
    max-height: 450px; 
    overflow-y: auto;
    padding: 0 10px 10px 0;
    margin-bottom: 25px;
}

/* Custom Scrollbar */
#level-stats-container::-webkit-scrollbar {
    width: 8px;
}
#level-stats-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}
#level-stats-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
#level-stats-container::-webkit-scrollbar-thumb:hover {
    background: #ff9800;
}

/* Level Card Styling */
.level-card {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

.level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.level-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin: 0;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.level-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.stat-value.score {
    color: var(--primary-color);
}

.stat-value.correct {
    color: var(--correct-color);
}

/* Expandable Word Breakdown Section */
.level-details {
    margin-top: 15px;
    border-top: 2px dashed #ddd;
    padding-top: 15px;
}

.level-details summary {
    font-weight: 700;
    cursor: pointer;
    padding: 10px;
    outline: none;
    color: var(--text-color);
    background: linear-gradient(120deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 10px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-details summary:hover {
    background: linear-gradient(120deg, #bbdefb 0%, #e1bee7 100%);
}

.level-details summary::marker {
    font-size: 1.2rem;
}

.level-details[open] summary {
    margin-bottom: 15px;
    background: linear-gradient(120deg, #90caf9 0%, #ce93d8 100%);
    color: white;
}

.word-breakdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.word-breakdown-list li {
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.word-breakdown-list li:hover {
    transform: translateX(5px);
}

.word-name {
    font-weight: 800;
    font-size: 1rem;
}

.word-attempts {
    font-size: 0.85rem;
    opacity: 0.8;
}

.correct-word {
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
    color: #1b5e20;
    border-left: 4px solid var(--correct-color);
}

.wrong-word {
    background: linear-gradient(135deg, #ffcdd2, #ef9a9a);
    color: #b71c1c;
    border-left: 4px solid var(--wrong-color);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 1.1rem;
}

.empty-state::before {
    content: '📊';
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
}

/* NEW: Exit Button - Positioned within screen */
.exit-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b, var(--wrong-color));
    color: white;
    padding: 6px 12px;
    font-size: 0.65rem;
    border-radius: 18px;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
    z-index: 100;
    cursor: pointer;
    border: 2px solid white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1;
}
.exit-button::before {
    content: '🏠';
    font-size: 0.75rem;
    line-height: 1;
}
.exit-button:hover {
    background: linear-gradient(135deg, #ff5252, #c82333);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}
.exit-button:active {
    transform: translateY(0px) scale(1.01);
}

/* Difficulty Selection Styling */
#difficulty-selection {
    margin: 25px 0;
}

#difficulty-selection h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

#level-selection {
    margin: 2rem 0;
    display: none; /* Initially hidden until a game mode is selected */
}

#level-selection h3 {
    color: #34495e;
    margin-bottom: 1rem;
}

.level-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.btn-level {
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-level:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-level.completed {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-level.in-progress {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-level.locked {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-level.selected {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

.btn-level .level-status {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.btn-difficulty {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 140px;
    text-align: center;
}

.btn-difficulty:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-difficulty.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    transform: scale(1.05);
}

.difficulty-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
    opacity: 0.8;
}

/* Timer Selection for Speed Challenge */
#timer-selection {
    margin: 2rem 0;
    padding: 20px;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border-radius: 15px;
    border: 2px solid var(--primary-color);
}

#timer-selection h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.timer-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-timer {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 18px 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 120px;
    text-align: center;
}

.btn-timer:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-timer.selected {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    transform: scale(1.05);
}

.timer-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
    opacity: 0.9;
}

/* Speed Challenge Leaderboard Filters */
.speed-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    border-color: #ff6b6b;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

#speed-leaderboard-container {
    margin-top: 20px;
}

/* Jumbled Hint Display */
#jumbled-hint {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    background: linear-gradient(120deg, #fff9e6 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 15px;
    border: 3px dashed var(--primary-color);
    margin: 20px 0;
    letter-spacing: 8px;
    animation: pulse 2s ease-in-out infinite;
}


@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Timer Styling */
#timer {
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Hints System Styling */
.hints-container {
    margin: 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
}

.hints-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

#hints-remaining {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
}

.hint-cost {
    color: #666;
    font-size: 12px;
}

.hint-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-hint {
    flex: 1;
    min-width: 140px;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

.btn-hint:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.5);
}

.btn-hint:active:not(:disabled) {
    transform: translateY(0);
}

.btn-hint:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.hint-display {
    min-height: 50px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    display: none;
}

.hint-display.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.hint-display strong {
    color: var(--primary-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== MULTIPLAYER MODE STYLES ==================== */

/* Battle Arena Button */
.btn-special {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    animation: battlePulse 2s ease-in-out infinite;
}

.btn-special:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

@keyframes battlePulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(255, 107, 107, 0.7); }
}

/* Multiplayer Lobby */
#multiplayer-lobby {
    text-align: center;
}

#multiplayer-lobby .subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.multiplayer-options {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.option-card {
    background: white;
    border: 3px solid #ddd;
    border-radius: 20px;
    padding: 2rem;
    min-width: 280px;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.option-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.option-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.join-room-input {
    display: flex;
    gap: 10px;
}

#room-code-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#room-code-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Waiting Room */
.room-info {
    text-align: center;
    margin: 2rem 0;
}

.room-code {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: #333;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 8px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.share-instruction {
    color: #666;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.players-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
}

.player-slot {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 20px;
    min-width: 180px;
}

.player-slot.waiting {
    border-color: #ddd;
    opacity: 0.6;
}

.player-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.player-avatar.pulse {
    animation: avatarPulse 1.5s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

.player-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ready-status {
    font-size: 1.1rem;
    color: #28a745;
}

.vs-divider {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff6b6b;
}

/* Battle Settings */
#battle-settings {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 400px;
}

#battle-settings h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-group label {
    font-weight: 600;
}

.setting-select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.setting-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Multiplayer Game Screen */
.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.opponent-info, .your-info {
    flex: 1;
    text-align: center;
}

.opponent-info h3, .your-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.opponent-score, .opponent-progress,
.your-score, .your-progress {
    font-size: 1.1rem;
    margin: 0.3rem 0;
}

.battle-vs {
    font-size: 2.5rem;
    font-weight: 900;
    padding: 0 2rem;
}

#multiplayer-word-image {
    font-size: 8rem;
    text-align: center;
    margin: 2rem 0;
}

#multiplayer-sentence {
    font-size: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    color: #333;
}

#multiplayer-feedback {
    font-weight: 800;
    margin-top: 15px;
    height: 30px;
    font-size: 1.1rem;
    text-align: center;
}

/* Multiplayer Waiting for Opponent Screen */
#multiplayer-waiting-for-opponent {
    text-align: center;
    padding: 2rem;
}

#multiplayer-waiting-for-opponent h1 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.waiting-animation {
    margin: 2rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waiting-text {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
}

.waiting-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.waiting-stats .stat-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(0, 123, 255, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 1.5rem;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.waiting-stats .stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.waiting-stats .stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--secondary-color);
}

/* Multiplayer Results */
.final-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
}

.player-final {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 3px solid #ddd;
    border-radius: 20px;
    min-width: 200px;
}

.player-final.winner {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fff9e6, #ffffff);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.final-score {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 1rem 0;
}

.final-words {
    font-size: 1.1rem;
    color: #666;
}

.result-vs {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff6b6b;
}

#winner-announcement {
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 15px;
    animation: winnerShine 2s ease-in-out infinite;
}

@keyframes winnerShine {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7); }
}

.battle-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ==================== DAILY CHALLENGE ==================== */

.daily-challenge-info {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.challenge-stat {
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    padding: 1.5rem;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    text-align: left;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.challenge-description {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.challenge-description h3 {
    margin-top: 0;
    color: var(--text-color);
}

.bonus-text {
    color: var(--secondary-color);
    font-weight: 700;
    margin-top: 1rem;
}

#daily-challenge-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Daily Challenge Game Screen */

.daily-progress {
    text-align: center;
    margin: 1.5rem 0;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

#daily-progress-bar {
    background: #e0e0e0;
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
    margin: 1rem auto;
    max-width: 400px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), #ffdb4d);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 20px;
}

#daily-word-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #666;
    margin-top: 0.5rem;
}

#daily-word-image-container {
    text-align: center;
    margin: 2rem 0;
}

#daily-word-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#daily-sentence-container {
    background: #f0f8ff;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

#daily-sentence {
    font-size: 1.1rem;
    font-style: italic;
    color: #333;
    margin: 0;
}

#daily-input-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

#daily-spelling-input {
    flex: 1;
    max-width: 300px;
    padding: 15px;
    font-size: 1.2rem;
    border: 3px solid #ddd;
    border-radius: 15px;
    text-align: center;
    font-weight: 700;
    transition: border-color 0.3s ease;
}

#daily-spelling-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#daily-feedback {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 30px;
    margin: 1rem 0;
}

/* Daily Results Screen */

.daily-results-summary {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.result-stat {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

#streak-celebration {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    animation: celebration 1s ease-in-out;
}

#streak-celebration h2 {
    margin: 0 0 1rem 0;
    color: #ff6b00;
    font-size: 2rem;
}

#new-streak-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.daily-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Daily Leaderboard */

.leaderboard-list {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    margin: 2rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease;
}

.leaderboard-entry:hover {
    transform: translateX(5px);
    background: #fff9e6;
}

.leaderboard-entry.top-three {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: 800;
}

.entry-rank {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 50px;
    text-align: center;
}

.entry-name {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
}

.entry-score {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.entry-streak {
    font-size: 1rem;
    color: #ff6b00;
    margin-left: 1rem;
}

/* ==================== AUTH FORMS ==================== */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #ddd;
}

.auth-divider span {
    padding: 0 15px;
    color: #666;
    font-weight: 700;
    font-size: 0.9rem;
}

#auth-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.btn-toggle {
    background: #f0f0f0;
    color: #333;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-toggle.active {
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    color: var(--text-color);
    border-color: var(--primary-color);
}

.btn-toggle:hover {
    transform: translateY(-2px);
}

.auth-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 15px;
}

.auth-form h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.auth-input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Mulish', sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-error {
    color: var(--wrong-color);
    font-size: 0.9rem;
    margin-top: 10px;
    min-height: 20px;
}

/* No explicit confetti styling, as the effect is typically handled by a JS library */

/* Bee icon/Alphabet addition */
/* To visually reinforce the theme, we can add a subtle background texture to the game container's header area, or simply rely on the body background. */

/* Speed Challenge Results Screen */
#speed-challenge-results {
    text-align: center;
}

#speed-challenge-results h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(0, 123, 255, 0.1));
    border-radius: 15px;
}

.stat-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary-color);
}

.comparison-box {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(52, 211, 153, 0.1));
    border-radius: 12px;
    border-left: 5px solid var(--correct-color);
}

.comparison-box h3 {
    color: var(--correct-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-weight: 600;
}

.comparison-row:last-child {
    border-bottom: none;
}

.stat-diff {
    font-size: 1.2rem;
    font-weight: 900;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
}

.stat-diff.positive {
    background: rgba(40, 167, 69, 0.2);
    color: var(--correct-color);
}

.stat-diff.negative {
    background: rgba(220, 53, 69, 0.2);
    color: var(--wrong-color);
}

.stat-diff.neutral {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--text-color);
    border-color: #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* Battle Arena Results Styling */
.battle-results-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;
    margin: 2rem auto;
    padding: 0 1rem;
    flex-wrap: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.player-result-card {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(0, 123, 255, 0.1));
    border-radius: 15px;
    padding: 1.5rem;
    flex: 1;
    max-width: 320px;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .battle-results-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .player-result-card {
        width: 100%;
        max-width: 90%;
    }
}

.player-result-card h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--secondary-color);
    word-wrap: break-word;
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.result-stats .stat-box {
    background: white;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.result-stats .stat-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.result-stats .stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--secondary-color);
}

/* Daily Challenge Results Summary Styling */
.daily-results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(0, 123, 255, 0.1));
    border-radius: 15px;
}

.result-stat {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--primary-color);
}

.result-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--secondary-color);
}

/* Leaderboard Styling */
.leaderboard-description {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin: -0.5rem 0 1.5rem 0;
}

.leaderboard-list {
    max-width: 800px;
    margin: 1.5rem auto;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.leaderboard-entry.current-user {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(0, 123, 255, 0.15));
    border-color: var(--primary-color);
    font-weight: 700;
}

.leaderboard-entry .rank {
    font-size: 1.5rem;
    font-weight: 900;
    min-width: 50px;
    text-align: center;
}

.leaderboard-entry .player-info {
    flex: 1;
}

.leaderboard-entry .player-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.leaderboard-entry .player-stats {
    font-size: 0.85rem;
    color: #666;
}

.leaderboard-entry .score {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary-color);
    min-width: 80px;
    text-align: right;
}

.no-data {
    text-align: center;
    color: #999;
    font-size: 1rem;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.daily-filters,
.speed-filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    background: rgba(255, 193, 7, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #ffdb4d);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

