.jojo-tarot {
    --jojo-tarot-border: rgba(232, 232, 232, 0.12);
    --jojo-tarot-panel: rgba(43, 48, 56, 0.74);
    --jojo-tarot-soft: rgba(255, 255, 255, 0.08);
    --jojo-tarot-point: #00c7b3;
    --jojo-tarot-gold: #e0a846;
}

.jojo-tarot-stage {
    display: grid;
    gap: 0;
    align-items: stretch;
    border: 1px solid var(--jojo-tarot-border);
    background-color: var(--jojo-tarot-panel);
    margin-top: 0.75rem;
}

.jojo-tarot.is-daily .jojo-tarot-stage {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
}

.jojo-tarot.is-spread-page .jojo-tarot-stage {
    grid-template-columns: 1fr;
}

.jojo-tarot-tabs {
    display: grid;
    grid-template-columns: minmax(0, 0.785fr) minmax(0, 1fr);
    gap: 0;
    margin-top: 1.5rem;
    border: 1px solid var(--jojo-tarot-border);
}

.jojo-tarot.is-spread-page .jojo-tarot-tabs {
    border-bottom: 0 none;
}

.jojo-tarot-tab {
    padding: 0.55rem 1rem;
    border: 0;
    border-right: 1px solid var(--jojo-tarot-border);
    background-color: rgba(43, 48, 56, 0.72);
    color: rgba(234, 235, 239, 0.78);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.jojo-tarot-tab:last-child {
    border-right: 0;
}

.jojo-tarot-tab:hover {
    color: #9ff1e8;
    text-decoration: none;
}

.jojo-tarot-tab.is-active {
    background-color: rgba(0, 199, 179, 0.14);
    color: #9ff1e8;
}

.jojo-tarot-card-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 0;
    perspective: 1200px;
}

