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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

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;
    color: var(--text);
    padding: 20px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

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

h1 {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Selection Screen */
.selected-count {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.selected-count span {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--card-bg);
    border: 3px solid transparent;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--shadow-lg);
}

.category-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 6px var(--shadow);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px var(--shadow-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #db2777 100%);
    color: white;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    font-size: 2rem;
    margin: 0;
}

.game-header .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

.word-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px var(--shadow-lg);
}

.word-label {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.current-word {
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.current-category {
    color: var(--text-light);
    font-size: 1.1rem;
    font-style: italic;
}

.game-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.game-btn {
    background: var(--card-bg);
    border: none;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--shadow-lg);
}

.game-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.game-btn-icon {
    font-size: 2rem;
}

.game-btn-text {
    font-size: 0.9rem;
}

/* Color variations for game buttons */
.game-btn:nth-child(6n+1):not(:disabled) { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); color: white; }
.game-btn:nth-child(6n+2):not(:disabled) { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.game-btn:nth-child(6n+3):not(:disabled) { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.game-btn:nth-child(6n+4):not(:disabled) { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.game-btn:nth-child(6n+5):not(:disabled) { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.game-btn:nth-child(6n+6):not(:disabled) { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); color: white; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
        min-height: 100px;
    }

    .category-icon {
        font-size: 2rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .current-word {
        font-size: 2rem;
    }

    .word-display {
        padding: 2rem 1rem;
    }

    .game-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .game-header .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}
