/* ============================================================
   CCG MASTER CSS — GLOBAL STRUCTURE & FOUNDATION LOCK
   PHASE 0 — BASELINE NORMALISATION (PERMANENT)
   ------------------------------------------------------------
   • Eliminates browser default styling regressions
   • Locks anchors, lists, cards & text behaviour
   • ZERO layout changes
   • ZERO visual redesign
   • REQUIRED BEFORE ANY PAGE POLISH
============================================================ */

/* Global font import — Robotron (Orbitron base) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');


/* ============================================================
   ROOT VARIABLES
============================================================ */

:root {
    --ccg-font-robotron: 'Orbitron', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --ccg-font-main: var(--ccg-font-robotron);
    --ccg-font-body: var(--ccg-font-robotron);

    --ccg-bg-dark: #000;
    --ccg-text-light: #e8ecff;
    --ccg-text-soft: #b5bbdf;
    --ccg-soft: rgba(255, 255, 255, 0.5);

    /* HEADER CONTRACT */
    --ccg-header-padding-y: 14px;
    --ccg-header-padding-x: clamp(12px, 4vw, 18px);
    --ccg-header-offset: clamp(108px, 6vw + 88px, 168px);

    --ccg-nav-pill-pad-y: 8px;
    --ccg-nav-pill-pad-x: 12px;

    /* PAGE ENTRY */
    --ccg-page-entry-pad: 32px;

    /* TOUCH & MOBILE SAFETY */
    --ccg-touch-size: 48px;

    /* MODE ACCENTS */
    --accent-rgb: 0,170,255;
}


/* ============================================================
   RESET — SAFE, NON-DESTRUCTIVE
============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(var(--accent-rgb), 0.12), transparent 26%),
        radial-gradient(circle at 82% 8%, rgba(255, 255, 255, 0.08), transparent 24%),
        linear-gradient(135deg, #05060f, #060714 48%, #05060f);
    color: var(--ccg-text-light);
    font-family: var(--ccg-font-body);
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;

    text-size-adjust: 100%;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ccg-body--nav-open {
    overflow-x: hidden;
}


img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
    width: 100%;
    border: 0;
}

.ccg-skip-link {
    position: absolute;
    top: -999px;
    left: -999px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--ccg-text-light);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 12px rgba(var(--accent-rgb),0.35);
    z-index: 10000;
}

.ccg-skip-link:focus-visible {
    top: 18px;
    left: 18px;
    outline: 3px solid rgba(var(--accent-rgb), 0.6);
    outline-offset: 3px;
}

main:focus {
    outline: 3px solid rgba(var(--accent-rgb), 0.38);
    outline-offset: 6px;
}

button,
.ccg-btn,
.ccg-nav-toggle,
.ccg-mode-toggle,
.ccg-nav__link {
    min-height: 42px;
}


/* ============================================================
   🔒 GLOBAL ANCHOR LOCK (CRITICAL)
============================================================ */

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

a:hover,
a:focus,
a:active {
    color: inherit;
    text-decoration: none;
}


/* ============================================================
   🔒 GLOBAL LIST LOCK (CRITICAL)
============================================================ */

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}


/* ============================================================
   PAGE WRAPPERS
============================================================ */

.ccg-page {
    min-height: 100vh;
    position: relative;
    -webkit-overflow-scrolling: touch;

    max-width: 1420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
    overflow-x: hidden;
    overflow-y: visible; /* avoid nested page scrollbars */
}

.ccg-page,
.ccg-main,
.ccg-header,
.ccg-hero,
.home-hero {
    max-width: 100vw;
}

.ccg-page,
.ccg-main,
.ccg-header,
.ccg-hero,
.home-hero {
    max-width: 100vw;
}

.ccg-main {
    width: min(1240px, 95vw);
    margin: 0 auto;
    padding: calc(var(--ccg-page-entry-pad) + 8px) clamp(1rem, 2vw, 1.5rem) 48px;
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
}

