/* Fubuki CSS */
.fubuki-wrapper {
    width: 100%;
}

.fubuki-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
    max-width: 380px;
    margin: 0 auto;
    align-items: stretch;
}

.fubuki-board[data-size="4"] {
    max-width: 480px;
}

.fubuki-board-grid {
    display: grid;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.fubuki-col-sums {
    display: grid;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.fubuki-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    text-align: center;
    font-size: clamp(1.1rem, 3.8vw, 1.75rem);
    font-weight: 700;
    color: #1e293b;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.fubuki-cell-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.fubuki-cell:focus {
    border-color: #6366f1;
    background: #f8fafc;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.fubuki-cell--given {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.fubuki-cell--bad {
    background: var(--color-accent-rose);
    border-color: var(--color-rose-300);
}

.fubuki-cell--warn {
    background: var(--color-accent-amber);
    border-color: var(--color-amber-300);
}

.fubuki-cell--good {
    background: var(--color-accent-green);
    border-color: var(--color-emerald-300);
}

.fubuki-cell--diag-main,
.fubuki-cell--diag-anti {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

.fubuki-sum {
    text-align: center;
    font-weight: 700;
    color: #475569;
    min-height: 2.5rem;
}

.fubuki-sum--diag {
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fubuki-sum--col {
    padding-top: 2px;
}

.fubuki-sum--filler {
    opacity: 0;
}

.fubuki-sum--empty {
    background: transparent;
    border: none;
    box-shadow: none;
    color: transparent;
}

.fubuki-board[data-size="4"] .fubuki-cell {
    font-size: 1.1rem;
}

.fubuki-status {
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.error-message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.error-message.error {
    background: #ffcdd2;
    color: #c62828;
}

.error-message.success {
    background: #c8e6c9;
    color: #2e7d32;
}

button,
.fubuki-cell,
.numpad-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {

    .fubuki-board-grid,
    .fubuki-col-sums {
        gap: 8px;
    }
}