:root {
    --font-xs: 12px;
    --font-sm: 14px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 24px;
    --font-2xl: 32px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
}

/* =========================
   HERO SECTION
   ========================= */
.hero-text{
    position:relative;
    overflow:visible !important;
    max-width:900px;
    margin:auto;
    text-align:center;
    padding:120px 20px 90px;
    min-height: 280px;
    contain: style;
    animation:fadeUp 1s ease;
}

.hero-text::before{
    content:"";
    position:absolute;
    width:350px;
    height:350px;
    border-radius:50%;
    background:rgba(108,99,255,.12);
    top:-120px;
    left:-120px;
    filter:blur(40px);
    animation:float 8s ease-in-out infinite;
}

.hero-text::after{
    content:"";
    position:absolute;
    width:300px;
    height:300px;
    border-radius:50%;
    background:rgba(79,140,255,.12);
    bottom:-120px;
    right:-120px;
    filter:blur(40px);
    animation:float 10s ease-in-out infinite reverse;
}

.hero-text h1,
.hero-text p{
    position:relative;
    z-index:2;
}

/* =========================
   AD SPACE
   ========================= */

.ad-space{
    width:84%;
    margin:30px auto;
    padding:30px;
    text-align:center;
    background:var(--card);
    border-radius:var(--radius-md, 12px);
    box-shadow:var(--shadow);
    color:var(--text-light);
}

/* =========================
   BREAKING NEWS TICKER
   ========================= */

