:root {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    background-color: #020617;
}

body.confirm-open {
    position: fixed;
    overflow: hidden;
    width: 100%;
}

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .primary-nav {
        display: none !important;
    }
}

.confirm-dialog {
    border: 0;
    padding: 0;
    background: transparent;
    width: min(420px, 92vw);
    max-width: 420px;
    color: inherit;
}

.confirm-dialog::backdrop {
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 55%) rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
}

.confirm-dialog[data-mode="native"][open] {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
}

.confirm-dialog[data-mode="fallback"] {
    display: none;
}

.confirm-dialog[data-mode="fallback"].is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    padding: 1.5rem;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 55%) rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
    z-index: 2000;
}

.confirm-glow {
    position: absolute;
    width: clamp(260px, 60vw, 460px);
    height: clamp(260px, 60vw, 460px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.32), rgba(20, 184, 166, 0));
    filter: blur(42px);
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.confirm-dialog[data-state="opening"] .confirm-glow,
.confirm-dialog[data-state="open"] .confirm-glow {
    opacity: 0.78;
    transform: scale(1);
}

.confirm-panel {
    position: relative;
    width: min(420px, 100%);
    background: linear-gradient(155deg, rgba(30, 41, 59, 0.96) 8%, rgba(15, 23, 42, 0.98) 62%, rgba(17, 24, 39, 0.97) 100%);
    border-radius: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 40px 120px rgba(6, 11, 25, 0.65);
    padding: 2.5rem 2.2rem 2.1rem;
    text-align: center;
    direction: rtl;
    transform: translateY(32px) scale(0.92);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    overflow: hidden;
}

.confirm-dialog[data-state="opening"] .confirm-panel,
.confirm-dialog[data-state="open"] .confirm-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.confirm-dialog[data-state="closing"] .confirm-panel {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
}

.confirm-panel::before,
.confirm-panel::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

.confirm-panel::before {
    background: radial-gradient(circle at 15% 15%, rgba(129, 140, 248, 0.4), transparent 55%),
        radial-gradient(circle at 85% 22%, rgba(56, 189, 248, 0.3), transparent 60%),
        radial-gradient(circle at 50% 110%, rgba(15, 118, 110, 0.22), transparent 72%);
    opacity: 0.62;
    filter: blur(1px);
}

.confirm-panel::after {
    inset: 1.5px;
    border-radius: calc(1.75rem - 1.5px);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.28), rgba(148, 163, 184, 0));
    opacity: 0.35;
}

.confirm-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(56, 189, 248, 0.26), rgba(99, 102, 241, 0.32));
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 45px rgba(99, 102, 241, 0.28);
    color: rgba(125, 211, 252, 0.96);
    position: relative;
}

.confirm-icon svg {
    width: 34px;
    height: 34px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.confirm-icon::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.5);
    opacity: 0.6;
}

.confirm-icon::before {
    content: "";
    position: absolute;
    inset: -18%;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    filter: blur(16px);
    animation: confirmPulse 3s ease-in-out infinite;
}

.confirm-copy h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f8fafc;
    text-transform: uppercase;
}

.confirm-copy {
    position: relative;
    z-index: 1;
}

.confirm-copy::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1.25rem;
    width: 72px;
    height: 2px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0), rgba(99, 102, 241, 0.7), rgba(99, 102, 241, 0));
    opacity: 0.65;
}

.confirm-copy p {
    margin-top: 0.85rem;
    font-size: 0.97rem;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.88);
    max-width: 90%;
    margin-right: auto;
    margin-left: auto;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.3rem;
}

.confirm-actions .confirm-cancel,
.confirm-actions .confirm-yes {
    position: relative;
    border-radius: 9999px;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.7rem 2rem;
    min-width: 7.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.confirm-actions .confirm-cancel {
    background: rgba(71, 85, 105, 0.18);
    border-color: rgba(148, 163, 184, 0.4);
    color: rgba(203, 213, 225, 0.9);
}

.confirm-actions .confirm-cancel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(148, 163, 184, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-actions .confirm-cancel:hover,
.confirm-actions .confirm-cancel:focus-visible {
    background: rgba(71, 85, 105, 0.36);
    box-shadow: 0 18px 36px rgba(71, 85, 105, 0.24);
    outline: none;
    transform: translateY(-1px);
}

.confirm-actions .confirm-cancel:hover::after,
.confirm-actions .confirm-cancel:focus-visible::after {
    opacity: 0.35;
}

.confirm-actions .confirm-yes {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.94), rgba(56, 189, 248, 0.96));
    color: #020617;
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: 0 26px 52px rgba(56, 189, 248, 0.42);
    overflow: hidden;
}

