:root {
    --ll-shell: 1400px;
}

.ll-page {
    width: min(var(--ll-shell), calc(100% - 24px));
    margin: 0 auto;
    padding: 93px 0 48px;
}

/* .pg-hero {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(700px 320px at 10% 20%, var(--hero-a), transparent 60%),
    radial-gradient(600px 280px at 85% 30%, var(--hero-b), transparent 60%),
    radial-gradient(500px 240px at 60% 80%, var(--hero-c), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
} */

.pg-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 9px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(109, 93, 252, 0.18);
    background: linear-gradient(135deg,
            rgba(109, 93, 252, 0.08),
            rgba(255, 122, 168, 0.04));
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(109, 93, 252, 0.06);
}

.pg-title {
    margin: 12px 0 13px;
    font-size: clamp(30px, 4.4vw, 47px);
    line-height: 1.05;
}

.pg-subtitle {
    max-width: 760px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}

.pg-controls {
    margin-top: 16px;
}

.pg-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: relative;
}

/* Search suggestions dropdown - DARK & LIGHT MODE COMPATIBLE */
#searchSuggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

#searchSuggestions.show {
    display: block;
    animation: dropdownSlideDown 0.2s ease-out;
}

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

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

.pg-suggestion-item {
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: 0.15s ease;
    border-bottom: 1px solid var(--border);
    display: block;
    font-weight: 500;
}

.pg-suggestion-item:last-child {
    border-bottom: none;
}

.pg-suggestion-item:hover,
.pg-suggestion-item.is-active {
    background: var(--surface-3);
    padding-left: 16px;
    color: var(--primary);
}

.pg-suggestion-item:active {
    background: var(--surface);
}

.pg-search-input,
.pg-sort-select {
    height: 36px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    padding: 0 14px;
    font-size: 14px;
}

.pg-search-input {
    flex: 1;
    border: none;
    background: transparent;
    height: 46px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.pg-search-btn {
    height: 42px;
    border: none;
    border-radius: 16px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.pg-filters-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 23px;
}

.pg-chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pg-chip {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s ease;
}

.pg-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 93, 252, 0.3);
}

.pg-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--btn-solid-text);
    border-color: transparent;
}

.pg-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 21px;
}

/* Prompt gallery — compact stats row (neutral, ~search bar height) */
.pg-stats--premium {
    margin-top: 24px;
    margin-bottom: 44px;
    padding: 0;
    gap: 0;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    min-height: 52px;
    align-items: stretch;
    overflow: hidden;
}

/* Default stat tiles (courses, tutorials, category pages) */
.pg-stats .pg-stat {
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.pg-stats:not(.pg-stats--premium) .pg-stat-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.pg-stats:not(.pg-stats--premium) .pg-stat strong {
    font-size: 18px;
}

.pg-stats--premium .pg-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 8px 14px;
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    box-shadow: none;
}

.pg-stats--premium .pg-stat:last-child {
    border-right: none;
}

.pg-stats--premium .pg-stat-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
    line-height: 1.25;
    margin: 0;
}

.pg-stats--premium .pg-stat-value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46%;
}

@media (max-width: 760px) {
    .pg-stats--premium .pg-stat {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 48px;
    }

    .pg-stats--premium .pg-stat:last-child {
        border-bottom: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-stats--premium {
        box-shadow: var(--shadow-sm);
    }
}

/* Section hub: breathing room below stats + above content */
.pg-section-hub {
    margin-top: 28px;
    margin-bottom: 22px;
}

/* Prompt gallery: categories only in horizontal hub; hide duplicate full-width rails.
   !important beats inline display from legacy render helpers after fetch. */
main.ll-page.pg-page--hub-rails-only #trendingStrip,
main.ll-page.pg-page--hub-rails-only #promptBundleSection,
main.ll-page.pg-page--hub-rails-only #promptClusterSection,
main.ll-page.pg-page--hub-rails-only #premiumSection,
main.ll-page.pg-page--hub-rails-only #exclusiveSection,
main.ll-page.pg-page--hub-rails-only #packSection,
main.ll-page.pg-page--hub-rails-only #trendingTodaySection,
main.ll-page.pg-page--hub-rails-only #trendingWeekSection,
main.ll-page.pg-page--hub-rails-only #leaderboardSection,
main.ll-page.pg-page--hub-rails-only #weeklyDropsSection,
main.ll-page.pg-page--hub-rails-only #battlesSection,
main.ll-page.pg-page--hub-rails-only #recentSection,
main.ll-page.pg-page--hub-rails-only #personalizedSection {
    display: none !important;
}

/* Courses / Tutorials listing: horizontal hub strip only (no duplicate full-width rails) */
main.ll-page.pg-page--learn-hub-rails-only #courseToolLanding,
main.ll-page.pg-page--learn-hub-rails-only #courseFeaturedSection,
main.ll-page.pg-page--learn-hub-rails-only #courseWeekSection,
main.ll-page.pg-page--learn-hub-rails-only #courseRecentSection {
    display: none !important;
}

/* Prompt Battles inside hub modal */
.pg-hub-battle-stage {
    display: none;
    flex-direction: column;
    gap: 22px;
    padding: 4px 2px 16px;
    width: 100%;
    box-sizing: border-box;
}

.pg-hub-battle-stage .battle-card {
    max-width: 100%;
    margin: 0;
}

.pg-hub-battle-slot {
    width: 100%;
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.pg-card {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    isolation: isolate;
    transform: none;
}

.pg-card:hover {
    transform: none;
}

.pg-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(6, 8, 18, 0.88) 0%,
            rgba(6, 8, 18, 0.55) 35%,
            rgba(6, 8, 18, 0.06) 72%,
            rgba(6, 8, 18, 0.02) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pg-card-media {
    /* Allow preview controls to stack above .pg-card-bottom (sibling) via z-index */
    display: contents;
}

.pg-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s ease, transform 0.45s ease, filter 0.35s ease;
}

.pg-card-image-after {
    opacity: 1;
    transform: scale(1);
}

.pg-card-image-before {
    opacity: 0;
    transform: scale(1.03);
}

.pg-card.is-previewing .pg-card-image-before {
    opacity: 1;
    transform: scale(1);
}

.pg-card.is-previewing .pg-card-image-after {
    opacity: 0.18;
    transform: scale(1.02);
}

