/* ==========================================
   命途 · Destiny Reading | Global Styles
   Batch 1 - 完整版
   ========================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
    background: linear-gradient(180deg, #0a0a1e 0%, #1a1a3e 50%, #0a0a1e 100%);
    color: #e8e0c8;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ---------- Starry background ---------- */
.starry-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 35% 85%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1.5px 1.5px at 10% 60%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5), transparent);
}

/* ---------- Top nav ---------- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: rgba(10, 10, 30, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f4d97a;
    text-decoration: none;
    font-family: "Cinzel", serif;
    font-size: 20px;
    letter-spacing: 4px;
    font-weight: 500;
}
.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}
.nav-links a {
    color: rgba(232, 224, 200, 0.85);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.nav-links a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #f4d97a;
}
.nav-links .nav-cta {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #f4d97a;
}
.nav-links .nav-cta:hover {
    background: linear-gradient(135deg, #d4af37, #f4d97a);
    color: #1a1a2e;
}
.nav-links .nav-logout {
    color: rgba(232, 224, 200, 0.5);
    font-size: 13px;
}
@media (max-width: 640px) {
    .top-nav { padding: 14px 20px; }
    .nav-logo { font-size: 17px; letter-spacing: 2px; }
    .nav-links a { padding: 6px 10px; font-size: 13px; }
}

/* ---------- Container ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 30px 40px;
}
.container.narrow {
    max-width: 720px;
}

/* ---------- Page header ---------- */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}
.brand-name {
    font-family: "Cinzel", serif;
    color: #f4d97a;
    font-size: 56px;
    letter-spacing: 12px;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(244, 217, 122, 0.3);
}
.brand-sub {
    color: rgba(212, 175, 55, 0.7);
    font-size: 14px;
    letter-spacing: 6px;
    font-family: "Cinzel", serif;
}
.page-title {
    color: #f4d97a;
    font-size: 32px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}
.page-sub {
    color: rgba(232, 224, 200, 0.75);
    font-size: 15px;
    letter-spacing: 2px;
    line-height: 1.9;
}
.result-tag {
    display: inline-block;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #f4d97a;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

/* ---------- Online badge ---------- */
.online-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(20, 20, 45, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 10px 20px;
    border-radius: 25px;
    max-width: fit-content;
    margin: 0 auto 40px;
}
.online-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 12px #4caf50;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.online-text {
    color: rgba(232, 224, 200, 0.85);
    font-size: 14px;
    letter-spacing: 1px;
}
.online-text #online-count {
    color: #f4d97a;
    font-weight: 500;
}

/* ---------- System grid (index) ---------- */
.system-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}
.system-card {
    background: rgba(20, 20, 45, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 30px 24px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.system-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.15);
}
.system-icon-svg {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}
.system-icon-svg svg {
    width: 100%;
    height: 100%;
}
.system-card h3 {
    color: #f4d97a;
    font-size: 20px;
    letter-spacing: 3px;
    margin-bottom: 10px;
}
.system-card p {
    color: rgba(232, 224, 200, 0.7);
    font-size: 13.5px;
    letter-spacing: 1px;
}
@media (max-width: 768px) {
    .system-grid { grid-template-columns: 1fr; }
    .brand-name { font-size: 42px; letter-spacing: 8px; }
    .page-title { font-size: 24px; }
}