.confirm-actions .confirm-yes::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-actions .confirm-yes:hover,
.confirm-actions .confirm-yes:focus-visible {
    box-shadow: 0 30px 64px rgba(56, 189, 248, 0.5);
    outline: none;
    transform: translateY(-2px) scale(1.01);
}

.confirm-actions .confirm-yes:hover::after,
.confirm-actions .confirm-yes:focus-visible::after {
    opacity: 0.65;
}

.confirm-actions button:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.7);
    outline-offset: 3px;
}

.confirm-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes confirmPulse {
    0% {
        opacity: 0.5;
        transform: scale(0.92);
    }
    50% {
        opacity: 0.88;
        transform: scale(1.06);
    }
    100% {
        opacity: 0.5;
        transform: scale(0.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    .confirm-icon::before {
        animation: none;
    }
}

@media (max-width: 640px) {
    .confirm-panel {
        padding: 2rem 1.75rem 1.9rem;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions .confirm-cancel,
    .confirm-actions .confirm-yes {
        width: 100%;
    }
}

input,
select {
    outline: none;
}

img {
    display: block;
    width: 100%;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cms-edit-chip {
    align-items: center;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 9999px;
    color: #c7d2fe;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.4rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.95rem;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cms-edit-chip:hover,
.cms-edit-chip:focus {
    background: rgba(99, 102, 241, 0.24);
    color: #ffffff;
    transform: translateY(-1px);
}

.cms-edit-chip:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 2px;
}

@keyframes fadeLift {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-lift {
    animation: fadeLift 0.6s ease-out both;
}

.cms-input,
.cms-textarea,
.cms-multiselect,
.cms-hidden-textarea,
.editor-html {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(71, 85, 105, 0.7);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.cms-input:focus,
.cms-textarea:focus,
.cms-multiselect:focus,
.editor-html:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.cms-textarea {
    min-height: 7rem;
    resize: vertical;
}

.cms-multiselect {
    min-height: 8rem;
}


.form-error {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #fca5a5;
}

.cms-checkbox {
    height: 1.15rem;
    width: 1.15rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
}

.tox-tinymce {
    border-radius: 1.5rem !important;
    border: 1px solid rgba(71, 85, 105, 0.7) !important;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    background: rgba(2, 6, 23, 0.95);
}

.tox-editor-header,
.tox-menubar,
.tox-toolbar,
.tox-toolbar__primary,
.tox-statusbar {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(71, 85, 105, 0.5) !important;
}

.tox .tox-toolbar__primary button {
    border-radius: 9999px !important;
}

.tox .tox-toolbar__primary button:hover,
.tox .tox-toolbar__primary button:focus-visible {
    background: rgba(129, 140, 248, 0.18) !important;
    color: #f8fafc !important;
}

.related-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2.25rem;
}

.related-picker-helper {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.8);
}

.related-picker-controls {
    margin-top: 0.75rem;
    width: 100%;
}

.related-picker-select {
    width: 100%;
}

.related-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.18);
    color: #e0e7ff;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

.related-chip-remove {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
}

.related-chip-remove:hover,
.related-chip-remove:focus-visible {
    color: #ffffff;
}

.tinymce-field-wrapper {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 1.75rem;
    border: 1px solid rgba(71, 85, 105, 0.7);
    padding: 0.75rem;
}

@keyframes riseSlow {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    55% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spinCard {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
        opacity: 0.5;
    }
    50% {
        transform: rotateX(25deg) rotateY(-25deg) translateY(-12px);
        opacity: 1;
    }
    100% {
        transform: rotateX(0deg) rotateY(0deg);
        opacity: 0.5;
    }
}

@keyframes twinkle {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.9;
    }
}

.animate-rise-slow {
    animation: riseSlow 0.7s ease-out both;
}

.reveal-card {
    animation: revealCard 0.8s ease-out both;
}

.card-surface {
    transition: transform 0.35s ease, box-shadow 0.35s ease, background-color 0.35s ease;
}

.card-surface:hover,
.card-surface:focus-visible {
    transform: translateY(-4px) scale(1.01);
    background-color: rgba(2, 6, 23, 0.7);
    box-shadow: 0 30px 60px rgba(99, 102, 241, 0.25);
}

.result-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
}

.result-hero::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.45), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(129, 140, 248, 0.35), transparent 55%);
    filter: blur(40px);
    opacity: 0.8;
}

.result-hero > * {
    position: relative;
    z-index: 1;
}

