/* VOID GACHA · 獨立法律文件頁（Meta / OAuth / Stripe 審核用） */
:root {
    color-scheme: dark;
    --legal-bg: #0a0612;
    --legal-panel: rgba(18, 10, 32, 0.92);
    --legal-border: rgba(192, 132, 252, 0.35);
    --legal-text: rgba(235, 228, 255, 0.92);
    --legal-muted: rgba(200, 190, 230, 0.72);
    --legal-accent: #c084fc;
    --legal-gold: #ffd700;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(127, 0, 255, 0.18), transparent 55%),
        var(--legal-bg);
    color: var(--legal-text);
    font-family: 'Noto Sans TC', 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.65;
}

html[data-legal-lang="zh"] .legal-lang-en,
html[data-legal-lang="en"] .legal-lang-zh {
    display: none;
}

.legal-page {
    max-width: 620px;
    margin: 0 auto;
    padding: 28px 16px 40px;
    text-align: center;
}

.legal-brand {
    font-family: 'Urbanist', 'Orbitron', sans-serif;
    color: var(--legal-gold);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 6px;
    text-align: center;
}

.legal-lang-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 12px;
}

.legal-lang-switch button {
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--legal-muted);
    font: inherit;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.legal-lang-switch button:hover {
    color: #fff;
    border-color: rgba(192, 132, 252, 0.55);
}

.legal-lang-switch button.is-active {
    color: var(--legal-gold);
    border-color: rgba(255, 215, 0, 0.45);
    background: rgba(255, 215, 0, 0.08);
}

.legal-lang-switch .divider {
    color: rgba(255, 255, 255, 0.15);
    font-size: 11px;
}

.legal-page h1 {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 3.5vw, 1.45rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    text-align: center;
}

.legal-updated {
    margin: 0 0 20px;
    font-size: 12px;
    color: var(--legal-muted);
    text-align: center;
}

.legal-panel {
    background: var(--legal-panel);
    border: 1px solid var(--legal-border);
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.legal-panel h2 {
    margin: 20px 0 8px;
    font-size: 0.92rem;
    color: var(--legal-accent);
    text-align: center;
}

.legal-panel h2:first-child {
    margin-top: 0;
}

.legal-panel p,
.legal-panel li {
    margin: 0 0 10px;
    color: var(--legal-text);
    font-size: 14px;
    text-align: center;
}

.legal-panel ul,
.legal-panel ol {
    margin: 0 auto 12px;
    padding-left: 0;
    list-style-position: inside;
    text-align: center;
}

.legal-panel a {
    color: #7dd3fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-site-url {
    color: inherit;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    text-align: center;
}

.legal-nav a {
    color: var(--legal-muted);
    text-decoration: none;
}

.legal-nav a:hover {
    color: #fff;
}

.legal-contact {
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(127, 0, 255, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.25);
    font-size: 13px;
    text-align: center;
}

.legal-notice {
    margin: 0 auto 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.35);
    text-align: center;
}

.legal-notice p {
    margin: 0;
    color: #fff;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.legal-notice strong {
    color: var(--legal-gold);
}

.legal-panel strong {
    color: #fff;
    font-weight: 600;
}

/* 獨立頁 · 與頁尾 Modal 相同外框（× 關閉返回首頁） */
.legal-modal-view {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.legal-modal-view__veil {
    position: absolute;
    inset: 0;
    background: rgba(4, 2, 12, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.legal-modal-view__panel {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 28px 22px 24px;
    border-radius: 22px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    background: linear-gradient(155deg, rgba(18, 8, 36, 0.97), rgba(8, 12, 32, 0.98));
    box-shadow:
        0 0 40px rgba(127, 0, 255, 0.35),
        0 0 24px rgba(0, 240, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.legal-modal-view__close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(240, 230, 255, 0.9);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.legal-modal-view__close:hover {
    border-color: rgba(255, 215, 0, 0.55);
    color: #ffd700;
}

.legal-modal-view .legal-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.legal-modal-view .legal-page h1 {
    padding-right: 0;
    font-family: 'Urbanist', 'Orbitron', 'Noto Sans TC', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
    text-align: center;
}

.legal-modal-view .legal-panel {
    background: rgba(8, 6, 20, 0.55);
    border-color: rgba(192, 132, 252, 0.22);
    box-shadow: none;
}

/* 嵌入頁尾 Modal iframe */
body.legal-embed {
    background: transparent;
    min-height: auto;
}

body.legal-embed .legal-modal-view,
body.legal-embed .legal-modal-view__veil,
body.legal-embed .legal-modal-view__close,
body.legal-embed .legal-brand,
body.legal-embed .legal-nav,
body.legal-embed .legal-lang-switch,
body.legal-embed .legal-page h1,
body.legal-embed .legal-updated {
    display: none;
}

body.legal-embed .legal-page {
    padding: 0;
    max-width: none;
    text-align: center;
}

body.legal-embed .legal-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-align: center;
}

@media (max-width: 640px) {
    .legal-page {
        padding: 20px 14px 32px;
    }

    .legal-panel {
        padding: 14px 12px;
    }

    .legal-panel p,
    .legal-panel li {
        font-size: 13px;
    }
}
