/* =========================================================
   Azami Tarot - Three Card Spread
   1枚引きの基本UIを共有し、3枚引き固有部分だけを追加
========================================================= */

.azt-three {
    --azt-stage-min-height: 500px;
}

.azt-three__selection {
    min-height: 540px;
}

/* 過去・現在・未来の役割ガイド */
.azt-three__role-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 660px);
    margin: 0 auto 1.15rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(171, 129, 58, 0.28);
    border-radius: 999px;
    background: rgba(255, 252, 247, 0.72);
    box-shadow:
        0 8px 22px rgba(75, 46, 70, 0.07),
        inset 0 0 0 1px rgba(255, 255, 255, 0.72);
    list-style: none;
}

.azt-three__role-guide li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    color: #857480;
    font-size: 0.83rem;
    transition:
        color 180ms ease,
        background-color 180ms ease;
}

.azt-three__role-guide li + li {
    border-left: 1px solid rgba(171, 129, 58, 0.18);
}

.azt-three__role-guide li::after {
    position: absolute;
    right: 16%;
    bottom: 0.22rem;
    left: 16%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(188, 141, 62, 0.7), transparent);
    content: "";
    opacity: 0;
    transform: scaleX(0.5);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.azt-three__role-guide li.is-current {
    color: #6b4962;
    background: rgba(245, 228, 240, 0.54);
}

.azt-three__role-guide li.is-filled {
    color: #5a3b53;
    background: linear-gradient(135deg, rgba(249, 232, 241, 0.8), rgba(240, 232, 249, 0.76));
}

.azt-three__role-guide li.is-filled::after {
    opacity: 1;
    transform: scaleX(1);
}

.azt-three__role-guide li span {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 246, 207, 0.9);
    border-radius: 50%;
    background: linear-gradient(145deg, #c09a4f, #8d672b);
    box-shadow: 0 3px 9px rgba(90, 57, 86, 0.18);
    font-family: Georgia, serif;
    font-size: 0.72rem;
    font-weight: 700;
}

.azt-three__role-guide li strong {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.azt-three .azt-card.is-unavailable {
    opacity: 0.38 !important;
    filter: saturate(0.5);
}

.azt-three .azt-card.is-selected .azt-card__badge {
    opacity: 1;
}

/* 3枚の結果 */
.azt-three__result {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    text-align: center;
    animation: azt-three-fade-up 620ms ease both;
    scroll-margin-top: 90px;
}

.azt-three__card-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 2.5vw, 1.5rem);
    align-items: start;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.azt-three-card-result {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 1rem 0.8rem 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(171, 129, 58, 0.25);
    border-radius: 19px;
    background:
        radial-gradient(circle at 50% 8%, rgba(232, 202, 221, 0.44), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(251, 244, 249, 0.82));
    box-shadow:
        0 14px 34px rgba(75, 46, 70, 0.09),
        inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.azt-three-card-result__role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 30px;
    margin: 0 0 0.75rem;
    padding: 0.25rem 0.75rem;
    color: #5e3f58;
    border: 1px solid rgba(174, 132, 62, 0.25);
    border-radius: 999px;
    background: rgba(255, 252, 246, 0.84);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.azt-three-card-result__role span {
    color: #9a6e2d;
    font-family: Georgia, serif;
}

.azt-three-card-result__figure {
    position: relative;
    width: min(100%, 190px);
    margin: 0 auto 0.75rem;
    padding: 0;
}

.azt-three-card-result__glow {
    position: absolute;
    z-index: -1;
    inset: 8% 0;
    border-radius: 18%;
    background:
        radial-gradient(circle, rgba(231, 178, 213, 0.52), transparent 67%),
        radial-gradient(circle at 60% 40%, rgba(187, 162, 226, 0.42), transparent 72%);
    filter: blur(15px);
    animation: azt-glow-breathe 3.8s ease-in-out infinite;
}

.azt-three-card-result__image {
    display: block;
    width: 100%;
    height: auto;
    filter:
        drop-shadow(0 0 2px rgba(255, 245, 203, 0.9))
        drop-shadow(0 14px 17px rgba(67, 43, 64, 0.2));
    animation: azt-result-card-in 720ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.azt-three-card-result:nth-child(2) .azt-three-card-result__image {
    animation-delay: 90ms;
}

.azt-three-card-result:nth-child(3) .azt-three-card-result__image {
    animation-delay: 180ms;
}

.azt-three-card-result__image.is-reversed {
    transform: rotate(180deg);
    animation-name: azt-result-card-in-reversed;
}

.azt-three .azt-three-card-result__name {
    margin: 0;
    color: #3f2f3d;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.55;
}

.azt-three .azt-three-card-result__position {
    margin: 0.2rem 0 0;
    color: #8a6426;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.azt-three .azt-three-card-result__position.is-reversed {
    color: #76516e;
}

/* 各ポジションの読み解き */
.azt-three__readings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.8rem, 2vw, 1.25rem);
    align-items: stretch;
    margin-bottom: 1.4rem;
    text-align: left;
}

.azt-three-reading {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: clamp(1rem, 2.4vw, 1.35rem);
    overflow: hidden;
    border: 1px solid rgba(174, 132, 62, 0.27);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(236, 208, 224, 0.35), transparent 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(253, 246, 249, 0.9));
    box-shadow:
        0 13px 30px rgba(76, 46, 71, 0.085),
        inset 0 0 0 1px rgba(255, 255, 255, 0.74);
}

.azt-three-reading:nth-child(2) {
    border-color: rgba(153, 110, 150, 0.25);
    background:
        radial-gradient(circle at 100% 0%, rgba(210, 190, 230, 0.38), transparent 38%),
        linear-gradient(145deg, rgba(255, 253, 255, 0.96), rgba(248, 242, 251, 0.92));
}