.pg-card-top {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pg-card-preview-toggle {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 3;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(18, 18, 24, 0.88);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: 0.25s ease;
}

.pg-card-preview-cue {
    position: absolute;
    right: 14px;
    top: 56px;
    z-index: 3;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(18, 18, 24, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-6px);
    transition: 0.25s ease;
}

.pg-card:hover .pg-card-preview-toggle,
.pg-card:hover .pg-card-preview-cue,
.pg-card.is-previewing .pg-card-preview-toggle,
.pg-card.is-previewing .pg-card-preview-cue {
    opacity: 1;
    transform: translateY(0);
}

.pg-badge,
.pg-likes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(18, 18, 24, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
}

.pg-card-bottom {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    color: #fff;
    padding-bottom: 2px;
}

.pg-card-title {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.15;
    color: #fff;
}

.pg-card-preview {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.65;
    font-size: 13px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pg-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.pg-card-creator {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.pg-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pg-card-copy,
.pg-card-premium {
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}

.pg-card-copy {
    background: rgb(255 255 255 / 11%);
    color: #ffffff;
}

.pg-card-copy:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: #7c5cff;
    color: #7c5cff;
    background: rgba(124, 92, 255, 0.08);
}

.pg-card-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.pg-card-locked .pg-card-preview {
    filter: blur(3px);
}

.pg-card-lockmark {
    display: inline-flex;
    margin-left: 8px;
    font-size: 14px;
}

.pg-empty {
    margin-top: 18px;
    padding: 24px 18px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 24px;
    background: var(--surface);
    font-size: 13px;
}

.pg-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    overflow-y: auto;
    padding: 28px 16px;
}

.pg-modal-card {
    width: min(1400px, 96%);
    margin: 0 auto;
    border-radius: 28px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.pg-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pg-modal-close svg {
    display: block;
}

.pg-modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
}

.pg-modal-visual {
    min-height: 100%;
    background: rgba(255, 255, 255, 0.03);
}

.pg-modal-visual img {
    width: 100%;
    height: 100%;
    min-height: 560px;
    object-fit: cover;
    display: block;
}

/*
 * Course / tutorial listing popup only — YouTube-style 16:9 hero.
 * Prompt Gallery uses #promptModal; this targets #courseModal only.
 */
#courseModal .pg-modal-grid {
    align-items: start;
}

#courseModal .pg-modal-visual {
    min-height: 0;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

#courseModal .pg-modal-visual img {
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}



.pg-test-gallery {
    display: flex;
    gap: 10px;
    padding: 12px;
    flex-wrap: wrap;
}

.pg-test-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: 0.2s ease;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 0;
}

.pg-test-thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

.pg-test-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

#promptCompareSection[style*="display: none"] {
    margin: 0;
}

.pg-compare-wrap {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: ew-resize;
}

.pg-compare-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: filter 0.25s ease, transform 0.25s ease;
}

.pg-compare-after {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
    -webkit-clip-path: inset(0 50% 0 0);
}

.pg-compare-before {
    z-index: 1;
}

/* .pg-compare-after-clip {
    position: absolute;
    inset: 0 auto 0 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
} */

.pg-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 3;
}

.pg-compare-divider::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(11, 13, 18, 0.08);
}

.pg-compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(11, 13, 18, 0.1);
    box-shadow: 0 12px 30px rgba(11, 13, 18, 0.18);
}

.pg-compare-handle::before,
.pg-compare-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid #0b0d12;
    border-right: 2px solid #0b0d12;
}

.pg-compare-handle::before {
    left: 14px;
    transform: translateY(-50%) rotate(-135deg);
}

.pg-compare-handle::after {
    right: 14px;
    transform: translateY(-50%) rotate(45deg);
}



.pg-modal-body {
    padding: 28px;
}

.pg-modal-topline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pg-mini-chip {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
}

.pg-mini-chip-premium {
    color: var(--btn-solid-text);
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
}

.pg-modal-title {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.1;
}

.pg-modal-desc {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.7;
}

.pg-modal-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pg-modal-section+.pg-modal-section {
    margin-top: 22px;
}

.pg-section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.pg-section-head h3,
.pg-modal-section h3 {
    margin: 0;
    font-size: 18px;
}

.pg-copy-btn,
.pg-upgrade-btn {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
}

.pg-copy-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.pg-upgrade-btn {
    background: #0b0d12;
    color: #fff;
}

.pg-modal-prompt {
    margin: 0;
    padding: 16px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--text);
    font-family: var(--font-body);
}

.pg-locked-box,
.pg-info-card {
    padding: 16px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.pg-locked-box h4 {
    margin: 0 0 8px;
}

.pg-locked-box p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.6;
}

.pg-locked-icon {
    font-size: 26px;
    margin-bottom: 10px;
}

.pg-settings-table {
    display: grid;
    gap: 10px;
}

.pg-setting-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.pg-setting-label {
    color: var(--muted);
    font-size: 14px;
}

.pg-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pg-related-card {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.pg-related-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.pg-related-body {
    padding: 12px;
}

.pg-related-body h4 {
    margin: 0 0 6px;
    font-size: 15px;
}

.pg-related-body p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.pg-search-input::placeholder {
    color: var(--muted);
    font-size: 13px;
}

.pg-hero {
    text-align: center;
}

.pg-hero-copy {
    max-width: 920px;
    margin: 0 auto;
}

.pg-subtitle {
    margin: 0 auto;
}

.pg-controls {
    max-width: 1400px;
    margin: 29px auto 0;
}

.pg-search-wrap {
    max-width: 100%;
    margin: 0 auto;
}

/* .pg-filters-row {
  justify-content: center;
} */

.pg-chip-row {
    justify-content: center;
    flex: 0 1 auto;
}

.pg-sort-select {
    min-width: 136px;
}

@media (max-width: 1080px) {
    .pg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-modal-grid {
        grid-template-columns: 1fr;
    }

    .pg-modal-visual img {
        min-height: 360px;
    }

    /* Narrow view: keep Learn popup 16:9 (beats generic modal min-height above) */
    #courseModal .pg-modal-visual img {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .ll-page {
        width: min(var(--ll-shell), calc(100% - 18px));
        padding-top: 78px;
    }

    .pg-grid,
    .pg-stats,
    .pg-related-grid {
        grid-template-columns: 1fr;
    }

    .pg-card {
        min-height: 360px;
    }

    .pg-title {
        font-size: 32px;
    }

    .pg-subtitle {
        font-size: 13px;
    }

    .pg-modal-body {
        padding: 18px;
    }

    .pg-setting-row {
        grid-template-columns: 1fr;
    }

    .pg-card-preview-toggle,
    .pg-card-preview-cue {
        opacity: 1;
        transform: none;
    }

    .pg-card-preview-toggle {
        min-height: 32px;
        padding: 0 10px;
        font-size: 10px;
    }

    .pg-card-preview-toggle {
        left: 12px;
        bottom: 12px;
    }

    .pg-card-preview-cue {
        right: 12px;
        top: 50px;
        font-size: 10px;
    }
}





