/* Neon Fuse — merge-drop arcade well. Dark neon page skin over the shared
   game-chrome wrapper (same structure as the other games). */

body {
    background-color: #0a0c16;
}

.game-wrapper {
    position: relative;
    max-width: 560px;
    margin: 1.25rem auto 2.5rem;
    padding: 0 12px;

    /* The game's own type — never inherit the page's (a Bootstrap CDN miss
       used to drop every panel into Times New Roman). Tabular figures keep
       scores from wobbling as digits change. */
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums;

    /* Nothing in the game chrome is text you'd want to copy, and aiming is a
       press-and-slide gesture — without this, a drag across a panel highlights
       menu copy, and a long-press on mobile raises the selection callout mid-run. */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ...except anything genuinely meant to be copied. The share fallback exists
   precisely because the clipboard was denied, so it has to stay selectable. */
.game-wrapper .nf-sharetext,
.game-wrapper input,
.game-wrapper textarea {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.game-header-integrated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0d1020;
    border: 1px solid #232a4a;
    border-radius: 12px 12px 0 0;
    padding: 10px 14px;
}

.game-logo {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    font-size: 1.25rem;
    margin: 0;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.65);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.high-score-display {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #9deaff;
    background: rgba(0, 229, 255, 0.12);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
}

.mute-btn {
    background: #171c33;
    color: #fff;
    border: 1px solid #2c3560;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.mute-btn:hover { background: #232b4d; }

/* Off state for the sound/music toggles — dimmed, not hidden, so the
   control stays discoverable while clearly reading as inactive. */
.mute-btn.is-off { opacity: 0.45; }

.canvas-container {
    position: relative;
    width: 100%;
    height: 70vh; /* fallback for browsers without dvh */
    height: max(460px, min(calc(100dvh - 172px), 880px));
    background: #05060f;
    border: 1px solid #232a4a;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    /* Theme accents — neon-fuse.js rewrites these per selected theme, so the
       DOM chrome reskins with the canvas instead of staying cyan forever. */
    --nf-accent: #00e5ff;
    --nf-accent2: #ff3db8;
    --chrome-accent: #00b8d4;
    --chrome-panel-bg: #10142a;
    font-family: inherit;
}

.canvas-container canvas#fuse {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

@supports (padding: max(0px)) {
    .game-wrapper {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

.canvas-container:fullscreen,
.canvas-container:-webkit-full-screen {
    height: 100%;
    border: none;
    border-radius: 0;
}

/* Overlay panels — faded + risen in via .nf-on (showScreen adds it a frame
   after display:flex), never snapped with a bare display flip. */
.nf-overlay {
    position: absolute;
    inset: 0;
    z-index: 65; /* above the shared chrome cluster (60), below its modal (70) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    background: rgba(4, 6, 14, 0.72);
    backdrop-filter: blur(9px) saturate(0.75);
    -webkit-backdrop-filter: blur(9px) saturate(0.75);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nf-overlay.nf-on { opacity: 1; pointer-events: auto; }

.nf-overlay .nf-panel {
    opacity: 0;
    transform: translateY(14px) scale(0.955);
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.18, 0.9, 0.28, 1.06);
}

.nf-overlay.nf-on .nf-panel { opacity: 1; transform: none; }

/* The menu is the one overlay that should NOT bury the board — the attract
   demo behind it is what teaches the fuse rule. Lighter scrim, softer blur,
   and the scrim fades off entirely over the bottom third. */
#menu-screen {
    background: linear-gradient(180deg,
        rgba(4, 6, 14, 0.66) 0%, rgba(4, 6, 14, 0.55) 55%, rgba(4, 6, 14, 0.2) 100%);
    backdrop-filter: blur(3px) saturate(0.9);
    -webkit-backdrop-filter: blur(3px) saturate(0.9);
}

/* Game-over rows cascade in (delay set per-row from JS via --nfd) */
#over-body > * {
    animation: nf-badge-in 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
    animation-delay: var(--nfd, 0ms);
}

@media (prefers-reduced-motion: reduce) {
    .nf-overlay { transition: opacity 0.12s linear; }
    .nf-overlay .nf-panel { transition: opacity 0.12s linear; transform: none; }
    #over-body > * { animation: none; }
}

.nf-panel {
    background: rgba(13, 16, 32, 0.96);
    color: #e8ecff;
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 18px;
    padding: 22px 22px 20px;
    max-width: 400px;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 34px rgba(0, 229, 255, 0.1),
        0 18px 50px rgba(0, 0, 0, 0.65);
}

.nf-panel h2 {
    margin: 0 0 4px;
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.nf-logo-text {
    background: linear-gradient(100deg, #35e0ff 15%, #ff3db8 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 14px rgba(53, 224, 255, 0.45));
}

.nf-panel .tagline {
    margin: 0 0 14px;
    color: #8b95c9;
    font-size: 0.9rem;
}

.nf-menu-best { font-size: 0.98rem; color: #b8c2ee; margin-bottom: 8px; }
.nf-menu-best strong { color: #fff; font-size: 1.15rem; }

/* Level / XP bar */
.nf-lvrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.nf-lv-pill {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #05060f;
    background: linear-gradient(135deg, var(--nf-accent, #35e0ff), color-mix(in srgb, var(--nf-accent, #7cc4f5) 55%, #ffffff));
    border-radius: 999px;
    padding: 3px 9px;
    box-shadow: 0 0 10px rgba(53, 224, 255, 0.4);
}

.nf-lv-pill.nf-dim {
    background: #1d2440;
    color: #8b95c9;
    box-shadow: none;
}

.nf-xp-track {
    flex: 1;
    height: 9px;
    background: #171c33;
    border-radius: 6px;
    overflow: hidden;
}

.nf-xp-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--nf-accent, #35e0ff), var(--nf-accent2, #ff3db8));
    box-shadow: 0 0 8px rgba(53, 224, 255, 0.6);
    transition: width 0.7s ease;
}

.nf-fine { font-size: 0.76rem; color: #8b95c9; margin: 2px 0 10px; }
.nf-h3 {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #b8c2ee;
    margin: 12px 0 7px;
    text-align: left;
}

/* Theme swatches */
.nf-swatch-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 6px;
    flex-wrap: wrap;
}

.nf-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    padding: 0;
    transition: transform 0.1s, box-shadow 0.15s;
}

.nf-swatch:not(.locked):hover { transform: scale(1.08); }
.nf-swatch.sel {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 14px rgba(53, 224, 255, 0.5);
}

/* Locked = aspirational, not mud: the gradient stays at full brightness;
   the lock reads from the LV chip stamped on the disc. */
.nf-swatch.locked {
    cursor: default;
    box-shadow: inset 0 0 0 44px rgba(6, 8, 16, 0.22);
}

.nf-swatch.locked > span {
    background: rgba(6, 8, 16, 0.78);
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.62rem;
    letter-spacing: 0.4px;
}

/* Badges */
.nf-badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-bottom: 8px;
}

/* A badge is an orb. The whole game is luminous discs with haloes, so the
   trophy case is built from the same material: earned badges are lit, locked
   ones are dead glass. The card chrome is gone — boxes around boxes added
   weight without adding meaning, and the disc alone carries the state. */
.nf-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 2px 4px;
    text-align: center;
    animation: nf-badge-in 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
    animation-delay: var(--nfd, 0ms);
}

.nf-badge-disc {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.28rem;
    line-height: 1;
}

.nf-badge.earned .nf-badge-disc {
    color: var(--bc, #35e0ff);
    border: 2px solid currentColor;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.18), rgba(5, 6, 15, 0.92) 72%);
    box-shadow: 0 0 15px -2px currentColor, inset 0 0 12px -7px currentColor;
}

.nf-badge.locked .nf-badge-disc {
    color: #39426e;
    border: 1.5px dashed currentColor;
    background: rgba(255, 255, 255, 0.02);
    /* The icon still shows — dimmed to a silhouette, so it reads as a prize
       not yet won rather than a blank slot. */
    filter: grayscale(1) brightness(0.65);
    opacity: 0.55;
}

.nf-badge-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: #e8ecff;
    letter-spacing: 0.2px;
}

.nf-badge.locked .nf-badge-name { color: #6c76a6; }

/* Clamped to two lines with a reserved height: the descriptions run up to
   ~30 characters, and free-height cards were clipping the longer ones
   mid-word and knocking every row out of alignment. */
.nf-badge-how {
    font-size: 0.66rem;
    color: #8b95c9;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.nf-badge.locked .nf-badge-how { color: #59618c; }

.nf-count {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8b95c9;
    letter-spacing: 0;
    margin-left: 6px;
}

@keyframes nf-badge-in {
    from { opacity: 0; transform: translateY(7px) scale(0.9); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nf-badge { animation: none; }
}

/* Game-over */
.nf-newbest {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffe83d;
    text-shadow: 0 0 12px rgba(255, 232, 61, 0.6);
    margin: 0 0 2px;
    animation: nf-pulse 1.1s ease-in-out infinite;
}

@keyframes nf-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.nf-over-score {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(53, 224, 255, 0.55);
    margin: 2px 0;
}

.nf-over-sub { font-size: 0.86rem; color: #8b95c9; margin: 0 0 10px; }
.nf-lvup { color: #a6ff3d; letter-spacing: 1px; }

/* Top fuse of the run — the orb sprite next to its name */
.nf-topfuse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2px 0 6px;
    font-size: 0.95rem;
    color: #b8c2ee;
}
.nf-topfuse em { font-style: normal; font-weight: 800; color: #fff; }
.nf-topfuse img { display: block; }

/* Unlock chips (capped row) on the game-over screen */
.nf-unlock-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 4px;
}

.nf-chip {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e8ecff;
    background: rgba(53, 224, 255, 0.1);
    border: 1px solid rgba(53, 224, 255, 0.3);
    border-radius: 999px;
    padding: 5px 12px;
}

.nf-chip-more {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: #8b95c9;
    font-weight: 600;
}

/* ------------------------------------------------------------------ daily --
   The daily sits directly under PLAY as the second call to action. It reads
   magenta against PLAY's cyan so the two never blur into one button stack. */
.nf-daily-btn {
    display: block;
    width: 100%;
    margin: 12px 0 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(255, 61, 184, 0.14), rgba(185, 61, 255, 0.12));
    border: 1px solid rgba(255, 61, 184, 0.38);
    border-radius: 14px;
    color: #e8ecff;
    cursor: pointer;
    text-align: center;
    touch-action: manipulation;
    transition: border-color 0.15s, background 0.15s;
}

.nf-daily-btn:hover {
    background: linear-gradient(135deg, rgba(255, 61, 184, 0.22), rgba(185, 61, 255, 0.18));
    border-color: rgba(255, 61, 184, 0.6);
}

.nf-daily-btn:active { transform: scale(0.985); }

.nf-daily-btn.is-done {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.14);
}

.nf-daily-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.nf-daily-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    color: #b8c2ee;
}

.nf-daily-btn.is-done .nf-daily-sub { color: #8b95c9; }

.nf-menu-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nf-menu-links .mode-button { padding: 8px 16px; font-size: 0.82rem; }

.nf-who { margin: 8px 0 0; opacity: 0.85; }
.nf-who strong { color: #d5dbf8; }
.nf-link { color: var(--nf-accent, #35e0ff); }

/* ----------------------------------------------------------------- boards --
   Tabbed leaderboard. Rows are a fixed 3-column grid so ranks, names and
   scores stay in their lanes no matter how long a generated username runs. */
.nf-tabs {
    display: flex;
    gap: 4px;
    margin: 10px 0 12px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.nf-tab {
    flex: 1 1 0;
    padding: 7px 4px;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: #8b95c9;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.nf-tab.is-on {
    background: linear-gradient(135deg, var(--nf-accent, #35e0ff), var(--nf-accent2, #b93dff));
    color: #05060f;
    box-shadow: 0 0 12px rgba(53, 224, 255, 0.35);
}

.nf-board { display: flex; flex-direction: column; gap: 3px; }

.nf-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.84rem;
    text-align: left;
}

.nf-row.is-me {
    background: rgba(53, 224, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(53, 224, 255, 0.32);
}

.nf-rank { font-weight: 800; color: #8b95c9; font-size: 0.76rem; }
.nf-row:nth-child(1) .nf-rank { color: #ffd166; }
.nf-row:nth-child(2) .nf-rank { color: #d8dcf0; }
.nf-row:nth-child(3) .nf-rank { color: #e0a06a; }

.nf-name {
    color: #e8ecff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nf-name em { font-style: normal; color: #8b95c9; font-weight: 500; font-size: 0.74rem; }
.nf-score { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

.nf-empty { color: #8b95c9; font-size: 0.84rem; padding: 18px 0; }

/* The fusion ladder on the game-over panel — the same shape the share card
   draws, so pressing Share is an obvious move. */
.nf-ladder {
    margin: 6px 0 2px;
    font-size: 1.05rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.nf-ladder-lit {
    color: #35e0ff;
    text-shadow: 0 0 10px rgba(53, 224, 255, 0.6);
}

/* Manual-copy fallback when the browser denies both share and clipboard */
.nf-sharetext {
    width: 100%;
    background: #05060f;
    color: #e8ecff;
    border: 1px solid #2c3560;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    resize: none;
}

/* Rank line under a finished run */
.nf-rankline {
    margin: 10px 0 2px;
    font-size: 0.86rem;
    color: #b8c2ee;
}

.nf-rankline strong { color: #fff; }

#boards-screen .nf-panel {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

#board-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 120px;
}

/* Game-over panel: scrollable body, CTA always visible */
#over-screen .nf-panel {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

#over-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.nf-cta {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding: 10px 0 16px;
    background: linear-gradient(180deg, rgba(13, 16, 32, 0) 0%, rgba(13, 16, 32, 0.97) 32%);
}

.nf-cta .mode-button { margin: 10px 4px 0; }

/* Progress panel: same sticky-footer pattern + scroll fade hint */
#progress-screen .nf-panel {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

#progress-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 90%, transparent);
    mask-image: linear-gradient(180deg, #000 90%, transparent);
}

/* Buttons */
.play-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--nf-accent, #00d9ff), var(--nf-accent2, #b93dff));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 13px 42px;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 22px rgba(0, 217, 255, 0.45), 0 6px 18px rgba(0, 0, 0, 0.5);
    transition: transform 0.12s, box-shadow 0.15s;
    touch-action: manipulation;
    margin-top: 6px;
}

.play-button:hover { box-shadow: 0 0 30px rgba(0, 217, 255, 0.65), 0 6px 18px rgba(0, 0, 0, 0.5); }
.play-button:active { transform: scale(0.96); }

.mode-button {
    background: #171c33;
    color: #d5dbf8;
    border: 1px solid #2c3560;
    border-radius: 999px;
    padding: 9px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
}

.mode-button:hover { background: #232b4d; }

/* The shared chrome cluster (? / fullscreen): keep it top-right but compress
   to icon-only squares so it shares the top strip with the pause chip and
   stays clear of the canvas-drawn HUD row below. */
.canvas-container .rmc-cluster {
    top: 8px;
    right: 8px;
    gap: 6px;
}

.canvas-container .rmc-btn {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
    font-size: 0;          /* hides the "Fullscreen" text node */
    border-radius: 10px;
}

.canvas-container .rmc-btn span { font-size: 17px; }
.canvas-container .rmc-help { font-size: 17px; }   /* '?' is a bare text node */

/* Panels own the screen — no chrome floating above them */
.canvas-container.nf-hide-chrome .rmc-cluster { display: none; }

/* In-game pause chip — top-left, mirroring the chrome cluster */
.nf-pause-btn {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 45;
    width: 38px;
    height: 38px;
    background: #10142a;
    color: #fff;
    border: 1px solid color-mix(in srgb, var(--nf-accent, #35e0ff) 55%, transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--nf-accent, #35e0ff) 25%, transparent);
    border-radius: 10px;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: none;
}

.nf-pause-btn:hover,
.nf-pause-btn:active {
    border-color: var(--nf-accent, #35e0ff);
}

/* Toasts */
#toast-box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.nf-toast {
    background: rgba(13, 16, 32, 0.94);
    border: 1px solid rgba(53, 224, 255, 0.35);
    color: #e8ecff;
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 8px 18px;
    box-shadow: 0 0 18px rgba(53, 224, 255, 0.18), 0 8px 22px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s, transform 0.35s;
}

.nf-toast.nf-show { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .nf-newbest { animation: none; }
    .nf-toast { transition: none; }
    .nf-xp-fill { transition: none; }
}

/* ------------------------------------------------------------- polish pass --
   Ergonomics + accessibility: commercial-grade touch targets, tap feedback,
   keyboard focus, and phone-width chrome that stays out of the canvas HUD. */

/* 44px minimum touch targets on all panel controls (padding carries the
   size — font stays as designed) */
.mode-button,
.nf-daily-btn,
.play-button {
    min-height: 44px;
}

.mute-btn,
.nf-tab {
    min-height: 40px;
}

/* Touch tap feedback — :hover never fires on touch, so secondary buttons
   need a real :active state */
.mode-button:active,
.nf-tab:active {
    transform: scale(0.96);
    background: #232b4d;
}

.nf-swatch:not(.locked):active { transform: scale(0.94); }

/* Keyboard focus that survives the dark theme */
.play-button:focus-visible,
.mode-button:focus-visible,
.nf-daily-btn:focus-visible,
.nf-tab:focus-visible,
.nf-swatch:focus-visible,
.mute-btn:focus-visible,
.nf-pause-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nf-accent, #35e0ff) 65%, transparent);
}

/* Disabled daily copy: solid muted color instead of opacity-dimming the
   whole button below AA contrast */
.nf-daily-btn:disabled { cursor: default; }
.nf-daily-btn:disabled .nf-daily-sub { color: #9aa3cc; }

/* Game over is the emotional peak — give its panel an accent signature */
#over-screen .nf-panel {
    border-top: 2px solid var(--nf-accent, #35e0ff);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 56px color-mix(in srgb, var(--nf-accent, #00e5ff) 16%, transparent),
        0 18px 50px rgba(0, 0, 0, 0.65);
}

/* Phone widths: the floating chrome shrinks and goes opaque so any brush
   against the canvas HUD reads as "under a control", never corrupted text */
@media (max-width: 400px) {
    .nf-pause-btn,
    .canvas-container .rmc-btn {
        width: 34px;
        height: 34px;
    }
    /* Opaque so anything beneath reads as "under a control", not corrupted */
    .nf-pause-btn,
    .canvas-container .rmc-btn { background: #10142a; }
}

/* ---------------------------------------------------------------- settings --
   Style/comfort options. Rows are label-wrapped so the whole line is the hit
   target; native range/checkbox pick up the theme via accent-color. */
.nf-set {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0 6px;
    text-align: left;
}

.nf-set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 44px;
    padding: 4px 6px;
    border-radius: 10px;
    cursor: pointer;
}

.nf-set-row:hover { background: rgba(255, 255, 255, 0.04); }

.nf-set-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e8ecff;
}

.nf-set-name em {
    display: block;
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 500;
    color: #8b95c9;
    margin-top: 1px;
}

.nf-set-row input[type="range"] {
    flex: 0 0 46%;
    accent-color: var(--nf-accent, #35e0ff);
    cursor: pointer;
}

.nf-set-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    accent-color: var(--nf-accent, #35e0ff);
    cursor: pointer;
}

/* Rapid Start: button + fill-level selector share one row under PLAY */
.nf-rapid-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 0;
}

.nf-rapid-row .mode-button { margin-top: 0; }

.nf-rapid-tabs {
    flex: 0 1 150px;
    margin: 0;
}

.nf-rapid-tabs .nf-tab {
    padding: 7px 2px;
    font-size: 0.72rem;
    min-height: 36px;
}
