/* =========================================
   1. GLOBAL STYLES AND THEME TOKENS
   ========================================= */
:root {
    --hover-border: rgba(44, 243, 200, 0.55);
    --hover-shadow: rgba(44, 243, 200, 0.2);
    --container-width: 1600px;
    --container-pad: 16px;

    --slide-w: min(86vw, 1240px);
    --visible-side: 0.2;
    --gap: 24px;
    --shift-amount: calc((var(--slide-w) * (1 - var(--visible-side))) + var(--gap));

    --surface-strong: rgba(7, 18, 31, 0.86);
    --surface-soft: rgba(12, 29, 48, 0.72);
    --surface-card: rgba(10, 25, 42, 0.78);
    --stroke-soft: rgba(149, 214, 255, 0.22);
    --stroke-strong: rgba(44, 243, 200, 0.4);
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(1100px 580px at 7% -12%, rgba(44, 243, 200, 0.2), transparent 60%),
        radial-gradient(900px 520px at 95% -18%, rgba(47, 198, 244, 0.18), transparent 62%),
        linear-gradient(180deg, #04080f 0%, #061122 34%, #071527 100%);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 35vw;
    height: 35vw;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(70px);
    opacity: 0.25;
    animation: ambientFloat 12s ease-in-out infinite;
}

body::before {
    top: -12vw;
    left: -8vw;
    background: rgba(44, 243, 200, 0.7);
}

body::after {
    right: -10vw;
    bottom: 8vh;
    background: rgba(50, 248, 255, 0.55);
    animation-delay: -6s;
}

@keyframes ambientFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(10px, -18px, 0) scale(1.06);
    }
}

section {
    width: 100%;
    overflow: visible;
    position: relative;
}

/* =========================================
   2. UI COMPONENTS
   ========================================= */
.section-title {
    font-size: clamp(1.8rem, 2.2vw, 2.9rem);
    font-weight: 850;
    text-align: center;
    margin-bottom: 14px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.1;
}

.section-title::before {
    content: '';
    position: absolute;
    inset: auto -10px -6px -10px;
    height: 20px;
    z-index: -1;
    background: linear-gradient(90deg, rgba(44, 243, 200, 0), rgba(44, 243, 200, 0.22), rgba(36, 214, 243, 0.25), rgba(36, 214, 243, 0));
    filter: blur(8px);
}

.section-title::after {
    content: '';
    display: block;
    width: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    position: absolute;
    bottom: -12px;
    left: 50%;
    transition: width 0.55s ease, left 0.55s ease;
}

.section-title.animate::after {
    width: 100%;
    left: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
    gap: 12px;
}

.section-header .section-title {
    margin-bottom: 0;
    left: 0;
    transform: none;
}

.section-header .see-all {
    font-size: 0.98rem;
    color: var(--text-light);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-block;
    margin: 0;
}

.section-header .see-all:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(118deg, var(--primary-color), #2ed9ff 54%, var(--secondary-color));
    color: #021019;
    font-weight: 820;
    border-radius: 999px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(8, 17, 28, 0.46), 0 0 0 1px rgba(44, 243, 200, 0.22);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn::before {
    content: '';
    position: absolute;
    top: -120%;
    left: -22%;
    width: 34%;
    height: 320%;
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(24deg);
    transition: transform 0.5s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(8, 17, 28, 0.58), 0 0 0 1px rgba(44, 243, 200, 0.4);
    filter: saturate(1.06);
}

.btn:hover::before {
    transform: translateX(265%) rotate(24deg);
}

.game-card,
.news-card,
.cloud-card,
.tournament-card,
.server-card,
.video-slide {
    background: linear-gradient(165deg, rgba(13, 30, 50, 0.95), rgba(9, 20, 34, 0.86));
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--stroke-soft);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(8px);
}

.game-card:hover,
.news-card:hover,
.cloud-card:hover,
.server-card:hover,
.video-slide:hover {
    transform: translateY(-8px);
    border-color: var(--hover-border);
    box-shadow: 0 18px 40px rgba(4, 11, 20, 0.62), 0 0 30px var(--hover-shadow);
}

.fade-in-load {
    animation: fadeInPage 0.4s ease-out both;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
    }
}

