/* ====================================================
   3D SPHERES PORTAL - CHANG'E & RABBIT BACKGROUND
   Việt Nam • Brazil • Turkey • Singapore
   ==================================================== */

:root {
    --gold-primary: #ffc93c;
    --gold-bright: #ffea79;
    --bg-dark: #070a14;
    --font-heading: 'Cinzel', 'Outfit', serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --color-vn: #da251d;
    --color-br: #009c3b;
    --color-tr: #e30a17;
    --color-sg: #ef3340;
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Layers: Chang'e & Rabbit Artwork */
.bg-art {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.bg-desktop {
    display: block;
    background: #070a14 url('bg.jpg') no-repeat center center;
    background-size: cover;
}

.bg-mobile {
    display: none;
    background: #070a14 url('bg-mobile.jpg') no-repeat center center;
    background-size: cover;
}

@media (max-width: 768px), (orientation: portrait) {
    .bg-desktop {
        display: none;
    }
    .bg-mobile {
        display: block;
    }
}

.bg-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(7, 10, 20, 0.45) 0%, rgba(7, 10, 20, 0.78) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Starfield / Sparkles Canvas */
#lantern-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 30px 20px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
}

/* Header */
.main-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.top-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(214, 28, 39, 0.25);
    border: 1px solid rgba(255, 201, 60, 0.55);
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold-bright);
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(214, 28, 39, 0.35);
}

.main-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #ffea88 50%, #ffc93c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
}

.main-subtitle {
    font-size: 1rem;
    color: #e2e8f0;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Portal Glass Card */
.portal-card {
    width: 100%;
    background: rgba(10, 16, 32, 0.72);
    border: 1.5px solid rgba(255, 201, 60, 0.35);
    border-radius: 28px;
    padding: 32px 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 40px rgba(255, 201, 60, 0.15);
}

/* Spheres Grid */
.spheres-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.sphere-item {
    position: relative;
    background: rgba(16, 24, 48, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 24px 14px 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    backdrop-filter: blur(8px);
}

.sphere-item:hover {
    transform: translateY(-8px);
}

/* Neon Glow per country */
.sphere-item#link-vn:hover {
    border-color: #ff3b30;
    box-shadow: 0 12px 35px rgba(218, 37, 29, 0.5), 0 0 30px rgba(255, 209, 0, 0.35);
}

.sphere-item#link-br:hover {
    border-color: #00e676;
    box-shadow: 0 12px 35px rgba(0, 156, 59, 0.5), 0 0 30px rgba(255, 223, 0, 0.35);
}

.sphere-item#link-tr:hover {
    border-color: #ff3d00;
    box-shadow: 0 12px 35px rgba(227, 10, 23, 0.5), 0 0 30px rgba(255, 255, 255, 0.35);
}

.sphere-item#link-sg:hover {
    border-color: #ff2d55;
    box-shadow: 0 12px 35px rgba(239, 51, 64, 0.5), 0 0 30px rgba(255, 255, 255, 0.35);
}

/* 3D Canvas Container */
.sphere-canvas-container {
    width: 180px;
    height: 180px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    z-index: 2;
}

.sphere-glow-pedestal {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    filter: blur(25px);
    opacity: 0.35;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#link-vn .sphere-glow-pedestal { background: radial-gradient(circle, #da251d, transparent 70%); }
#link-br .sphere-glow-pedestal { background: radial-gradient(circle, #009c3b, transparent 70%); }
#link-tr .sphere-glow-pedestal { background: radial-gradient(circle, #e30a17, transparent 70%); }
#link-sg .sphere-glow-pedestal { background: radial-gradient(circle, #ef3340, transparent 70%); }

.sphere-item:hover .sphere-glow-pedestal {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Sphere Information */
.sphere-info {
    position: relative;
    z-index: 3;
    margin-top: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.country-tag {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    padding: 3px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

.tag-vn { background: rgba(218, 37, 29, 0.3); border: 1px solid rgba(255, 209, 0, 0.6); color: #ffd100; }
.tag-br { background: rgba(0, 156, 59, 0.3); border: 1px solid rgba(255, 223, 0, 0.6); color: #ffdf00; }
.tag-tr { background: rgba(227, 10, 23, 0.3); border: 1px solid rgba(255, 255, 255, 0.6); color: #ffffff; }
.tag-sg { background: rgba(239, 51, 64, 0.3); border: 1px solid rgba(255, 255, 255, 0.6); color: #ffffff; }

.greeting-text {
    font-family: var(--font-body);
    font-size: 0.96rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.sphere-item:hover .greeting-text {
    color: #ffffff;
}

/* Footer */
.main-footer {
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .spheres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .main-title {
        font-size: 1.9rem;
    }

    .sphere-canvas-container {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 540px) {
    .main-container {
        padding: 20px 12px 30px;
        gap: 20px;
    }

    .portal-card {
        padding: 20px 12px;
        border-radius: 20px;
    }

    .spheres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sphere-item {
        padding: 16px 8px 14px;
        border-radius: 16px;
    }

    .sphere-canvas-container {
        width: 120px;
        height: 120px;
    }

    .main-title {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    .main-subtitle {
        font-size: 0.85rem;
    }

    .greeting-text {
        font-size: 0.82rem;
    }

    .country-tag {
        font-size: 0.72rem;
        padding: 2px 8px;
    }
}