.azt-three-reading:nth-child(3) {
    background:
        radial-gradient(circle at 100% 0%, rgba(238, 218, 198, 0.42), transparent 38%),
        linear-gradient(145deg, rgba(255, 254, 249, 0.96), rgba(253, 247, 240, 0.91));
}

.azt-three-reading__header {
    margin: 0 0 1rem;
}

.azt-three .azt-three-reading__role {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    margin: 0 0 0.45rem;
    color: #5b3b54;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 1.5;
}

.azt-three .azt-three-reading__role::before {
    color: #b18a3f;
    content: "✦";
    font-size: 0.7em;
}

.azt-three .azt-three-reading__role span {
    color: #917b89;
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0;
}

.azt-three .azt-three-reading__identity {
    position: relative;
    margin: 0;
    padding: 0 0 0.65rem;
    color: #4b3b48;
    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.azt-three .azt-three-reading__identity::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        #8a6426 0%,
        #c7a355 36%,
        #ead89d 68%,
        rgba(199, 163, 85, 0.12) 100%
    );
    content: "";
}

.azt-three-reading__block {
    margin: 0;
}

.azt-three-reading__block + .azt-three-reading__block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(156, 113, 151, 0.16);
}

.azt-three .azt-three-reading__label {
    margin: 0 0 0.55rem;
    color: #6d4a64;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.5;
}

.azt-three .azt-three-reading__label::before {
    margin-right: 0.32rem;
    color: #b18a3f;
    content: "◆";
    font-size: 0.58em;
    vertical-align: 0.15em;
}

.azt-three .azt-three-reading__catch {
    margin: 0 0 0.38rem;
    color: #453441;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.7;
}

.azt-three .azt-three-reading__text {
    margin: 0;
    color: #584952;
    font-size: 0.86rem;
    line-height: 1.82;
}

/* 3枚の総合解釈 */
.azt-three-overall {
    position: relative;
    margin: 0;
    padding: clamp(1.2rem, 3vw, 1.65rem);
    overflow: hidden;
    border: 1px solid rgba(171, 129, 58, 0.3);
    border-radius: 20px;
    background:
        radial-gradient(circle at 8% 0%, rgba(237, 205, 223, 0.4), transparent 28%),
        radial-gradient(circle at 94% 8%, rgba(211, 195, 232, 0.38), transparent 30%),
        linear-gradient(145deg, rgba(255, 254, 249, 0.97), rgba(253, 246, 250, 0.94));
    box-shadow:
        0 16px 38px rgba(76, 46, 71, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.78);
    text-align: left;
}

.azt-three .azt-three-overall__label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0 0 0.65rem;
    color: #56324f;
    border-bottom: 1px solid rgba(176, 134, 60, 0.25);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 1.5;
}

.azt-three .azt-three-overall__label::before {
    color: #b18a3f;
    content: "✦";
    text-shadow: 0 0 8px rgba(197, 156, 78, 0.25);
}

.azt-three .azt-three-overall__catch {
    margin: 0 0 0.5rem;
    color: #43313f;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.75;
}

.azt-three .azt-three-overall__text {
    margin: 0;
    color: #554652;
    font-size: 0.92rem;
    line-height: 1.9;
}

.azt-three__balloon {
    max-width: 780px;
    margin: 1.2rem auto 0;
    text-align: left;
}

.azt-three__result > .azt-button {
    margin-top: 1.25rem;
}

@keyframes azt-three-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 820px) {
    .azt-three__readings {
        grid-template-columns: minmax(0, 1fr);
    }

    .azt-three-reading {
        padding: 1.15rem;
    }
}

@media (max-width: 720px) {
    .azt-three {
        --azt-stage-min-height: 430px;
    }

    .azt-three .azt-rail-arrow {
        display: none !important;
    }

    .azt-three__selection {
        min-height: 500px;
    }

    .azt-three__role-guide {
        margin-bottom: 0.9rem;
        border-radius: 14px;
    }

    .azt-three__role-guide li {
        flex-direction: column;
        gap: 0.18rem;
        padding: 0.45rem 0.25rem;
        font-size: 0.72rem;
    }

    .azt-three__role-guide li span {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
        font-size: 0.65rem;
    }

    .azt-three__card-row {
        gap: 0.4rem;
        margin-bottom: 1.25rem;
    }

    .azt-three-card-result {
        padding: 0.55rem 0.35rem 0.65rem;
        border-radius: 13px;
    }

    .azt-three-card-result__role {
        min-height: 25px;
        margin-bottom: 0.5rem;
        padding: 0.18rem 0.48rem;
        font-size: 0.68rem;
    }

    .azt-three-card-result__figure {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .azt-three .azt-three-card-result__name {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    .azt-three .azt-three-card-result__position {
        font-size: 0.66rem;
    }

    .azt-three-reading {
        padding: 1rem;
        border-radius: 16px;
    }

    .azt-three .azt-three-reading__role {
        font-size: 1rem;
    }

    .azt-three .azt-three-reading__identity {
        font-size: 0.76rem;
    }

    .azt-three .azt-three-reading__catch {
        font-size: 0.92rem;
    }

    .azt-three .azt-three-reading__text {
        font-size: 0.84rem;
    }

    .azt-three-overall {
        padding: 1rem 1.05rem 1.1rem;
        border-radius: 17px;
    }

    .azt-three .azt-three-overall__catch {
        font-size: 0.98rem;
    }

    .azt-three .azt-three-overall__text {
        font-size: 0.86rem;
        line-height: 1.85;
    }
}

@media (prefers-reduced-motion: reduce) {
    .azt-three *,
    .azt-three *::before,
    .azt-three *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
