/* Kakuro grid - CSS Grid layout */
.kakuro-grid {
    display: grid;
    user-select: none;
    touch-action: none;
    margin: 0 auto;
}

/* Cell base */
.kakuro-cell {
    border: 1px solid #444;
    position: relative;
    box-sizing: border-box;
}

/* Wall cells - solid dark */
.wall-cell {
    background: #111118;
}

/* Clue cells - dark with diagonal line */
.clue-cell {
    background: #1c1c30;
    position: relative;
    overflow: hidden;
}

/* Diagonal line in clue cells using CSS */
.clue-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 141.4%; /* sqrt(2) * 100% */
    height: 1px;
    background: #555;
    transform-origin: top left;
    transform: rotate(45deg);
}

/* Clue numbers positioned in triangles */
.clue-right {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.65em;
    color: white;
    font-weight: bold;
    line-height: 1;
}

.clue-down {
    position: absolute;
    bottom: 2px;
    left: 3px;
    font-size: 0.65em;
    color: white;
    font-weight: bold;
    line-height: 1;
}

/* Answer cells */
.answer-cell {
    background: #2a2d3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    color: #e2e8f0;
}

.answer-cell:hover {
    background: #353848;
}

/* Selected cell */
.answer-cell.selected {
    background: #1e3a5f;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

/* Same-run highlight */
.answer-cell.run-highlight {
    background: #1e2a3a;
}

/* Error highlight */
.answer-cell.error {
    background: #3b1c1c;
    box-shadow: inset 0 0 0 2px #ef4444;
    color: #ef4444;
}

/* Empty cell highlight */
.answer-cell.empty {
    background: #2a2a1e;
    box-shadow: inset 0 0 0 2px #eab308;
}

/* Correct completion flash */
.answer-cell.correct {
    background: #1c3b2a;
    box-shadow: inset 0 0 0 2px #22c55e;
    color: #22c55e;
}

/* Responsive cell sizing */
.kakuro-grid.size-small {
    --cell-size: clamp(40px, min(10vw, 8vh), 64px);
}
.kakuro-grid.size-medium {
    --cell-size: clamp(30px, min(6vw, 5vh), 52px);
}
.kakuro-grid.size-large {
    --cell-size: clamp(24px, min(4.5vw, 3.5vh), 42px);
}

/* Number pad */
.number-pad {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto;
}

.number-pad button {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #374151;
    color: #e5e7eb;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
}

.number-pad button:hover {
    background: #4b5563;
}

.number-pad button:active {
    background: #6b7280;
}
