/* ====================================================
   8-COUNTRY 3D SPHERES PORTAL - CYBER SPACE NEBULA THEME
   Việt Nam • Hoa Kỳ (USA) • Brazil • Nhật Bản • Hàn Quốc • Anh • Thổ Nhĩ Kỳ • Singapore
   ==================================================== */

:root {
    --gold-primary: #ffc93c;
    --gold-bright: #ffea79;
    --bg-dark: #060814;
    --bg-card: rgba(11, 17, 36, 0.72);
    --border-card: rgba(255, 255, 255, 0.15);
    --font-heading: 'Cinzel', 'Outfit', serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --color-vn: #da251d;
    --color-us: #0052b4;
    --color-br: #009c3b;
    --color-jp: #bc002d;
    --color-kr: #0047a0;
    --color-gb: #012169;
    --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;
}

/* Deep Space Ambient Canvas */
#space-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.space-ambient-glow {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 20%, rgba(30, 58, 138, 0.22) 0%, transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(88, 28, 135, 0.18) 0%, transparent 50%),
                radial-gradient(circle at 20% 70%, rgba(14, 116, 144, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

#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: 1280px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 16px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

/* 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(0, 102, 255, 0.18);
    border: 1px solid rgba(0, 195, 255, 0.5);
    padding: 5px 18px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #7dd3fc;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 16px rgba(0, 140, 255, 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%, #e2e8f0 45%, #38bdf8 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: 0.98rem;
    color: #94a3b8;
    font-weight: 400;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    max-width: 620px;
}

/* Portal Glass Card */
.portal-card {
    width: 100%;
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    border-radius: 26px;
    padding: 28px 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 140, 255, 0.12);
}

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

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

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

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

.sphere-item#link-us:hover {
    border-color: #38bdf8;
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.5), 0 0 25px rgba(255, 45, 85, 0.35);
}

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

.sphere-item#link-jp:hover {
    border-color: #ff334b;
    box-shadow: 0 10px 30px rgba(188, 0, 45, 0.5), 0 0 25px rgba(255, 255, 255, 0.35);
}

.sphere-item#link-kr:hover {
    border-color: #60a5fa;
    box-shadow: 0 10px 30px rgba(0, 71, 160, 0.5), 0 0 25px rgba(205, 46, 58, 0.35);
}

.sphere-item#link-gb:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 30px rgba(1, 33, 105, 0.5), 0 0 25px rgba(200, 16, 46, 0.35);
}

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

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

/* 3D Canvas Container */
.sphere-canvas-container {
    width: 150px;
    height: 150px;
    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: 110px;
    height: 110px;
    border-radius: 50%;
    filter: blur(22px);
    opacity: 0.32;
    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-us .sphere-glow-pedestal { background: radial-gradient(circle, #0052b4, #b22234, transparent 70%); }
#link-br .sphere-glow-pedestal { background: radial-gradient(circle, #009c3b, transparent 70%); }
#link-jp .sphere-glow-pedestal { background: radial-gradient(circle, #bc002d, transparent 70%); }
#link-kr .sphere-glow-pedestal { background: radial-gradient(circle, #0047a0, #cd2e3a, transparent 70%); }
#link-gb .sphere-glow-pedestal { background: radial-gradient(circle, #012169, #c8102e, 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.22);
}

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

.country-tag {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tag-vn { background: rgba(218, 37, 29, 0.3); border: 1px solid rgba(255, 209, 0, 0.6); color: #ffd100; }
.tag-us { background: rgba(0, 82, 180, 0.35); border: 1px solid rgba(56, 189, 248, 0.65); color: #7dd3fc; }
.tag-br { background: rgba(0, 156, 59, 0.3); border: 1px solid rgba(255, 223, 0, 0.6); color: #ffdf00; }
.tag-jp { background: rgba(188, 0, 45, 0.3); border: 1px solid rgba(255, 255, 255, 0.6); color: #ffffff; }
.tag-kr { background: rgba(0, 71, 160, 0.3); border: 1px solid rgba(205, 46, 58, 0.6); color: #93c5fd; }
.tag-gb { background: rgba(1, 33, 105, 0.35); border: 1px solid rgba(200, 16, 46, 0.65); color: #e2e8f0; }
.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.88rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: lowercase;
    letter-spacing: 0.4px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

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

/* Footer */
.main-footer {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 6px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .spheres-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

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

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

@media (max-width: 768px) {
    .spheres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .main-container {
        padding: 20px 12px 30px;
        gap: 18px;
    }

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

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

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

    .country-tag {
        font-size: 0.72rem;
    }

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

@media (max-width: 480px) {
    .spheres-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .sphere-item {
        padding: 12px 6px 12px;
        border-radius: 16px;
    }

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

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

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

    .top-tag {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
}
