/* ====================================================
   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;
    }
}

/* ====================================================
   STAGE 1: 18+ AGE VERIFICATION & STAGE 2: 3S PROCESSING & STAGE 4: MATH MODAL
   ==================================================== */

.overlay-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.portal-inactive {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s ease;
}

.portal-active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

/* Common Overlay Backdrop */
.age-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 8, 20, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.processing-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 8, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

/* ==================== 1. AGE VERIFY CARD ==================== */
.age-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, rgba(16, 24, 54, 0.92) 0%, rgba(10, 15, 36, 0.96) 100%);
    border: 1px solid rgba(255, 201, 60, 0.35);
    border-radius: 24px;
    padding: 36px 28px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
                0 0 40px rgba(255, 201, 60, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: ageCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ageCardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.age-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle, #e53e3e 0%, #9b2c2c 100%);
    border: 3px solid #ffea79;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(229, 62, 62, 0.6),
                0 0 12px rgba(255, 234, 121, 0.4);
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(229, 62, 62, 0.6); }
    50% { transform: scale(1.06); box-shadow: 0 0 32px rgba(229, 62, 62, 0.85); }
}

.badge-number {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.age-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffea79;
    letter-spacing: 0.5px;
    text-shadow: 0 0 16px rgba(255, 234, 121, 0.3);
    line-height: 1.3;
}

.age-desc {
    font-size: 0.96rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.age-desc strong {
    color: #ffd700;
}

.age-terms-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
}

.age-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #ffd700;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label {
    font-size: 0.88rem;
    color: #e2e8f0;
    cursor: pointer;
    line-height: 1.45;
}

.checkbox-label strong {
    color: #ffea79;
}

.btn-register-now {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ffd700 0%, #ff9900 100%);
    border: none;
    border-radius: 14px;
    color: #0c0f1d;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 170, 0, 0.4),
                0 0 15px rgba(255, 234, 121, 0.3);
    transition: all 0.25s ease;
}

.btn-register-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(255, 170, 0, 0.55),
                0 0 24px rgba(255, 234, 121, 0.5);
    filter: brightness(1.08);
}

.btn-register-now:active {
    transform: translateY(1px);
}

.btn-arrow {
    transition: transform 0.2s ease;
}

.btn-register-now:hover .btn-arrow {
    transform: translateX(4px);
}

.age-note {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ==================== 2. PROCESSING CARD (3s LOADING) ==================== */
.processing-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: linear-gradient(135deg, rgba(13, 20, 48, 0.94) 0%, rgba(9, 14, 32, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 24px;
    padding: 38px 28px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 45px rgba(56, 189, 248, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cyber-radar {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
}

.radar-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px dashed rgba(56, 189, 248, 0.45);
    animation: rotateClockwise 8s linear infinite;
}

.radar-ring.ring-2 {
    inset: 22px;
    border-style: dotted;
    animation: rotateCounter 6s linear infinite;
}

.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(56, 189, 248, 0.45) 60deg, transparent 70deg);
    animation: rotateClockwise 1.5s linear infinite;
}

.radar-core {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px #38bdf8;
}

.core-icon {
    font-size: 1rem;
    color: #fff;
}

@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounter {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.processing-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
    text-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.processing-stage-text {
    font-size: 0.92rem;
    color: #cbd5e1;
    min-height: 24px;
}

/* Tube Progress Bar (Ống chạy 100%) */
.tube-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.tube-glass {
    position: relative;
    width: 100%;
    height: 26px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(56, 189, 248, 0.5);
    border-radius: 999px;
    overflow: hidden;
    padding: 3px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8),
                0 0 16px rgba(56, 189, 248, 0.25);
}

.tube-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #34d399 100%);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
    transition: width 0.08s linear;
    position: relative;
    overflow: hidden;
}

.tube-light-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    animation: sweepLight 1.2s infinite ease-in-out;
}

@keyframes sweepLight {
    from { transform: translateX(-100%); }
    to { transform: translateX(200%); }
}

.tube-percentage {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.processing-security-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.sec-tag {
    font-size: 0.74rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
}

/* ==================== 4. MATH MULTIPLICATION MODAL ==================== */
.math-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 8, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.math-modal-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, rgba(16, 24, 52, 0.95) 0%, rgba(10, 16, 38, 0.98) 100%);
    border: 1px solid rgba(255, 201, 60, 0.4);
    border-radius: 22px;
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 35px rgba(255, 201, 60, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.math-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #cbd5e1;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.math-modal-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fff;
}

.math-country-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #ffea79;
    font-weight: 600;
}

.math-modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffea79;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.math-modal-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Math Equation Big Box */
.math-equation-box {
    width: 100%;
    padding: 16px 20px;
    background: rgba(2, 132, 199, 0.12);
    border: 2px dashed rgba(56, 189, 248, 0.5);
    border-radius: 16px;
    margin: 4px 0;
    box-shadow: inset 0 0 16px rgba(56, 189, 248, 0.1);
}

.equation-text {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.7),
                 0 0 8px #38bdf8;
}

#math-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.math-input-wrapper {
    width: 100%;
}

.math-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    transition: all 0.2s ease;
}

.math-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
    background: rgba(15, 23, 42, 0.95);
}

.math-quick-choices {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.82rem;
    color: #94a3b8;
}

.quick-btns-row {
    display: flex;
    gap: 8px;
}

.btn-quick {
    min-width: 44px;
    height: 38px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffea79;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quick:hover {
    background: rgba(255, 201, 60, 0.2);
    border-color: #ffd700;
    color: #fff;
    transform: translateY(-1px);
}

.btn-quick:active {
    transform: translateY(1px);
}

.math-error-msg {
    min-height: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ef4444;
    transition: all 0.2s ease;
}

.math-error-msg.success {
    color: #10b981;
}

.btn-math-submit {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8800 100%);
    border: none;
    border-radius: 12px;
    color: #0b0e1e;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 136, 0, 0.35);
    transition: all 0.25s ease;
}

.btn-math-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 136, 0, 0.5);
    filter: brightness(1.08);
}

.btn-math-submit:active {
    transform: translateY(1px);
}

.card-shake {
    animation: shakeCard 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

@media (max-width: 480px) {
    .age-card,
    .processing-card,
    .math-modal-card {
        padding: 26px 18px 22px;
        border-radius: 18px;
    }

    .age-title {
        font-size: 1.25rem;
    }

    .equation-text {
        font-size: 1.85rem;
    }

    .btn-register-now,
    .btn-math-submit {
        font-size: 0.98rem;
        padding: 14px 18px;
    }
}