.fade-in-scroll {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Hidden only after main.js adds .gg-reveal, so content stays visible if the script fails. */
.gg-reveal .fade-in-scroll:not(.visible) {
    opacity: 0;
    transform: translateY(24px);
}

@supports (content-visibility: auto) {
    section.fade-in-scroll {
        content-visibility: auto;
        contain-intrinsic-size: 900px 1000px;
    }
}

/* =========================================
   3. HERO SECTION
   ========================================= */
/* One banner at a time with a crossfade. Slides share a grid cell, so the
   slider takes the height of the tallest slide and nothing is cut off.
   The banner image sits in ::before and fades into the surface under the text.
   A slide can zoom into part of its picture with --size and --pos. */
#hero {
    --hero-pad-x: clamp(28px, 5vw, 72px);
    --hero-controls-h: 96px;
    /* Autoplay interval. scripts/main.js moves to the next slide when the
       progress bar on the active slide bar finishes, so this is the only timer. */
    --hero-interval: 6s;
    position: relative;
    max-width: var(--container-width);
    margin: 16px auto 0;
    padding: 0 var(--container-pad);
}

#hero .hero-slider {
    display: grid;
    min-height: clamp(420px, 58vh, 560px);
    border: 1px solid var(--gg-line);
    border-radius: var(--gg-radius-xl);
    background:
        radial-gradient(70% 90% at 0% 100%, rgba(44, 243, 200, 0.12), transparent 60%),
        linear-gradient(180deg, var(--gg-surface-2), var(--gg-surface-1));
    box-shadow: var(--gg-shadow-2);
    overflow: hidden;
    isolation: isolate;
}

#hero .hero-slide {
    grid-area: 1 / 1;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--gg-space-7);
    padding: var(--gg-space-8) var(--hero-pad-x) var(--hero-controls-h);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

#hero .hero-slide.active,
#hero .hero-slider:not(:has(.active)) .hero-slide:first-child {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    transition: opacity 0.6s ease, visibility 0s;
}

#hero .hero-slide::before {
    content: "";
    position: absolute;
    inset: 0 0 0 var(--img-left, 32%);
    z-index: -1;
    background-repeat: no-repeat;
    background-size: var(--size, cover);
    background-position: var(--pos, right center);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 22%, #000 58%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 22%, #000 58%);
    transform: scale(1.06);
    transition: transform 7s ease-out;
}

/* Load images only for the visible slide and its neighbours. */
#hero .hero-slide:is(.active, .prev, .next, :first-child)::before {
    background-image: var(--bg-set, var(--bg));
}

#hero .hero-slide.active::before {
    transform: scale(1);
}

#hero .hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gg-space-4);
    max-width: 560px;
    color: var(--gg-text-1);
}

#hero .hero-slide.active .hero-content > * {
    animation: ggHeroIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

#hero .hero-slide.active .hero-content > :nth-child(2) { animation-delay: 0.06s; }
#hero .hero-slide.active .hero-content > :nth-child(3) { animation-delay: 0.12s; }
#hero .hero-slide.active .hero-content > :nth-child(4) { animation-delay: 0.18s; }

@keyframes ggHeroIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

#hero .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--gg-space-2);
    padding: 6px 12px;
    border: 1px solid rgba(44, 243, 200, 0.35);
    border-radius: var(--gg-radius-pill);
    background: rgba(44, 243, 200, 0.08);
    color: var(--gg-mint);
    font-size: var(--gg-fs-caption);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#hero .hero-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

#hero .hero-content h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--gg-text-1);
    text-wrap: balance;
}

#hero .hero-content h2 span {
    background: var(--gg-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#hero .hero-content p {
    margin: 0;
    max-width: 46ch;
    font-size: var(--gg-fs-body-l);
    line-height: 1.55;
    color: var(--gg-text-2);
}

#hero .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gg-space-3);
    margin-top: var(--gg-space-3);
}

#hero .hero-actions .gg-btn {
    min-height: 48px;
    padding: 0 var(--gg-space-6);
    font-size: 15px;
}

#hero .hero-actions .gg-btn--ghost {
    background: rgba(5, 12, 21, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* Controls row: slide bars on the left, arrows on the right. */
#hero .hero-controls {
    position: absolute;
    left: calc(var(--container-pad) + var(--hero-pad-x));
    right: calc(var(--container-pad) + var(--hero-pad-x));
    bottom: 32px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

#hero .hero-controls > * {
    pointer-events: auto;
}

#hero .hero-pagination {
    display: flex;
    align-items: center;
    gap: var(--gg-space-2);
}