.pg-interactive-controls {
    display: grid;
    gap: 14px;
    margin: 18px 0 20px;
}

.pg-interactive-controls+.pg-control-card {
    margin-top: 16px;
}

.pg-control-card+.pg-control-card {
    margin-top: 16px;
}

.pg-control-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.pg-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-control-head h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
}

.pg-control-value {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.pg-tone-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pg-tone-btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

.pg-tone-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 93, 252, 0.3);
}

.pg-tone-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.pg-strength-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.pg-palette-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pg-palette-swatch {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-sm);
    display: inline-block;
    cursor: pointer;
    transition: 0.2s ease;
}

.pg-palette-swatch:hover {
    transform: scale(1.06);
}

.pg-palette-swatch.active {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.16);
    border-color: rgba(109, 93, 252, 0.9);
}

.pg-remix-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pg-remix-btn {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pg-remix-btn.is-disabled,
.pg-remix-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.15);
    pointer-events: none;
}

.pg-remix-btn-ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.pg-remix-output {
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.pg-version-history {
    display: grid;
    gap: 10px;
}

.pg-version-item {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.pg-version-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.pg-version-item span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.pg-version-item.active {
    border-color: rgba(109, 93, 252, 0.32);
    box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.08);
}

@media (max-width: 900px) {
    .pg-control-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .pg-remix-actions {
        flex-direction: column;
    }

    .pg-remix-btn,
    .pg-remix-btn-ghost {
        width: 100%;
    }
}

















.pg-card-premium-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(109, 93, 252, 0.16);
    color: var(--primary);
    border: 1px solid rgba(109, 93, 252, 0.28);
}

.pg-card-locked .pg-card-image {
    filter: blur(5px) saturate(0.9);
    transform: scale(1.03);
}

.pg-card-locked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(7, 8, 18, 0.72),
            rgba(7, 8, 18, 0.18));
    pointer-events: none;
    opacity: 1;
    z-index: 1;
}

.pg-card-lockmark {
    margin-left: 8px;
    font-size: 16px;
}

.pg-card-premium,
#promptUpgradeBtn {
    border: 0;
    outline: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.pg-related-lock {
    margin-left: 6px;
    font-size: 13px;
}

#promptLockedBox {
    display: none;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(109, 93, 252, 0.22);
    background: rgba(109, 93, 252, 0.08);
    color: var(--text);
}

#promptUpgradeBtn {
    display: none;
}













.pg-filters-side {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pg-category-landing {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.pg-category-landing-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.pg-category-landing-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pg-category-landing-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.pg-category-landing-card {
    text-align: left;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: 0.2s ease;
    color: var(--text);
}

.pg-category-landing-card:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 93, 252, 0.28);
}

.pg-category-landing-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pg-category-landing-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.pg-category-landing-meta {
    color: var(--muted);
    font-size: 12px;
}

.pg-card-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-save-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 18, 24, 0.88);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

.pg-save-icon.active {
    color: #fff;
    border-color: rgba(109, 93, 252, 0.36);
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.pg-card-micro {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pg-card-score,
.pg-card-difficulty,
.pg-card-model-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 12, 22, 0.36);
    color: #fff;
}

.pg-card-teaser {
    margin: 10px 0 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.pg-card-models {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.pg-modal-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pg-save-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pg-save-btn .pg-inline-svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.pg-likes .pg-inline-svg {
    flex-shrink: 0;
    opacity: 0.92;
}

.pg-save-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    border-color: transparent;
}

.pg-trend-score {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.pg-trend-score-label {
    color: var(--muted);
    font-size: 13px;
}

.pg-token-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pg-token-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
}

.pg-list-block {
    margin: 0;
    padding-left: 18px;
    color: var(--text);
}

.pg-list-block li+li {
    margin-top: 8px;
}

.pg-params-guide {
    display: grid;
    gap: 10px;
}

.pg-param-row {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.pg-param-row strong {
    font-size: 14px;
}

.pg-param-row span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pg-variants-wrap {
    display: grid;
    gap: 12px;
}

.pg-variant-card pre {
    max-height: 260px;
    overflow: auto;
}

.pg-variant-card pre::-webkit-scrollbar {
    width: 8px;
}

.pg-variant-card pre::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 252, 0.28);
    border-radius: 999px;
}

.pg-variant-card {
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px;
}

.pg-variant-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.pg-variant-copy {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.pg-variant-copy:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pg-variant-card pre {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.7;
    font-family: var(--font-body);
    color: var(--text);
}

.pg-negative-head {
    font-weight: 700;
    margin-bottom: 8px;
}

.pg-negative-text {
    color: var(--muted);
    line-height: 1.7;
}

@media (max-width: 1080px) {
    .pg-category-landing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pg-filters-side {
        width: 100%;
    }

    .pg-filters-side .pg-sort-select {
        width: 100%;
    }

    .pg-category-landing-grid {
        grid-template-columns: 1fr;
    }

    .pg-modal-actions-row {
        align-items: stretch;
    }

    .pg-save-btn,
    .pg-trend-score {
        width: 100%;
        justify-content: center;
    }

    .pg-compare-wrap {
        max-width: 100%;
        border-radius: 18px;
    }


    .pg-compare-handle {
        width: 44px;
        height: 44px;
    }
}




.pg-advanced-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pg-compare-text-wrap {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.pg-compare-text-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.pg-compare-text-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.pg-compare-text-head strong {
    font-size: 13px;
}

.pg-compare-text-head span {
    font-size: 12px;
    color: var(--muted);
}

.pg-compare-text-card pre {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.7;
    font-family: var(--font-body);
    color: var(--text);
}

.pg-compare-state-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}



.pg-bundle-section,
.pg-cluster-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.pg-bundle-head,
.pg-cluster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pg-bundle-head h2,
.pg-cluster-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.pg-bundle-head p,
.pg-cluster-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pg-bundle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pg-cluster-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pg-bundle-card,
.pg-cluster-card {
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s ease;
    color: var(--text);
}

.pg-bundle-card:hover,
.pg-cluster-card:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 93, 252, 0.28);
}

.pg-bundle-cover,
.pg-cluster-cover {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--surface);
}

.pg-bundle-cover img,
.pg-cluster-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-bundle-cover-empty,
.pg-cluster-cover-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pg-bundle-body,
.pg-cluster-body {
    padding: 14px;
}

.pg-bundle-body strong,
.pg-cluster-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.pg-bundle-meta,
.pg-cluster-body span {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1080px) {
    .pg-bundle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-cluster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .pg-bundle-grid,
    .pg-cluster-grid {
        grid-template-columns: 1fr;
    }
}