.jojo-tarot.is-daily .jojo-tarot-card-frame {
    min-height: 740px;
    border-right: 1px solid var(--jojo-tarot-border);
    background:
        radial-gradient(circle at center, #000 0%, #000 68%, #111 83%, #252525 100%);
}

.jojo-tarot.is-spread-page .jojo-tarot-card-frame {
    min-height: 420px;
    border-bottom: 1px solid var(--jojo-tarot-border);
    background: #000;
}

.jojo-tarot-card-frame.is-drawing .jojo-tarot-card-back {
    animation: jojo-tarot-draw 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jojo-tarot-card-frame.is-drawing .jojo-tarot-spread-card img {
    animation: jojo-tarot-draw 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jojo-tarot-card-frame.is-revealed .jojo-tarot-card-image {
    animation: jojo-tarot-reveal 0.78s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jojo-tarot-card-image,
.jojo-tarot-card-back {
    display: block;
    width: min(100%, 280px);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 0;
    background-color: #000;
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.jojo-tarot-card-image {
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.jojo-tarot-card-back {
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
}

.jojo-tarot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 280px);
    aspect-ratio: 2 / 3;
    border: 1px dashed rgba(255, 255, 255, 0.24);
    color: rgba(234, 235, 239, 0.7);
    text-align: center;
    word-break: keep-all;
}

.jojo-tarot-spread-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: min(100%, 720px);
    padding: 1rem;
}

.jojo-tarot-spread-card {
    min-width: 0;
    text-align: center;
}

.jojo-tarot-spread-card img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 0;
    background-color: #000;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    transform-origin: center center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.jojo-tarot-card-frame.is-drawing .jojo-tarot-spread-card:nth-child(2) img {
    animation-delay: 0.12s;
}

.jojo-tarot-card-frame.is-drawing .jojo-tarot-spread-card:nth-child(3) img {
    animation-delay: 0.24s;
}

.jojo-tarot-spread-card.is-revealing img {
    animation: jojo-tarot-reveal 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jojo-tarot-spread-role {
    margin-top: 0.65rem;
    color: rgba(234, 235, 239, 0.72);
    font-size: 0.875rem;
    word-break: keep-all;
}

.jojo-tarot-result {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 0;
    background-color: var(--jojo-tarot-panel);
}

.jojo-tarot.is-daily .jojo-tarot-result {
    min-height: 740px;
}

.jojo-tarot.is-spread-page .jojo-tarot-result {
    min-height: 420px;
}

.jojo-tarot-result::before {
    position: absolute;
    inset: 0;
    content: '';
    pointer-events: none;
}

.jojo-tarot.is-daily .jojo-tarot-result::before {
    background-image: var(--jojo-tarot-stand-image, none);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 200% auto;
    opacity: 0.5;
    filter: saturate(0.92) contrast(1.12);
    transition: opacity 0.28s ease, background-image 0.28s ease;
    animation: jojo-tarot-stand-breathe 5.5s ease-in-out infinite;
}

.jojo-tarot.is-spread-page .jojo-tarot-result::before {
    background-color: transparent;
}

.jojo-tarot-stand-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    pointer-events: none;
}

.jojo-tarot-stand-bg-item {
    position: relative;
    overflow: hidden;
}

.jojo-tarot-stand-bg-item::before {
    position: absolute;
    inset: -18% -42%;
    content: '';
    background-image: var(--jojo-tarot-stand-image, none);
    background-repeat: no-repeat;
    background-position: center 70%;
    background-size: 190% auto;
    opacity: 0.46;
    filter: saturate(0.92) contrast(1.12);
    animation: jojo-tarot-stand-breathe 5.5s ease-in-out infinite;
}

.jojo-tarot-result::after {
    position: absolute;
    inset: 0;
    content: '';
    background:
        linear-gradient(90deg, rgba(43, 48, 56, 0.95) 0%, rgba(43, 48, 56, 0.72) 52%, rgba(43, 48, 56, 0.38) 100%),
        linear-gradient(0deg, rgba(43, 48, 56, 0.88) 0%, transparent 44%);
    pointer-events: none;
}

.jojo-tarot.is-spread-page .jojo-tarot-result::after {
    z-index: 1;
}

.jojo-tarot.is-daily .jojo-tarot-result > * {
    position: relative;
    z-index: 1;
}

.jojo-tarot.is-spread-page .jojo-tarot-result > :not(.jojo-tarot-stand-bg) {
    position: relative;
    z-index: 2;
}

.jojo-tarot-kicker {
    margin-bottom: 0.4rem;
    color: var(--jojo-tarot-point);
    font-size: 0.875rem;
    font-weight: 500;
}

.jojo-tarot-name {
    margin: 0;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
    word-break: keep-all;
}

.jojo-tarot-stand {
    margin-top: 0.4rem;
    color: rgba(234, 235, 239, 0.72);
    font-size: 1rem;
}

.jojo-tarot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0;
    padding: 0;
    list-style: none;
}

.jojo-tarot-keywords li {
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(0, 199, 179, 0.36);
    border-radius: 999px;
    background-color: rgba(0, 199, 179, 0.1);
    color: #9ff1e8;
    font-size: 0.875rem;
}

.jojo-tarot-reading {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.jojo-tarot-reading-item {
    padding: 1rem;
    border-left: 3px solid var(--jojo-tarot-point);
    background-color: var(--jojo-tarot-soft);
}

.jojo-tarot-reading-item.is-caution {
    border-left-color: var(--jojo-tarot-gold);
}

.jojo-tarot-reading-label {
    margin-bottom: 0.35rem;
    color: rgba(234, 235, 239, 0.68);
    font-size: 0.8125rem;
}

.jojo-tarot-reading-text {
    margin: 0;
    line-height: 1.7;
    word-break: keep-all;
}

.jojo-tarot-summary {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--jojo-tarot-border);
    color: rgba(234, 235, 239, 0.9);
    font-size: 1.05rem;
    line-height: 1.7;
    word-break: keep-all;
}

.jojo-tarot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.jojo-tarot-foresight {
    margin-top: 1rem;
}

.jojo-tarot-foresight-label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(234, 235, 239, 0.72);
    font-size: 0.875rem;
}

