:root {
    --gold: #d4af37;
    --gold-bright: #ffdf73;
    --dark-bg: #0b0c10;
    --mystic-purple: #1f1235;
    --mystic-red: #3e1423;
    --accent-cyan: #45a29e;
    --text-main: #c5c6c7;
}

body {
    margin: 0; padding: 0; background-color: var(--dark-bg);
    color: var(--text-main); font-family: 'PingFang TC', 'Microsoft JhengHei', serif;
    overflow-x: hidden; min-height: 100vh; display: flex; justify-content: center;
}

.top-nav {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(11, 12, 16, 0.85); backdrop-filter: blur(10px);
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; 
    padding: 10px 5px; z-index: 100; border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.nav-btn {
    background: transparent; border: none; color: #888; font-size: 0.95rem; 
    cursor: pointer; transition: 0.3s; padding: 5px 10px; position: relative;
}

.nav-btn.active { color: var(--gold-bright); text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
.nav-btn.active::after {
    content: ''; position: absolute; bottom: -5px; left: 50%;
    transform: translateX(-50%); width: 20px; height: 2px;
    background: var(--gold-bright); box-shadow: 0 0 10px var(--gold-bright);
}

.nav-dropdown-wrapper { position: relative; display: inline-block; }
.nav-dropdown {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: rgba(20, 20, 25, 0.95); border: 1px solid var(--gold); border-radius: 8px;
    width: max-content; max-width: 90vw; z-index: 200; box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px); padding: 5px 0; margin-top: 15px;
}

.nav-dropdown::before {
    content: ''; position: absolute; top: -15px; left: 0; width: 100%; height: 15px;
}

@media (hover: hover) {
    .nav-dropdown-wrapper:hover .nav-dropdown { 
        display: block; animation: fadeIn 0.2s ease; 
    }
}

.nav-dropdown.show { display: block; animation: fadeIn 0.2s ease; }
.nav-dropdown div {
    padding: 12px 20px; color: #ccc; cursor: pointer; transition: 0.2s;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1); text-align: left; font-size: 0.95rem;
}
.nav-dropdown div:last-child { border-bottom: none; }
.nav-dropdown div:hover { background: rgba(212, 175, 55, 0.15); color: var(--gold-bright); }

@keyframes fadeIn { from{opacity:0; transform: translate(-50%, -10px);} to{opacity:1; transform: translate(-50%, 0);} }

.mystic-background {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 50%, var(--mystic-purple) 0%, var(--mystic-red) 50%, var(--dark-bg) 100%);
    opacity: 0.6; z-index: -2;
}
.floating-particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255, 223, 115, 0.15) 1px, transparent 1px);
    background-size: 60px 60px; z-index: -1; animation: floating 40s linear infinite;
}
@keyframes floating { 0% { background-position: 0 0; } 100% { background-position: -120px -120px; } }