/* =========================
   Ai tutoreial and Ai courses
========================= */



.ll-progress-block {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.ll-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.ll-progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow: hidden;
}

.ll-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    transition: width 0.25s ease;
}

.ll-chapters-wrap {
    display: grid;
    gap: 10px;
}

.ll-chapter-item {
    width: 100%;
    text-align: left;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ll-chapter-item:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 93, 252, 0.28);
}

.ll-chapter-item.is-current {
    border-color: rgba(109, 93, 252, 0.36);
    box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.08);
}

.ll-chapter-item.is-watched {
    background: rgba(109, 93, 252, 0.06);
    border-color: rgba(109, 93, 252, 0.24);
}

.ll-chapter-main {
    display: grid;
    gap: 4px;
}

.ll-chapter-main strong {
    font-size: 14px;
}

.ll-chapter-main span {
    font-size: 12px;
    color: var(--muted);
}

.ll-chapter-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

@media (max-width: 760px) {
    .ll-chapter-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .ll-progress-top {
        flex-direction: column;
    }
}









.ll-playlist-wrap,
.ll-path-wrap {
    display: grid;
    gap: 10px;
}

.ll-playlist-item {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 88px 1fr;
    gap: 12px;
    align-items: center;
    text-align: left;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: 0.2s ease;
}

.ll-playlist-item:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 93, 252, 0.28);
}

.ll-playlist-index {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.ll-playlist-item img {
    width: 88px;
    height: 62px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ll-playlist-body {
    display: grid;
    gap: 4px;
}

.ll-playlist-body strong {
    font-size: 14px;
}

.ll-playlist-body span {
    font-size: 12px;
    color: var(--muted);
}

.ll-path-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 2px 4px;
}

.ll-path-head strong {
    font-size: 15px;
}

.ll-path-head span {
    font-size: 12px;
    color: var(--muted);
}

.ll-path-list {
    display: grid;
    gap: 10px;
}

.ll-path-item {
    width: 100%;
    text-align: left;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: 0.2s ease;
    display: grid;
    gap: 5px;
}

.ll-path-item:hover {
    transform: translateY(-1px);
    border-color: rgba(109, 93, 252, 0.28);
}

.ll-path-item.is-active {
    border-color: rgba(109, 93, 252, 0.38);
    box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.08);
}

.ll-path-step {
    font-size: 12px;
    color: var(--muted);
}

.ll-reward-box {
    display: grid;
    gap: 12px;
}

.ll-reward-badge {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(109, 93, 252, 0.24);
    background: rgba(109, 93, 252, 0.08);
}

.ll-reward-badge.is-locked {
    border-color: var(--border);
    background: var(--surface);
}