/* ---------- Trust strip ---------- */
.trust-strip {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 40px 0 60px;
    padding: 30px 20px;
    background: rgba(20, 20, 45, 0.35);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.trust-item { text-align: center; }
.trust-num {
    color: #f4d97a;
    font-size: 28px;
    font-family: "Cinzel", serif;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.trust-label {
    color: rgba(232, 224, 200, 0.65);
    font-size: 12.5px;
    letter-spacing: 2px;
}

/* ---------- Testimonials ---------- */
.section-title {
    color: #f4d97a;
    text-align: center;
    font-size: 22px;
    letter-spacing: 4px;
    margin-bottom: 32px;
    font-weight: 500;
}
.testimonials { margin: 60px 0; }
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.testimonial-card {
    position: relative;
    background: rgba(20, 20, 45, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 28px 24px 22px;
}
.testimonial-quote {
    position: absolute;
    top: 6px;
    left: 18px;
    font-family: "Cinzel", serif;
    font-size: 56px;
    color: rgba(212, 175, 55, 0.25);
    line-height: 1;
}
.testimonial-body {
    color: rgba(232, 224, 200, 0.85);
    font-size: 14px;
    line-height: 1.9;
    margin: 20px 0 20px;
    min-height: 100px;
}
.testimonial-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding-top: 14px;
}
.testimonial-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f4d97a;
    font-size: 16px;
}
.testimonial-name {
    color: #f4d97a;
    font-size: 14px;
    letter-spacing: 1px;
}
.testimonial-topic {
    color: rgba(232, 224, 200, 0.55);
    font-size: 12px;
    margin-top: 2px;
}
@media (max-width: 768px) {
    .trust-strip { flex-direction: column; gap: 24px; }
    .testimonial-grid { grid-template-columns: 1fr; }
}

/* ---------- Topic page ---------- */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 30px 0 60px;
}
.topic-card {
    background: rgba(20, 20, 45, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 24px 22px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.topic-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.55);
}
.topic-icon {
    font-size: 32px;
    margin-bottom: 10px;
}
.topic-card h3 {
    color: #f4d97a;
    font-size: 17px;
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.topic-card p {
    color: rgba(232, 224, 200, 0.7);
    font-size: 13px;
    letter-spacing: 1px;
}
@media (max-width: 640px) {
    .topic-grid { grid-template-columns: 1fr; }
}

/* ---------- Back link ---------- */
.back-link {
    display: inline-block;
    color: rgba(212, 175, 55, 0.75);
    font-size: 13.5px;
    text-decoration: none;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.back-link:hover { color: #f4d97a; }

/* ---------- Form ---------- */
.form-box {
    background: rgba(20, 20, 45, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 26px 28px;
    margin-bottom: 18px;
}
.form-box h3 {
    color: #f4d97a;
    font-size: 16px;
    letter-spacing: 3px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    color: rgba(232, 224, 200, 0.85);
    font-size: 13.5px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 10, 30, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    color: #f4d97a;
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.field textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.7;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #f4d97a;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
}
.exact-time-row {
    margin-top: 10px;
    display: none;
}
.exact-time-row.show { display: block; }

/* Partner toggle */
.partner-toggle {
    text-align: center;
    color: #f4d97a;
    font-size: 14px;
    letter-spacing: 2px;
    padding: 12px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.partner-toggle:hover { background: rgba(212, 175, 55, 0.1); }
.partner-box {
    display: none;
    margin-top: 18px;
}
.partner-box.show { display: block; }

/* Agree box */
.agree-box {
    padding: 14px 18px;
    background: rgba(20, 20, 45, 0.3);
    border: 1px dashed rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    margin: 20px 0;
    color: rgba(232, 224, 200, 0.85);
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
}
.agree-box a { color: #f4d97a; }

/* Submit button */
.btn-submit {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #d4af37, #f4d97a);
    color: #1a1a2e;
    border: none;
    padding: 16px;
    border-radius: 28px;
    font-size: 16px;
    letter-spacing: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.3);
    transition: transform 0.2s;
}
.btn-submit:hover { transform: translateY(-2px); }
.btn-submit:disabled {
    background: rgba(212, 175, 55, 0.3);
    color: rgba(26, 26, 46, 0.6);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Flash messages */
.flash-msg {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #f4d97a;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* ---------- Site Footer ---------- */
.site-footer {
    margin-top: 80px;
    padding-top: 40px;
    background: rgba(10, 10, 25, 0.6);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 1.5fr 3fr;
    gap: 40px;
}
.footer-brand .footer-logo {
    color: #f4d97a;
    font-family: "Cinzel", serif;
    font-size: 22px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}
.footer-brand p {
    color: rgba(232, 224, 200, 0.55);
    font-size: 13px;
    letter-spacing: 2px;
}
.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.footer-col h4 {
    color: rgba(212, 175, 55, 0.85);
    font-size: 13px;
    letter-spacing: 3px;
    margin-bottom: 14px;
    font-weight: 500;
}
.footer-col a {
    display: block;
    color: rgba(232, 224, 200, 0.65);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
    letter-spacing: 1px;
    transition: color 0.2s;
}
.footer-col a:hover { color: #f4d97a; }
.footer-bottom {
    max-width: 1100px;
    margin: 30px auto 0;
    padding: 20px 30px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    text-align: center;
    color: rgba(232, 224, 200, 0.4);
    font-size: 12px;
    letter-spacing: 1px;
}
@media (max-width: 768px) {
    .footer-inner { grid-template-columns: 1fr; gap: 30px; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- LINE Floating Button ---------- */
.line-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #06C755;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.4);
    z-index: 90;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 14px;
    letter-spacing: 1px;
}
.line-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(6, 199, 85, 0.5);
}
.line-fab svg { flex-shrink: 0; }
.line-fab-label { font-weight: 500; }
@media (max-width: 640px) {
    .line-fab {
        padding: 10px 14px;
        bottom: 18px;
        right: 18px;
    }
    .line-fab-label { display: none; }
}

/* ---------- Error Pages (404/500) ---------- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-code {
    font-family: "Cinzel", serif;
    color: rgba(212, 175, 55, 0.5);
    font-size: 96px;
    letter-spacing: 8px;
    text-shadow: 0 0 40px rgba(244, 217, 122, 0.2);
    margin-bottom: 20px;
}
.error-title {
    color: #f4d97a;
    font-size: 28px;
    letter-spacing: 6px;
    margin-bottom: 12px;
}
.error-sub {
    color: rgba(232, 224, 200, 0.7);
    font-size: 15px;
    letter-spacing: 2px;
    margin-bottom: 20px;
}
.error-desc {
    color: rgba(232, 224, 200, 0.65);
    font-size: 14px;
    line-height: 2;
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}
.error-btn {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37, #f4d97a);
    color: #1a1a2e;
    padding: 12px 36px;
    border-radius: 24px;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 4px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

/* ---------- Print (report page) ---------- */
@media print {
    body { background: #fff; color: #333; }
    .starry-bg, .top-nav, .site-footer, .line-fab,
    .report-toolbar, .save-box, .share-box { display: none !important; }
    .container { max-width: 100%; padding: 20px; }
    .full-report { background: #fff; border: none; padding: 0; color: #333; }
    .full-report h2 { color: #b8912e; border-color: #ddd; }
    .full-report strong { color: #b8912e; }
}



/* ==========================================
   Batch 2 · 塔羅選牌動畫(舊版恢復 + 逆位)
   ========================================== */


   .tarot-picker {
    background: rgba(20, 20, 45, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 24px;
    position: relative;
}


.picker-status {
    text-align: center;
    margin-bottom: 20px;
}
.picker-step {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(10, 10, 30, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 10px 22px;
    border-radius: 30px;
}
.step-badge {
    color: #1a1a2e;
    background: linear-gradient(135deg, #d4af37, #f4d97a);
    padding: 3px 12px;
    border-radius: 12px;
    font-family: "Cinzel", serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}
.step-text {
    color: #f4d97a;
    font-size: 14px;
    letter-spacing: 2px;
}
.picker-note {
    color: rgba(212, 175, 55, 0.7);
    font-size: 12.5px;
    letter-spacing: 1.5px;
    margin-top: 12px;
}
.picker-note strong { color: #b8860b; }


/* 選中三張的顯示區 */
.selected-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0 26px;
}
.slot {
    background: rgba(10, 10, 30, 0.5);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    min-height: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.slot.filled {
    border-style: solid;
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(212, 175, 55, 0.06);
}
.slot.filled.reversed {
    border-color: rgba(184, 134, 11, 0.7);
    background: rgba(184, 134, 11, 0.06);
}
.slot-label {
    color: rgba(212, 175, 55, 0.8);
    font-size: 13px;
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.slot-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(212, 175, 55, 0.3);
    font-size: 30px;
    width: 100%;
}
.slot-inner img {
    width: 88px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.slot-inner img.is-reversed {
    transform: rotate(180deg);
}
.slot-name {
    color: #f4d97a;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.slot-orient {
    font-size: 11px;
    color: rgba(212, 175, 55, 0.75);
    letter-spacing: 1.5px;
}
.slot-orient.rev { color: #b8860b; }


/* 洗牌動畫遮罩 */
.shuffle-overlay {
    position: absolute;
    inset: 20px;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(4px);
    z-index: 5;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.6s;
}
.shuffle-overlay.done {
    opacity: 0;
    pointer-events: none;
}
.shuffle-stage {
    position: relative;
    width: 100px;
    height: 140px;
}
.shuffle-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: 76px;
    height: 114px;
    margin-left: -38px;
    background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    animation: shuffleFly 1.8s ease-in-out infinite;
}
.shuffle-card:nth-child(1) { animation-delay: 0s; }
.shuffle-card:nth-child(2) { animation-delay: 0.15s; }
.shuffle-card:nth-child(3) { animation-delay: 0.3s; }
.shuffle-card:nth-child(4) { animation-delay: 0.45s; }
.shuffle-card:nth-child(5) { animation-delay: 0.6s; }
.shuffle-card:nth-child(6) { animation-delay: 0.75s; }
.shuffle-card:nth-child(7) { animation-delay: 0.9s; }
@keyframes shuffleFly {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    20%  { transform: translate(-40px, -20px) rotate(-15deg); opacity: 1; }
    50%  { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    80%  { transform: translate(40px, -20px) rotate(15deg); opacity: 1; }
    100% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
}
.shuffle-text {
    color: #f4d97a;
    font-size: 15px;
    letter-spacing: 4px;
    animation: shuffleTextFade 1.5s ease-in-out infinite;
}
@keyframes shuffleTextFade {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}


/* 22 張橫向卡片捲軸 */
.cards-scroller {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
    transition: opacity 0.5s;
}
.cards-scroller::-webkit-scrollbar { height: 8px; }
.cards-scroller::-webkit-scrollbar-track { background: rgba(10, 10, 30, 0.4); border-radius: 4px; }
.cards-scroller::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.4); border-radius: 4px; }


.cards-track {
    display: flex;
    gap: 12px;
    padding: 0 20px;
    min-width: fit-content;
}


.card-item {
    flex-shrink: 0;
    width: 90px;
    height: 135px;
    cursor: pointer;
    perspective: 800px;
    transition: transform 0.3s;
}
.card-item:hover {
    transform: translateY(-8px);
}
.card-item.selected {
    opacity: 0.35;
    pointer-events: none;
}


.card-flip {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.5, 0, 0.3, 1);
}
.card-item.flipped .card-flip {
    transform: rotateY(180deg);
}
.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-front {
    transform: rotateY(180deg);
}
.card-front.is-reversed img {
    transform: rotate(180deg);
}


.picker-hint {
    text-align: center;
    color: rgba(212, 175, 55, 0.55);
    font-size: 12.5px;
    letter-spacing: 3px;
    margin-top: 10px;
}


/* 確認 Modal */
.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.confirm-modal.show { display: flex; }
.confirm-inner {
    background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 45, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.confirm-title {
    color: #f4d97a;
    font-size: 20px;
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.confirm-sub {
    color: rgba(232, 224, 200, 0.85);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 20px;
}
.confirm-card-back {
    margin: 20px auto;
}
.confirm-card-back img {
    width: 110px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.confirm-note {
    color: rgba(212, 175, 55, 0.7);
    font-size: 12.5px;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
    line-height: 1.8;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-cancel, .btn-confirm {
    padding: 12px 22px;
    border-radius: 24px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-cancel {
    background: rgba(232, 224, 200, 0.1);
    color: rgba(232, 224, 200, 0.85);
    border: 1px solid rgba(232, 224, 200, 0.3);
}
.btn-cancel:hover { background: rgba(232, 224, 200, 0.15); }
.btn-confirm {
    background: linear-gradient(135deg, #d4af37, #f4d97a);
    color: #1a1a2e;
    font-weight: 600;
}
.btn-confirm:hover { transform: translateY(-2px); }


/* 翻牌大圖 Modal */
.reveal-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.92);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    animation: revealFadeIn 0.4s ease-out;
}
.reveal-modal.show { display: flex; }
@keyframes revealFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.reveal-inner {
    text-align: center;
    animation: revealPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes revealPop {
    from { transform: scale(0.5) rotateY(180deg); opacity: 0; }
    to   { transform: scale(1) rotateY(0); opacity: 1; }
}
.reveal-card img {
    width: 200px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(244, 217, 122, 0.3);
}
.reveal-card img.is-reversed {
    transform: rotate(180deg);
}
.reveal-name {
    color: #f4d97a;
    font-size: 26px;
    letter-spacing: 6px;
    margin-top: 20px;
    text-shadow: 0 0 20px rgba(244, 217, 122, 0.4);
}
.reveal-position {
    color: rgba(232, 224, 200, 0.85);
    font-size: 15px;
    letter-spacing: 4px;
    margin-top: 6px;
}
.reveal-orientation {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 16px;
    border-radius: 14px;
    background: rgba(212, 175, 55, 0.2);
    color: #f4d97a;
    font-size: 13px;
    letter-spacing: 3px;
    border: 1px solid rgba(212, 175, 55, 0.4);
}
.reveal-orientation.rev {
    background: rgba(184, 134, 11, 0.25);
    color: #d4a04a;
    border-color: rgba(184, 134, 11, 0.5);
}


/* Mobile */
@media (max-width: 640px) {
    .selected-slots { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .slot { min-height: 160px; padding: 8px; }
    .slot-inner img { width: 60px; }
    .card-item { width: 76px; height: 114px; }
    .reveal-card img { width: 160px; }
    .reveal-name { font-size: 22px; letter-spacing: 4px; }
}