* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    position: relative;
}

#login-screen.active {
    display: block;
    max-width: 600px;
}

.hamburger-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hamburger-btn:hover {
    background: #5568d3;
}

.sidebar {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 300px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 15px;
}

.sidebar-header h3 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 1.3em;
}

.progress-info {
    font-size: 0.9em;
    color: #666;
}

.sidebar-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.sidebar-btn {
    padding: 10px;
    font-size: 0.9em;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-btn:hover {
    background: #5568d3;
}

.word-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: #f9f9f9;
    font-size: 0.9em;
}

.word-item.current {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.word-item.answered {
    opacity: 0.6;
}

.word-status {
    font-size: 1.2em;
    min-width: 25px;
    text-align: center;
}

.word-stats {
    font-size: 0.75em;
    color: #666;
    margin-left: 5px;
}

.word-item.current .word-stats {
    color: #fff;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    flex: 1;
    max-width: 600px;
}

#login-screen .container {
    max-width: 600px;
}

/* Login Screen */
#login-screen h1 {
    text-align: center;
    font-size: 3em;
    margin-bottom: 30px;
    color: #667eea;
}

#username-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

#username-input:focus {
    outline: none;
    border-color: #667eea;
}

.wordlist-select {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
    background: white;
    cursor: pointer;
}

.wordlist-select:focus {
    outline: none;
    border-color: #667eea;
}

#login-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

#login-btn:hover {
    background: #5568d3;
}

/* Game Screen */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#username-display {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

#logout-btn {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

/* Game Area */
.game-area {
    text-align: center;
}

.word-count {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.current-word {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.definition-display {
    font-size: 1.1em;
    color: #555;
    margin: 10px 0 20px 0;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
    font-style: italic;
    min-height: 50px;
}

.bee {
    font-size: 4em;
    margin: 20px 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.bee.buzz {
    animation: buzz 0.5s ease-in-out;
}

@keyframes buzz {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.word-display {
    margin: 30px 0;
}

.icon-btn {
    font-size: 3em;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: #667eea;
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.95);
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 20px;
    font-size: 1em;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.voice-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.voice-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.voice-btn.listening {
    background: #f44336;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0);
    }
}

.answer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.answer-btn {
    flex: 1;
    max-width: 200px;
    padding: 15px 25px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.correct-btn {
    background: #4caf50;
    color: white;
}

.correct-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.incorrect-btn {
    background: #f44336;
    color: white;
}

.incorrect-btn:hover {
    background: #da190b;
    transform: translateY(-2px);
}

.answer-btn:active {
    transform: translateY(0);
}

.feedback {
    min-height: 60px;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
}

.feedback.correct {
    background: #4caf50;
    color: white;
    animation: slideIn 0.3s ease-out;
}

.feedback.incorrect {
    background: #f44336;
    color: white;
    animation: shake 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }
    
    .screen.active {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 999;
        border-radius: 0 20px 20px 0;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .container {
        max-width: 100%;
        order: 1;
        margin-top: 70px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    #login-screen h1 {
        font-size: 2.5em;
    }
    
    .bee {
        font-size: 3em;
    }
    
    .icon-btn {
        width: 70px;
        height: 70px;
        font-size: 2.5em;
    }
}
