:root {
    --bg-color: #f0f4f8;
    --cell-size: 35px;
    --cell-border: #999;
    --cell-bg: #fff;
    --cell-empty: #2c3e50;
    --primary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    width: 95%;
    max-width: 1000px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

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

header h1 {
    margin: 0;
    color: var(--primary-color);
}

#main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

#grid-wrapper {
    overflow: auto;
    padding: 10px;
    background: #ddd;
    border-radius: 8px;
}

.grid {
    display: grid;
    gap: 1px;
    background-color: var(--cell-border);
    border: 2px solid var(--cell-border);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background-color: var(--cell-bg);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell.empty {
    background-color: var(--cell-empty);
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    outline: none;
    background: transparent;
}

.cell input:focus {
    background-color: #e1f5fe;
}

.cell .number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.65rem;
    color: #555;
    pointer-events: none;
}

#clues-container {
    flex: 1;
    min-width: 300px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    border-left: 2px solid #eee;
}

.clue-section h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    margin-top: 0;
}

.clue-section ul {
    list-style: none;
    padding: 0;
}

.clue-section li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.clue-section li b {
    color: var(--primary-color);
    margin-right: 5px;
}

.controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

#check-btn {
    background-color: var(--primary-color);
    color: white;
    flex: 2;
}

#reset-btn {
    background-color: #95a5a6;
    color: white;
    flex: 1;
}

button:hover {
    opacity: 0.9;
}

/* Modal */
.hidden { display: none !important; }

#modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
}

#close-modal {
    background: var(--primary-color);
    color: white;
    margin-top: 15px;
}

.cell.correct input {
    color: #27ae60;
}

.cell.incorrect input {
    color: #e74c3c;
    background-color: #ffebee;
}

@media (max-width: 600px) {
    :root {
        --cell-size: 28px;
    }
    #main-layout {
        flex-direction: column;
    }
    #clues-container {
        border-left: none;
        border-top: 2px solid #eee;
    }
}