/* Chinese New Year overlay */
.cny-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #8b1a1a, #4a0e0e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1s ease;
}
.cny-overlay.fade-out { opacity: 0; pointer-events: none; }
.cny-content { text-align: center; animation: cny-appear 1s ease-out; }
.cny-lantern { font-size: 4rem; display: block; margin-bottom: 15px; animation: cny-swing 2s ease-in-out infinite; }
.cny-title { font-family: 'Noto Serif SC', serif; font-size: 3rem; color: #ffd700; margin: 0 0 10px; text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4); }
.cny-subtitle { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #f5f2e9; margin: 0 0 5px; letter-spacing: 2px; }
.cny-year { font-family: 'Noto Serif SC', serif; font-size: 1rem; color: #ffd700; opacity: 0.7; margin: 0; }

@keyframes cny-appear {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes cny-swing {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

:root {
    --gold: #d4a017;
    --dark-gold: #b8860b;
    --text: #2c2c2c;
    --sepia: #f5f2e9;
}

body {
    font-family: 'Times New Roman', serif;
    background-color: var(--sepia);
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 100%;
    background: white;
    padding: 30px;
    border: 1px solid var(--gold);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    box-sizing: border-box;
}

h1 { font-family: 'Playfair Display', serif; color: #8b4513; text-transform: uppercase; font-size: 1.6rem; margin-bottom: 20px; }

.input-group {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px double var(--gold);
    flex-wrap: wrap;
}

.input-field { display: flex; flex-direction: column; align-items: center; }
.input-field label { font-size: 10px; font-weight: bold; color: var(--dark-gold); margin-bottom: 5px; text-transform: uppercase; }
input { width: 65px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; text-align: center; font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.15); }
button { background: #8b4513; color: white; border: none; padding: 12px 25px; border-radius: 50px; cursor: pointer; font-weight: bold; font-family: 'Playfair Display', serif; margin-top: 10px; transition: 0.3s; }
button:hover { background: var(--gold); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 40px; }
@media (max-width: 768px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }

.pillar { border: 1px solid var(--gold); padding: 15px 5px; background: #fff; border-radius: 4px; }
.pillar-header { font-size: 11px; font-weight: bold; color: #8b4513; margin-bottom: 15px; border-bottom: 1px solid #f0f0f0; padding-bottom: 5px; }
.section { margin-bottom: 15px; }
.term { font-size: 8px; color: #999; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 4px; }

.fr-desc { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: bold; color: var(--text); display: block; line-height: 1.2; margin-bottom: 2px; }
.cn-char { font-family: 'Noto Serif SC', serif; font-size: 1.3rem; color: #888; display: block; }

.star-label { display: inline-block; font-size: 0.8rem; color: #8b4513; background: transparent; padding: 4px 12px; border-radius: 50px; border: 1.5px solid #8b4513; font-style: italic; font-weight: 600; margin-top: 10px; letter-spacing: 0.5px; font-family: 'Inter', 'Helvetica Neue', sans-serif; }
.day-master { background: #fffdf2; outline: 1px solid var(--gold); box-shadow: 0 0 10px rgba(212,160,23,0.1); }
.dm-badge { display: inline-block; font-size: 0.65rem; color: #fff; background: var(--gold); padding: 2px 8px; border-radius: 50px; font-style: normal; font-weight: 700; margin-top: 5px; letter-spacing: 0.5px; font-family: 'Playfair Display', serif; }

.explanation {
    text-align: left;
    background: #fafafa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    margin-top: 20px;
}

.explanation h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #8b4513; margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.explanation p { font-size: 0.9rem; line-height: 1.5; color: #555; margin-bottom: 15px; }
.explanation b { color: #8b4513; }
.promo-banner {
    margin: 60px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
}

.promo-text-meta {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    color: #444;
    letter-spacing: 2px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
}

.buy-report-btn {
    display: inline-block;
    background: #8b4513;
    color: #f5f2e9;
    text-decoration: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    font-style: normal;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.buy-report-btn:hover {
    background: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.3);
}

/* Elements chart */
.elements-container {
    margin: 40px auto;
    max-width: 600px;
    padding: 25px;
    background: #fffdf2;
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-radius: 4px;
}
.elements-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #8b4513;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.element-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}
.element-label {
    width: 70px;
    font-size: 0.9rem;
    font-family: 'Playfair Display', serif;
    color: #444;
    font-weight: bold;
}
.bar-bg {
    flex-grow: 1;
    height: 10px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}
.bg-bois { background: #a3b18a; }
.bg-feu { background: #e9c46a; }
.bg-terre { background: #bc8a5f; }
.bg-metal { background: #adb5bd; }
.bg-eau { background: #457b9d; }
.bar-fill {
    height: 100%;
    width: 0;
    transition: width 1s cubic-bezier(0.1, 0.5, 0.5, 1);
}

.element-count {
    width: 50px;
    font-size: 0.95rem;
    color: #444;
    text-align: right;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.error-message {
    color: #c0392b;
    font-weight: bold;
    padding: 10px;
}

.explanation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.explanation-column { font-size: 0.85rem; line-height: 1.4; }
.explanation-column ul { padding-left: 20px; }
.explanation-heading { color: #8b4513; }
.explanation-footer { border-top: 1px solid #eee; padding-top: 15px; font-style: italic; }

@media (max-width: 480px) { .explanation { padding: 15px; } .explanation h2 { font-size: 1.1rem; } .explanation-grid { grid-template-columns: 1fr; } }
