/* -------------------------------------------------
       Global layout
    ------------------------------------------------- */
    #nm-game {
        max-width: 820px;
        margin: 0 auto;
        font-family: system-ui, sans-serif;
        text-align: center;
        position: relative;
        overflow: visible !important;
    }

    /* -------------------------------------------------
       ACTIVE STATES
    ------------------------------------------------- */

    /* DIFFICULTY BUTTONS — identical to Sudoku */
    .nm-diff {
        background: #ffffff;
        color: #111;
        border: 1px solid #cfcfcf;
        padding: 5px 14px;
        border-radius: 14px;
        cursor: pointer;
        font-size: .85rem;
        transition: 0.15s;
    }
    /* Difficulty buttons override global .nm-btn styling */
    .nm-btn.nm-diff {
        background: #ffffff !important;
        color: #111 !important;
        border: 1px solid #cfcfcf !important;
        box-shadow: none !important;
    }

        /* ACTIVE difficulty = blue */
        .nm-btn.nm-diff.nm-diff-active {
            background: #2563eb !important;
            color: #fff !important;
            border-color: #1d4ed8 !important;
            box-shadow: 0 0 0 2px rgba(37,99,235,0.4) !important;
        }




    /* Mode buttons (New Game / Daily) */
    .nm-mode-active {
        background: #2563eb !important;
        color: #fff !important;
    }

    /* -------------------------------------------------
       Stats row
    ------------------------------------------------- */
    .nm-stats {
        display: flex;
        justify-content: center;
        gap: 2rem;
        margin-bottom: 8px;
    }

    .nm-streak-warning {
        display: none;
        margin: 0 auto 10px;
        max-width: 820px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: .82rem;
        font-weight: 700;
        text-align: center;
        border: 1px solid #f59e0b;
        background: #fffbeb;
        color: #92400e;
    }

    .nm-streak-warning.show {
        display: block;
    }

    .nm-streak-warning.nm-streak-warning-critical {
        border-color: #ef4444;
        background: #fef2f2;
        color: #991b1b;
        animation: nmStreakWarnPulse 1.2s ease-in-out infinite;
    }

    @keyframes nmStreakWarnPulse {
        0%,
        100% {
            box-shadow: 0 0 0 0 rgba(239,68,68,0);
        }
        50% {
            box-shadow: 0 0 0 4px rgba(239,68,68,0.12);
        }
    }

    /* -------------------------------------------------
       Leaderboards
    ------------------------------------------------- */
    .nm-lb {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 14px;
        margin: 10px auto 14px;
        max-width: 820px;
        text-align: left;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }

        .nm-lb h3 {
            margin: 0 0 4px;
            font-size: 1rem;
        }

    .nm-lb-sub {
        margin: 0 0 10px;
        color: #6b7280;
        font-size: .85rem;
    }

    .nm-lb-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.85rem;
    }

        .nm-lb-table th,
        .nm-lb-table td {
            border-bottom: 1px solid #e5e7eb;
            padding: 4px 6px;
        }

        .nm-lb-table tr:nth-child(even) td {
            background: #f3f4f6;
        }

    /* -------------------------------------------------
       Buttons
    ------------------------------------------------- */
    .nm-buttons {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .nm-btn {
        padding: 6px 18px;
        border-radius: 999px;
        background: #2563eb;
        border: none;
        color: white;
        cursor: pointer;
        font-size: 0.9rem;
    }

    .nm-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
    }
    /* MODE BUTTONS — identical to Sudoku */
    .nm-mode-toggle {
        background: #ffffff;
        color: #111;
        border: 1px solid #cfcfcf;
        padding: 6px 18px;
        border-radius: 14px;
        cursor: pointer;
        font-size: .9rem;
        transition: 0.15s;
    }

        .nm-mode-toggle.nm-mode-active {
            background: #2563eb !important;
            color: #fff !important;
            border-color: #1d4ed8 !important;
            box-shadow: 0 0 0 2px rgba(37,99,235,0.4);
        }

    .nm-btn.nm-secondary {
        background: #6b7280;
    }

    .nm-tools {
        margin-top: -4px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .nm-tool-btn {
        background: #0f172a;
        color: #f8fafc;
        border: 1px solid #1e293b;
        padding: 6px 14px;
    }

    .nm-tool-btn.nm-tool-active {
        background: #f97316;
        border-color: #c2410c;
        box-shadow: 0 0 0 2px rgba(249,115,22,.25);
    }

    /* -------------------------------------------------
       Difficulty row
    ------------------------------------------------- */
    .nm-diff-row {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }

    .nm-diff-label {
        font-size: 0.85rem;
        color: #6b7280;
    }

    /* -------------------------------------------------
       Game board
    ------------------------------------------------- */
    .nm-board {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        gap: 6px;
        padding: 6px;
        background: #e5e7eb;
        border-radius: 12px;
        max-height: none !important;
        overflow-y: visible !important;
    }

    .nm-cell {
        aspect-ratio: 1/1;
        background: white;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2rem;
        font-weight: 700;
        cursor: pointer;
        transition: transform 0.1s ease;
    }

    .nm-cell.nm-streak-guard {
        background: #f8fafc;
    }

    .nm-cell.nm-streak-guard.nm-empty {
        background: #e6f6ec !important;
        border-color: #86efac;
    }

    .nm-cell.nm-streak-guard.nm-streak-blocked {
        box-shadow: inset 0 0 0 3px rgba(239,68,68,.35);
    }

    .nm-board.nm-tool-armed .nm-cell {
        cursor: crosshair;
    }

    .nm-cell.nm-neo-pick {
        outline: 3px solid #22c55e;
        outline-offset: -3px;
    }

    .nm-bomb-burst {
        position: absolute;
        transform: translate(-50%, -50%) scale(.25);
        border-radius: 999px;
        pointer-events: none;
        background: radial-gradient(circle, rgba(251,146,60,0.92) 0%, rgba(249,115,22,0.46) 42%, rgba(249,115,22,0.08) 75%, rgba(249,115,22,0) 100%);
        box-shadow: 0 0 0 0 rgba(249,115,22,.30);
        z-index: 13000;
        animation: nmBombBurst .45s ease-out forwards;
    }

    @keyframes nmBombBurst {
        0% {
            opacity: .98;
            transform: translate(-50%, -50%) scale(.25);
        }
        70% {
            opacity: .7;
            transform: translate(-50%, -50%) scale(1);
        }
        100% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(1.2);
        }
    }

    .nm-rocket-trail {
        position: absolute;
        pointer-events: none;
        z-index: 13000;
        border-radius: 999px;
        animation: nmRocketTrail .4s ease-out forwards;
    }

    .nm-rocket-trail.row {
        height: 6px;
        background: linear-gradient(90deg, rgba(14,165,233,.05) 0%, rgba(14,165,233,.9) 50%, rgba(14,165,233,.05) 100%);
    }

    .nm-rocket-trail.col {
        width: 6px;
        background: linear-gradient(180deg, rgba(14,165,233,.05) 0%, rgba(14,165,233,.9) 50%, rgba(14,165,233,.05) 100%);
    }

    @keyframes nmRocketTrail {
        0% {
            opacity: .95;
            filter: blur(0px);
        }
        100% {
            opacity: 0;
            filter: blur(2px);
        }
    }

    .nm-board.nm-neo-scan {
        animation: nmNeoBoard .5s ease-out;
    }

    @keyframes nmNeoBoard {
        0% {
            box-shadow: 0 0 0 rgba(34,197,94,0);
        }
        50% {
            box-shadow: 0 0 0 4px rgba(34,197,94,.35);
        }
        100% {
            box-shadow: 0 0 0 rgba(34,197,94,0);
        }
    }

    .nm-cell.nm-neo-focus {
        animation: nmNeoFocus .6s ease-out;
    }

    @keyframes nmNeoFocus {
        0% {
            transform: scale(1);
            box-shadow: inset 0 0 0 0 rgba(34,197,94,.2);
        }
        45% {
            transform: scale(1.04);
            box-shadow: inset 0 0 0 4px rgba(34,197,94,.45);
        }
        100% {
            transform: scale(1);
            box-shadow: inset 0 0 0 0 rgba(34,197,94,0);
        }
    }

    .nm-empty {
        background: #cfd3d7 !important;
        cursor: default;
    }

    .nm-selected {
        background: #dbeafe !important;
        border: 2px solid #2563eb;
    }

    .nm-original {
        color: #1d4ed8; /* blå */
    }

    .nm-block {
        background: #4b5563 !important;
        border-color: #111827;
        cursor: default;
    }

    /* -------------------------------------------------
       Animations
    ------------------------------------------------- */
    .nm-match {
        animation: nmMatchFlash 0.6s ease-out;
    }

    @keyframes nmMatchFlash {
        0% {
            transform: scale(1);
            background: #dbeafe;
        }

        50% {
            transform: scale(1.08);
            background: #bfdbfe;
        }

        100% {
            transform: scale(1);
            background: white;
        }
    }

    .nm-line {
        position: absolute;
        height: 4px;
        background: rgba(37,99,235,0.55);
        border-radius: 2px;
        transform-origin: 0 50%;
        z-index: 5000;
        pointer-events: none;
    }

    .nm-float-score {
        position: absolute;
        pointer-events: none;
        font-weight: 700;
        font-size: 1.1rem;
        color: #16a34a;
        animation: nmScoreFloat 1.4s ease-out forwards;
    }

    @keyframes nmScoreFloat {
        0% {
            opacity: 1;
            transform: translate(-50%, -50%);
        }

        100% {
            opacity: 0;
            transform: translate(-50%, -120%);
        }
    }
    /* Streak popup + pulse */
    .nm-streak-popup {
        position: absolute;
        left: 50%;
        top: 64px;
        transform: translateX(-50%) translateY(0) scale(.98);
        background: #0f172a;
        color: #fff;
        padding: 8px 14px;
        border-radius: 12px;
        font-weight: 800;
        z-index: 12000;
        opacity: 0;
        pointer-events: none;
        transition: transform .36s cubic-bezier(.2,.9,.2,1), opacity .36s;
    }

        .nm-streak-popup.show {
            transform: translateX(-50%) translateY(-8px) scale(1);
            opacity: 1;
        }

    /* subtle board pulse when streak granted */
    .nm-board.nm-streak-pulse {
        animation: nmStreakPulse .8s ease-in-out 0s 2;
    }

    @keyframes nmStreakPulse {
        0% {
            box-shadow: 0 0 0 rgba(37,99,235,0);
        }

        50% {
            box-shadow: 0 12px 28px rgba(37,99,235,0.10);
        }

        100% {
            box-shadow: 0 0 0 rgba(37,99,235,0);
        }
    }

    /* HIGHLIGHT: visually mark the target rows that must be kept clear for a streak */
    .nm-cell.nm-streak-target {
        box-shadow: inset 0 0 0 3px rgba(37,99,235,0.10);
        transition: box-shadow .36s, transform .36s;
    }

        .nm-cell.nm-streak-target.pulse {
            transform: translateY(-4px);
        }
    /* -------------------------------------------------
       Game Over overlay
    ------------------------------------------------- */
    .nm-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9000;
    }

        .nm-overlay.hidden {
            display: none;
        }

    .nm-box {
        background: white;
        padding: 20px;
        border-radius: 12px;
        width: 240px;
    }

    /* Submit section */
    .nm-submit {
        margin: 10px 0 12px;
        text-align: left;
    }

    .nm-submit-row {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 6px 0;
        font-size: 0.9rem;
    }

    #nm-name {
        flex: 1;
        padding: 4px 8px;
        border-radius: 6px;
        border: 1px solid #d1d5db;
    }

    .nm-submit-msg {
        margin: 4px 0 0;
        font-size: 0.8rem;
        color: #16a34a;
    }