.result-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.result-stars .star {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(250, 250, 255, 0.8);
    box-shadow: 0 0 12px rgba(250, 250, 255, 0.6);
    animation: twinkle 2.4s ease-in-out infinite;
}

.result-stars .star-a { top: 12%; left: 18%; animation-delay: 0s; }
.result-stars .star-b { top: 28%; right: 12%; animation-delay: 0.4s; }
.result-stars .star-c { bottom: 22%; left: 26%; animation-delay: 0.8s; }
.result-stars .star-d { bottom: 18%; right: 20%; animation-delay: 1.2s; }
.result-stars .star-e { top: 45%; left: 48%; animation-delay: 1.6s; }

.result-hero--common::before {
    background: radial-gradient(circle at 20% 30%, rgba(71, 85, 105, 0.5), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(34, 197, 94, 0.25), transparent 55%);
}

.result-hero--rare::before {
    background: radial-gradient(circle at 25% 35%, rgba(56, 189, 248, 0.45), transparent 55%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.35), transparent 55%);
}

.result-hero--epic::before {
    background: radial-gradient(circle at 20% 30%, rgba(192, 38, 211, 0.5), transparent 55%),
        radial-gradient(circle at 75% 70%, rgba(14, 165, 233, 0.35), transparent 55%);
}

.result-hero--legendary::before {
    background: radial-gradient(circle at 25% 25%, rgba(251, 191, 36, 0.55), transparent 60%),
        radial-gradient(circle at 75% 75%, rgba(147, 51, 234, 0.45), transparent 60%);
}

.spin-visual {
    display: none;
    margin-top: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.25), rgba(99, 102, 241, 0.15));
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(4px);
}

.spin-visual.active {
    display: block;
}

.spin-visual .spin-reel {
    display: flex;
    justify-content: center;
    gap: 1rem;
    perspective: 800px;
    margin-bottom: 1.25rem;
}

.spin-visual .spin-card {
    width: 90px;
    height: 134px;
    border-radius: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(129, 140, 248, 0.25));
    backdrop-filter: blur(6px);
    animation: spinCard 1.2s ease-in-out infinite;
    box-shadow: 0 18px 40px rgba(99, 102, 241, 0.25);
}

.spin-visual .spin-card:nth-child(2) {
    animation-delay: 0.15s;
}

.spin-visual .spin-card:nth-child(3) {
    animation-delay: 0.3s;
}

.spin-visual p {
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.9);
}


.existing-cover-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 80;
    align-items: center;
    justify-content: center;
}

.existing-cover-modal:not(.hidden) {
    display: flex;
}

.existing-cover-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
}

.existing-cover-modal__panel {
    position: relative;
    width: min(960px, 92vw);
    max-height: min(80vh, 720px);
    overflow: hidden auto;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: radial-gradient(circle at top, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
    padding: 2rem;
    box-shadow: 0 45px 90px rgba(15, 23, 42, 0.55);
}

.existing-cover-modal__close {
    font-size: 1.5rem;
    line-height: 1;
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: rgba(226, 232, 240, 0.9);
    border-radius: 999px;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.existing-cover-modal__close:hover {
    background: rgba(129, 140, 248, 0.4);
    transform: scale(1.05);
}

.existing-cover-modal__grid {
    margin-top: 2rem;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.existing-cover-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(30, 41, 59, 0.7);
    background: rgba(15, 23, 42, 0.75);
    color: rgba(226, 232, 240, 0.85);
    text-align: left;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.existing-cover-card:hover,
.existing-cover-card:focus-visible {
    border-color: rgba(99, 102, 241, 0.65);
    box-shadow: 0 18px 36px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    outline: none;
}

.existing-cover-card--selected {
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.35);
}

.existing-cover-card__thumb {
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(30, 41, 59, 0.6);
    background: rgba(15, 23, 42, 0.7);
}

.existing-cover-card__label {
    font-size: 0.75rem;
    line-height: 1.3;
    color: rgba(203, 213, 225, 0.85);
}

.existing-cover-modal__action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.7);
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.existing-cover-modal__action:hover,
.existing-cover-modal__action:focus-visible {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
    outline: none;
}

.existing-cover-modal__action--primary {
    border-color: rgba(129, 140, 248, 0.6);
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.25), rgba(99, 102, 241, 0.25));
    color: rgba(224, 231, 255, 0.95);
}

.existing-cover-modal__action--primary:hover,
.existing-cover-modal__action--primary:focus-visible {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(129, 140, 248, 0.4));
    border-color: rgba(99, 102, 241, 0.8);
}