@media (max-width: 900px) {
    .ccg-page,
    .ccg-main,
    .ccg-header {
        width: 100%;
        max-width: 100%;
    }

    .ccg-main {
        padding-inline: 18px;
    }
}

@media (min-width: 1025px) {
    html {
        overflow-y: auto;
    }

    body {
        overflow-y: visible;
    }
}

@media (max-width: 640px) {
    .ccg-main {
        width: 100%;
        padding: calc(var(--ccg-page-entry-pad) + 10px) 16px 42px;
        text-align: center;
    }

    .ccg-section,
    .ccg-hero__inner,
    .games-hero__inner,
    .game-hero__inner,
    .ccg-genre-hero__inner,
    .ccg-hero-inner--collections {
        margin-inline: auto;
        text-align: center;
    }

    .ccg-hero-actions,
    .ccg-header-actions,
    .ccg-genre-meta {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .ccg-genre-meta__left,
    .ccg-genre-meta__right {
        justify-content: center;
        text-align: center;
    }

    p,
    .ccg-section__intro,
    .ccg-hero__tagline,
    .ccg-genre-hero__tagline {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}


/* ============================================================
   HEADER — STRUCTURE (LOCKED, NO VISUAL CHANGE)
============================================================ */

.ccg-header {
    position: sticky;
    top: 0;
    z-index: 9999;

    width: 100%;
    max-width: 100vw;
    padding: var(--ccg-header-padding-y) clamp(10px, 2vw, 18px);

    display: flex;
    align-items: center;

    background:
        linear-gradient(120deg,
            rgba(0,0,0,0.94),
            rgba(0,0,0,0.86)),
        radial-gradient(circle at 15% 20%, rgba(var(--accent-rgb),0.16), transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(255,255,255,0.08), transparent 45%);

    backdrop-filter: blur(10px);
    box-shadow: 0 20px 46px rgba(0,0,0,0.72), 0 0 18px rgba(var(--accent-rgb),0.24);
    overflow: visible;
    will-change: transform, opacity;
}

.ccg-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0; /* was -1px — this caused bleed */
    height: 18px;
    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.65),
            rgba(0,0,0,0.0)
        );
}

/* ============================================================
   MOBILE VISUAL BLEED FIX — HEADER / HERO
   • No layout changes
   • Visual containment only
============================================================ */

.ccg-header {
    isolation: isolate;
}

@media (max-width: 768px) {
    .ccg-header {
        overflow: hidden;
    }

    .ccg-header::after {
        height: 8px;
        opacity: 0.6;
    }
}

.ccg-header-inner {
    width: min(1320px, 100%);
    padding-inline: clamp(8px, 2vw, 14px);
    margin: 0 auto;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav actions";
    align-items: center;
    row-gap: 12px;

    gap: clamp(14px, 1.8vw, 22px);
    overflow: visible;
    min-width: 0;
}

/* ============================================================
   MOBILE VISUAL BLEED FIX — HORIZONTAL CONTAINMENT
   • Prevents right-edge bleed from hero/cards
   • No layout changes
============================================================ */

@media (max-width: 768px) {
    .ccg-page,
    .ccg-main,
    .ccg-hero,
    .ccg-hero__inner,
    .games-hero,
    .games-hero__inner,
    .game-hero,
    .game-hero__inner {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* ============================================================
   MOBILE VISUAL BLEED FIX — INTERACTIVE ELEMENT CLIP
   • Fixes right-edge bleed from buttons & cards
   • Mobile only
   • No layout changes
============================================================ */

@media (max-width: 768px) {
    .ccg-btn,
    .ccg-link,
    .home-hero-actions a,
    .home-hero-actions button,
    .home-link-tile,
    .ccg-card {
        overflow: hidden;
        max-width: 100%;
    }
}


/* ============================================================
   BRAND — STRUCTURAL ONLY
============================================================ */

.ccg-brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
    min-width: 0;

    padding: 6px 12px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(var(--accent-rgb),0.18),
            rgba(255,255,255,0.05)
        );

    box-shadow:
        0 10px 26px rgba(0,0,0,0.72),
        0 0 24px rgba(var(--accent-rgb),0.28),
        inset 0 0 16px rgba(var(--accent-rgb),0.14);

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

    isolation: isolate;
}