.ll-reward-icon {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.ll-reward-icon .ll-reward-icon-svg {
    width: 24px;
    height: 24px;
    color: var(--text);
    stroke: currentColor;
}

.ll-reward-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.ll-reward-copy {
    color: var(--muted);
    line-height: 1.6;
    font-size: 13px;
}

@media (max-width: 760px) {
    .ll-playlist-item {
        grid-template-columns: 1fr;
    }

    .ll-playlist-item img {
        width: 100%;
        height: 180px;
    }
}









.pg-pack-modal-card {
    max-width: 1180px;
}

.pg-pack-modal-body {
    padding: 28px;
}

.pg-pack-top {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.pg-pack-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pg-pack-list {
    display: grid;
    gap: 12px;
}

.pg-pack-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.pg-pack-item img {
    width: 96px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    border: 1px solid var(--border);
}

.pg-pack-item-body {
    display: grid;
    gap: 6px;
}

.pg-pack-item-body strong {
    font-size: 15px;
}

.pg-pack-item-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.pg-pack-item-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pg-pack-open-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.pg-pack-card-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

@media (max-width: 760px) {
    .pg-pack-modal-body {
        padding: 18px;
    }

    .pg-pack-actions {
        flex-direction: column;
    }

    .pg-pack-actions button {
        width: 100%;
    }

    .pg-pack-item {
        grid-template-columns: 1fr;
    }

    .pg-pack-item img {
        width: 100%;
        height: 180px;
    }
}




/* ===== RATINGS STYLES ===== */
.rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stars {
    font-size: 22px;
}

.star-filled {
    color: #ffd700;
}

.star-empty {
    color: var(--muted);
}

.rating-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.rating-total {
    font-size: 13px;
    color: var(--muted);
}

.rating-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.rating-stars {
    display: flex;
    gap: 6px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.15s, transform 0.1s;
    padding: 2px;
}

.star-btn:hover,
.star-btn.active {
    color: #ffd700;
    transform: scale(1.15);
}

.rating-review {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    padding: 10px 14px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.rating-review:focus {
    border-color: var(--primary);
}

.rating-submit-btn {
    align-self: flex-start;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--btn-solid-text);
    transition: opacity 0.2s;
}

.rating-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rating-status {
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
    color: var(--text);
}

.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.distribution-label {
    font-size: 13px;
    color: var(--muted);
    width: 32px;
    text-align: right;
}

.distribution-bar {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.distribution-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ffd700);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.distribution-count {
    font-size: 12px;
    color: var(--muted);
    width: 24px;
}

/* ===== BATTLES STYLES ===== */
.pg-battle-wrapper {
    margin-bottom: 20px;
}

.battle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.battle-status {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
    color: var(--primary);
}

.battle-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
}

.battle-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.battle-side img {
    width: 100%;
    border-radius: 14px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.prompt-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.prompt-desc {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.vote-bar {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.vote-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.vote-fill.left {
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.vote-fill.right {
    background: linear-gradient(90deg, #ff7aa8, #ff4f8b);
}

.vote-count {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.battle-vote-btn {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--btn-solid-text);
    border: none;
    transition: opacity 0.2s;
}

.battle-vote-btn:hover {
    opacity: 0.88;
}

.battle-vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.battle-vs {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-badge {
    background: linear-gradient(135deg, var(--primary), #ff7aa8);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.battle-winner {
    margin-top: 16px;
    text-align: center;
    padding: 14px;
    background: rgba(109, 93, 252, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(109, 93, 252, 0.24);
}

.winner-badge {
    font-size: 22px;
    margin-bottom: 6px;
}

.winner-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
}

.battles-history {
    display: grid;
    gap: 12px;
}

.history-item {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.history-result {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-winner h4,
.history-loser h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text);
}

.history-winner {
    flex: 1;
}

.history-loser {
    flex: 1;
    text-align: right;
}

.history-vs {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.muted {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

@media (max-width: 600px) {
    .battle-container {
        grid-template-columns: 1fr;
    }

    .battle-vs {
        margin: 8px 0;
    }
}





















/* =============================================================
   PHASE 16 — SKELETON LOADING ANIMATION
   ============================================================= */

/* Base skeleton class */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: 12px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skeleton * {
    visibility: hidden !important;
}

/* Shimmer animation */
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 40%,
            rgba(255, 255, 255, 0.14) 50%,
            rgba(255, 255, 255, 0.08) 60%,
            transparent 100%);
    background-size: 200% 100%;
    will-change: transform;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Skeleton Card — prompt gallery cards ke liye */
.pg-card-skeleton {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    border-radius: 28px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.pg-card-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.07) 40%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.07) 60%,
            transparent 100%);
    background-size: 200% 100%;
    will-change: transform;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

/* Skeleton lines — text placeholder ke liye */
.skeleton-line {
    height: 14px;
    border-radius: 999px;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
    background-size: 200% 100%;
    will-change: transform;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 65%;
}

.skeleton-line.long {
    width: 90%;
}

/* Skeleton image block */
.skeleton-img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
}

.skeleton-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%);
    background-size: 200% 100%;
    will-change: transform;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

/* Course / Tutorial card skeleton */
.ll-card-skeleton {
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ll-card-skeleton-img {
    width: 100%;
    height: 180px;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
}

.ll-card-skeleton-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%);
    background-size: 200% 100%;
    will-change: transform;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
}

.ll-card-skeleton-body {
    padding: 14px;
    display: grid;
    gap: 10px;
}

/* Dark mode skeleton tweak */
@media (prefers-color-scheme: dark) {

    .skeleton::after,
    .pg-card-skeleton::after,
    .skeleton-line::after,
    .skeleton-img::after,
    .ll-card-skeleton-img::after {
        background: linear-gradient(90deg,
                transparent 0%,
                rgba(255, 255, 255, 0.05) 40%,
                rgba(255, 255, 255, 0.10) 50%,
                rgba(255, 255, 255, 0.05) 60%,
                transparent 100%);
        background-size: 200% 100%;
    }
}

/* Responsive */
@media (max-width: 760px) {
    .pg-card-skeleton {
        min-height: 320px;
        border-radius: 20px;
    }

    .ll-card-skeleton-img {
        height: 160px;
    }
}








/* =============================================================
   PHASE 17 — SOCIAL SHARE BAR
   ============================================================= */

.pg-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.pg-share-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-right: 4px;
}

.pg-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
}

.pg-share-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

.pg-share-twitter {
    font-family: serif;
}

.pg-share-whatsapp:hover {
    border-color: #25d366;
    color: #25d366;
}

.pg-share-facebook:hover {
    border-color: #1877f2;
    color: #1877f2;
}

@media (max-width: 760px) {
    .pg-share-bar {
        gap: 6px;
        padding: 10px 12px;
    }

    .pg-share-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}











/* =============================================================
   PHASE 17 — MOBILE ACTION BAR
   ============================================================= */

/* Mobile action bar — sirf mobile pe dikhega */
.pg-mobile-bar {
    display: none;
}

@media (max-width: 760px) {
    .pg-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9990;
        height: 64px;
        align-items: center;
        justify-content: space-around;
        gap: 0;
        background: var(--surface-2);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 28px rgba(11, 13, 18, 0.14);
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Page ke neeche space do — bar ke upar content na chhupo */
    .ll-page {
        padding-bottom: 84px;
    }

    .pg-mobile-bar-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        height: 100%;
        background: none;
        border: none;
        color: var(--text);
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: 0.2s ease;
        border-radius: 12px;
        padding: 8px 4px;
        font-family: var(--font-body);
        text-decoration: none;
    }

    .pg-mobile-bar-btn:hover,
    .pg-mobile-bar-btn:active {
        color: var(--primary);
        background: rgba(109, 93, 252, 0.08);
    }

    .pg-mobile-bar-icon {
        font-size: 20px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pg-mobile-bar-icon svg {
        width: 22px;
        height: 22px;
        display: block;
    }

    .pg-mobile-bar-label {
        font-size: 10px;
        line-height: 1;
        color: var(--muted);
    }

    .pg-mobile-bar-btn:hover .pg-mobile-bar-label,
    .pg-mobile-bar-btn:active .pg-mobile-bar-label {
        color: var(--primary);
    }

    /* Active state */
    .pg-mobile-bar-btn.active {
        color: var(--primary);
    }

    .pg-mobile-bar-btn.active .pg-mobile-bar-label {
        color: var(--primary);
    }

    /* Copy button — highlighted */
    .pg-mobile-bar-btn.pg-mobile-bar-copy {

        /* color: #fff; */
        border-radius: 16px;
        min-width: 64px;
        flex: 1.2;
    }

    .pg-mobile-bar-btn.pg-mobile-bar-copy .pg-mobile-bar-label {
        color: rgba(255, 255, 255, 0.9);
    }

    .pg-mobile-bar-btn.pg-mobile-bar-copy:hover {
        opacity: 0.9;
        background: linear-gradient(135deg, var(--primary), var(--primary-2));
        color: #fff;
    }
}

/* Dark mode mobile bar */
@media (max-width: 760px) and (prefers-color-scheme: dark) {
    .pg-mobile-bar {
        background: rgba(7, 8, 18, 0.92);
        border-top-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
    }
}





/* ============================================================
   PHASE 17 — Unified Mobile Action Bar (sare pages ke liye)
   ============================================================ */
.pg-mobile-bar {
    display: none;
}

@media (max-width: 760px) {
    .pg-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9998;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
        padding: 8px 0 env(safe-area-inset-bottom, 8px);
        justify-content: space-around;
        align-items: center;
        gap: 0;
    }

    .pg-mobile-bar-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        border: none;
        background: transparent;
        color: var(--text);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        padding: 6px 4px;
        min-height: 52px;
        transition: color 0.2s ease;
        text-decoration: none;
    }

    .pg-mobile-bar-btn:hover,
    .pg-mobile-bar-btn:active {
        color: var(--primary);
    }

    .pg-mobile-bar-icon {
        font-size: 18px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pg-mobile-bar-icon svg {
        width: 20px;
        height: 20px;
        display: block;
    }

    /* Page ke bottom padding fix karo taaki content bar ke neeche na chhupo */
    .ll-page,
    .pd-page {
        padding-bottom: 72px;
    }
}

/* ============================================================
   PHASE 17 — Mobile Action Bar (sare pages ke liye ek CSS)
   ============================================================ */

@media (max-width: 760px) {

    /* Body ko neeche se space do taaki content bar ke peeche na chhuppe */
    body {
        padding-bottom: 29px !important;
    }

    /* Mobile Bar — fixed bottom bar */
    .ll-mobile-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9990;
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 0;
        height: 64px;
        padding: 0 8px;
        background: var(--surface, #fff);
        border-top: 1px solid var(--border, rgba(0, 0, 0, 0.1));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    }

    /* Har button */
    .ll-mob-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        border: none;
        background: transparent;
        color: var(--text, #0b0d12);
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        padding: 0;
        transition: color 0.2s ease;
    }

    .ll-mob-btn span:first-child {
        font-size: 20px;
        line-height: 1;
    }

    .ll-mob-btn:active,
    .ll-mob-btn.active {
        color: var(--primary, #6d5dfc);
    }

    /* ============================================================
     Share Menu Fix — screen ke andar rahe, bahar na jaye
     ============================================================ */



    .pg-share-menu,
    [class*="share-menu"],
    [id*="shareMenu"],
    [id*="share-menu"] {
        position: fixed !important;
        bottom: 80px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        max-width: calc(100vw - 32px) !important;
        width: 260px !important;
        z-index: 9995 !important;
        overflow: hidden !important;
    }

    /* Share bar inside modal/detail page */
    .pg-share-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        max-width: 100%;
        overflow: hidden;
    }

    .pg-share-btn {
        flex-shrink: 0;
    }

}







/* ===== Personalized For You — Growth Grid Fix ===== */
.pg-growth-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.pg-growth-head {
    margin-bottom: 14px;
}

.pg-growth-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.pg-growth-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pg-growth-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1080px) {
    .pg-growth-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pg-growth-grid {
        grid-template-columns: 1fr;
    }
}



