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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#clearBtn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#clearBtn:hover {
    background-color: #c0392b;
}

.user-info {
    color: #27ae60;
    font-weight: bold;
}

.puzzle-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.crossword-grid {
    display: grid;
    grid-template-columns: repeat(18, 40px);
    grid-template-rows: repeat(17, 40px);
    gap: 0px;
    justify-content: center;
    background-color: #000;
    padding: 5px;
    border-radius: 5px;
    margin: 0 auto;
    width: fit-content;
}

.cell {
    width: 39px;
    height: 39px;
    background-color: white;
    border: 1px solid #999;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    padding: 0;
    margin: 0;
}

.cell.black {
    background-color: #000;
    border: 1px solid #000;
}

.cell.numbered::before {
    content: attr(data-number);
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    line-height: 1;
    z-index: 1;
    background-color: white;
    width: auto;
    height: auto;
}

.cell:focus {
    background-color: #e8f4fd;
    outline: 2px solid #3498db;
}

.cell.focused-by-other {
    background-color: #ffe6e6;
    outline: 2px solid #e74c3c;
}

.clues-container {
    overflow-y: auto;
    max-height: 600px;
}

.clues-across, .clues-down {
    margin-bottom: 25px;
}

.clues-across h3, .clues-down h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

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

.clue {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    border-left: 3px solid #3498db;
}

.cipher-legend {
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cipher-legend h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.expert-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.expert {
    padding: 5px 10px;
    border-radius: 15px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.status {
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 4px;
}

#statusMessage {
    color: #7f8c8d;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 1200px) {
    .puzzle-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .clues-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .crossword-grid {
        grid-template-columns: repeat(12, 30px);
        grid-template-rows: repeat(15, 30px);
    }
    
    .cell {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .cell.numbered::before {
        font-size: 8px;
        top: 1px;
        left: 2px;
    }
    
    .clues-container {
        grid-template-columns: 1fr;
    }
}

.clue {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    border-left: 3px solid #3498db;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clue:hover {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}