.breaking-news {
    display: flex;
    align-items: center;
    background: var(--card, #ffffff);
    margin: 16px auto 24px;
    width: 90%;
    max-width: 1080px;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.breaking-label {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    padding: 10px 18px;
    font-weight: 800;
    font-size: var(--font-xs, 12px);
    white-space: nowrap;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 1px solid rgba(239, 68, 68, 0.2);
    z-index: 2;
}

.breaking-scroll {
    padding: 10px 14px;
    flex: 1;
    font-size: var(--font-sm, 14px);
    font-weight: 600;
    color: var(--text, #1e293b);
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.breaking-scroll marquee {
    display: flex;
    align-items: center;
}

.breaking-scroll a {
    color: var(--text, #1e293b);
    text-decoration: none;
    margin-right: 28px;
    font-weight: 600;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: var(--radius-sm, 8px);
}

.breaking-scroll a:hover {
    color: var(--primary, #6366f1);
    text-decoration: underline;
}

.highlight-box {
    width: 84%;
    margin: auto;
    padding: 20px;
    text-align: center;
    font-weight: 600;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow);
}

/* =========================
   MOBILE HERO
   ========================= */

@media(max-width:768px){
    .hero-text{
        padding:70px 20px 50px;
    }

    .hero-text h1{
        font-size:2.3rem;
    }

    .hero-text p{
        font-size:1rem;
    }

    .ad-space,
    .highlight-box{
        width:92%;
    }

}

/* =========================
   CATEGORY SECTION
   ========================= */

.cards-section{
    padding:40px 0;
    width: 90%;
    max-width: 1080px;
    margin: 0 auto;
}

.cards-section h2{
    text-align:center;
    font-size:var(--font-xl, 24px);
    margin-bottom:28px;
    color:var(--text);
}

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

.card-link{
    display:block;
    height: 100%;
}

.card{
    background:var(--card);
    border-radius:var(--radius-md, 12px);
    padding:24px 20px;
    box-shadow:var(--shadow);
    transition:.3s ease;
    position:relative;
    overflow:hidden;
    height:100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.card::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:4px;
    background:linear-gradient(
        90deg,
        var(--primary),
        var(--secondary)
    );
}

.card h3{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:var(--font-lg, 18px);
    margin: 0 0 8px 0;
    color:var(--text);
}

.card p {
    font-size: var(--font-sm, 14px);
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

.card h3 i{
    color:var(--primary);
    font-size:1.2rem;
    transition:.3s;
}

.card:hover h3 i{
    transform:rotate(-8deg) scale(1.15);
}

/* =========================
   RESPONSIVE CARDS
   ========================= */

@media(max-width:992px){
    .cards{
        grid-template-columns:repeat(2,1fr);
    }

}

@media(max-width:768px){
    .cards{
        grid-template-columns:1fr;
    }

    .cards-section h2{
        font-size:var(--font-lg, 18px);
    }

}

/* =========================
   LATEST UPDATES
   ========================= */

.updates{
    padding:40px 0;
    width: 90%;
    max-width: 1080px;
    margin: 0 auto;
}

.updates h2{
    text-align:center;
    font-size:var(--font-xl, 24px);
    margin-bottom:24px;
}

.news-box {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.news-box a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
    box-sizing: border-box !important;
    background: var(--card, #ffffff);
    padding: 12px 18px !important;
    border-radius: var(--radius-md, 12px) !important;
    box-shadow: var(--shadow-sm);
    color: var(--text, #1e293b);
    font-size: var(--font-sm, 14px);
    font-weight: 500;
    line-height: 1.45;
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary, #4f46e5);
    text-decoration: none;
    white-space: normal !important;
    word-break: break-word;
}

.news-box a:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

/* =========================
   RESPONSIVE NEWS
   ========================= */

@media(max-width:768px){
    .news-box{
        grid-template-columns: 1fr !important;
    }
}

/* =========================
   STATS SECTION
   ========================= */

.stats-section{
    width:90%;
    max-width: 1080px;
    margin:32px auto;
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

.stat-card{
    background:var(--card);
    border-radius:var(--radius-md, 12px);
    padding:20px 16px;
    text-align:center;
    box-shadow:var(--shadow);
    border: 1px solid var(--border, #e2e8f0);
    transition:.3s ease;
}

.stat-card:hover{
    transform:translateY(-4px);
}

.stat-card h2{
    font-size:var(--font-2xl, 32px);
    font-weight:800;
    color:var(--primary);
    margin:0 0 4px 0;
    line-height:1.2;
}

.stat-card p{
    font-size:var(--font-sm, 14px);
    font-weight:700;
    color:var(--text-light);
    margin:0;
}

@media(max-width:900px){
    .stats-section{
        grid-template-columns:repeat(2,1fr);
    }

}

@media(max-width:600px){
    .stats-section{
        grid-template-columns:1fr;
    }

}

/* =========================
   HERO SEARCH (STYLED IN COMMON.CSS UIVERSE-SEARCH-BOX)
   ========================= */

/* Optimization for 95+ Lighthouse Performance */
.cards-section, .stats-section, .updates {
    will-change: transform;
}

.hero-text::before, .hero-text::after {
    will-change: transform;
    transform: translateZ(0);
}

/* ==========================================
   ANTIGRAVITY PHYSICS ENGINE
   ========================================== */

#ag-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.ag-layer-back {
    z-index: 1;
    will-change: transform;
    transform: translateZ(0);
}

.ag-layer-mid {
    z-index: 2;
    will-change: transform;
    transform: translateZ(0);
}

.ag-layer-front {
    z-index: 3;
    will-change: transform;
    transform: translateZ(0);
}

.ag-layer-ultra {
    z-index: 4;
    will-change: transform;
    transform: translateZ(0);
}

/* Cursor states for draggable objects */
body.ag-active .card,
body.ag-active .stat-card,
body.ag-active .news-box a,
body.ag-active header nav a,
body.ag-active .logo-container,
body.ag-active .breaking-label,
body.ag-active .hero-search button,
body.ag-active .card h3 i,
body.ag-active .free-badge,
body.ag-active #breakingMarquee a {
    cursor: grab;
}

body.ag-active .card:active,
body.ag-active .stat-card:active,
body.ag-active .news-box a:active,
body.ag-active header nav a:active,
body.ag-active .logo-container:active,
body.ag-active .breaking-label:active,
body.ag-active .hero-search button:active {
    cursor: grabbing;
}

/* Prevent text selection while dragging in antigravity mode */
body.ag-active .card,
body.ag-active .stat-card,
body.ag-active .news-box a,
body.ag-active header nav a,
body.ag-active .logo-container,
body.ag-active .breaking-label,
body.ag-active .hero-search button {
    user-select: none;
    -webkit-user-select: none;
}

/* Impact flash effect */
@keyframes impactFlash {
    0% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
        border-color: rgba(239, 68, 68, 0.8);
    }
    100% { 
        box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
        border-color: transparent;
    }
}

@keyframes impactFlashYellow {
    0% { 
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
        border-color: rgba(251, 191, 36, 0.8);
    }
    100% { 
        box-shadow: 0 0 0 20px rgba(251, 191, 36, 0);
        border-color: transparent;
    }
}

.impact-flash-red {
    animation: impactFlash 0.4s ease-out;
}

.impact-flash-yellow {
    animation: impactFlashYellow 0.4s ease-out;
}

/* Screen shake */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, 2px); }
}

body.shake {
    animation: screenShake 0.15s ease-in-out;
}

/* Preserve 3D for smooth GPU transforms */
.cards-section,
.stats-section,
.updates,
.breaking-news,
.hero-text,
.hero-search,
.card,
.stat-card,
.news-box a,
header nav a,
.logo-container,
.breaking-label,
.card h3 i,
.free-badge,
#breakingMarquee a {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Smooth hover interactions within physics */
.card:hover,
.stat-card:hover,
.news-box a:hover {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    z-index: 10;
}

/* Disable conflicting CSS transforms on physics elements */
.ag-layer-back .hero-text::before,
.ag-layer-back .hero-text::after {
    animation: none;
}

/* Mobile performance: reduce physics load */
@media (max-width: 768px) {
    #ag-canvas {
        opacity: 0.35;
    }
    
    .ag-layer-ultra {
        will-change: auto;
    }
    
    .card h3 i,
    .free-badge,
    #breakingMarquee a {
        will-change: auto;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ag-layer-back,
    .ag-layer-mid,
    .ag-layer-front,
    .ag-layer-ultra {
        animation: none !important;
        transition: none !important;
        will-change: auto;
    }
    
    #ag-canvas {
        display: none;
    }
}