/* ✅ Horizontal Scroll — All Bundle/Cluster Sections */

/* Sections ko scroll-ready banao */
#promptBundleGrid,
#promptClusterGrid,
#premiumGrid,
#exclusiveGrid,
#packGrid,
#trendingTodayGrid,
#trendingWeekGrid,
#leaderboardGrid,
#weeklyDropsGrid,
#battlesListContainer,
#recentGrid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: visible;
    gap: 14px;
    padding-bottom: 14px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

/* Har card fixed width */
#promptBundleGrid>*,
#promptClusterGrid>*,
#premiumGrid>*,
#exclusiveGrid>*,
#packGrid>*,
#trendingTodayGrid>*,
#trendingWeekGrid>*,
#leaderboardGrid>*,
#weeklyDropsGrid>*,
#battlesListContainer>*,
#recentGrid>* {
    flex: 0 0 300px !important;
    min-width: 300px !important;
    width: 300px !important;
    scroll-snap-align: start;
}

/* pg-card inside these sections */
#premiumGrid .pg-card,
#exclusiveGrid .pg-card,
#trendingTodayGrid .pg-card,
#trendingWeekGrid .pg-card,
#leaderboardGrid .pg-card,
#weeklyDropsGrid .pg-card,
#recentGrid .pg-card {
    width: 300px !important;
    min-height: 400px !important;
    flex: 0 0 300px !important;
}

/* Scrollbar styling — same purple */
#promptBundleGrid::-webkit-scrollbar,
#promptClusterGrid::-webkit-scrollbar,
#premiumGrid::-webkit-scrollbar,
#exclusiveGrid::-webkit-scrollbar,
#packGrid::-webkit-scrollbar,
#trendingTodayGrid::-webkit-scrollbar,
#trendingWeekGrid::-webkit-scrollbar,
#leaderboardGrid::-webkit-scrollbar,
#weeklyDropsGrid::-webkit-scrollbar,
#battlesListContainer::-webkit-scrollbar,
#recentGrid::-webkit-scrollbar {
    height: 3px;
}

#promptBundleGrid::-webkit-scrollbar-track,
#promptClusterGrid::-webkit-scrollbar-track,
#premiumGrid::-webkit-scrollbar-track,
#exclusiveGrid::-webkit-scrollbar-track,
#packGrid::-webkit-scrollbar-track,
#trendingTodayGrid::-webkit-scrollbar-track,
#trendingWeekGrid::-webkit-scrollbar-track,
#leaderboardGrid::-webkit-scrollbar-track,
#weeklyDropsGrid::-webkit-scrollbar-track,
#battlesListContainer::-webkit-scrollbar-track,
#recentGrid::-webkit-scrollbar-track {
    background: transparent;
}

#promptBundleGrid::-webkit-scrollbar-thumb,
#promptClusterGrid::-webkit-scrollbar-thumb,
#premiumGrid::-webkit-scrollbar-thumb,
#exclusiveGrid::-webkit-scrollbar-thumb,
#packGrid::-webkit-scrollbar-thumb,
#trendingTodayGrid::-webkit-scrollbar-thumb,
#trendingWeekGrid::-webkit-scrollbar-thumb,
#leaderboardGrid::-webkit-scrollbar-thumb,
#weeklyDropsGrid::-webkit-scrollbar-thumb,
#battlesListContainer::-webkit-scrollbar-thumb,
#recentGrid::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 252, 0.35);
    border-radius: 999px;
}

#promptBundleGrid::-webkit-scrollbar-thumb:hover,
#promptClusterGrid::-webkit-scrollbar-thumb:hover,
#premiumGrid::-webkit-scrollbar-thumb:hover,
#exclusiveGrid::-webkit-scrollbar-thumb:hover,
#packGrid::-webkit-scrollbar-thumb:hover,
#trendingTodayGrid::-webkit-scrollbar-thumb:hover,
#trendingWeekGrid::-webkit-scrollbar-thumb:hover,
#leaderboardGrid::-webkit-scrollbar-thumb:hover,
#weeklyDropsGrid::-webkit-scrollbar-thumb:hover,
#battlesListContainer::-webkit-scrollbar-thumb:hover,
#recentGrid::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 93, 252, 0.6);
}


/* ✅ Horizontal Scroll — Personalized For You (#personalizedGrid) */

#personalizedGrid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: visible;
    gap: 14px;
    padding-bottom: 14px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

#personalizedGrid>* {
    flex: 0 0 300px !important;
    min-width: 300px !important;
    width: 300px !important;
    scroll-snap-align: start;
}

#personalizedGrid .pg-card {
    width: 300px !important;
    min-height: 400px !important;
    flex: 0 0 300px !important;
}

#personalizedGrid::-webkit-scrollbar {
    height: 6px;
}

#personalizedGrid::-webkit-scrollbar-track {
    background: transparent;
}

#personalizedGrid::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 252, 0.35);
    border-radius: 999px;
}

