:root {
    --prompt-bg: #090c15;
    --prompt-panel: rgba(15, 23, 42, 0.76);
    --prompt-border: rgba(255, 255, 255, 0.1);
    --prompt-text: #f8fafc;
    --prompt-muted: #94a3b8;
    --prompt-violet: #8b5cf6;
    --prompt-cyan: #22d3ee;
    --prompt-green: #6ee7b7;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(circle at 14% 8%, rgba(34, 211, 238, 0.13), transparent 32rem),
        radial-gradient(circle at 90% 30%, rgba(139, 92, 246, 0.14), transparent 36rem),
        #090c15;
    color: var(--prompt-text);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

button,
a {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--prompt-cyan);
    outline-offset: 3px;
}

.prompts-page {
    width: min(1380px, 100%);
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    padding: 34px 28px 72px;
}

.prompts-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    padding: 32px 34px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 24px;
    background:
        linear-gradient(115deg, rgba(37, 99, 235, 0.17), rgba(124, 58, 237, 0.1) 52%, rgba(6, 182, 212, 0.08)),
        rgba(15, 23, 42, 0.68);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.prompts-hero::after {
    content: '';
    position: absolute;
    right: 9%;
    bottom: -100px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(110, 231, 183, 0.24);
    border-radius: 52px;
    transform: rotate(27deg);
    pointer-events: none;
}

.prompts-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.prompts-eyebrow {
    margin-bottom: 8px;
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.prompts-hero h1 {
    margin: 0;
    font-size: clamp(36px, 5vw, 68px);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.045em;
    background: linear-gradient(100deg, #ffffff 12%, #a5f3fc 52%, #c4b5fd 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.prompts-hero p {
    max-width: 640px;
    margin: 16px 0 0;
    color: #cbd5e1;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.55;
}

.prompts-channel-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 13px;
    background: rgba(8, 47, 73, 0.34);
    color: #e0f2fe;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.prompts-channel-link:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(8, 47, 73, 0.58);
}

.prompts-library {
    padding-top: 28px;
}

.prompts-filter-wrap {
    position: sticky;
    top: 72px;
    z-index: 20;
    margin: 0 -8px 22px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(9, 12, 21, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.prompts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompts-subfilters {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.prompt-filter {
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid var(--prompt-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--prompt-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.prompt-filter:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.prompt-filter.is-active {
    border-color: rgba(110, 231, 183, 0.42);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.19), rgba(34, 211, 238, 0.14));
    color: #ecfdf5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(6, 182, 212, 0.08);
}

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

.prompt-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.prompt-card:hover {
    transform: translateY(-5px);
    border-color: rgba(125, 211, 252, 0.34);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.38), 0 0 30px rgba(59, 130, 246, 0.08);
}

.prompt-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity 0.35s ease, transform 0.5s ease;
}

.prompt-card img.is-loaded {
    opacity: 1;
}

.prompt-card:hover img {
    transform: scale(1.045);
}

.prompt-card::after {
    content: '';
    position: absolute;
    inset: 42% 0 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0));
    pointer-events: none;
}

.prompt-card-model,
.prompt-card-holiday {
    position: absolute;
    z-index: 2;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prompt-card-model {
    left: 12px;
    bottom: 12px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.prompt-card-holiday {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(124, 45, 18, 0.78);
    color: #fef3c7;
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.prompts-status {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--prompt-muted);
    text-align: center;
}

.prompts-status[hidden] {
    display: none;
}

.prompts-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.13);
    border-top-color: var(--prompt-cyan);
    border-radius: 50%;
    animation: prompts-spin 0.8s linear infinite;
}

.prompts-sentinel {
    height: 1px;
}

.prompt-modal[hidden] {
    display: none;
}

.prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.prompt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.prompt-modal-card {
    position: relative;
    width: min(940px, 100%);
    max-height: min(780px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    background: #0f172a;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.7);
    animation: prompt-modal-in 0.24s ease both;
}

.prompt-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(2, 6, 23, 0.72);
    color: #fff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.prompt-modal-visual {
    position: relative;
    min-height: 560px;
    background:
        radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.1), transparent 48%),
        #070b14;
}

.prompt-modal-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center top;
}

.prompt-modal-shade {
    position: absolute;
    inset: 55% 0 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.55), transparent);
    pointer-events: none;
}

.prompt-modal-holiday {
    position: absolute;
    top: 16px;
    left: 16px;
    max-width: calc(100% - 80px);
    padding: 7px 11px;
    overflow: hidden;
    border: 1px solid rgba(254, 243, 199, 0.24);
    border-radius: 11px;
    background: rgba(124, 45, 18, 0.78);
    color: #fef3c7;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.prompt-modal-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 58px 34px 34px;
}

.prompt-modal-model {
    margin-bottom: 16px;
    color: #a5f3fc;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prompt-modal-text {
    display: -webkit-box;
    max-height: 300px;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-size: 15px;
    line-height: 1.65;
    text-align: left;
    white-space: pre-wrap;
    cursor: pointer;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
}

.prompt-modal-text.is-expanded {
    display: block;
    overflow-y: auto;
    -webkit-line-clamp: unset;
}

.prompt-modal-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.5fr;
    gap: 10px;
    margin-top: 28px;
}

.prompt-action {
    min-height: 48px;
    padding: 11px 16px;
    border-radius: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.prompt-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
}

.prompt-action:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.prompt-action-secondary {
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.1));
    color: #e0e7ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.prompt-action-primary {
    border: 1px solid rgba(167, 139, 250, 0.42);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.prompts-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 11000;
    max-width: min(360px, calc(100vw - 32px));
    padding: 13px 17px;
    border: 1px solid rgba(110, 231, 183, 0.3);
    border-radius: 13px;
    background: rgba(6, 78, 59, 0.94);
    color: #ecfdf5;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

body.prompt-modal-open {
    overflow: hidden;
}

@keyframes prompts-spin {
    to { transform: rotate(360deg); }
}

@keyframes prompt-modal-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
    .prompts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .prompts-page {
        padding: 20px 16px 54px;
    }

    .prompts-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 26px 22px;
        border-radius: 20px;
    }

    .prompts-channel-link {
        min-height: 42px;
    }

    .prompts-filter-wrap {
        position: static;
    }

    .prompts-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .prompts-filters::-webkit-scrollbar {
        display: none;
    }

    .prompt-filter {
        flex: 0 0 auto;
    }

    .prompts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .prompt-card {
        border-radius: 16px;
    }

    .prompt-modal {
        padding: 0;
        place-items: stretch;
    }

    .prompt-modal-card {
        width: 100%;
        max-height: 100dvh;
        min-height: 100dvh;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(260px, 52vh) 1fr;
        border: 0;
        border-radius: 0;
        overflow-y: auto;
    }

    .prompt-modal-visual {
        min-height: 0;
    }

    .prompt-modal-content {
        justify-content: flex-start;
        padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    }

    .prompt-modal-text {
        max-height: 28vh;
        -webkit-line-clamp: 4;
    }

    .prompt-modal-actions {
        grid-template-columns: 1fr 1.45fr;
        margin-top: 20px;
    }
}

@media (max-width: 430px) {
    .prompts-page {
        padding-inline: 12px;
    }

    .prompts-hero h1 {
        font-size: 38px;
    }

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

    .prompt-action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