#hero .pagination-dot {
    position: relative;
    width: 28px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    cursor: pointer;
    transition: width 0.3s ease;
}

#hero .pagination-dot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: var(--gg-radius-pill);
    background: rgba(238, 246, 255, 0.22);
    transition: background 0.3s ease;
}

#hero .pagination-dot:hover::before {
    background: rgba(238, 246, 255, 0.45);
}

#hero .pagination-dot.active {
    width: 56px;
}

/* The active bar fills up while the slide is on screen. */
#hero .pagination-dot::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: var(--gg-radius-pill);
    background: var(--gg-gradient);
    box-shadow: 0 0 12px rgba(44, 243, 200, 0.45);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
}

#hero .pagination-dot.active::after {
    opacity: 1;
    animation: ggHeroProgress var(--hero-interval) linear forwards;
}

#hero.is-paused .pagination-dot.active::after {
    animation-play-state: paused;
}

@keyframes ggHeroProgress {
    to {
        transform: scaleX(1);
    }
}

/* No autoplay with reduced motion, so the active bar is simply full. */
@media (prefers-reduced-motion: reduce) {
    #hero .pagination-dot.active::after {
        animation: none;
        transform: none;
    }
}

#hero .hero-arrows {
    display: flex;
    gap: var(--gg-space-2);
}

#hero .slider-btn {
    position: static;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--gg-line-strong);
    border-radius: 50%;
    background: rgba(5, 12, 21, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--gg-text-1);
    box-shadow: none;
    transform: none;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

#hero .slider-btn:hover {
    border-color: var(--gg-mint);
    background: rgba(44, 243, 200, 0.1);
    color: var(--gg-mint);
    transform: none;
    box-shadow: none;
}

#hero .slider-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 1100px) {
    #hero .hero-slide {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        gap: var(--gg-space-5);
    }
}

/* Phones and small tablets: picture on top, text below it. */
@media (max-width: 768px) {
    #hero {
        --hero-pad-x: 20px;
        --hero-controls-h: 64px;
        margin-top: 12px;
    }

    #hero .hero-slider {
        min-height: 0;
        border-radius: var(--gg-radius-l);
    }

    #hero .hero-slide {
        grid-template-columns: minmax(0, 1fr);
        align-content: end;
        gap: 0;
        padding: 196px var(--hero-pad-x) var(--hero-controls-h);
    }

    #hero .hero-slide::before {
        inset: 0 0 auto 0;
        height: 280px;
        background-size: var(--size-mobile, var(--size, cover));
        background-position: var(--pos-mobile, var(--pos, center));
        -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 35%, transparent 100%);
    }

    #hero .hero-content {
        gap: var(--gg-space-3);
        max-width: none;
    }

    #hero .hero-content h2 {
        font-size: 28px;
    }

    #hero .hero-content p {
        font-size: 15px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #hero .hero-actions {
        margin-top: var(--gg-space-2);
    }

    #hero .hero-actions .gg-btn {
        min-height: 44px;
        padding: 0 var(--gg-space-5);
        font-size: 14px;
    }

    #hero .hero-controls {
        bottom: 18px;
    }

    #hero .hero-arrows {
        display: none;
    }
}

@media (max-width: 480px) {
    #hero .hero-actions .gg-btn--ghost {
        display: none;
    }

    #hero .hero-actions .gg-btn--primary {
        flex: 1;
    }
}


.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(3, 11, 19, 0.82);
    color: #fff;
    border: 1px solid rgba(166, 216, 255, 0.36);
    font-size: 1.45rem;
    padding: 10px;
    border-radius: 999px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.slider-btn:hover {
    background: linear-gradient(120deg, rgba(44, 243, 200, 0.88), rgba(36, 214, 243, 0.88));
    color: #021019;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}

.slider-btn.prev {
    left: calc((100% - var(--slide-w)) / 2 - 26px);
}

.slider-btn.next {
    right: calc((100% - var(--slide-w)) / 2 - 26px);
}

.pagination-dot {
    width: 22px;
    height: 6px;
    background-color: rgba(242, 252, 255, 0.28);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot.active {
    width: 34px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px rgba(44, 243, 200, 0.5);
}

/* =========================================
   4. CONTENT SECTIONS
   ========================================= */
.container > section {
    margin-top: 24px;
}

#games,
#popular-games,
#servers,
#news,
#tournaments,
#cloud-gaming {
    border-radius: 26px;
    border: 1px solid rgba(147, 210, 255, 0.2);
    padding: clamp(20px, 3vw, 34px);
    background: linear-gradient(155deg, var(--surface-strong), var(--surface-soft));
    box-shadow: 0 18px 42px rgba(2, 9, 17, 0.5);
}

#cloud-gaming {
    margin-bottom: 36px;
}

