/* =========================================================
   GAMESO — GLOBAL STYLES
========================================================= */

:root {
    --bg: #080b14;
    --bg-secondary: #0e1320;
    --card: #121827;
    --card-hover: #171f31;
    --border: rgba(255, 255, 255, 0.08);

    --text: #ffffff;
    --text-secondary: #a8b0c0;
    --text-muted: #727b8d;

    --primary: #6c5ce7;
    --primary-light: #8175ee;
    --accent: #00d4ff;

    --container: 1200px;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --shadow: 0 15px 40px rgba(0, 0, 0, 0.28);

    --transition: 0.25s ease;
}


/* =========================================================
   RESET
========================================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    line-height: 1.6;

    min-height: 100vh;

    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    border: none;
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}


/* =========================================================
   CONTAINERS
========================================================= */

.header-container,
.section-container,
.footer-container,
.search-container {
    width: min(var(--container), calc(100% - 40px));
    margin-inline: auto;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(8, 11, 20, 0.88);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--border);
}

.header-container {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* =========================================================
   LOGO
========================================================= */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    font-size: 22px;
    font-weight: 800;

    letter-spacing: -0.5px;
}

.logo-icon {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--accent)
    );

    font-size: 19px;

    box-shadow:
        0 7px 20px rgba(108, 92, 231, 0.25);
}

.logo-text {
    background: linear-gradient(
        90deg,
        #ffffff,
        #b8b5ff
    );

    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-fill-color: transparent;
}


/* =========================================================
   DESKTOP NAV
========================================================= */

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-left: auto;
    margin-right: 30px;
}

.nav-link {
    position: relative;

    padding: 8px 13px;

    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;

    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.nav-link.active::after {
    content: "";

    position: absolute;

    left: 13px;
    right: 13px;
    bottom: 0;

    height: 2px;

    border-radius: 10px;

    background: var(--primary);
}


/* =========================================================
   HEADER ACTIONS
========================================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-toggle,
.menu-toggle {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    color: var(--text-secondary);

    background: transparent;

    border-radius: 10px;

    font-size: 18px;

    transition: var(--transition);
}

.search-toggle:hover,
.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.menu-toggle {
    display: none;
}


/* =========================================================
   MOBILE NAV
========================================================= */

.mobile-nav {
    display: none;

    padding: 12px 20px 18px;

    border-top: 1px solid var(--border);

    background: var(--bg);
}

.mobile-nav a {
    display: block;

    padding: 11px 0;

    color: var(--text-secondary);

    font-size: 15px;
    font-weight: 600;
}

.mobile-nav a:hover {
    color: var(--text);
}

.mobile-nav.show {
    display: block;
}


/* =========================================================
   SEARCH
========================================================= */

.search-section {
    display: none;

    padding: 16px 0;

    background: var(--bg-secondary);

    border-bottom: 1px solid var(--border);
}

.search-section.show {
    display: block;
}

.search-box {
    position: relative;

    max-width: 700px;
    margin: auto;
}

.search-box input {
    width: 100%;

    height: 52px;

    padding:
        0 48px
        0 48px;

    color: var(--text);

    background: var(--card);

    border: 1px solid var(--border);
    border-radius: 14px;

    outline: none;

    font-size: 15px;

    transition: var(--transition);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: rgba(108, 92, 231, 0.7);

    box-shadow:
        0 0 0 4px rgba(108, 92, 231, 0.1);
}

.search-icon {
    position: absolute;

    left: 17px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);

    font-size: 17px;
}

.clear-search {
    position: absolute;

    right: 10px;
    top: 50%;

    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    display: none;
    place-items: center;

    background: transparent;

    color: var(--text-muted);

    font-size: 24px;
}

.clear-search:hover {
    color: var(--text);
}

.clear-search.show {
    display: grid;
}


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

.hero {
    position: relative;

    min-height: 570px;

    display: flex;
    align-items: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 80% 30%,
            rgba(108, 92, 231, 0.17),
            transparent 32%
        ),
        radial-gradient(
            circle at 15% 70%,
            rgba(0, 212, 255, 0.08),
            transparent 28%
        );
}

