/* General */
:root {
    --cell-size: 30px;
    --clues-width: 300px;
    --clues-font-size: 14px;
}

body {
    font-family: Arial, sans-serif;
}

/* Index Page Styles */
.month {
    margin-bottom: 30px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-width: 350px;
}

.day {
    padding: 8px;
    text-align: center;
    border-radius: 4px;
}

.valid a {
    text-decoration: none;
    color: #000;
    display: block;
    height: 100%;
    width: 100%;
}

.valid {
    background: #e8f0ff;
}

.invalid {
    background: #f0f0f0;
    color: #aaa;
}

.header {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Crossword Page Styles */
.crossword-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 20px;
}

.grid-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crossword-grid {
    display: grid;
    gap: 1px;
    background: #000;
    border: 2px solid #000;
    width: fit-content;
}

.cw-cell {
    background: #fff;
    position: relative;
    width: var(--cell-size);
    height: var(--cell-size);
}

.cw-black {
    background: #000;
    width: var(--cell-size);
    height: var(--cell-size);
}

.cw-num {
    position: absolute;
    top: 1px;
    left: 1px;
    font-size: calc(var(--cell-size) * 0.3);
    line-height: 1;
    color: #333;
    pointer-events: none;
    z-index: 5;
}

.cw-input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: calc(var(--cell-size) * 0.55);
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    font-family: sans-serif;
    z-index: 1;
    position: relative;
    color: #000;
}

.cw-input:focus {
    background: #fffae6;
}

/* Highlighting */
.highlight-word {
    background-color: #e6f2ff !important;
}

.highlight-cell {
    background-color: #fffae6 !important;
}

.selected-cell {
    background-color: #fffae6 !important;
}

/* Checking */
.check-correct {
    background-color: #d4edda !important;
}

.check-incorrect {
    background-color: #f8d7da !important;
}

.clues-container {
    flex: 0 0 var(--clues-width);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    /* Fallback */
    overflow-y: auto;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.clues-container::-webkit-scrollbar {
    display: none;
}

.clues-container::after {
    content: "";
    display: block;
    min-height: 60vh;
    flex-shrink: 0;
}

.clue-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #eee;

}

.clue-item {
    padding: 7px 0;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: var(--clues-font-size);
}

.clue-item:hover {
    background-color: #f5f5f5;
}

.clue-item.active {
    background-color: #e6f2ff;
    font-weight: bold;
}

.controls {
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
}

.btn:hover {
    background-color: #0056b3;
}

.btn-solution {
    background-color: #28a745;
    margin-left: 10px;
}

.btn-solution:hover {
    background-color: #218838;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.setting-item {
    margin: 15px 0;
}

#debug-info {
    display: none;
    margin-top: 20px;
    padding: 10px;
    border-top: 1px solid #ccc;
}

p {
    margin: 0;
    margin-bottom: 5px;
}