* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-weight: 600;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.word-card {
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.word-card.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.word-card.solved {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #999;
}

.word-card.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.word-card.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.selected-words {
    text-align: center;
    margin-bottom: 20px;
    min-height: 30px;
    color: #666;
}

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

.btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

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

.categories {
    margin-top: 30px;
}

.category-solved {
    background: #f5f5f5;
    border-left: 4px solid #4caf50;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.category-solved h3 {
    color: #4caf50;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.category-words {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-word {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: 600;
}

.message {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
    font-weight: 600;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.win {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    font-size: 1.2em;
}

@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 2em;
    }
    
    .container {
        padding: 20px;
    }
}

