:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    --gold: #d4af37;
    --gold-bright: #f9d976;
    --white: #ffffff;
    --purple-light: #a29bfe;
    --text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-gradient);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* Background Stars */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: var(--text-shadow);
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--purple-light);
    letter-spacing: 1px;
}

.date-display {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.mode-btn {
    padding: 10px 25px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--white);
    border: 1px solid var(--gold);
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.mode-btn.active {
    background: var(--gold);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Tarot Board */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 30px;
    perspective: 1000px;
}

.card {
    width: 140px;
    height: 240px;
    cursor: pointer;
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card:hover {
    transform: translateY(-15px) scale(1.05);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.selected {
    border: 3.5px solid var(--gold-bright);
    box-shadow: 0 0 30px var(--gold-bright), 0 0 50px rgba(212, 175, 55, 0.4);
    transform: translateY(-20px) scale(1.08);
    z-index: 100;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 2px solid var(--gold);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-back {
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: 
        radial-gradient(circle at center, var(--gold) 1px, transparent 1px),
        repeating-conic-gradient(from 0deg, #1a1a2e 0deg 90deg, #16213e 90deg 180deg);
    background-size: 20px 20px;
}

.card-back::after {
    content: '\f130';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 3rem;
    color: var(--gold);
    opacity: 0.5;
}

.card-front {
    transform: rotateY(180deg);
    background: white;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Pick Effect */
.card-pick-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--gold-bright), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: explode 0.8s ease-out forwards;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(15); opacity: 0; }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
}

.modal-content-today {
    background: #1a1a2e;
    margin: 3% auto;
    padding: 35px;
    border: 3px solid var(--gold);
    width: 95%;
    max-width: 1000px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 0 70px rgba(0,0,0,0.8);
    overflow-y: auto;
    max-height: 90vh;
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 35px;
    color: var(--gold);
    cursor: pointer;
    z-index: 10;
}

/* 3 Card Result Styles */
.multi-result-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.result-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-item h3 {
    color: var(--purple-light);
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.result-item-card {
    width: 120px;
    height: 210px;
    border-radius: 8px;
    border: 1.5px solid var(--gold);
    margin-bottom: 15px;
    object-fit: cover;
}

.result-item-info h4 {
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 10px;
    text-align: center;
}

.general-desc {
    font-size: 0.85rem;
    color: #eee;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 15px;
}

.detail-box {
    width: 100%;
    text-align: left;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-box h5 {
    font-size: 0.85rem;
    color: var(--gold-bright);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-box p {
    font-size: 0.8rem;
    color: #bbb;
    line-height: 1.4;
}

.comprehensive-summary {
    background: rgba(212, 175, 55, 0.08);
    padding: 25px;
    border-radius: 20px;
    border: 1px dashed var(--gold);
    text-align: center;
    margin-top: 20px;
}

.comprehensive-summary h3 {
    font-size: 1.3rem;
    color: var(--gold-bright);
    margin-bottom: 15px;
}

.comprehensive-summary p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #eee;
    white-space: pre-line;
}

/* 1 Card (Today's Card) Styles */
.today-one-liner {
    font-size: 1.25rem;
    color: var(--gold-bright);
    margin: 10px 0 20px;
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-style: italic;
    text-shadow: 0 0 10px rgba(249, 217, 118, 0.3);
}

.today-result-header { text-align: center; margin-bottom: 25px; }
.badge { background: var(--gold); color: var(--bg-dark); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; margin-bottom: 10px; display: inline-block; }
.today-result-body { display: flex; gap: 30px; }
.today-card-view img { width: 220px; height: 380px; border-radius: 15px; border: 3px solid var(--gold); }
.today-text-view { flex: 1; }
.today-section { background: rgba(255, 255, 255, 0.05); padding: 15px; border-radius: 12px; margin-bottom: 15px; }
.today-section h3, .today-section h4 { color: var(--gold-bright); margin-bottom: 8px; font-size: 1rem; }
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lucky-items { display: flex; gap: 15px; margin-bottom: 20px; justify-content: center; flex-wrap: wrap; }
.lucky-item { background: rgba(212, 175, 55, 0.1); padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; border: 1px solid var(--gold); }

/* Common Buttons */
.btn-primary {
    display: block;
    padding: 12px 35px;
    background: var(--gold);
    color: var(--bg-dark);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px auto;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover { transform: scale(1.05); background: var(--gold-bright); }
.btn-retry { padding: 10px 25px; background: transparent; color: var(--gold); border: 1px solid var(--gold); border-radius: 30px; cursor: pointer; transition: all 0.3s; }
.btn-retry:hover { background: var(--gold); color: var(--bg-dark); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 1s ease-out forwards; }
.animate-fade-in-delay { opacity: 0; animation: fadeIn 1s ease-out 0.5s forwards; }

/* Responsive */
@media (max-width: 850px) {
    .multi-result-container { flex-direction: column; align-items: center; }
    .result-item { max-width: 100%; width: 100%; }
    .today-result-body { flex-direction: column; align-items: center; }
}
