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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

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

header h1 {
    color: #2e7d32;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    color: #555;
    font-size: 1.1em;
}

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

.crossword-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
}

.crossword-grid {
    display: grid;
    gap: 2px;
    background-color: #333;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.cell {
    width: 35px;
    height: 35px;
    background-color: #fff;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cell:hover {
    background-color: #f0f8ff;
    transform: scale(1.05);
}

.cell.selected {
    background-color: #81c784;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.cell.word-selected {
    background-color: #c8e6c9;
}

.cell.blocked {
    background-color: #333;
    cursor: default;
}

.cell.blocked:hover {
    transform: none;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    outline: none;
    text-transform: uppercase;
}

.cell .number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    font-weight: bold;
    color: #666;
    line-height: 1;
}

.cell.correct {
    background-color: #c8e6c9;
    animation: pulse-green 0.6s ease-in-out;
}

.cell.incorrect {
    background-color: #ffcdd2;
    animation: shake 0.6s ease-in-out;
}

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

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

.clues-container {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 500px;
    overflow-y: auto;
}

.clues-section {
    margin-bottom: 25px;
}

.clues-section h3 {
    color: #2e7d32;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 5px;
}

.clues-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clue {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.clue:hover {
    background: #e8f5e8;
    transform: translateX(5px);
}

.clue.selected {
    background: #c8e6c9;
    font-weight: bold;
}

.clue .number {
    font-weight: bold;
    color: #2e7d32;
    margin-right: 8px;
}

.clue.completed {
    background: #dcedc8;
    text-decoration: line-through;
    opacity: 0.8;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #2196f3;
    color: white;
}

.btn-secondary:hover {
    background: #1976d2;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-success {
    background: #8bc34a;
    color: white;
}

.btn-success:hover {
    background: #7cb342;
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.feedback.success {
    background: #dcedc8;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.feedback.error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #f44336;
}

.feedback.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #2196f3;
}

footer {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .crossword-container {
        order: 1;
    }
    
    .clues-container {
        order: 2;
        max-height: 300px;
    }
    
    .cell {
        width: 30px;
        height: 30px;
    }
    
    .cell input {
        font-size: 14px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .cell {
        width: 25px;
        height: 25px;
    }
    
    .cell input {
        font-size: 12px;
    }
    
    .cell .number {
        font-size: 8px;
    }
}