.ccg-brand__logo {
    width: 56px;
    height: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;

    filter:
        drop-shadow(0 0 14px rgba(var(--accent-rgb),0.45))
        drop-shadow(0 10px 24px rgba(0,0,0,0.58));

    animation: ccgLogoGlow 3.4s ease-in-out infinite alternate;
}

.ccg-brand::before,
.ccg-brand::after {
    content: "";
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),0.28), transparent 55%);
    filter: blur(26px);
    opacity: 0.55;
    z-index: -1;
    animation: ccgAurora 14s ease-in-out infinite;
}

.ccg-brand::after {
    animation-duration: 18s;
    animation-direction: reverse;
    opacity: 0.35;
}

.ccg-brand__kicker,
.ccg-brand__neon-cheeky,
.ccg-brand__neon-sub {
    display: block;
}

.ccg-brand__kicker {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
    text-wrap: balance;
    text-shadow:
        0 0 10px rgba(var(--accent-rgb),0.48),
        0 0 16px rgba(var(--accent-rgb),0.28);
}

.ccg-brand__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 1.08rem;
    letter-spacing: 0.1em;
    text-wrap: balance;
}

.ccg-brand__neon-cheeky {
    color: #45d8ff;
    text-shadow:
        0 0 12px rgba(69,216,255,0.75),
        0 0 24px rgba(69,216,255,0.55),
        2px 2px 0 #000;
}

.ccg-brand__neon-sub {
    color: #c28bff;
    text-shadow:
        0 0 12px rgba(194,139,255,0.85),
        0 0 26px rgba(194,139,255,0.55),
        2px 2px 0 #000;
}


/* ============================================================
   NAVIGATION — GLOBAL, PRIORITY-FIRST
============================================================ */

.ccg-nav {
    grid-area: nav;
    min-width: 0;
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    justify-self: stretch;
    pointer-events: auto;
}


.ccg-nav__bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: min(1200px, 100%);
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.ccg-nav__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ccg-nav__list {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-inline: 12px;

    overflow: visible;
    scrollbar-width: none;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    flex: 1 1 100%;
    max-width: 100%;
}

.ccg-nav__bar,
.ccg-nav__list,
.ccg-nav__link,
.ccg-nav__more-toggle {
    text-wrap: balance;
    word-break: keep-all;
}

.ccg-nav__list--secondary {
    justify-content: center;
}

.ccg-nav__list--mobile {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-inline: 0;
}

.ccg-nav__more {
    position: relative;
}

.ccg-nav__more-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(var(--accent-rgb),0.16));
    color: #fff;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0,0,0,0.6);
    font-family: var(--ccg-font-main);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 160ms ease;
}

.ccg-nav__more-toggle:hover,
.ccg-nav__more-toggle:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb),0.6);
    box-shadow: 0 16px 32px rgba(0,0,0,0.7), 0 0 18px rgba(var(--accent-rgb),0.22);
    outline: none;
}

.ccg-nav__more {
    display: none;
}

.ccg-nav__mobile {
    display: none;
}

.ccg-nav__more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    display: grid;
    gap: 8px;
    padding: 14px;
    min-width: 220px;

    background: rgba(6,6,10,0.92);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px;
    box-shadow: 0 20px 38px rgba(0,0,0,0.75);

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
    backdrop-filter: blur(12px);
    z-index: 12;
}

