 

/* ===== Board ===== */
.sudoku-board {
    margin-bottom: 24px;
    display: grid;
    gap: 0.25rem;
    width: fit-content;
}

.sudoku-3x3 {
    grid-template-columns: repeat(3, 80px);
}

.sudoku-4x4 {
    grid-template-columns: repeat(4, 80px);
}

/* ===== Cells ===== */
.sudoku-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.1);
}

.sudoku-cell.prefilled {
    background: #538ac6;
    border-color: transparent;
    cursor: default;
    font-weight: 600;
}

.sudoku-cell.selected {
    background: #eef2ff;
    border: 2px solid #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sudoku-cell.error {
    animation: cell-error 0.4s ease-in-out;
}

@keyframes cell-error {

    0%,
    100% {
        background: #fafbfc;
        border-color: #e2e8f0;
    }

    50% {
        background: #fee2e2;
        border-color: #ef4444;
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
    }
}

.sudoku-image {
    width: 50%;
    height: 50%;
    object-fit: contain;
    pointer-events: none;
}

/* ===== Tray ===== */
.sudoku-tray {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
}

.sudoku-tray-item {
    user-select: none;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0 0.75rem;
}

.sudoku-tray-item img {
    max-width: 100%; height: auto;
}

.sudoku-tray-item:hover {
    transform: translateY(-2px);
}

.sudoku-tray-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sudoku-tray-item:active {
    transform: translateY(0);
}

.sudoku-tray-image {
    object-fit: contain;
}

/* ===== Controls ===== */
.sudoku-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 16px;
}

.sudoku-btn {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 1rem;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sudoku-btn:hover {
    transform: translateY(-1px);
}

.sudoku-btn:active {
    transform: translateY(0);
}

.sudoku-erase-btn {
    background: #fef2f2;
    color: #be123c;
    border-color: #fbcfe8;
}

.sudoku-erase-btn:hover {
    background: #ffe0e6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sudoku-hint-btn {
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

.sudoku-hint-btn:hover {
    background: #fef3c7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sudoku-check-btn {
    background: #f0fdf4;
    color: #15803d;
    border-color: #86efac;
}

.sudoku-check-btn:hover {
    background: #dcfce7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sudoku-new-btn {
    background: #f0f9ff;
    color: #075985;
    border-color: #a5f3fc;
}

.sudoku-new-btn:hover {
    background: #e0f2fe;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ===== Message ===== */
.sudoku-message {
    padding: 12px 16px;
    border-radius: 1rem;
    font-weight: 600;
    display: none;
    margin-top: 12px;
    animation: message-slide 0.3s ease;
}

@keyframes message-slide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sudoku-message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.sudoku-message.error {
    display: block;
    background: #fef2f2;
    color: #be123c;
    border: 1px solid #fbcfe8;
}

/* ===== Accessibility ===== */
.sudoku-btn:focus-visible,
.sudoku-tray-item:focus-visible,
.sudoku-cell:not(.prefilled):focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
    .sudoku-3x3 {
        grid-template-columns: repeat(3, 70px);
    }

    .sudoku-4x4 {
        grid-template-columns: repeat(4, 70px);
    }

    .sudoku-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .sudoku-tray {
        gap: 10px;
    }

    .sudoku-tray-item {
        padding: 10px;
    }

    .sudoku-tray-image {
        width: 48px;
        height: 48px;
    }
}

/* Stílus a cellára, ami felett épp húznak egy elemet */
.sudoku-cell.drag-over {
    background-color: rgba(144, 238, 144, 0.5);
    /* Világoszöld áttetsző háttér */
    border: 2px dashed #383;
}

/* A tálcán lévő képek legyenek "fogható" kinézetűek */
.sudoku-tray-image {
    cursor: grab;
}

/* A kuka is legyen "fogható" */
.sudoku-erase-btn {
    cursor: grab;
}

/* Stílus a cellára, ami felett épp húznak egy elemet */
.sudoku-cell.drag-over {
    background-color: rgba(144, 238, 144, 0.5);
    /* Világoszöld áttetsző háttér */
    border: 2px dashed #383;
}

/* A tálcán lévő képek legyenek "fogható" kinézetűek */
.sudoku-tray-image {
    cursor: grab;
}

/* A kuka is legyen "fogható" */
.sudoku-erase-btn {
    cursor: grab;
}