.float-row-cleared {
    position: fixed;
    pointer-events: none;
    font-size: 24px;
    font-weight: 700;
    color: #ff9800;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease-out, transform 0.8s ease-out;
    z-index: 9999;
    text-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.float-row-cleared.float-active {
    opacity: 1;
    transform: translateY(-20px);
}
.nm-row-popup {
    position: fixed;
    left: 50%;
    top: 120px;
    transform: translateX(-50%) scale(.92);
    background: #f97316;
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-weight: 800;
    z-index: 15000;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: opacity .35s ease-out, transform .35s ease-out;
}

.nm-row-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1);
}

    /* -------------------------------------------------
       Calendar popup
    ------------------------------------------------- */
    .nm-cal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9500;
    }

        .nm-cal-overlay.hidden {
            display: none;
        }

    .nm-cal-box {
        background: #f9fafb;
        border-radius: 20px;
        padding: 16px;
        width: min(360px, 92vw);
    }

    .nm-cal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nm-cal-weekdays {
        margin: 10px 0 6px;
        display: grid;
        grid-template-columns: repeat(7,1fr);
        font-size: 0.75rem;
        color: #6b7280;
    }

    .nm-cal-grid {
        display: grid;
        grid-template-columns: repeat(7,1fr);
        gap: 4px;
    }

    .nm-cal-day {
        padding: 6px 0;
        text-align: center;
        border-radius: 999px;
        cursor: pointer;
    }

        .nm-cal-day.nm-cal-selected {
            background: #2563eb;
            color: white;
            font-weight: 700;
        }

        .nm-cal-day.nm-cal-today {
            border: 1px solid #60a5fa;
        }

    /* Fix Elementor containers */
    #nm-board,
    #nm-game {
        min-height: 0 !important;
        height: auto !important;
    }