.ccg-nav__more-menu[data-state="open"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ccg-nav--more-open .ccg-nav__more-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ccg-nav__more[data-open="true"] .ccg-nav__more-menu,
.ccg-nav__more:focus-within .ccg-nav__more-menu,
.ccg-nav__more:hover .ccg-nav__more-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ccg-nav__link--overflow {
    width: 100%;
    justify-content: flex-start;
}

.ccg-nav__link--mobile {
    width: 100%;
    justify-content: flex-start;
}

.ccg-nav-toggle {
    grid-area: toggle;
    display: none;
    align-items: center;
    gap: 8px;

    touch-action: manipulation;

    padding: 9px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(var(--accent-rgb),0.14));
    border: 1px solid rgba(255,255,255,0.26);
    color: #fff;
    font-family: var(--ccg-font-main);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0,0,0,0.6), 0 0 12px rgba(var(--accent-rgb),0.28);
    position: relative;
    z-index: 3;
}

.ccg-nav-toggle__bars {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
}

.ccg-nav-toggle__bars span {
    display: block;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb),0.86), rgba(255,255,255,0.9));
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.ccg-header--nav-open .ccg-nav-toggle__bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ccg-header--nav-open .ccg-nav-toggle__bars span:nth-child(2) {
    opacity: 0;
}

.ccg-header--nav-open .ccg-nav-toggle__bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.ccg-nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: stretch;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.ccg-nav-drawer[aria-hidden="true"] {
    display: none;
}

.ccg-nav-drawer__backdrop {
    flex: 1;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.ccg-nav-drawer__panel {
    width: min(460px, 100vw);
    background: rgba(6, 6, 14, 0.96);
    border-left: 1px solid rgba(255,255,255,0.14);
    box-shadow: -20px 0 38px rgba(0,0,0,0.72);
    padding: 18px 18px calc(28px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(100%);
    transition: transform 0.32s ease;
}

.ccg-nav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ccg-nav-drawer__title {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
}

.ccg-nav-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,0.6);
}

.ccg-nav-drawer__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ccg-nav-drawer__label {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ccg-text-soft);
}

.ccg-nav-drawer .ccg-nav__list {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    padding: 4px 0 0;
    gap: 10px;
}

.ccg-header--nav-open .ccg-nav-drawer {
    pointer-events: auto;
    opacity: 1;
}

.ccg-header--nav-open .ccg-nav-drawer__panel {
    transform: translateX(0);
}

.ccg-body--locked {
    overflow: hidden;
}

@media (max-width: 768px) {
    .ccg-nav-drawer__panel {
        width: 100vw;
        max-width: none;
        border-left: none;
        border-radius: 0;
    }
}

@media (min-width: 1025px) {
    .ccg-nav-drawer__panel {
        max-height: none;
        overflow-y: visible;
    }
}

.ccg-header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: nowrap;
    row-gap: 0;
    min-width: 0;
}

@media (max-width: 1180px) {
    .ccg-header {
        padding: 12px 0 10px;
    }

    .ccg-header-inner {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "brand actions"
            "nav nav";
        align-items: center;
    }

    .ccg-header-actions {
        gap: 12px;
        flex-wrap: wrap;
        row-gap: 8px;
        justify-content: flex-end;
    }

    .ccg-nav__list--secondary {
        display: none;
    }

    .ccg-nav__more {
        display: inline-flex;
    }

}

