body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #e3e9f7 100%);
}

h1 {
    text-align: center;
    color: #2d3a4b;
    font-size: 2.2rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
    margin-top: 20px;
    text-shadow: 0 2px 8px #e3e9f7;
}

.crossword-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 24px 0 rgba(44,62,80,0.10), 0 1.5px 4px 0 rgba(44,62,80,0.08);
    border-radius: 18px;
    padding: 24px 18px;
    margin-top: 30px;
}

.grid-and-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.crossword-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(10px, 30px));
    grid-template-rows: repeat(12, minmax(10px, 30px));
    gap: 1px;
    margin-bottom: 10px;
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-self: center;
    align-self: center;
}

.cell {
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    border: 1px solid #000;
    position: relative;
    background-color: #fff;
    /* box-sizing: border-box; */
}

.cell.black {
    background-color: #000;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: clamp(14px, 3vw, 20px);
    text-transform: uppercase;
    background-color: transparent;
    padding: 0;
    box-sizing: border-box;
}

.cell-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.6rem;
    font-weight: bold;
}

.clues {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    background: #f4f7fb;
    border-radius: 12px;
    box-shadow: 0 2px 8px 0 rgba(44,62,80,0.06);
    padding: 18px 12px;
    margin-top: 10px;
}

.clue-section {
    flex: 1;
}

.clue-section h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #4a5a6a;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px #e3e9f7;
}

.clue {
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 6px 10px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px 0 rgba(44,62,80,0.04);
    transition: background 0.2s, color 0.2s;
}

.clue:hover, .clue.highlighted {
    background-color: #e3e9f7;
    color: #0066cc;
}

.controls {
    text-align: center;
    margin: 10px 0;
}

button {
    padding: 8px 16px;
    background-color: #646e9c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover {
    background-color: #646e9c;
}

#message {
    text-align: center;
    font-size: 1rem;
    margin-top: 10px;
    min-height: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin: 0 auto 0 auto;
    max-width: 400px;
    transition: all 0.2s;
}

#message.correct, #message.incorrect {
    background: #f4f7fb;
    border-radius: 8px;
    border: 1px solid #e3e9f7;
    box-shadow: 0 1px 4px 0 rgba(44,62,80,0.04);
    margin: 16px auto 0 auto;
    min-height: 24px;
    padding: 0 10px;
}

.correct {
    color: green;
}

.incorrect {
    color: red;
}

.reveal-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #189832;
    color: white !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    margin-top: 8px;
    box-shadow: 0 2px 8px 0 rgba(44,62,80,0.10);
    animation: pop-in 0.5s cubic-bezier(.68,-0.55,.27,1.55);
}

.reveal-btn:hover {
    background-color: #189832;
    color: #fff !important;
    text-decoration: none;
}

@keyframes pop-in {
    0% { transform: scale(0.7); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@media (min-width: 768px) {
    .crossword-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    }
    
    .grid-and-controls {
    flex: 0 0 auto;
    }
    
    .clues {
    flex-direction: row;
    max-width: 800px;
    }
    
    .clue-section {
    flex: 1;
    }
    
    h1 {
    font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .crossword-container {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 2vw;
        margin-top: 10px;
    }
    .clues {
        flex-direction: column;
        max-width: 100%;
        padding: 10px 2vw;
        margin-top: 10px;
        box-sizing: border-box;
    }
    .clue-section {
        width: 100%;
        margin-bottom: 16px;
    }
    .crossword-grid {
        max-width: 98vw;
        min-width: 0;
    }
}

@media (max-width: 400px) {
    .crossword-grid {
        grid-template-columns: repeat(12, minmax(8px, 1fr));
        grid-template-rows: repeat(12, minmax(8px, 1fr));
        max-width: 100vw;
    }
}