/* ─── Cheat Sheet Badge (sparkle on nodes) ─────────────────────── */
.cheatsheet-badge {
    pointer-events: none;
    font-size: 10px;
    opacity: 0.85;
    filter: drop-shadow(0 0 2px rgba(255, 200, 0, 0.6));
    transition: opacity 0.3s ease;
}

/* ─── Floating Cheat Sheet Pill ────────────────────────────────── */
.cheatsheet-pill {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 100;
    display: flex;
    align-items: center;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #93c5fd;
    font-family: var(--font-main, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.cheatsheet-pill.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cheatsheet-pill:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
    color: #bfdbfe;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%) translateY(-1px);
}

.cheatsheet-pill:active {
    transform: translateX(-50%) translateY(0) scale(0.97);
}

.cheatsheet-pill-icon {
    font-size: 14px;
    display: flex;
    align-items: center;
}

.cheatsheet-pill-text {
    display: flex;
    align-items: center;
}

.cheatsheet-pill-title {
    font-size: 12px;
    font-weight: 600;
}

.cheatsheet-pill-hint {
    display: none;
}

.cheatsheet-pill-sparkle {
    display: none;
}

@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0.7; transform: scale(1) rotate(0deg); }
    50%      { opacity: 1;   transform: scale(1.25) rotate(8deg); }
}

/* ─── Lightbox Overlay (Dialog Box Style) ───────────────────────── */
.cheatsheet-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cheatsheet-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.cheatsheet-lightbox-content {
    background: var(--surface, #1e202c);
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border, #2a2d3a);
}

.cheatsheet-lightbox.open .cheatsheet-lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.cheatsheet-lightbox-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border, #2a2d3a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
}

.cheatsheet-lightbox-title {
    margin: 0;
    font-family: var(--font-main, 'Inter', sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #e8e8ed);
}

.cheatsheet-lightbox-close {
    background: none;
    border: none;
    color: var(--text-secondary, #9ba1b0);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 4px;
}

.cheatsheet-lightbox-close:hover {
    color: var(--text-primary, #e8e8ed);
    background: rgba(255,255,255,0.1);
}

.cheatsheet-lightbox-close:active {
    transform: scale(0.95);
}

.cheatsheet-lightbox-body {
    flex: 1;
    background: #fff;
    position: relative;
    overflow: hidden;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cheatsheet-pill {
        padding: 6px 14px;
        gap: 6px;
    }

    .cheatsheet-pill-icon {
        font-size: 14px;
    }

    .cheatsheet-pill-title {
        font-size: 12px;
    }

    .cheatsheet-lightbox {
        align-items: flex-start;
    }
    .cheatsheet-lightbox-content {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .cheatsheet-lightbox-header {
        padding: 10px 12px;
        padding-top: max(10px, env(safe-area-inset-top, 10px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
    }
    .cheatsheet-lightbox-title {
        font-size: 13px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .cheatsheet-lightbox-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
}

/* ─── Cheatsheet List Container ────────────────────────────────── */
.cheatsheet-lightbox-list-container {
    position: absolute;
    inset: 0;
    background: var(--bg, #0f1117);
    padding: 30px;
    overflow-y: auto;
    display: none;    
}

.cheatsheet-lightbox.list-mode .cheatsheet-lightbox-list-container {
    display: block;
}

.cheatsheet-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.cheatsheet-card {
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-width: 1px;
    border-style: solid;
    color: var(--text-primary);
    background: transparent;
}
.cheatsheet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    filter: brightness(1.25);
}
.cheatsheet-card .icon {
    font-size: 24px;
    margin-bottom: 4px;
}
.cheatsheet-card .title {
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-main, 'Inter', sans-serif);
}

.cheatsheet-lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.cheatsheet-lightbox-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