.video-slider-wrapper {
    position: relative;
    overflow: hidden;
    padding: 8px 60px;
}

/* The wrapper clips at its padding edge, so the gap must be wider than the
   side padding plus the slide shadow, or the edges of the neighbouring
   slides show next to the arrows. scripts/main.js reads this gap. */
.video-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 128px;
    width: 100%;
}

.video-slide {
    display: flex;
    align-items: stretch;
    gap: 34px;
    flex: 0 0 100%;
    min-width: 100%;
    padding: 26px;
    margin: 0;
    overflow: hidden;
    border-color: rgba(162, 217, 255, 0.26);
    background: linear-gradient(145deg, rgba(16, 37, 61, 0.96), rgba(9, 20, 34, 0.92));
}

.video-player {
    flex: 0 0 60%;
    position: relative;
    align-self: stretch;
    display: flex;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.game-video {
    width: 100%;
    height: 100%;
    min-height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #030910;
}

.game-video::-webkit-media-controls-panel {
    background-color: rgba(5, 13, 23, 0.86) !important;
    color: var(--text-light) !important;
}

.game-video::-webkit-media-controls-play-button {
    color: var(--primary-color) !important;
}

.vp-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.15s, transform 0.15s;
}

.vp-center.show {
    opacity: 1;
    transform: scale(1);
}

.vp-center-icon {
    width: 74px;
    height: 74px;
    color: #ecf9ff;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.vp-vol-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.58);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.18s ease;
    z-index: 2;
}

.video-player:hover .vp-vol-btn {
    opacity: 1;
    visibility: visible;
}

.vp-vol-icon {
    width: 22px;
    height: 22px;
    color: #f1fbff;
}

.vp-vol-btn:hover .vp-vol-icon {
    color: var(--primary-color);
}

.video-description {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
    word-wrap: break-word;
    --video-desc-lines: 6;
}

.video-description h3 {
    font-size: clamp(1.35rem, 1.9vw, 2rem);
    line-height: 1.16;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.video-description p {
    font-size: 1rem;
    color: var(--text-dark);
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: var(--video-desc-lines);
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-desc-image {
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 14px;
    max-width: 100%;
    flex: 0 0 auto;
}

.video-slider-wrapper .slider-btn {
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

.video-slider-wrapper .slider-btn.prev {
    left: 8px;
}

.video-slider-wrapper .slider-btn.next {
    right: 8px;
}

.video-pagination {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 12px;
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(4, 10, 18, 0.44);
    gap: 10px;
    border: 1px solid rgba(170, 218, 255, 0.2);
}

#carousel {
    padding: 30px 0;
    background:
        linear-gradient(160deg, rgba(10, 23, 39, 0.94), rgba(6, 13, 24, 0.96)),
        radial-gradient(circle at 20% 30%, rgba(44, 243, 200, 0.14), transparent 50%);
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-top: 1px solid rgba(147, 210, 255, 0.25);
    border-bottom: 1px solid rgba(147, 210, 255, 0.25);
}

.carousel-track {
    display: flex;
    width: max-content;
    margin-bottom: 16px;
}

.carousel-track.row-1 {
    animation: scrollLeft 24s linear infinite;
}

.carousel-track.row-2 {
    animation: scrollRight 24s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-track a {
    display: block;
    padding: 0 10px;
    transition: transform 0.28s ease;
}

.carousel-track a:hover {
    transform: scale(1.05);
}

.carousel-track .media-placeholder {
    width: auto;
    height: 210px;
    border-radius: 12px;
    position: relative;
    background-color: rgba(8, 20, 34, 0.9);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.carousel-track a:hover .media-placeholder {
    border-color: var(--hover-border);
    box-shadow: 0 14px 30px var(--hover-shadow);
}

.carousel-track .media-placeholder img {
    position: static !important;
    width: auto !important;
    height: 210px !important;
    border-radius: 12px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.42s ease;
}

.carousel-track .media-placeholder img.loaded {
    opacity: 1;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

.horizontal-scroll-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(5, 11, 20, 0.7);
    padding: 32px 10px 6px;
    margin: 0 -10px;
}

.horizontal-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    margin: 0 10px;
}

.horizontal-scroll-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 999px;
}

.game-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

.game-grid::after {
    content: '';
    display: block;
    min-width: 1px;
    height: 1px;
}

.game-card {
    flex: 0 0 calc((100% - 100px) / 6);
    margin-right: 0;
    z-index: 1;
}

#popular-games .game-card {
    border-radius: 16px;
}

#popular-games .game-card:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.62), 0 0 26px rgba(44, 243, 200, 0.28);
}