.hero::before {
    content: "";

    position: absolute;

    width: 500px;
    height: 500px;

    left: -280px;
    top: 80px;

    border-radius: 50%;

    background: rgba(108, 92, 231, 0.08);

    filter: blur(80px);
}

.hero-container {
    position: relative;

    width: min(var(--container), calc(100% - 40px));

    margin-inline: auto;

    display: grid;

    grid-template-columns: 1.05fr 0.95fr;

    align-items: center;

    gap: 60px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;

    align-items: center;

    padding: 7px 12px;

    margin-bottom: 20px;

    color: #c8c3ff;

    background: rgba(108, 92, 231, 0.11);

    border: 1px solid rgba(108, 92, 231, 0.22);

    border-radius: 100px;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.8px;
}

.hero h1 {
    max-width: 650px;

    font-size: clamp(42px, 5vw, 68px);

    line-height: 1.04;

    letter-spacing: -2.5px;

    font-weight: 850;
}

.hero p {
    max-width: 570px;

    margin-top: 22px;

    color: var(--text-secondary);

    font-size: 17px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 30px;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-btn,
.secondary-btn {
    min-height: 46px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 0 20px;

    border-radius: 11px;

    font-size: 14px;
    font-weight: 700;

    transition: var(--transition);
}

.primary-btn {
    color: white;

    background: linear-gradient(
        135deg,
        var(--primary),
        #5144d7
    );

    box-shadow:
        0 10px 25px rgba(108, 92, 231, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(108, 92, 231, 0.3);
}

.secondary-btn {
    color: var(--text);

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}


/* =========================================================
   HERO VISUAL
========================================================= */

.hero-visual {
    position: relative;

    min-height: 400px;

    display: grid;
    place-items: center;
}

.hero-circle {
    position: absolute;

    width: 280px;
    height: 280px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(108, 92, 231, 0.28),
            rgba(108, 92, 231, 0.02) 70%
        );

    border: 1px solid rgba(108, 92, 231, 0.12);

    box-shadow:
        0 0 100px rgba(108, 92, 231, 0.16);
}

.hero-game-card {
    position: absolute;

    width: 145px;
    height: 175px;

    display: grid;
    place-items: center;

    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            #182036,
            #101625
        );

    border: 1px solid rgba(255, 255, 255, 0.09);

    box-shadow: var(--shadow);

    font-size: 58px;

    z-index: 2;

    transition: transform 0.4s ease;
}

.card-one {
    transform:
        translate(-105px, -40px)
        rotate(-12deg);
}

.card-two {
    transform:
        translate(80px, -5px)
        rotate(10deg);
}

.card-three {
    transform:
        translate(0, 110px)
        rotate(-3deg);
}

.hero-visual:hover .card-one {
    transform:
        translate(-120px, -48px)
        rotate(-15deg);
}

.hero-visual:hover .card-two {
    transform:
        translate(95px, -10px)
        rotate(13deg);
}

.hero-visual:hover .card-three {
    transform:
        translate(0, 120px)
        rotate(-4deg);
}


/* =========================================================
   SECTIONS
========================================================= */

.games-section,
.categories-section {
    padding: 90px 0;
}

.categories-section {
    background: var(--bg-secondary);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 32px;
}

.section-header.centered {
    text-align: center;

    justify-content: center;

    align-items: center;
}

.section-label {
    display: inline-block;

    margin-bottom: 8px;

    color: #8e85f5;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1px;
}

.section-header h2 {
    font-size: 32px;

    line-height: 1.2;

    letter-spacing: -1px;
}

.section-header p {
    margin-top: 6px;

    color: var(--text-muted);

    font-size: 14px;
}

.view-all {
    flex-shrink: 0;

    color: #9c94ff;

    font-size: 13px;

    font-weight: 700;

    transition: var(--transition);
}

.view-all:hover {
    color: white;

    transform: translateX(3px);
}


/* =========================================================
   GAME GRID
========================================================= */

.games-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/* =========================================================
   GAME CARD
========================================================= */

.game-card {
    min-width: 0;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    overflow: hidden;

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition);
}

.game-card:hover {
    transform: translateY(-5px);

    background: var(--card-hover);

    border-color:
        rgba(108, 92, 231, 0.35);

    box-shadow:
        0 18px 35px rgba(0, 0, 0, 0.25);
}

.game-link {
    display: block;
}