@media (max-width: 960px) {
    .ccg-header-inner {
        grid-template-columns: auto auto;
        grid-template-areas:
            "brand toggle"
            "nav nav"
            "actions actions";
        align-items: center;
    }

    .ccg-brand {
        justify-content: flex-start;
        width: 100%;
    }

    .ccg-nav-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .ccg-nav__bar {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
        display: none;
    }

    .ccg-nav:not(.ccg-nav--hydrated) .ccg-nav__bar {
        display: flex;
    }

    .ccg-nav:not(.ccg-nav--hydrated) .ccg-nav__list--secondary,
    .ccg-nav:not(.ccg-nav--hydrated) .ccg-nav__more {
        display: flex;
    }

    .ccg-nav__list--secondary,
    .ccg-nav__more {
        display: none;
    }

    .ccg-nav--mobile-fallback .ccg-nav__bar,
    .ccg-nav--mobile-fallback .ccg-nav__list--secondary,
    .ccg-nav--mobile-fallback .ccg-nav__more {
        display: flex;
    }

    .ccg-nav--mobile-fallback .ccg-nav-drawer {
        display: none;
    }

    .ccg-nav__mobile {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(6,6,12,0.94);
        z-index: 9998;
        padding: 18px 20px max(24px, env(safe-area-inset-bottom));
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.26s ease, transform 0.26s ease;
        pointer-events: none;
        backdrop-filter: blur(12px);
        top: var(--ccg-header-height, 0px);
        visibility: hidden;
    }

    .ccg-nav__list--mobile .ccg-nav__link {
        justify-content: flex-start;
        width: 100%;
        font-size: 0.78rem;
    }

    .ccg-header--nav-open .ccg-nav__mobile,
    .ccg-nav--open .ccg-nav__mobile {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }

    .ccg-header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .ccg-header-inner {
        padding-inline: 0;
    }

    .ccg-brand {
        white-space: normal;
        gap: 10px;
        align-items: flex-start;
    }

    .ccg-brand__title {
        word-break: break-word;
        white-space: normal;
        line-height: 1.1;
    }

    .ccg-brand__title {
        font-size: 1rem;
    }

    .ccg-brand__kicker {
        letter-spacing: 0.18em;
    }

    .ccg-header-inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "toggle"
            "nav"
            "actions";
        justify-items: stretch;
    }

    .ccg-brand {
        justify-content: space-between;
    }

    .ccg-header-actions {
        justify-content: space-between;
        gap: 10px;
    }

    .ccg-nav-toggle {
        justify-self: flex-end;
        width: 100%;
        justify-content: space-between;
        padding-inline: 16px;
    }

}

@media (max-width: 480px) {
    .ccg-brand {
        padding: 8px 10px;
        gap: 10px;
    }

    .ccg-brand__logo {
        width: 48px;
    }

    .ccg-header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ccg-nav-toggle {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
    }

    .ccg-nav__link {
        letter-spacing: 0.06em;
    }
}

.ccg-nav__list::-webkit-scrollbar {
    display: none;
}

.ccg-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: auto;
    min-height: 40px;
    padding: var(--ccg-nav-pill-pad-y) var(--ccg-nav-pill-pad-x);
    border-radius: 999px;

    pointer-events: auto;

    font-family: var(--ccg-font-main);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.12),
            rgba(255,255,255,0.05)
        ),
        linear-gradient(
            90deg,
            rgba(var(--accent-rgb),0.28),
            rgba(var(--accent-rgb),0.06)
        );

    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 26px rgba(0,0,0,0.68);
    backdrop-filter: blur(8px);
    transition: transform 140ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

@media (max-width: 1180px) {
    .ccg-nav__link {
        font-size: 0.64rem;
        padding: 9px 11px;
        letter-spacing: 0.08em;
    }

    .ccg-nav__list {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .ccg-nav__link {
        font-size: 0.7rem;
        letter-spacing: 0.06em;
        padding: 10px 12px;
    }
}

.ccg-nav__link--active {
    border-color: rgba(var(--accent-rgb),0.7);
    box-shadow: 0 16px 36px rgba(0,0,0,0.75), 0 0 22px rgba(var(--accent-rgb),0.35);
}

.ccg-nav__link:hover,
.ccg-nav__link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb),0.65);
    box-shadow: 0 16px 36px rgba(0,0,0,0.74), 0 0 18px rgba(var(--accent-rgb),0.28);
    outline: none;
}

@media (hover: none) and (pointer: coarse) {
    .ccg-btn,
    .ccg-nav__link,
    .ccg-nav__more-toggle {
        transition: none;
        transform: none !important;
        box-shadow: 0 10px 24px rgba(0,0,0,0.55);
    }

    .ccg-nav__link:hover,
    .ccg-nav__link:focus-visible,
    .ccg-nav__more-toggle:hover,
    .ccg-nav__more-toggle:focus-visible,
    .ccg-btn:hover,
    .ccg-btn:focus-visible {
        transform: none;
        box-shadow: 0 10px 24px rgba(0,0,0,0.55);
    }
}