#popular-games .game-card .media-placeholder {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#popular-games .game-card .media-placeholder img {
    transform: scale(1.08);
    transition: transform 0.45s ease, filter 0.45s ease;
}

#popular-games .game-card:hover .media-placeholder img {
    transform: scale(1.14);
    filter: brightness(0.86);
}

.game-card .card-content {
    padding: 15px;
}

.game-card h3 {
    font-size: 1.08rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-type {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.download-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
}

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

.server-card {
    position: relative;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
}

.server-card::after {
    content: 'LIVE';
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(90deg, #3aa9ff, #24d6f3);
    box-shadow: 0 0 14px rgba(255, 78, 78, 0.45);
    z-index: 5;
}

.server-card .server-img-placeholder,
.server-card .hover-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s;
}

.server-card .hover-video {
    opacity: 0;
    z-index: 1;
}

.server-card:hover .hover-video {
    opacity: 1;
}

.server-card:hover .server-img-placeholder {
    opacity: 0;
}

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

.news-card .card-content {
    padding: 18px;
}

.news-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.news-card p {
    color: var(--text-dark);
}

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

.tournament-card {
    background: linear-gradient(160deg, rgba(18, 39, 64, 0.96), rgba(9, 20, 34, 0.9));
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.tournament-card:hover {
    transform: translateY(-10px) scale(1.015);
}

.tournament-card .card-image .media-placeholder {
    height: 220px !important;
}

.tournament-card .card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tournament-card h3 {
    font-size: 1.42rem;
    color: var(--esport-accent);
    margin-bottom: 8px;
}

.details {
    margin: 10px 0;
    color: var(--text-light);
    font-weight: 650;
    font-size: 1rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
}

.chip {
    background: rgba(44, 243, 200, 0.13);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid rgba(44, 243, 200, 0.28);
}

.tourney-btn {
    width: 100%;
    text-align: center;
    background: linear-gradient(120deg, var(--esport-accent), #2ed9ff 55%, var(--secondary-color));
    border-color: rgba(255, 255, 255, 0.4);
    color: #03111b;
    margin-top: auto;
}

.tourney-btn:hover {
    color: #03111b;
}

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

.cloud-card {
    padding: 25px 20px;
    text-align: center;
}

.cloud-card .cloud-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #44dcff;
    background: radial-gradient(circle at 30% 25%, rgba(15, 57, 87, 0.85), rgba(7, 28, 44, 0.92));
    border: 1px solid rgba(114, 212, 255, 0.3);
    box-shadow: 0 0 0 1px rgba(12, 42, 64, 0.48), 0 0 20px rgba(68, 220, 255, 0.26);
}

.cloud-card .cloud-icon svg {
    width: 42px;
    height: 42px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(68, 220, 255, 0.35));
}

.cloud-card h3 {
    font-size: 1.22rem;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.media-placeholder {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    background-color: rgba(15, 31, 50, 0.95);
    transition: background-color 0.4s;
}

.media-placeholder::before,
.placeholder-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(146, 222, 255, 0.26) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shimmer-animation 1.8s infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes shimmer-animation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.media-placeholder.loaded::before,
.media-placeholder.loaded {
    background-color: transparent !important;
    animation: none !important;
}

.media-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.45s;
    z-index: 2;
}

.media-placeholder img.loaded {
    opacity: 1 !important;
}

#cloud-gaming .cloud-card .media-placeholder {
    background-color: transparent !important;
}

#cloud-gaming .cloud-card .media-placeholder img {
    object-fit: contain !important;
    position: absolute !important;
}

@media (min-width: 1400px) {
    .video-description {
        --video-desc-lines: 7;
    }
}

/* =========================================
   5. RESPONSIVE BREAKPOINTS
   ========================================= */
