#panel:has(.divine-cards) {
    width: min(1000px, 94vw);
    max-height: 90dvh;
    padding: 28px;
    color: #ebe4d5;
    border: 1px solid #aa916b66;
    background: radial-gradient(ellipse at 10% 0%, #31334c, #161925 65%);
}
#panel:has(.divine-cards) #panel-title {
    color: #f5e7c9;
    margin-bottom: 4px;
}
#panel:has(.divine-cards) #panel-subtitle {
    color: #b7b6c8;
}
#panel:has(.divine-cards) #panel-close {
    color: #f5e7c9;
}
.divine-cards {
    line-height: 1.5;
}
.divine-cards button,
.cards-notice button {
    font: inherit;
    color: #eee7d9;
    border: 1px solid #bfa77766;
    background: #ffffff08;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
}
.divine-cards button:hover,
.cards-notice button:hover {
    background: #ffffff14;
}
.divine-cards button:focus-visible,
.cards-notice button:focus-visible {
    outline: 3px solid #f7d595;
    outline-offset: 3px;
}
.divine-cards button:disabled,
.cards-notice button:disabled {
    opacity: 0.5;
    cursor: wait;
}
.divine-cards button.cards-primary,
.cards-notice button.cards-primary {
    background: #e7cc95;
    color: #272538;
    border-color: #e7cc95;
    font-weight: 700;
}
.cards-hero {
    padding: 20px 0 24px;
}
.cards-eyebrow {
    color: #cfb887;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.divine-cards h3 {
    font-family: 'Noto Serif TC', Georgia, serif;
    font-size: 24px;
    margin: 12px 0;
    color: #f5e7c9;
}
.cards-hero > p {
    color: #bfc0ce;
    max-width: 640px;
    font-size: 14px;
}
.cards-stats {
    display: flex;
    gap: 40px;
    margin: 22px 0;
}
.cards-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cards-stats strong {
    font-family: Georgia, serif;
    font-size: 30px;
    color: #f5e7c9;
}
.divine-cards small {
    display: block;
    color: #bfc0ce;
    font-size: 12px;
}
.cards-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.cards-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ffffff18;
}
.cards-tabs button[aria-current='true'] {
    color: #f4d7a0;
    border-color: #dfbc77;
}
.cards-progress {
    font-size: 13px;
    color: #c3bfd4;
    margin: 18px 0;
}
.deity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.divine-cards .deity-card {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    aspect-ratio: 2 / 3;
    border: 1px solid var(--deity-color);
    border-radius: 13px;
    overflow: hidden;
    background: #242638;
    text-align: left;
    box-shadow: 0 8px 24px #0005;
    isolation: isolate;
}
.deity-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.35s;
}
button.deity-card:hover img {
    transform: scale(1.035);
}
.deity-caption {
    position: absolute;
    inset: auto 0 0;
    padding: 40px 14px 15px;
    background: linear-gradient(transparent, #101221e8 55%);
}
.deity-caption strong {
    display: block;
    color: #fff2d9;
    font-family: 'Noto Serif TC', Georgia, serif;
    font-size: 22px;
    line-height: 1.3;
}
.deity-caption small {
    color: #f2e4cd;
    font-size: 11px;
    letter-spacing: 0.06em;
}
.deity-status {
    display: inline-block;
    border: 1px solid #e5d8bd55;
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 7px;
    color: #eadfcb;
    font-size: 10px;
}
.deity-unowned {
    border-style: dashed !important;
}
.cards-detail {
    display: grid;
    grid-template-columns: minmax(0, 320px) 1fr;
    align-items: center;
    gap: 28px;
    margin-top: 22px;
}
.cards-detail p {
    color: #c9c4d5;
}
.cards-invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 0;
    border-bottom: 1px solid #ffffff18;
}
.cards-invite-row strong,
.cards-notice strong {
    overflow-wrap: anywhere;
}
.cards-invite-row button {
    flex-shrink: 0;
}
.cards-mute {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    font-size: 14px;
}
.cards-mute input {
    width: 18px;
    height: 18px;
    accent-color: #ddbd83;
}
.cards-empty {
    padding: 24px 0;
    color: #b9b7ca;
}
.cards-milestones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cards-milestones span {
    padding: 12px;
    border: 1px solid #ffffff20;
    border-radius: 10px;
    font-size: 13px;
    color: #b9b7ca;
}
.cards-milestones .earned {
    color: #f5d496;
    border-color: #e9c58388;
}
.cards-encounters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cards-memory {
    padding: 15px;
    border: 1px solid #ffffff18;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}
.cards-memory.earned {
    background: #d9b8780b;
    border-color: #cbb58255;
}
.cards-memory p {
    font-size: 13px;
    color: #c4bdd2;
}
.divine-cards .cards-history-row {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 10px;
    overflow-wrap: anywhere;
}
.cards-result-heading {
    text-align: center;
    margin: 20px 0;
}
.cards-arena {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    align-items: center;
    gap: 15px;
    max-width: 650px;
    margin: auto;
}
.cards-duelist > strong {
    display: block;
    text-align: center;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}
.cards-duelist .deity-card {
    animation: deity-reveal 1.8s ease-out both;
}
.cards-versus {
    text-align: center;
    font-size: 27px;
    color: #e4c68c;
}
.cards-revealed [data-winner='true'] .deity-card {
    box-shadow: 0 0 30px #e4c68c66;
}
.cards-result-summary {
    text-align: center;
    padding: 14px 0;
}
.cards-result-summary button {
    display: block;
    margin: 18px auto 0;
}
.cards-unlock {
    padding: 12px;
    border-radius: 10px;
    background: #d2b0ee22;
    color: #e9c6ff;
}
.cards-notice {
    position: fixed;
    top: 100px;
    right: 20px;
    width: min(360px, calc(100vw - 40px));
    z-index: 35;
    padding: 18px;
    border: 1px solid #bd9c67;
    border-radius: 15px;
    background: #1f2134f5;
    color: #eee7d9;
    box-shadow: 0 12px 35px #0004;
}
.cards-notice[hidden],
body:has(dialog[open]) .cards-notice {
    display: none;
}
.cards-notice small {
    display: block;
    color: #bfc0ce;
    margin: 6px 0 13px;
}
@keyframes deity-reveal {
    0% {
        filter: brightness(0.05);
        transform: rotateY(85deg) scale(0.95);
    }
    55% {
        filter: brightness(0.15);
        transform: rotateY(0) scale(1);
    }
    100% {
        filter: brightness(1);
    }
}
@media (max-width: 650px) {
    #panel:has(.divine-cards) {
        padding: 20px 14px;
    }
    .deity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .cards-stats {
        gap: 28px;
    }
    .cards-tabs {
        gap: 6px;
    }
    .cards-tabs button {
        padding: 10px 12px;
        font-size: 13px;
    }
    .cards-detail {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .cards-detail > .deity-card {
        max-width: 320px;
        margin: auto;
    }
    .cards-encounters {
        grid-template-columns: 1fr;
    }
    .cards-arena {
        grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
        gap: 6px;
    }
    .cards-arena .deity-caption {
        padding: 30px 8px 10px;
    }
    .cards-arena .deity-caption strong {
        font-size: 18px;
    }
    .cards-arena .deity-caption small {
        font-size: 9px;
    }
    .cards-versus {
        font-size: 20px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .cards-duelist .deity-card {
        animation: none;
    }
    .deity-card img {
        transition: none;
    }
}

.divine-cards .cards-primary:disabled {
    background: #333345;
    color: #c2bfd0;
    opacity: 1;
    cursor: not-allowed;
}
.cards-purchase {
    text-align: center;
}
.cards-purchase .cards-detail {
    display: block;
    max-width: 240px;
    margin: 18px auto;
}
.cards-purchase .cards-actions {
    justify-content: center;
}