.game-thumbnail {
    position: relative;

    aspect-ratio: 16 / 10;

    display: grid;

    place-items: center;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #1c2740,
            #111827
        );
}

.game-thumbnail::before {
    content: "";

    position: absolute;

    width: 150px;
    height: 150px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.04);

    filter: blur(5px);
}

.game-emoji {
    position: relative;

    z-index: 2;

    font-size: clamp(42px, 4vw, 58px);

    transition:
        transform 0.35s ease;
}

.game-card:hover .game-emoji {
    transform: scale(1.12);
}

.play-overlay {
    position: absolute;

    z-index: 4;

    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    color: white;

    background: rgba(8, 11, 20, 0.75);

    border: 1px solid rgba(255, 255, 255, 0.15);

    backdrop-filter: blur(8px);

    opacity: 0;

    transform: scale(0.8);

    transition: var(--transition);
}

.game-card:hover .play-overlay {
    opacity: 1;

    transform: scale(1);
}

.game-info {
    padding: 14px;
}

.game-info h3 {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 15px;

    font-weight: 700;
}

.game-meta {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    margin-top: 6px;

    color: var(--text-muted);

    font-size: 11px;
}

.game-meta span:first-child {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* =========================================================
   THUMBNAIL VARIANTS
========================================================= */

.snake-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(46, 204, 113, 0.18),
            transparent 55%
        ),
        #101d1a;
}

.puzzle-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(241, 196, 15, 0.16),
            transparent 55%
        ),
        #1b1910;
}

.board-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(52, 152, 219, 0.16),
            transparent 55%
        ),
        #101a24;
}

.memory-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(155, 89, 182, 0.18),
            transparent 55%
        ),
        #191321;
}

.sports-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(26, 188, 156, 0.16),
            transparent 55%
        ),
        #101b1b;
}

.action-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(231, 76, 60, 0.17),
            transparent 55%
        ),
        #211414;
}

.color-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(230, 126, 34, 0.17),
            transparent 55%
        ),
        #201711;
}

.strategy-thumbnail {
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(52, 73, 94, 0.4),
            transparent 55%
        ),
        #111820;
}


/* =========================================================
   NEW BADGE
========================================================= */

.new-badge {
    position: absolute;

    top: 10px;
    left: 10px;

    z-index: 5;

    padding: 4px 7px;

    color: white;

    background: rgba(108, 92, 231, 0.9);

    border-radius: 6px;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 0.5px;
}


/* =========================================================
   CATEGORIES
========================================================= */

.categories-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.category-card {
    min-height: 92px;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 18px;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-3px);

    background: var(--card-hover);

    border-color:
        rgba(108, 92, 231, 0.35);
}

.category-icon {
    width: 52px;
    height: 52px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background: rgba(108, 92, 231, 0.1);

    font-size: 25px;
}

.category-card h3 {
    font-size: 14px;

    font-weight: 700;
}

.category-card span:not(.category-icon) {
    display: block;

    margin-top: 2px;

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   CTA
========================================================= */

.cta-section {
    padding: 80px 0;
}

.cta-box {
    position: relative;

    overflow: hidden;

    padding: 65px 30px;

    text-align: center;

    border-radius: var(--radius-lg);

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(108, 92, 231, 0.25),
            transparent 50%
        ),
        linear-gradient(
            135deg,
            #11182a,
            #0e1422
        );

    border: 1px solid var(--border);
}

.cta-box::before {
    content: "";

    position: absolute;

    width: 250px;
    height: 250px;

    right: -120px;
    bottom: -130px;

    border-radius: 50%;

    background: rgba(0, 212, 255, 0.06);

    filter: blur(30px);
}

.cta-content {
    position: relative;

    z-index: 2;
}

.cta-icon {
    display: block;

    margin-bottom: 10px;

    font-size: 35px;
}

.cta-box h2 {
    font-size: 34px;

    letter-spacing: -1px;
}

.cta-box p {
    max-width: 500px;

    margin: 8px auto 25px;

    color: var(--text-secondary);

    font-size: 14px;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    background: #060810;

    border-top: 1px solid var(--border);
}

.footer-container {
    display: grid;

    grid-template-columns:
        2fr 1fr 1fr 1fr;

    gap: 50px;

    padding: 65px 0;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-muted);

    font-size: 13px;

    line-height: 1.8;
}