@media (max-width: 1200px) {
    :root {
        --slide-w: min(90vw, 980px);
    }

    .news-grid,
    .cloud-grid,
    .server-grid,
    .tournament-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-card {
        flex: 0 0 calc((100% - 60px) / 4);
    }

    .video-description {
        --video-desc-lines: 5;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {

    .video-slide {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px;
    }

    .video-player,
    .video-description {
        width: 100%;
        flex: none;
    }

    .video-desc-image {
        display: none;
    }

    .video-description p {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .video-slider-wrapper {
        padding: 12px 46px;
    }

    .video-slider-track {
        gap: 100px;
    }
}

@media (max-width: 768px) {
    :root {
        --slide-w: 92vw;
        --visible-side: 0.07;
        --gap: 10px;
    }

    body::before,
    body::after {
        width: 62vw;
        height: 62vw;
        opacity: 0.16;
        filter: blur(55px);
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1.05rem;
    }

    .vp-center-icon {
        width: 60px;
        height: 60px;
    }

    .slider-btn.prev {
        left: 6px;
    }

    .slider-btn.next {
        right: 6px;
    }

    .pagination-dot {
        width: 18px;
        height: 5px;
    }

    .pagination-dot.active {
        width: 28px;
    }

    .container > section {
        margin-top: 18px;
    }

    #games,
    #popular-games,
    #servers,
    #news,
    #tournaments,
    #cloud-gaming {
        border-radius: 18px;
        padding: 16px;
    }

    #carousel {
        width: 100%;
        left: auto;
        right: auto;
        margin-left: 0;
        margin-right: 0;
        border-radius: 14px;
        overflow: hidden;
        padding: 12px 0 8px;
    }

    .carousel-track {
        margin-bottom: 10px;
    }

    .carousel-track a {
        padding: 0 6px;
    }

    .carousel-track .media-placeholder,
    .carousel-track .media-placeholder img {
        height: 150px !important;
    }

    #cloud-gaming {
        margin-bottom: 22px;
    }

    .video-slider-wrapper {
        padding: 2px 0;
    }

    .video-slide {
        flex-direction: column;
        padding: 14px;
        gap: 14px;
    }

    .video-player {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        flex: 0 0 auto;
        position: relative !important;
        z-index: 1;
    }

    .game-video {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .video-desc-image {
        display: none !important;
    }

    .cloud-card .cloud-icon {
        width: 68px;
        height: 68px;
    }

    .cloud-card .cloud-icon svg {
        width: 38px;
        height: 38px;
    }

    .video-description h3 {
        font-size: 1.35rem;
    }

    .video-description {
        --video-desc-lines: 4;
    }

    .video-description p {
        font-size: 0.96rem;
        max-width: 100%;
    }

    .video-slider-wrapper .slider-btn {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 20 !important;
    }

    .video-slider-wrapper .slider-btn.prev {
        left: 10px !important;
    }

    .video-slider-wrapper .slider-btn.next {
        right: 10px !important;
    }

    .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .section-header .section-title {
        left: 50%;
        transform: translateX(-50%);
    }

    .see-all {
        position: static !important;
        margin-top: 4px !important;
    }

    .server-grid,
    .tournament-grid,
    .news-grid,
    .cloud-grid {
        grid-template-columns: 1fr !important;
    }

    .horizontal-scroll-wrapper {
        overflow-x: auto;
        margin: 0 -10px;
        padding: 16px 10px 6px;
    }

    .game-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 16px;
        width: max-content;
    }

    .game-grid::after {
        display: block;
    }

    .game-card {
        flex: 0 0 240px;
        width: auto;
        min-width: 0;
    }

    .game-card .card-content {
        display: flex;
        flex-direction: column;
        min-height: 164px;
    }

    .download-btn {
        margin-top: auto;
    }
}

@media (max-width: 560px) {
    .section-title {
        font-size: 1.55rem;
    }

    .video-slide {
        padding: 12px;
    }

    .game-card {
        flex: 0 0 210px;
    }
}

@media (max-width: 420px) {

    .game-card {
        flex: 0 0 190px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .vp-vol-btn {
        opacity: 1;
        visibility: visible;
    }

    .video-slide,
    .video-slide:hover,
    .video-slide:active,
    .video-slide:focus,
    .video-slide:focus-visible {
        transform: none !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
        border-color: rgba(255, 255, 255, 0.14) !important;
        transition: none !important;
        outline: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