#personalizedGrid::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 93, 252, 0.6);
}


/* ✅ Horizontal Scroll — Explore by Category (.pg-category-landing-grid) */

.pg-category-landing-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    gap: 12px;
    padding-bottom: 14px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.pg-category-landing-grid>* {
    flex: 0 0 200px;
    min-width: 200px;
    width: 200px;
    scroll-snap-align: start;
}

.pg-category-landing-grid::-webkit-scrollbar {
    height: 3px;
}

.pg-category-landing-grid::-webkit-scrollbar-track {
    background: transparent;
}

.pg-category-landing-grid::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 252, 0.35);
    border-radius: 999px;
}

.pg-category-landing-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 93, 252, 0.6);
}





/* ✅ Hover Clip Fix — cards upar se cut na ho */

#promptBundleGrid,
#promptClusterGrid,
#premiumGrid,
#exclusiveGrid,
#packGrid,
#trendingTodayGrid,
#trendingWeekGrid,
#leaderboardGrid,
#weeklyDropsGrid,
#battlesListContainer,
#recentGrid,
#personalizedGrid {
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 8px;
    /* hover ke liye space */
}

/* Parent sections ka overflow bhi fix karo */
#promptBundleGrid,
#promptClusterGrid,
#premiumGrid,
#exclusiveGrid,
#packGrid,
#trendingTodayGrid,
#trendingWeekGrid,
#leaderboardGrid,
#weeklyDropsGrid,
#battlesListContainer,
#recentGrid,
#personalizedGrid {
    clip-path: none;
}

/* Section wrappers ko bhi visible karo */
.pg-section,
.pg-bundle-section,
.pg-premium-section,
[class*="section"] {
    overflow: visible;
}


/* ✅ Explore by Category — hover clip fix */
.pg-category-landing-grid {
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 6px;
    padding-bottom: 14px;
}

/* ✅ Tutorial Page — Featured, Best This Week, Recently Added Horizontal Scroll */

#courseFeaturedGrid,
#courseWeekGrid,
#courseRecentGrid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    gap: 14px;
    padding-bottom: 14px;
    padding-top: 8px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

#courseFeaturedGrid>*,
#courseWeekGrid>*,
#courseRecentGrid>* {
    flex: 0 0 300px;
    min-width: 300px;
    width: 300px;
    scroll-snap-align: start;
}

/* Scrollbar styling — same purple */
#courseFeaturedGrid::-webkit-scrollbar,
#courseWeekGrid::-webkit-scrollbar,
#courseRecentGrid::-webkit-scrollbar {
    height: 3px;
}

#courseFeaturedGrid::-webkit-scrollbar-track,
#courseWeekGrid::-webkit-scrollbar-track,
#courseRecentGrid::-webkit-scrollbar-track {
    background: transparent;
}

#courseFeaturedGrid::-webkit-scrollbar-thumb,
#courseWeekGrid::-webkit-scrollbar-thumb,
#courseRecentGrid::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 252, 0.35);
    border-radius: 999px;
}

#courseFeaturedGrid::-webkit-scrollbar-thumb:hover,
#courseWeekGrid::-webkit-scrollbar-thumb:hover,
#courseRecentGrid::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 93, 252, 0.6);
}

/* Bottom mobile bar ko menu ke peeche karo */
#pgMobileBar {
    z-index: 999 !important;
}

/* -------------------------------------------------------------------------- */
/* LearnLab: gallery card hover (prompt / courses / tutorials) — pure CSS     */
/* -------------------------------------------------------------------------- */

@media (min-width: 769px) {
    .pg-card:not(.pg-card-locked)::after {
        opacity: 0;
    }

    .pg-card-bottom {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        padding: 20px 16px 16px;
        box-sizing: border-box;
        z-index: 2;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.92) 0%,
                rgba(0, 0, 0, 0.7) 50%,
                rgba(0, 0, 0, 0) 100%);
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s ease, opacity 0.35s ease;
    }

    .pg-card:hover .pg-card-bottom,
    .pg-card:focus-within .pg-card-bottom {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .pg-card-top {
        z-index: 3;
    }

    .pg-card .pg-card-top-actions {
        opacity: 0;
        transform: translateY(-4px);
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .pg-card:hover .pg-card-top-actions,
    .pg-card:focus-within .pg-card-top-actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .pg-card-preview-toggle,
    .pg-card-preview-cue {
        z-index: 4;
    }

    .pg-card:hover:not(.is-previewing) .pg-card-image-after,
    .pg-card:focus-within:not(.is-previewing) .pg-card-image-after {
        transform: scale(1.04);
    }
}

/*
 * Learn Courses / Tutorials listing + hub modal: 16:9 YouTube-style card hero.
 * (JSON-LD for these pages lives in <head>, so `body:has(#jsonld-*)` never matched —
 * scope with `main.pg-page--learn-cards-16x9` instead. Prompt Gallery is unchanged.)
 */
main.ll-page.pg-page--learn-cards-16x9 #courseGrid.pg-grid > .pg-card,
main.ll-page.pg-page--learn-cards-16x9 #llHubModalGrid.pg-grid > .pg-card {
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
}

/* Hidden legacy rails kept in DOM — preserve 16:9 if rails are turned back on */
main.ll-page.pg-page--learn-cards-16x9 #courseFeaturedGrid > .pg-card,
main.ll-page.pg-page--learn-cards-16x9 #courseWeekGrid > .pg-card,
main.ll-page.pg-page--learn-cards-16x9 #courseRecentGrid > .pg-card {
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    width: 300px !important;
    flex: 0 0 300px !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {
    .pg-card:not(.pg-card-locked)::after {
        opacity: 0;
    }

    .pg-card-bottom {
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        padding: 16px 14px 14px;
        box-sizing: border-box;
        z-index: 2;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.88) 0%,
                rgba(0, 0, 0, 0.5) 60%,
                rgba(0, 0, 0, 0) 100%);
    }

    .pg-card .pg-card-top-actions {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .pg-card:hover:not(.is-previewing) .pg-card-image-after {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .skeleton::after,
    .pg-card-skeleton::after,
    .skeleton-line::after,
    .skeleton-img::after,
    .ll-card-skeleton-img::after {
        animation: none !important;
    }
}

/* Section Hub — horizontal collection cards */
.pg-section-hub-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pg-section-hub-row::-webkit-scrollbar {
    display: none;
}

/* Load more — main grid + hub modal */
.pg-load-more-wrap {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px 0 8px;
    width: 100%;
}

.pg-hub-modal-load-footer {
    padding-bottom: 4px;
    flex-shrink: 0;
}

.pg-load-more-btn {
    min-height: 33px;
    padding: 0 28px;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary, #6d5dfc), #ff7aa8);
    color: var(--btn-solid-text, #fff);
    box-shadow: var(--shadow-sm);
}

.pg-load-more-btn:hover {
    opacity: 0.93;
}

.pg-load-more-btn:active {
    transform: translateY(1px);
}

.pg-hub-section-card:focus-visible {
    outline: 2px solid rgba(109, 93, 252, 0.55);
    outline-offset: 2px;
}

/* Hub modal — fixed shell, scroll only inside body */
.pg-hub-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.85);
    overflow: hidden;
    overscroll-behavior: none;
}