.jojo-tarot-foresight-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, auto);
    gap: 0.5rem;
    width: 100%;
}

.jojo-tarot-foresight-select {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--jojo-tarot-border);
    background-color: rgba(43, 48, 56, 0.72);
    color: #eaebef;
    cursor: pointer;
}

.jojo-tarot-note {
    margin-top: 1rem;
    color: rgba(234, 235, 239, 0.58);
    font-size: 0.875rem;
    line-height: 1.6;
    word-break: keep-all;
}

.jojo-tarot-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.72);
}

.jojo-tarot-modal.is-open {
    display: flex;
}

.jojo-tarot-dialog {
    width: min(100%, 420px);
    padding: 1.5rem;
    border: 1px solid rgba(224, 168, 70, 0.45);
    background:
        radial-gradient(circle at top, rgba(224, 168, 70, 0.14), transparent 48%),
        #1f2329;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

.jojo-tarot.is-spread-page .jojo-tarot-dialog {
    width: min(100%, 440px);
}

.jojo-tarot-dialog-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.35;
    word-break: keep-all;
}

.jojo-tarot-dialog-text {
    margin: 0;
    color: rgba(234, 235, 239, 0.78);
    line-height: 1.7;
    word-break: keep-all;
}

.jojo-tarot-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

@keyframes jojo-tarot-draw {
    0% {
        opacity: 0;
        transform: translateY(-34px) rotate(-7deg) scale(0.96);
        filter: brightness(0.72);
    }

    62% {
        opacity: 1;
        transform: translateY(4px) rotate(1deg) scale(1.01);
        filter: brightness(1.08);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
        filter: brightness(1);
    }
}

@keyframes jojo-tarot-reveal {
    0% {
        opacity: 0;
        transform: rotateY(92deg) scale(0.98);
        filter: brightness(1.35);
    }

    45% {
        opacity: 1;
        transform: rotateY(-8deg) scale(1.01);
        filter: brightness(1.12);
    }

    100% {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
        filter: brightness(1);
    }
}

@keyframes jojo-tarot-stand-breathe {
    0%,
    100% {
        opacity: 0.42;
        filter: saturate(0.88) contrast(1.08);
    }

    50% {
        opacity: 0.58;
        filter: saturate(1) contrast(1.16);
    }
}

@media (hover: hover) and (pointer: fine) {
    .jojo-tarot-card-frame:not(.is-drawing) .jojo-tarot-card-image:hover,
    .jojo-tarot-card-frame:not(.is-drawing) .jojo-tarot-card-back:hover {
        transform: translateY(-12px) rotateX(4deg) rotateY(-4deg) scale(1.025);
        box-shadow: 0 26px 48px rgba(0, 0, 0, 0.48);
        filter: brightness(1.06);
    }
}

@media (max-width: 767.98px) {
    .jojo-tarot.is-daily .jojo-tarot-stage {
        grid-template-columns: 1fr;
    }

    .jojo-tarot-card-frame {
        min-height: auto;
    }

    .jojo-tarot.is-daily .jojo-tarot-card-frame {
        border-right: 0;
        border-bottom: 1px solid var(--jojo-tarot-border);
    }

    .jojo-tarot-result {
        min-height: 560px;
    }

    .jojo-tarot-card-image,
    .jojo-tarot-card-back,
    .jojo-tarot-placeholder {
        width: min(68vw, 240px);
    }

    .jojo-tarot-spread-cards {
        width: min(100%, 340px);
        gap: 0.45rem;
        padding: 0.75rem;
    }

    .jojo-tarot-spread-role {
        font-size: 0.75rem;
    }

    .jojo-tarot-name {
        font-size: 1.65rem;
    }

    .jojo-tarot-actions .btn {
        flex: 1 1 100%;
    }

    .jojo-tarot-foresight-row {
        grid-template-columns: 1fr;
    }
}
