* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    color: white;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.admin-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: white;
    color: #667eea;
    transform: scale(1.05);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #868e96, #6c757d);
    color: white;
}

.word-select {
    padding: 12px 20px;
    border: 3px solid white;
    border-radius: 25px;
    font-size: 1.1rem;
    background: white;
    min-width: 200px;
}

.word-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.letter-box {
    width: 60px;
    height: 60px;
    border: 3px solid white;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.letter-box.filled {
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
    transform: scale(1.1);
}

.letter-box.correct {
    background: linear-gradient(45deg, #51cf66, #40c057);
    animation: bounce 0.6s ease;
}

.letter-box.incorrect {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    animation: shake 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0) scale(1.1); }
    40% { transform: translateY(-20px) scale(1.2); }
    80% { transform: translateY(-10px) scale(1.15); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.input-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.letter-input {
    padding: 15px 20px;
    border: 3px solid white;
    border-radius: 25px;
    font-size: 1.2rem;
    text-align: center;
    background: white;
    min-width: 250px;
    text-transform: uppercase;
}

.letter-input:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 15px rgba(255,165,0,0.5);
}

.feedback {
    text-align: center;
    margin: 30px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-message {
    font-size: 2rem;
    color: #51cf66;
    font-weight: bold;
    animation: celebration 1s ease;
}

.error-message {
    font-size: 2rem;
    color: #ff6b6b;
    font-weight: bold;
    animation: sadShake 0.8s ease;
}

.sad-emoji {
    font-size: 4rem;
    animation: sadBounce 1s ease infinite;
}

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

@keyframes sadShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

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

/* Admin Panel Styles */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.admin-panel.hidden {
    display: none;
}

.admin-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.admin-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.admin-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.admin-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

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

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.time-input {
    width: 80px;
    padding: 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.word-selection {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.selected-count {
    font-weight: bold;
    color: #667eea;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #667eea;
}

.word-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.word-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 5px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.word-checkbox-item:hover {
    background: #f0f8ff;
    border-color: #667eea;
}

.word-checkbox-item.selected {
    background: #e3f2fd;
    border-color: #667eea;
    font-weight: bold;
}

.word-checkbox {
    margin: 0;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
    width: 100%;
    margin-top: 10px;
}

/* Game Session Styles */
.game-session-active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.word-timer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.word-timer.hidden {
    display: none;
}

.timer-word {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timer-countdown {
    font-size: 2rem;
    color: #ffa500;
    font-weight: bold;
}

.session-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1500;
}

.session-controls.hidden {
    display: none;
}

.session-info {
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

@media (max-width: 768px) {
    .word-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .word-selection-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .timer-word {
        font-size: 2.5rem;
    }
    
    .session-controls {
        position: static;
        margin-bottom: 20px;
    }
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .admin-btn {
        position: static;
        margin-top: 10px;
    }
    
    .letter-box {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .letter-input {
        min-width: 200px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .input-section {
        flex-direction: column;
        align-items: center;
    }
}