/* ============================================================
   WOW TAGS — GLOBAL VIEWPORT REVEAL

[data-ccg-wow] {
    opacity: 0.4;
    transform: translateY(12px) scale(0.99);
    filter: saturate(0.9);
    transition:
        opacity 520ms ease,
        transform 520ms ease,
        filter 520ms ease,
        box-shadow 520ms ease;
}

[data-ccg-wow].is-lit {
    opacity: 1;
    transform: translateY(0) scale(1.01);
    filter: saturate(1.08);
    box-shadow: 0 18px 38px rgba(0,0,0,0.7), 0 0 22px rgba(var(--accent-rgb),0.26);
}

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

.is-glinting {
    transform: translateY(-1px) scale(1.02);
    filter: saturate(1.15) brightness(1.05);
    text-shadow: 0 0 10px rgba(var(--accent-rgb),0.45);
}


/* ============================================================
   SIGNATURE KEYFRAMES
============================================================ */

@keyframes ccgLogoGlow {
    from { filter: drop-shadow(0 0 10px rgba(var(--accent-rgb),0.4)) drop-shadow(0 12px 24px rgba(0,0,0,0.7)); }
    to   { filter: drop-shadow(0 0 18px rgba(var(--accent-rgb),0.65)) drop-shadow(0 18px 28px rgba(0,0,0,0.65)); }
}

@keyframes ccgAurora {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(12deg) scale(1.1); }
    100% { transform: rotate(-8deg) scale(1.05); }
}


/* ============================================================
   WOW TAGS — GLOBAL VIEWPORT REVEAL
============================================================ */

[data-ccg-wow] {
    opacity: 0.4;
    transform: translateY(12px) scale(0.99);
    filter: saturate(0.9);
    transition:
        opacity 520ms ease,
        transform 520ms ease,
        filter 520ms ease,
        box-shadow 520ms ease;
}

[data-ccg-wow].is-lit {
    opacity: 1;
    transform: translateY(0) scale(1.01);
    filter: saturate(1.08);
    box-shadow: 0 18px 38px rgba(0,0,0,0.7), 0 0 22px rgba(var(--accent-rgb),0.26);
}

.is-glinting {
    transform: translateY(-1px) scale(1.02);
    filter: saturate(1.15) brightness(1.05);
    text-shadow: 0 0 10px rgba(var(--accent-rgb),0.45);
}


/* ============================================================
   SIGNATURE KEYFRAMES
============================================================ */

@keyframes ccgLogoGlow {
    from { filter: drop-shadow(0 0 10px rgba(var(--accent-rgb),0.4)) drop-shadow(0 12px 24px rgba(0,0,0,0.7)); }
    to   { filter: drop-shadow(0 0 18px rgba(var(--accent-rgb),0.65)) drop-shadow(0 18px 28px rgba(0,0,0,0.65)); }
}

@keyframes ccgAurora {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(12deg) scale(1.1); }
    100% { transform: rotate(-8deg) scale(1.05); }
}


/* ============================================================
   HEADER ACTIONS — STRUCTURAL ONLY
============================================================ */