.pg-hub-modal-card {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: min(92vh, 920px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 24px 20px 16px;
    box-sizing: border-box;
}

.pg-hub-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
}

.pg-hub-modal-close:hover {
    color: var(--text);
    background: var(--surface);
}

.pg-hub-modal-head {
    flex-shrink: 0;
    padding-right: 48px;
    margin-bottom: 10px;
}

.pg-hub-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text);
}

.pg-hub-modal-subtitle {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.pg-hub-pack-actions {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.pg-hub-modal-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
}

.pg-hub-scroll-sentinel {
    width: 100%;
    height: 3px;
    flex-shrink: 0;
    pointer-events: none;
    opacity: 0;
}

.pg-hub-modal-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Hide modal prompt grid when showing battles (overrides display: grid !important below) */
#pgHubModalGrid.pg-hub-modal-grid--hidden,
#llHubModalGrid.pg-hub-modal-grid--hidden {
    display: none !important;
}

#pgHubModalGrid.pg-grid,
#llHubModalGrid.pg-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-top: 0 !important;
    overflow: visible !important;
    flex-direction: unset !important;
    padding-bottom: 0 !important;
}

#pgHubModalGrid.pg-grid > .pg-card,
#llHubModalGrid.pg-grid > .pg-card {
    width: auto !important;
    min-width: 0 !important;
    flex: unset !important;
    min-height: 400px;
}

#pgHubModalGrid .ll-pg-skel,
#promptGrid .ll-pg-skel,
#llHubModalGrid .ll-pg-skel {
    pointer-events: none;
}

/* Skeleton cards use .pg-card — real cards rely on ::after for the image scrim.
   That overlay sits above the skeleton cover (z-index 0) and hides shimmer;
   bottom bones also sit on the dark scrim with near-invisible contrast. */
.pg-card.ll-pg-skel::after {
    opacity: 0;
}

@media (max-width: 1080px) {
    #pgHubModalGrid.pg-grid,
    #llHubModalGrid.pg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .pg-hub-modal {
        padding: 0;
        align-items: stretch;
    }

    .pg-hub-modal-card {
        max-height: none;
        height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 20px 14px 12px;
    }

    #pgHubModalGrid.pg-grid,
    #llHubModalGrid.pg-grid {
        grid-template-columns: 1fr !important;
    }

    #pgHubModalGrid.pg-grid > .pg-card,
    #llHubModalGrid.pg-grid > .pg-card {
        min-height: 360px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .pg-load-more-btn:active {
        transform: none;
    }
}

/* ===== Community prompt submit modal ===== */
.pg-community-modal {
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

.pg-community-modal-card {
    position: relative;
    width: min(640px, 100%);
    max-height: min(92vh, 920px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.pg-community-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.pg-community-modal-close:hover {
    background: var(--surface-3);
    border-color: rgba(109, 93, 252, 0.35);
}

.pg-community-modal-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 24px 56px 0 24px;
    flex-shrink: 0;
}

.pg-community-modal-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(109, 93, 252, 0.18), rgba(255, 122, 168, 0.12));
    border: 1px solid rgba(109, 93, 252, 0.22);
    color: var(--primary);
}

.pg-community-modal-head-copy {
    min-width: 0;
    flex: 1;
}

.pg-community-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.pg-community-modal-title {
    margin: 0 0 8px;
    font-size: clamp(22px, 4vw, 28px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.pg-community-modal-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: var(--muted);
}

.pg-community-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 20px 24px 0;
    padding: 12px 14px;
    list-style: none;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.pg-community-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pg-community-step-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.pg-community-step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
}

.pg-community-step-divider {
    width: 24px;
    height: 1px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 4px;
    align-self: center;
    margin-bottom: 18px;
}

.pg-community-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 8px;
    -webkit-overflow-scrolling: touch;
}

.pg-community-fieldset {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.pg-community-fieldset:last-child {
    margin-bottom: 0;
}

.pg-community-legend {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.pg-community-grid {
    display: grid;
    gap: 14px;
}

.pg-community-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pg-community-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pg-community-field--full {
    grid-column: 1 / -1;
}

.pg-community-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.pg-community-required {
    font-style: normal;
    color: #ff7aa8;
    font-weight: 700;
}

.pg-community-input,
.pg-community-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.pg-community-input {
    height: 46px;
    padding: 0 14px;
}

.pg-community-textarea {
    padding: 12px 14px;
    resize: vertical;
    min-height: 88px;
}

.pg-community-textarea--sm {
    min-height: 72px;
}

.pg-community-input::placeholder,
.pg-community-textarea::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

.pg-community-input:focus,
.pg-community-textarea:focus {
    border-color: rgba(109, 93, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.12);
}

.pg-community-footer {
    flex-shrink: 0;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.pg-community-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
}

.pg-community-footer-note svg {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.85;
}

.pg-community-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pg-community-btn {
    min-height: 33px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.pg-community-btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 8px 24px rgba(109, 93, 252, 0.28);
}

.pg-community-btn--primary:hover:not(:disabled) {
    opacity: 0.94;
}

.pg-community-btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pg-community-btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.pg-community-btn--ghost:hover {
    background: var(--surface-2);
    border-color: rgba(109, 93, 252, 0.3);
}

@media (max-width: 640px) {
    .pg-community-modal-head {
        padding: 20px 48px 0 18px;
    }

    .pg-community-steps {
        margin-left: 18px;
        margin-right: 18px;
        padding: 10px 8px;
    }

    .pg-community-step-label {
        font-size: 10px;
    }

    .pg-community-step-divider {
        width: 12px;
    }

    .pg-community-form {
        padding-left: 18px;
        padding-right: 18px;
    }

    .pg-community-grid--2 {
        grid-template-columns: 1fr;
    }

    .pg-community-field--full {
        grid-column: auto;
    }

    .pg-community-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .pg-community-actions {
        flex-direction: column-reverse;
    }

    .pg-community-btn {
        width: 100%;
        justify-content: center;
    }
}