.footer-column {
    display: flex;

    flex-direction: column;

    gap: 9px;
}

.footer-column h3 {
    margin-bottom: 7px;

    font-size: 13px;

    font-weight: 700;
}

.footer-column a {
    width: fit-content;

    color: var(--text-muted);

    font-size: 12px;

    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--text);
    transform: translateX(2px);
}

.footer-bottom {
    width: min(var(--container), calc(100% - 40px));

    margin-inline: auto;

    padding: 20px 0;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   SEARCH NO RESULTS
========================================================= */

.no-results {
    grid-column: 1 / -1;

    padding: 50px 20px;

    text-align: center;

    color: var(--text-muted);

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius-md);
}

.no-results strong {
    display: block;

    margin-bottom: 5px;

    color: var(--text);

    font-size: 16px;
}


/* =========================================================
   SELECTION
========================================================= */

::selection {
    color: white;
    background: var(--primary);
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #252d3d;

    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #343e54;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .hero-container {
        grid-template-columns: 1fr;

        text-align: center;

        gap: 20px;
    }

    .hero-content {
        display: flex;

        flex-direction: column;

        align-items: center;
    }

    .hero p {
        margin-inline: auto;
    }

    .hero-visual {
        min-height: 320px;
    }

    .games-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .categories-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .footer-container {
        grid-template-columns:
            2fr 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: 500px;
    }
}


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

@media (max-width: 700px) {

    .header-container,
    .section-container,
    .footer-container,
    .search-container,
    .hero-container,
    .footer-bottom {
        width: min(100% - 28px, var(--container));
    }

    .header-container {
        height: 64px;
    }

    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: grid;
    }

    .logo {
        font-size: 20px;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .hero {
        min-height: auto;

        padding:
            70px 0
            50px;
    }

    .hero h1 {
        font-size: 42px;

        letter-spacing: -1.8px;
    }

    .hero p {
        font-size: 15px;

        line-height: 1.7;
    }

    .hero-buttons {
        width: 100%;

        flex-direction: column;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .hero-visual {
        min-height: 290px;

        transform: scale(0.82);
    }

    .games-section,
    .categories-section {
        padding: 65px 0;
    }

    .section-header {
        align-items: flex-start;

        margin-bottom: 22px;
    }

    .section-header h2 {
        font-size: 27px;
    }

    .section-header p {
        font-size: 13px;
    }

    .view-all {
        margin-top: 5px;
    }

    .games-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 11px;
    }

    .game-info {
        padding: 11px;
    }

    .game-info h3 {
        font-size: 13px;
    }

    .game-meta {
        font-size: 10px;
    }

    .play-overlay {
        width: 40px;
        height: 40px;
    }

    .categories-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    .category-card {
        min-height: 82px;

        padding: 12px;

        gap: 9px;
    }

    .category-icon {
        width: 43px;
        height: 43px;

        border-radius: 11px;

        font-size: 21px;
    }

    .category-card h3 {
        font-size: 12px;
    }

    .category-card span:not(.category-icon) {
        font-size: 9px;
    }

    .cta-section {
        padding: 55px 0;
    }

    .cta-box {
        padding: 50px 20px;
    }

    .cta-box h2 {
        font-size: 29px;
    }

    .footer-container {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 35px 25px;

        padding: 50px 0;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;

        align-items: flex-start;

        gap: 6px;

        padding: 17px 0;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .hero h1 {
        font-size: 36px;
    }

    .hero-visual {
        transform: scale(0.72);

        margin-top: -20px;
        margin-bottom: -30px;
    }

    .games-grid {
        gap: 8px;
    }

    .game-thumbnail {
        aspect-ratio: 1 / 0.72;
    }

    .game-emoji {
        font-size: 40px;
    }

    .game-info {
        padding: 9px;
    }

    .game-meta {
        display: block;
    }

    .game-meta span {
        display: block;
    }

    .game-meta span + span {
        margin-top: 2px;
    }

    .categories-grid {
        gap: 8px;
    }

    .category-card {
        padding: 10px;
    }

    .category-icon {
        width: 38px;
        height: 38px;

        font-size: 18px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