.container { max-width: 800px; width: 95%; padding: 120px 0 50px; text-align: center; position: relative; z-index: 1; }
.hidden { display: none !important; }
.fade-section { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-section.active { opacity: 1; transform: translateY(0); }

h1 { color: var(--gold); font-size: 3rem; letter-spacing: 8px; text-shadow: 0 0 20px rgba(212, 175, 55, 0.4); margin-bottom: 10px; }
.subtitle { color: #8a8d91; font-size: 1.1rem; margin-bottom: 40px; letter-spacing: 2px; }

.question-display {
    color: var(--gold-bright); font-size: 1.25rem; margin-bottom: 20px;
    letter-spacing: 1.5px; font-weight: normal; text-shadow: 0 0 8px rgba(255, 223, 115, 0.3);
}

.input-group { display: flex; flex-direction: column; gap: 20px; max-width: 400px; margin: 0 auto 40px; }
input, select.mystic-select { 
    background: rgba(20, 20, 25, 0.6); border: 1px solid rgba(212, 175, 55, 0.3); 
    padding: 15px 20px; color: white; font-size: 1rem; border-radius: 8px; outline: none; transition: 0.3s; 
    font-family: inherit; width: 100%; box-sizing: border-box;
}
input:focus, select.mystic-select:focus { border-color: var(--gold-bright); box-shadow: 0 0 15px rgba(212, 175, 55, 0.2); }
select.mystic-select option { background: var(--dark-bg); color: white; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(1) saturate(3) hue-rotate(5deg); cursor: pointer; }

.btn-glow {
    background: transparent; color: var(--gold); border: 1px solid var(--gold); padding: 15px 50px; 
    font-size: 1.2rem; cursor: pointer; border-radius: 4px; transition: 0.4s;
}
.btn-glow:hover { background-color: rgba(212, 175, 55, 0.15); box-shadow: 0 0 20px var(--gold); transform: translateY(-2px); }

.slot-container { display: flex; justify-content: center; gap: 15px; margin: 20px 0 40px; flex-wrap: wrap; min-height: 110px; }
.card-slot {
    width: 65px; height: 110px; border: 2px dashed rgba(212, 175, 55, 0.4); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; transition: 0.3s; position: relative;
}
.card-slot.filled { border: 1px solid var(--gold-bright); background: linear-gradient(135deg, #2a1b3d 0%, #4a192c 100%); box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); cursor: pointer; }
.card-slot.filled::after { content: '✧'; color: var(--gold-bright); font-size: 1.5rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.card-slot.filled:hover { transform: translateY(-5px); box-shadow: 0 5px 20px rgba(212, 175, 55, 0.5); }

.card-deck-horizontal {
    display: flex; justify-content: center; align-items: center; height: 130px; 
    margin: 20px auto 40px; max-width: 100%; padding: 0 15px;
}
.tarot-card-overlap {
    width: 65px; height: 110px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(212, 175, 55, 0.6); border-radius: 6px; margin-left: -45px; 
    cursor: pointer; transition: transform 0.3s, opacity 0.3s; box-shadow: -2px 0 8px rgba(0,0,0,0.6);
    position: relative;
}
.tarot-card-overlap:first-child { margin-left: 0; }
.tarot-card-overlap::after { content: '✧'; color: rgba(212, 175, 55, 0.3); font-size: 1.2rem; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tarot-card-overlap:hover { transform: translateY(-15px); border-color: var(--gold-bright); z-index: 50 !important; }
.tarot-card-overlap.hidden-deck-card { opacity: 0; pointer-events: none; }

.card-display-row { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 20px; padding: 10px; flex-wrap: wrap; }
.display-card-wrapper { width: 28%; min-width: 110px; max-width: 160px; perspective: 1000px; opacity: 0; transform: translateY(20px); transition: 1s all ease; }
.display-card-wrapper.reveal { opacity: 1; transform: translateY(0); }
.display-card-img { width: 100%; height: auto; border-radius: 10px; border: 2px solid var(--gold); box-shadow: 0 5px 15px rgba(0,0,0,0.8), 0 0 10px rgba(212, 175, 55, 0.2); display: block; transition: transform 0.4s ease; cursor: pointer; }
.display-card-img:hover { transform: scale(1.08); box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4); }
.is-reversed { transform: rotate(180deg); }
.is-reversed:hover { transform: rotate(180deg) scale(1.08); }

.progress-bar { width: 200px; height: 4px; background: #222; margin: 0 auto 10px; border-radius: 2px; overflow: hidden; }
.progress-fill { width: 0%; height: 100%; background: var(--gold); transition: width 0.5s ease; }

.result-item { background: rgba(30, 30, 40, 0.8); margin: 20px 0; padding: 25px; border-radius: 12px; border-left: 4px solid var(--gold); text-align: left; opacity: 0; transform: translateY(30px); transition: 1s all ease; }
.result-item.reveal { opacity: 1; transform: translateY(0); }
.keyword-tag { background: rgba(212, 175, 55, 0.1); color: var(--gold); padding: 4px 12px; border-radius: 15px; margin-right: 5px; font-size: 0.85rem; }

.history-controls { margin-bottom: 20px; text-align: right; }
.history-meta { display: flex; justify-content: space-between; align-items: center; color: #888; font-size: 0.85rem; margin-bottom: 15px; border-bottom: 1px dashed #444; padding-bottom: 10px; }
.history-question { color: var(--gold-bright); font-size: 1.1rem; margin-bottom: 15px; font-weight: bold; text-align: left;}
.history-cards-mini { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.mini-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(212,175,55,0.3); padding: 5px 10px; border-radius: 4px; font-size: 0.9rem; text-align: center; }
.empty-history { color: #666; padding: 50px 0; }
.btn-outline { background: transparent; border: 1px solid #555; color: #ccc; padding: 10px 30px; border-radius: 4px; cursor: pointer; transition: 0.3s; }
.btn-outline:hover { border-color: var(--text-main); color: white; }
.btn-danger { border-color: #8a3a3a; color: #d76d77; }
.btn-danger:hover { border-color: #d76d77; background: rgba(215, 109, 119, 0.1); }
.card-header { display: flex; align-items: baseline; gap: 15px; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.card-position { font-size: 0.9rem; color: var(--accent-cyan); letter-spacing: 1px; }
.card-name { font-size: 1.5rem; color: var(--gold-bright); margin: 0; }
.keyword-list { margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.text-block { margin-bottom: 15px; line-height: 1.7; color: #dcdde1; }
.text-label { color: var(--gold); font-size: 0.9rem; letter-spacing: 1px; display: block; margin-bottom: 5px; opacity: 0.8; }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px);
    display: none; justify-content: center; align-items: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease;
}
.modal.active { opacity: 1; }
.modal-content {
    background: linear-gradient(180deg, rgba(30, 30, 40, 0.98) 0%, rgba(20, 20, 25, 1) 100%); border: 1px solid var(--gold); border-radius: 12px;
    padding: 30px; max-width: 90%; width: 400px; position: relative; transform: translateY(20px); transition: transform 0.3s ease; box-shadow: 0 10px 40px rgba(0,0,0,0.8); text-align: left;
}
.modal.active .modal-content { transform: translateY(0); }
.close-btn { position: absolute; top: 10px; right: 15px; color: var(--gold); font-size: 1.8rem; cursor: pointer; transition: 0.3s; }
.close-btn:hover { color: var(--gold-bright); transform: scale(1.1); }