.advice-section p {
    margin: 0 0 12px 0;
    line-height: 1.65;
}

.advice-section p:last-child {
    margin-bottom: 0;
}

:root {
    --deep-purple: #1a0b3e;
    --midnight: #030108;
    --nebula-glow: #5e00a3;
    --gold: #d4af37;
    --gold-bright: #fff3d6;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(212, 175, 55, 0.3);
    --metal-gradient: linear-gradient(135deg, var(--gold), #b38f2d);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--midnight);
    color: #FFFFFF;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Header --- */
header {
    background: transparent;
    padding: calc(15px + env(safe-area-inset-top)) 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 1000;
}

.logo-container {
    text-align: left;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    letter-spacing: 4px;
    font-weight: 700;
    color: #FFD700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    margin: 0;
}

.logo-tagline {
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: var(--gold-bright);
    font-weight: 500;
    text-transform: uppercase;
    margin-top: -2px;
}

/* --- Dashboard Header --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    margin-top: -10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid var(--glass-border);
}

.user-greeting h2 {
    font-size: 1.1rem;
    margin: 0;
    color: white;
    font-family: 'Montserrat', sans-serif;
}

.user-greeting p {
    font-size: 0.75rem;
    margin: 2px 0 0;
    color: #888;
}

.header-action {
    font-size: 1.2rem;
    color: var(--gold);
}

/* --- Bottom Navigation --- */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(3, 1, 8, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
    z-index: 2000;
}

nav button {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 10px 4px;
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 
                0 4px 8px rgba(0, 0, 0, 0.5);
}

.nav-icon {
    font-size: 1.5rem;
    transition: 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.nav-label {
    font-size: 0.55rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

nav button.nav-active {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), 
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
}

nav button.nav-active .nav-icon {
    filter: drop-shadow(0 0 8px var(--gold));
    transform: scale(1.1);
}

nav button.nav-active .nav-label {
    opacity: 1;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* --- Backgrounds --- */
.nebula-global {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 20% 30%, #5e00a3 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, #1a0b3e 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, #030108 0%, transparent 100%);
    opacity: 0.6;
    z-index: -2;
    filter: blur(60px);
    pointer-events: none;
    animation: nebula-shimmer 20s infinite alternate ease-in-out;
}

@keyframes nebula-shimmer {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

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

/* --- Aurora skin: animated nebula canvas (natal page only) --- */
#aurora-bg-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    display: none;
    pointer-events: none;
}

.skin-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 2px;
    margin-bottom: 14px;
    gap: 1px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.skin-toggle-btn {
    border: 0;
    background: transparent;
    color: #8478a1;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
}

.skin-toggle-btn.active {
    color: #2a1b06;
    background: var(--metal-gradient);
    background-size: 220% 220%;
    background-position: 30% 50%;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 8px rgba(217, 166, 62, 0.5);
}

/* --- Aurora skin overrides, applied app-wide via a body class --- */
body.aurora-skin {
    --gold: #d9a63e;
    --gold-bright: #fffdf3;
    --glass-border: rgba(232, 197, 120, 0.3);
    --metal-gradient: linear-gradient(120deg,
        #33200a 0%, #fffdf3 14%, #7a4f14 26%,
        #f3d998 42%, #33200a 54%, #fffdf3 68%,
        #d9a63e 82%, #7a4f14 100%);
}

/* replace every page's photo nebula with the animated canvas */
body.aurora-skin .page {
    background-image: none !important;
}

/* crop the metallic ramp to one smooth sheen instead of stretching every
   band across the button — without this, wide buttons show the dark/light/
   dark/light bands as distinct visible stripes rather than a shine */
body.aurora-skin .gold-btn,
body.aurora-skin .nav-arrow {
    background: var(--metal-gradient);
    background-size: 220% 220%;
    background-position: 20% 30%;
}

/* bottom nav's active tab was still using the classic translucent-glass
   treatment instead of a filled metallic badge like the rest of Aurora */
body.aurora-skin nav button.nav-active {
    background: var(--metal-gradient);
    background-size: 220% 220%;
    background-position: 20% 30%;
    border: 1px solid rgba(51, 32, 10, 0.5);
    box-shadow: 0 2px 10px rgba(217, 166, 62, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.aurora-skin nav button.nav-active .nav-icon {
    filter: none;
    color: #2a1b06;
}

/* Tarot (🃏) and Books (📖) are full-color emoji glyphs — unlike the plain-symbol
   icons (☀ ✦ ☾), `color` has no effect on them, so they stayed their native
   colors instead of matching the rest of the nav bar in both states.
   Recolor them via a filter chain instead: muted gray to match the other
   inactive icons (which pick up `color: #888` from the base `nav button` rule),
   dark bronze to match the other icons on the active tab's gold badge. */
body.aurora-skin nav button:not(.nav-active)[onclick*="tarot"] .nav-icon,
body.aurora-skin nav button:not(.nav-active)[onclick*="books"] .nav-icon {
    filter: grayscale(1) brightness(0.75) contrast(0.9);
}

body.aurora-skin nav button.nav-active[onclick*="tarot"] .nav-icon,
body.aurora-skin nav button.nav-active[onclick*="books"] .nav-icon {
    filter: grayscale(1) sepia(1) saturate(6) hue-rotate(-15deg) brightness(0.55) contrast(1.2);
}

body.aurora-skin nav button.nav-active .nav-label {
    color: #2a1b06;
    text-shadow: none;
}

body.aurora-skin .glass,
body.aurora-skin .glass-card,
body.aurora-skin .news-card,
body.aurora-skin .psychic-card,
body.aurora-skin .book-card,
body.aurora-skin .modal-content,
body.aurora-skin .sign-box,
body.aurora-skin .achievement-item {
    background: rgba(20, 15, 38, 0.55);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.aurora-skin .details-title,
body.aurora-skin .profile-section h3 {
    background: var(--metal-gradient);
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.aurora-skin .btn-calc-main {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 0;
    border-radius: 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2a1b06;
    border: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--metal-gradient);
    background-size: 220% 220%;
    background-position: 20% 30%;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 -3px 6px rgba(0, 0, 0, 0.3) inset, 0 10px 22px -6px rgba(217, 166, 62, 0.6);
}

body.aurora-skin .btn-calc-main::after {
    content: '';
    position: absolute;
    top: -60%; left: -20%;
    width: 40%; height: 220%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: rotate(20deg);
}

.star {
    position: absolute;
    background: #fff;
    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); }
}

/* --- Page Structure --- */
.page {
    display: none;
    padding: 10px 5% calc(var(--nav-height, 100px) + 24px + env(safe-area-inset-bottom));
    text-align: center;
    min-height: auto;
    animation: fadeIn 0.5s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nebula-horsehead {
    background-image: linear-gradient(rgba(3, 1, 8, 0.6), rgba(3, 1, 8, 0.6)), url('https://images.unsplash.com/photo-1446776811953-b23d57bd21aa?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- Cards --- */
.news-card, .psychic-card, .book-card {
    text-align: center;
    padding: 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(212, 175, 55, 0.5); 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(212, 175, 55, 0.1);
    margin-bottom: 2rem;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.transit-jump {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-align-last: center;
    max-width: 65%;
    padding: 4px 8px;
    cursor: pointer;
}

.transit-jump option {
    background: var(--midnight);
    color: #FFFFFF;
    text-align: left;
}

.nav-arrow {
    background: var(--gold);
    border: none;
    color: var(--midnight);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.nav-arrow:hover {
    filter: brightness(1.2);
    transform: scale(1.1);
}

.news-card { text-align: left; }

.psychic-card {
    display: flex;
    flex-direction: column;
}

.psychic-card .description {
    color: #CCC;
    font-size: 0.8rem;
    line-height: 1.5;
}

.gold-btn {
    background: var(--metal-gradient);
    color: var(--midnight);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.gold-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
    filter: brightness(1.2);
}

.gold-btn.glow {
    animation: goldGlow 2s infinite alternate;
}

@keyframes goldGlow {
    from { box-shadow: 0 0 5px var(--gold), 0 4px 15px rgba(212, 175, 55, 0.3); }
    to { box-shadow: 0 0 25px var(--gold), 0 4px 15px rgba(212, 175, 55, 0.3); }
}

/* --- Tarot --- */
.tarot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.deck {
    width: 180px;
    height: 280px;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.2);
}

.card-back {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--gold);
    background: #000;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.card-front {
    width: 220px;
    height: 380px;
    border: 1px solid var(--gold);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--gold-glow);
    position: relative;
    box-sizing: border-box;
}

.card-front img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain !important;
    display: block;
    margin: auto;
}

/* --- Books --- */
.card-grid, .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.book-cover {
    width: 160px; height: 240px; border-radius: 8px; margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}

/* --- Profile --- */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    text-align: left;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid var(--gold);
}

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--gold);
    padding-left: 10px;
}

.signs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.sign-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.sign-box label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 5px;
    font-weight: 700;
}

.sign-box select {
    width: 100%;
    background: transparent;
    color: white;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    text-align-last: center;
}

.sign-box select option {
    background: var(--midnight);
}

.google-link-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    color: white;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    header { padding: 40px 20px 10px; }
    .page { padding: 10px 5% 100px; }
    .dashboard-header { padding: 0 10px 20px; }
}

/* --- 7-inch tablets --- */
@media (min-width: 1200px) and (max-width: 1799px) {
    html { font-size: 175%; }
    .page { max-width: 900px; margin: 0 auto; }
}

/* --- 10-inch tablets --- */
@media (min-width: 1800px) {
    html { font-size: 250%; }
    .page { max-width: 900px; margin: 0 auto; }
}

/* --- Achievements --- */
.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.achievement-item.locked {
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement-item.unlocked {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.05);
}

.ach-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.ach-info h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gold-bright);
}

.ach-info p {
    margin: 2px 0 0;
    font-size: 0.7rem;
    color: #888;
}

.ach-check {
    margin-left: auto;
    font-size: 0.9rem;
}

/* Achievement Popup */
.hidden { display: none !important; }

.achievement-popup {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 350px;
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--gold);
    background: rgba(3, 1, 8, 0.95);
}

.achievement-popup.show {
    top: 20px;
}

.achievement-popup h4 {
    margin: 0;
    color: var(--gold);
    font-size: 1rem;
}

.achievement-popup p {
    margin: 5px 0 0;
    font-size: 0.8rem;
    color: #CCC;
}

#google-login-btn.linked {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.1) !important;
    color: #FFF !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 1, 8, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 30px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--gold);
    cursor: pointer;
}
