/* ── Grid hint (matches sudoku-solver.css) ─────────────────────────────────── */
.grid-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 5;
    transition: opacity .4s ease;
}
.grid-hint.hidden { opacity: 0; pointer-events: none; }
.grid-hint span {
    font-size: 14px; color: var(--muted); text-align: center;
    line-height: 1.6; padding: 20px;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(4px); border-radius: 10px;
}

/* ── Kakuro grid ───────────────────────────────────────────────────────────── */
.kakuro-grid {
    display: inline-grid;
    border: 2.5px solid var(--accent);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px var(--accent-glow), 0 8px 32px rgba(0,0,0,.06);
    background: var(--border);
    gap: 1px;
    max-width: 100%;
}

/* ── Cell types ─────────────────────────────────────────────────────────────── */
.kak-cell {
    width: 52px;
    height: 52px;
    min-width: 0; min-height: 0;
    position: relative;
    overflow: hidden;
}
@media (max-width: 520px) { .kak-cell { width: 40px; height: 40px; } }
@media (max-width: 380px) { .kak-cell { width: 34px; height: 34px; } }

/* Black / wall cell */
.kak-cell.black {
    background: var(--fg);
}

/* Clue cell */
.kak-cell.clue {
    background: #2d2d2d;
    position: relative;
}
/* Diagonal divider */
.kak-cell.clue::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - .5px),
        rgba(255,255,255,.25) calc(50% - .5px),
        rgba(255,255,255,.25) calc(50% + .5px),
        transparent calc(50% + .5px)
    );
}
/* Across clue (upper-right) */
.clue-across {
    position: absolute;
    right: 3px;
    top: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}
@media (max-width: 520px) { .clue-across { font-size: 9px; } }
/* Down clue (lower-left) */
.clue-down {
    position: absolute;
    left: 3px;
    bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}
@media (max-width: 520px) { .clue-down { font-size: 9px; } }

/* White / answer cell */
.kak-cell.white {
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--fg);
    cursor: pointer;
    transition: background .1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
@media (max-width: 520px) { .kak-cell.white { font-size: .9rem; } }
.kak-cell.white:hover    { background: var(--card-hover); }
.kak-cell.white.selected { background: var(--accent-glow) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.kak-cell.white.user     { color: var(--accent); }
.kak-cell.white.solver-fill { color: var(--success); }
.kak-cell.white.error    { color: var(--error) !important; background: var(--error-bg) !important; }

/* ── Numpad for Kakuro (1-9 only) ─────────────────────────────────────────── */
#kakuro-numpad {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin: .75rem 0;
}
.kak-num-btn {
    width: 2.5rem; height: 2.5rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .1s, border-color .1s;
}
.kak-num-btn:hover { background: var(--accent-glow); border-color: var(--accent); }
.kak-num-btn.erase-btn { font-size: .75rem; }

.num-pad-hidden { display: none; }

@media (max-width: 480px) {
    .kakuro-grid { width: min(96vw, 420px); }
}

/* Custom puzzle editor */
.editor-toolbar{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center;padding:.75rem;margin:.75rem auto;border:1.5px dashed var(--border);border-radius:10px;max-width:600px;}