.ccg-header-socials {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ccg-mode-toggle {
    height: 36px;
    min-width: 86px;
    border-radius: 999px;
}


/* ============================================================
   PAGE TYPE HANDOFF (NO VISUALS)
============================================================ */

/* HOME — hero docks closer */
html[data-ccg-page="home"] .ccg-main {
    padding-top: 18px;
}

/* INDEX PAGES */
.ccg-page--games-index .ccg-main,
.ccg-page--collections-index .ccg-main,
.ccg-page--genres-index .ccg-main {
    padding-top: var(--ccg-page-entry-pad);
}

/* SINGLE GAME */
.ccg-page--single-game .ccg-main {
    padding-top: 14px;
}


/* ============================================================
   MODE COLOURS
============================================================ */

body[data-ccg-mode="c64"] {
    --accent-rgb: 0,170,255;
}

body[data-ccg-mode="amiga"] {
    --accent-rgb: 255,41,224;
}

/* ============================================================
   HEADER INTERACTION HARD OVERRIDE (FINAL SAFETY NET)
   ------------------------------------------------------------
   Forces header/nav to always receive pointer events
   Prevents ANY overlay or effect layer from blocking clicks
============================================================ */

/* Header must ALWAYS be interactive */
.ccg-header,
.ccg-header * {
    pointer-events: auto !important;
}

/* ============================================================
   HEADER PSEUDO-ELEMENT SAFETY FIX
   Prevents ::after gradient from blocking dropdown interaction
============================================================ */

.ccg-header::after {
    pointer-events: none !important;
}

.ccg-is-mobile,
.ccg-is-mobile body,
html.ccg-is-mobile,
body.ccg-is-mobile {
    max-width: 100%;
    width: 100%;
    overflow-x: clip;
}

html.ccg-is-mobile .ccg-page,
body.ccg-is-mobile .ccg-page,
html.ccg-is-mobile .ccg-main,
body.ccg-is-mobile .ccg-main,
html.ccg-is-mobile .ccg-header,
body.ccg-is-mobile .ccg-header,
html.ccg-is-mobile .ccg-hero,
body.ccg-is-mobile .ccg-hero,
html.ccg-is-mobile .home-hero,
body.ccg-is-mobile .home-hero,
html.ccg-is-mobile .home-hero__frame,
body.ccg-is-mobile .home-hero__frame,
html.ccg-is-mobile .home-hero__bg,
body.ccg-is-mobile .home-hero__bg {
    max-width: 100%;
    overflow-x: clip;
}

/* ============================================================
   MOBILE SAFETY — HORIZONTAL OVERFLOW CLAMP
   • Prevents right-side spill on mobile
   • No layout or alignment changes
   • Desktop untouched
============================================================ */

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* ============================================================
   FINAL MOBILE LOCK — HEADER / HERO / VIEWPORT
   ------------------------------------------------------------
   • No padding hacks
   • No layout changes
   • Prevents late reflow & GPU bleed
   • Mobile only
   • FINAL — DO NOT MOVE
============================================================ */

@media (max-width: 820px) {

    /* ----------------------------------------
       HARD VIEWPORT CLAMP
    ---------------------------------------- */
    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    /* ----------------------------------------
       HEADER CONTAINMENT (CRITICAL)
    ---------------------------------------- */
    .ccg-header {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;

        isolation: isolate;
        contain: layout paint;
        overflow: hidden;

        transform: translateZ(0);
        backface-visibility: hidden;
    }

    /* Kill any pseudo-element bleed */
    .ccg-header::before,
    .ccg-header::after {
        left: 0;
        right: 0;
        max-width: 100%;
        overflow: hidden;
    }

    /* ----------------------------------------
       HEADER INNER — NO ESCAPE
    ---------------------------------------- */
    .ccg-header-inner {
        max-width: 100%;
        overflow: hidden;
        contain: layout paint;
    }

    /* ----------------------------------------
       NAV / ACTIONS SAFETY
    ---------------------------------------- */
    .ccg-nav,
    .ccg-header-actions {
        max-width: 100%;
        overflow: hidden;
    }

    /* ----------------------------------------
       HERO HARD CLAMP
    ---------------------------------------- */
    .home-hero,
    .home-hero__frame,
    .home-hero__bg,
    .home-hero__visual,
    .home-hero__visual-plate {
        max-width: 100%;
        overflow: hidden;
        contain: paint;
    }

    /* ----------------------------------------
       GPU EFFECT KILL-SWITCH (MOBILE ONLY)
       Stops late animation wake-ups
    ---------------------------------------- */
    .ccg-bg,
    .ccg-bg *,
    .home-hero * {
        animation: none !important;
        transition: none !important;
    }

}
