:root {
    /* Performance-based blur variables */
    --blur-heavy: 64px;
    --blur-medium: 20px;
    --blur-light: 10px;
    --blur-canvas: 8px;
    
    /* Animation variables */
    --transition-normal: 0.3s;
    --transition-slow: 0.8s;
}

/* Low performance mode - reduced blur */
.perf-low {
    --blur-heavy: 0px;
    --blur-medium: 0px;
    --blur-light: 0px;
    --blur-canvas: 0px;
    --transition-normal: 0.2s;
    --transition-slow: 0.3s;
}

/* Medium performance mode - moderate blur */
.perf-medium {
    --blur-heavy: 20px;
    --blur-medium: 10px;
    --blur-light: 5px;
    --blur-canvas: 4px;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* Reduced motion preference - disable blur and fast transitions */
@media (prefers-reduced-motion: reduce) {
    :root {
        --blur-heavy: 0px;
        --blur-medium: 0px;
        --blur-light: 0px;
        --blur-canvas: 0px;
        --transition-normal: 0.1s;
        --transition-slow: 0.2s;
    }
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #222;
    overflow: hidden;
    font-size: max(2vw, 16px);
    font-family: "Lexend Deca", sans-serif;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

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

button {
    padding: 0;
    border: none;
    background: none;
    text-decoration: none;
    font: inherit;
}

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

h1 {
    all: unset;
}

.wrapper {
    min-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[class*="__container"] {
    max-width: 1200px;
}

@media (max-width: 1199.98px) {
    [class*="__container"] {
        max-width: 970px;
    }
}

@media (max-width: 990.98px) {
    [class*="__container"] {
        max-width: 750px;
    }
}

@media (max-width: 767.98px) {
    [class*="__container"] {
        max-width: none;
    }
}

@media (min-width: 2200px) {
    [class*="__container"] {
        max-width: 2000px;
    }
}

.fullpage {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-color: #55555f #121216;
    scrollbar-width: thin;
}

.fullpage::-webkit-scrollbar {
    width: 6px;
}

.fullpage::-webkit-scrollbar-track {
    background: #121216;
}

.fullpage::-webkit-scrollbar-thumb {
    background: #55555f;
    border-radius: 3px;
}

.fullpage::-webkit-scrollbar-thumb:hover {
    background: #88888f;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    touch-action: pan-y;
    -webkit-touch-callout: none;
}

/* Landscape Mode Adaptations */
/* Smartphones in landscape (limited height) */
@media (max-height: 600px) and (orientation: landscape) {
    .fullpage {
        scroll-snap-type: y proximity; /* Softer snap for better scrolling */
    }
    
    .section {
        min-height: 85vh; /* Allow sections to be slightly shorter */
        padding: 2vh 0;
    }
}

/* Tablets in landscape */
@media (min-width: 768px) and (max-height: 800px) and (orientation: landscape) {
    .fullpage {
        scroll-snap-type: y proximity; /* Softer snap */
    }
    
    .section {
        min-height: 90vh; /* Tablets can handle taller sections */
        padding: 3vh 0;
    }
}

/* ============================================= */
header {
    position: fixed;
    top: 3vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10; 
    border-radius: 50px; 
    border: 1.5px solid rgba(67, 67, 67, 0.6);
    background: rgba(29, 31, 46, 0.5);
    backdrop-filter: blur(var(--blur-heavy));
    -webkit-backdrop-filter: blur(var(--blur-heavy));
    padding: 0.3rem 0.5rem; 
    will-change: transform;
}

/* Landscape header optimization */
@media (max-height: 600px) and (orientation: landscape) {
    header {
        top: 1.5vh;
        padding: 0.2rem 0.4rem;
    }
    
    .menu__list {
        gap: 0.5vw;
    }
    
    .menu__item {
        font-size: max(0.9vw, 11px);
    }
    
    .menu__link, .menu__link_downloader {
        padding: 0.15rem 0.4rem;
    }
}

.menu__list {
    display: flex;
    align-items: center;
    gap: 1vw; /* Зменшимо відстань між елементами */
    justify-content: center;
}

.menu__item {
    color: #CDCDCD;
    font-family: "Lexend Deca", sans-serif;
    font-size: max(1vw, 12px);
    font-style: normal;
    font-weight: 600;
    line-height: 1.5;
}

.menu__link, .menu__link_downloader {
    padding: 0.2rem 0.5rem;
    border-radius: 30px; /* Заокруглення для кнопок */
    transition: background-color 0.3s ease, color 0.3s ease;
    display: block; /* Робимо посилання блочним для правильних відступів */
    color: #CDCDCD;
}

/* Ефект наведення (сіре виділення) */
.menu__link:hover, .menu__link_downloader:hover {
    background-color: rgba(205, 205, 205, 0.15);
}

/* Активний стан (як "About" на фото) */
.menu__link.active {
    background-color: #CDCDCD;
    color: #222; /* Темний колір тексту */
    font-weight: 700;
}

/* ============================================= */

#hero {
    background-image: url(../assets/img/wall-background.webp);
	background-repeat: repeat;
}

.hero__logo__container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10vh;
}

/* Landscape Hero adaptation */
@media (max-height: 600px) and (orientation: landscape) {
    .hero__logo__container {
        flex-direction: row;
        gap: 3vw;
    }
    
    .logo_container__logo {
        height: 60vh;
        max-height: 280px;
        width: auto;
    }
    
    h1 {
        font-size: clamp(32px, 5vh, 48px);
        line-height: 110%;
        text-align: left;
    }
    
    .indented-line {
        padding-left: 2rem;
    }
}

@media (min-width: 768px) and (max-height: 800px) and (orientation: landscape) {
    .hero__logo__container {
        gap: 6vh;
    }
    
    .logo_container__logo {
        height: 50vh;
        max-height: 350px;
    }
    
    h1 {
        font-size: clamp(40px, 6vh, 55px);
    }
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        fill: #fff;
        filter: drop-shadow(0 0 10px #307FF6) drop-shadow(0 0 20px #307FF6);
    }
    20%, 22%, 24%, 55% {
        opacity: 0.5;
        fill: #aaa;
        filter:drop-shadow(0 0 5px #1a4a96);
    }
}

@keyframes neonTextFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px #307FF6, 0 0 20px #307FF6, 0 0 5px #307FF6;
    }
    20%, 22%, 24%, 55% {
        opacity: 0.5;
        text-shadow: none;
    }
}

.logo_container__logo {
    width: auto;
    height: 50vh;
    margin: auto;
    opacity: 0;
    animation: neonFlicker 2.5s ease-in-out forwards;
    will-change: stroke, stroke-width, opacity, fill;
    fill: #fff;
    stroke: #307FF6;
    stroke-width: 100;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

h1 {
    text-align: center;
    color: #FFF;
    font-family: 'Pacifico', cursive;
    font-size: max(6vw, 55px);
    font-style: normal;
    font-weight: 300;
    line-height: 50%;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: neonTextFlicker 2.5s ease-in-out 0.5s forwards;
    will-change: text-shadow, opacity;
}

.indented-line {
  padding-left: 4.5rem; 
  display: inline-block; 
}

/* ============================================= */
/* Загальний клас для секцій з градієнтним фоном */
.gradient-section {
    position: relative; /* Встановлює контекст позиціонування для дочірніх елементів */
    overflow: hidden;   /* Обрізає все, що виходить за межі секції */
}

/* Створюємо шар-накладення з градієнтом */
/* .gradient-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay, linear-gradient(117deg, rgba(18, 18, 22, 0.55) 0%, rgba(34, 34, 77, 0.55) 100%));
    z-index: 1;
} */

/* #about - специфічні стилі для about секції, якщо потрібні */

.background_canvas {
    position: absolute; /* Вириваємо canvas з потоку */
    top: 0;
    left: 0;
    opacity: 0.5;
    width: 100%;
    height: 100%;
    z-index: 0; /* Canvas на найнижчому шарі (під градієнтом) */
    filter: blur(var(--blur-canvas)); /* Розмиття фону */
}

/* Відключаємо blur та зменшуємо opacity для користувачів з prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .background_canvas {
        filter: none;
        opacity: 0.3;
    }
}

.about__container {
    position: relative; /* Щоб контент був поверх псевдо-елемента */
    z-index: 2; /* Контент на найвищому шарі (над градієнтом) */
}

.about__grid {
    display: grid;
    /* max-height: 70vh; */
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 0.5rem;;
}

/* Landscape About grid adaptation */
@media (max-height: 700px) and (orientation: landscape) {
    .about__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .card {
        padding: 0.6rem;
    }
    
    .card__main {
        grid-column: span 2;
        grid-row: span 1; /* Single row in landscape */
    }
    
    .card__main .card__icon {
        width: 8vh;
        margin-bottom: 0.5rem;
    }
    
    .card__main h2 {
        font-size: max(1.3vw, 18px);
    }
    
    .card_main__description {
        font-size: max(0.9vw, 11px);
        line-height: 145%;
    }
    
    .card__location {
        grid-row: span 1;
        flex-direction: row;
        gap: 1rem;
    }
    
    .card__location_block {
        gap: 0.4rem;
    }
    
    .card__location .card__icon {
        width: 4vh;
    }
    
    .card__location_block_h,
    .card__location_block_p {
        font-size: max(1vw, 11px);
    }
    
    .card__portfolio {
        grid-column: span 2;
    }
    
    .card__icon_portfolio {
        width: 3vw;
    }
    
    .card h3 {
        font-size: max(1vw, 13px);
    }
    
    .card__social p {
        font-size: max(0.9vw, 12px);
    }
    
    .card__social .card__icon {
        width: 1.8vw;
    }
    
    .card__games-created .card__icon {
        width: 2.5vw;
    }
    
    .card__games_number {
        font-size: max(1.8vw, 24px);
    }
}

/* Passive floating animation for all cards */
@keyframes subtle-float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-3px) rotate(0.5deg); 
    }
    50% { 
        transform: translateY(0) rotate(0deg); 
    }
    75% { 
        transform: translateY(-3px) rotate(-0.5deg); 
    }
}

.card {
    box-sizing: border-box; /* враховує padding в розмірах */
    height: 100%; /* заповнює висоту грід клітинки */
    padding: 1rem;
    border-radius: 0.5rem;
    
    /* Frosted Glass Effect */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle white border */
    background: rgba(255, 255, 255, 0.01); /* Very light transparent background */
    backdrop-filter: blur(var(--blur-light)); /* Blurs what's behind the card */
    -webkit-backdrop-filter: blur(var(--blur-light));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Slight shadow for depth */

    color: #CDCDCD;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    will-change: transform;
    
    /* 3D Tilt Effect */
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                background 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99);
    
    /* Spotlight effect variables */
    --spotlight-x: 50%;
    --spotlight-y: 50%;
    --spotlight-opacity: 0;
    position: relative;
    overflow: hidden;
}

/* Spotlight effect overlay */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 80px at var(--spotlight-x) var(--spotlight-y),
        rgba(255, 255, 255, 0.15),
        transparent 70%
    );
    opacity: var(--spotlight-opacity);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s ease;
}

/* Ensure card content is above spotlight */
.card > * {
    position: relative;
    z-index: 2;
}

/* Staggered passive animation for each card */
.about__grid .card:nth-child(1) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 0s; }
.about__grid .card:nth-child(2) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 0.3s; }
.about__grid .card:nth-child(3) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 0.6s; }
.about__grid .card:nth-child(4) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 0.9s; }
.about__grid .card:nth-child(5) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 1.2s; }
.about__grid .card:nth-child(6) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 1.5s; }
.about__grid .card:nth-child(7) { animation: subtle-float 4s ease-in-out infinite; animation-delay: 1.8s; }

/* Remove passive animation when hovering on desktop to allow 3D tilt */
@media (min-width: 768px) and (hover: hover) {
    .about__grid .card:hover {
        animation: none !important;
    }
}

.card h3 {
    margin: 0;
    font-size: max(1.1vw, 14px);
    font-weight: 600;
}

.card h2 {
    margin: 0;
    font-weight: bold;
    color: #FFF;
    font-size: max(1.5vw, 20px);
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

/* -------------------------------------------- */

.card__main {
    grid-column: span 2;
    grid-row: span 2;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.card__main .card__icon{
    height: auto;
    width: 10vh;
    margin-bottom: 10px;
}

.card__main p {
    font-size: max(1vw, 12px);
    line-height: 156.25%;
    letter-spacing: 0.8px;
}

.card_main__description{
    text-align: left;
    color: #FFF;
    font-style: normal;
    font-weight: 200;
    line-height: 156.25% ; 
    letter-spacing: 1px;
    opacity: 0.8;
}

/* -------------------------------------------- */

.card__location {
    grid-row: span 2;
    justify-content: space-evenly;
    gap: 2rem;
}

.card__location_block{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.card__location_block_h{
    margin: 0px;
    color: #FFF;
    font-size: max(1.7vw, 12px);
    font-style: normal;
    font-weight: 400;
    line-height: 24px; /* 75% */
}

.card__location_block_p{
    margin: 0px;
    color: #FFF;
    font-size: max(1.2vw, 12px);
    font-style: normal;
    font-weight: 200;
    line-height: 24px; /* 120% */
}

.card__location .card__icon{
    width: 5vh;
    height: auto;
}

/* -------------------------------------------- */

.card__portfolio {
    grid-column: span 2;
    /* background: rgba(255, 255, 255, 0.05); */
    background: linear-gradient(146deg, rgba(41, 22, 217, 0.1) 4.59%, rgba(20, 69, 137, 0.10) 78.97%);
    transition: transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                background 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.card__portfolio:hover {
    background: linear-gradient(146deg, rgba(41, 22, 217, 0.25) 4.59%, rgba(20, 69, 137, 0.25) 78.97%);
    box-shadow: 0 8px 16px rgba(41, 22, 217, 0.2);
}

.card__icon_portfolio{
    width: 4vw;
    height: auto;
}


/* -------------------------------------------- */

.card__social {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}

.card__content{
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.card__social p {
    font-size: max(1vw, 14px);
    line-height: 180%;
    font-weight: 200;
    margin: 0;
}

.card__social .card__icon{
    width: 2vw;
    height: auto;
}

.card__linkedin{ 
    /* background: rgba(255, 255, 255, 0.05); */
    background: linear-gradient(146deg, rgba(60, 117, 198, 0.10) 4.59%, rgba(20, 69, 137, 0.10) 78.97%); 
    transition: transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                background 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.card__linkedin:hover {
    background: linear-gradient(146deg, rgba(60, 117, 198, 0.25) 4.59%, rgba(20, 69, 137, 0.25) 78.97%);
    box-shadow: 0 8px 16px rgba(60, 117, 198, 0.2);
}

.card__meta-store,
.card__tumblr{
    /* background: rgba(255, 255, 255, 0.05); */
    background: linear-gradient(146deg, rgba(0, 129, 251, 0.10) 4.59%, rgba(0, 100, 224, 0.10) 78.97%); 
    transition: transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                background 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.card__meta-store:hover,
.card__tumblr:hover {
    background: linear-gradient(146deg, rgba(0, 129, 251, 0.25) 4.59%, rgba(0, 100, 224, 0.25) 78.97%);
    box-shadow: 0 8px 16px rgba(0, 129, 251, 0.2);
}

.card__itchio{
    /* background: rgba(255, 255, 255, 0.05); */
    /* background: linear-gradient(134deg, rgba(197, 21, 21, 0.10) 7.08%, rgba(95, 10, 10, 0.10) 94.87%); */
    background: linear-gradient(134deg, rgba(197, 21, 21, 0.10) 7.08%, rgba(95, 10, 10, 0.10) 94.87%);
    transition: transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                box-shadow 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
                background 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.card__itchio:hover {
    background: linear-gradient(134deg, rgba(197, 21, 21, 0.25) 7.08%, rgba(95, 10, 10, 0.25) 94.87%);
    box-shadow: 0 8px 16px rgba(197, 21, 21, 0.2);
}

/* -------------------------------------------- */

.card__games-created{
    font-size: max(1.5vw, 12px);
    
}

.card__games-created .card__icon{
    width: 3vw;
    height: auto;
}

.card__games-created p{
    margin: 0;
    line-height: 170%;
}

.card__games_number{
    font-size: max(2vw, 30px);
    margin: 0;
}



/* Адаптивність: на екранах менше 1024px переходимо до 2 колонок */
/* @media (max-width: 1024px) {
    .about__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card--main, .card--portfolio {
        grid-column: span 2; /
        grid-row: auto;
    }
} */

/* Адаптивність: на мобільних переходимо до 1 колонки */
/* @media (max-width: 767.98px) {
    .about__grid {
        grid-template-columns: 1fr;
    }
     .card--main, .card--portfolio {
        grid-column: auto;
        grid-row: auto;
    }
} */

/* #blocky-game - специфічні стилі для blocky-game секції, якщо потрібні */

.game__container {
    position: relative;
    z-index: 2;
    width: 40vw;
    height: 75vh;
    
    /* Frosted Glass Effect - як в Figma */
    /* border-radius: max(1.5vw, 32px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(64px);
    -webkit-backdrop-filter: blur(64px);
    box-shadow: inset 0px 0px 8px 0px rgba(255, 255, 255, 0.3);
    background-blend-mode: darken; */

    border-radius: max(1.5vw, 32px);
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle white border */
    background: rgba(255, 255, 255, 0.01); /* Very light transparent background */
    backdrop-filter: blur(var(--blur-light)); /* Blurs what's behind the card */
    -webkit-backdrop-filter: blur(var(--blur-light));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Slight shadow for depth */
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game__image-wrapper {
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: max(1.25vw, 20px);
    flex-shrink: 0;
}

.game__logo {
    border-radius: max(1.2vw, 20px);
    width: 100%;
    height: auto;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center;
    display: block;
}

.game__content {
    display: flex;
    padding: max(1.5vw, 20px);
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex: 1 0 0;
    align-self: stretch;
}

.game__content_text {
    display: flex;
    padding: 0 max(0.4vw, 6px);
    flex-direction: column;
    align-items: flex-start;
    gap: max(0.6vw, 10px);
    align-self: stretch;
    text-align: left;
}

.game__header {
    margin: 0;
    color: #FFF;
    font-family: "Lexend Deca";
    font-size: max(2.5vw, 30px);
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.game__sub_header {
    margin: 0;
    color: var(--section-accent-color, #D9DA7B);
    font-family: "Lexend Deca";
    font-size: max(1.2vw, 16px);
    font-style: normal;
    font-weight: 200;
    line-height: normal;
    letter-spacing: max(0.15vw, 2px);
}

.game__description {
    margin: 0;
    align-self: stretch;
    color: #B3B3B3;
    font-family: "Lexend Deca";
    font-size: max(1vw, 14px);
    font-style: normal;
    font-weight: 200;
    line-height: 150%;
}

.game__button_platforms {
    display: flex;
    padding: max(0.6vw, 10px);
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
}

.game__button {
    width: 35%;
    border-radius: max(0.8vw, 16px);
    border: 1px solid #FFF;
    padding: max(0.4vw, 10px) max(1.2vw, 16px);
    color: #FFF;
    text-align: center;
    font-family: "Lexend Deca";
    font-size: max(0.8vw, 18px);
    font-style: normal;
    font-weight: 300;
    line-height: 120%;
    letter-spacing: max(0.125vw, 2px);
    
    background: transparent;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.game__button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.game__platforms {
    display: flex;
    gap: max(0.7vw, 8px);
    align-items: center;
    justify-content: center;
}

.platforms__platform {
    height: max(2.2vw, 24px);
    height: auto;
    object-fit: contain;
    justify-self: center;
}

/* ============================================= */

/* Адаптивність для game__container */
@media (max-width: 1199.98px) {
    .game__container {
        width: 50vw;
        height: calc(50vw * 1.35);
    }
}

@media (max-width: 990.98px) {
    .game__container {
        width: 60vw;
        height: calc(60vw * 1.35);
    }
}

/* Landscape game container adaptation */
@media (orientation: landscape) and (max-height: 700px) {
    .game__container {
        width: 70vw;
        height: auto;
        max-height: 85vh;
        flex-direction: row;
    }
    
    .game__image-wrapper {
        width: 50%;
        flex-shrink: 0;
    }
    
    .game__content {
        width: 50%;
        padding: max(1.2vw, 16px);
    }
    
    .game__header {
        font-size: max(2vw, 24px);
    }
    
    .game__sub_header {
        font-size: max(1vw, 14px);
    }
    
    .game__description {
        font-size: max(0.9vw, 12px);
        line-height: 140%;
    }
    
    .game__button {
        font-size: max(0.7vw, 16px);
        padding: max(0.3vw, 8px) max(1vw, 14px);
    }
    
    .platforms__platform {
        width: max(1.8vw, 20px);
    }
}

@media (max-width: 767.98px) {
    .game__container {
        width: 90vw;
        height: auto;
    }
    
    .game__image-wrapper {
        width: 90vw;
    }
    
    .game__content_text {
        align-items: center;
        text-align: center;
    }

    
    .game__sub_header {
        font-size: max(4.5vw, 18px);
        text-align: center;
    }
    
    .game__description {
        font-size: max(3.5vw, 14px);
        text-align: center;
    }
    
    .game__button_platforms {
        flex-direction: column-reverse;
        margin-top: 20px;
        gap: 20px;
        align-items: center;
    }
    
    .game__button {
        width: 80%;
        font-size: max(4vw, 18px);
        padding: max(2.5vw, 4px) max(8vw, 24px);
    }
    
    .game__platforms {
        gap: max(3vw, 12px);
    }
    
    /* .platforms__platform {
        width: max(10vw, 40px);
        height: max(10vw, 40px);
    } */
}

@media (min-width: 2200px) {
    .game__container {
        width: 30vw;
        height: calc(30vw * 1.35);
    }
}

/* ============================================= */
/* Featured: нескінченна карусель                */
/* ============================================= */

.featured {
    --card-gap: max(2vw, 20px);
    position: relative;
    width: 100%;
}

/* Усі слайди лежать в одній клітинці гріда; games.js зсуває їх через transform */
.featured__track {
    position: relative;
    display: grid;
    place-items: center;
    padding: 2vh 0;
    overflow: hidden;
    overflow: clip; /* clip, а не hidden: фокус на посиланні не зсуватиме вміст */
    /* Вертикальний скрол сторінки лишається нативним, горизонтальні жести обробляє games.js */
    touch-action: pan-y;
    cursor: grab;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
}

.featured__track.is-dragging,
.featured__track.is-dragging * {
    cursor: grabbing;
}

.featured__track:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: -2px;
}

.featured__slide {
    grid-area: 1 / 1;
    box-sizing: border-box;
    /* Ширина слайда = картка + проміжок, тому вона ж є кроком каруселі */
    padding: 0 calc(var(--card-gap) / 2);
    will-change: transform;
}

.featured__slide:not(.is-active) {
    cursor: pointer;
}

/* Рухомий backdrop-blur перемальовується кожен кадр, тому в каруселі його немає.
   Затемнення неактивних карток — накладка, її прозорість games.js веде плавно від відстані до центру. */
.featured__slide .game__container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.04);
}

.featured__slide .game__container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.55);
    opacity: var(--dim, 0);
    pointer-events: none;
    z-index: 3;
}

.featured__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max(3vw, 44px);
    height: max(3vw, 44px);
    border-radius: 50%;
    border: 1.5px solid rgba(67, 67, 67, 0.6);
    background: rgba(29, 31, 46, 0.7);
    backdrop-filter: blur(var(--blur-light));
    -webkit-backdrop-filter: blur(var(--blur-light));
    color: #CDCDCD;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.featured__arrow--prev {
    left: max(1.5vw, 12px);
}

.featured__arrow--next {
    right: max(1.5vw, 12px);
}

.featured__arrow:hover {
    background: #CDCDCD;
    color: #222;
}

.featured__arrow:focus-visible,
.featured__dot:focus-visible {
    outline: 2px solid #FFF;
    outline-offset: 2px;
}

.featured__dots {
    display: flex;
    justify-content: center;
    gap: max(0.2vw, 2px);
    margin-top: max(0.8vw, 8px);
}

.featured__dot {
    box-sizing: content-box;
    width: max(0.6vw, 10px);
    height: max(0.6vw, 10px);
    /* Прозора рамка збільшує зону натискання, не змінюючи вигляду крапки */
    border: 8px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    background-clip: padding-box;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: width 0.35s ease, background-color 0.35s ease;
}

.featured__dot[aria-current="true"] {
    width: max(2vw, 28px);
    background-color: #CDCDCD;
    background-clip: padding-box;
}

/* На телефонах і вузьких вікнах гортають свайпом, стрілки лише заважали б */
@media (max-width: 767.98px), (hover: none) {
    .featured__arrow {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .featured {
        --card-gap: 3vw;
    }
}

/* ============================================= */
/* All games: каталог з фільтрами                */
/* ============================================= */

#all-games {
    box-sizing: border-box;
    /* Зверху, а не по центру: при фільтрації заголовок і чіпи не мають стрибати */
    justify-content: flex-start;
    /* Запас під фіксований header, щоб контент не ховався під ним, коли каталог вищий за екран */
    padding: calc(3vh + 3.5rem) 0 6vh;
}

.catalog__container {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    width: 100%;
    padding: 0 max(1.5vw, 16px);
    display: flex;
    flex-direction: column;
    gap: max(1.4vw, 18px);
}

.catalog__title {
    margin: 0;
    color: #FFF;
    font-size: max(2.5vw, 30px);
    font-weight: 700;
    line-height: normal;
}

/* --- Фільтри --- */
.catalog__filters {
    display: flex;
    flex-direction: column;
    gap: max(0.6vw, 10px);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: max(1vw, 12px);
}

.filter-group__label {
    flex: 0 0 5.5em;
    color: #B3B3B3;
    font-size: max(0.8vw, 12px);
    font-weight: 200;
    letter-spacing: max(0.12vw, 2px);
    text-transform: uppercase;
}

.filter-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: max(0.4vw, 6px);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.5em 0.95em;
    border-radius: 999px;
    border: 1px solid rgba(67, 67, 67, 0.6);
    background: rgba(29, 31, 46, 0.5);
    color: #CDCDCD;
    font-family: "Lexend Deca", sans-serif;
    font-size: max(0.85vw, 13px);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

/* Hover лише для миші: на дотиковому екрані він «залипає» після тапу й фарбує чіп у сірий */
@media (hover: hover) {
    .chip:hover:not(:disabled):not([aria-pressed="true"]) {
        background: rgba(205, 205, 205, 0.15);
    }
}

.chip[aria-pressed="true"] {
    background: #CDCDCD;
    border-color: #CDCDCD;
    color: #222;
    font-weight: 700;
}

.chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.chip:focus-visible,
.catalog-card:focus-visible {
    outline: 2px solid #FFF;
    outline-offset: 2px;
}

.chip__icon {
    height: 1.2em;
    width: auto;
}

/* Іконки білі — на світлому активному чіпі їх треба затемнити */
.chip[aria-pressed="true"] .chip__icon {
    filter: invert(1);
}

.chip__count {
    font-size: 0.85em;
    font-weight: 200;
    opacity: 0.6;
}

/* --- Сітка карток --- */
.catalog__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: max(1vw, 12px);
}

.catalog__item[hidden] {
    display: none;
}

.catalog__item.is-entering {
    animation: catalog-item-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) var(--enter-delay, 0ms) both;
}

@keyframes catalog-item-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.catalog-card {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    overflow: hidden;
    border-radius: max(1vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(var(--blur-light));
    -webkit-backdrop-filter: blur(var(--blur-light));
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #FFF;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.catalog-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--section-accent-color, #D9DA7B);
    box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--section-accent-color, #D9DA7B) 60%, transparent);
}

@media (hover: hover) {
    .catalog-card:hover {
        transform: translateY(-4px);
        border-color: var(--section-accent-color, #D9DA7B);
        box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--section-accent-color, #D9DA7B) 60%, transparent);
    }

    .catalog-card:hover .catalog-card__cover img {
        transform: scale(1.06);
    }
}

.catalog-card__cover {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.catalog-card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.catalog-card:focus-visible .catalog-card__cover img {
    transform: scale(1.06);
}

.catalog-card__body {
    display: flex;
    flex-direction: column;
    gap: max(0.4vw, 6px);
    padding: max(0.8vw, 12px);
}

.catalog-card__title {
    font-size: max(1.1vw, 15px);
    font-weight: 700;
    line-height: 1.2;
}

.catalog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
}

.catalog-card__genre {
    color: var(--section-accent-color, #D9DA7B);
    font-size: max(0.8vw, 12px);
    font-weight: 300;
    letter-spacing: max(0.1vw, 1px);
}

.catalog-card__platforms {
    display: flex;
    align-items: center;
    gap: max(0.35vw, 5px);
}

.catalog-card__platform {
    height: max(1.2vw, 16px);
    width: auto;
}

@media (max-width: 990.98px) {
    .catalog__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .catalog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .filter-group__label {
        flex-basis: auto;
    }

    .chip {
        gap: 0.35em;
        padding: 0.45em 0.75em;
    }
}

@media (min-width: 2200px) {
    .catalog__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

footer {
    text-align: center;
    padding: 1rem 0;
    background: #222;
    color: #fff;
}

/* ============================================= */
/* Performance Optimizations */
/* ============================================= */

/* Disable complex animations on low-performance devices */
.perf-low .card {
    animation: none !important;
    transition: transform 0.2s ease, background 0.2s ease !important;
    will-change: auto;
}

.perf-low .logo_container__logo,
.perf-low h1 {
    animation: none !important;
    opacity: 1 !important;
    /* Залишаємо легкий drop-shadow навіть на low */
    filter: drop-shadow(0 0 5px #307FF6) !important;
}

.perf-low h1 {
    text-shadow: 0 0 5px #307FF6, 0 0 10px #307FF6 !important;
}

.perf-low .card::before {
    display: none; /* Remove spotlight effect */
}

/* Medium performance: simpler animations */
.perf-medium .card {
    transition-duration: 0.5s;
}

/* ============================================= */
/* Reduced Motion Support - Accessibility */
/* ============================================= */

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

    /* Disable neon flicker animations */
    .logo_container__logo {
        animation: none !important;
        opacity: 1 !important;
        filter: drop-shadow(0 0 10px #307FF6) drop-shadow(0 0 20px #307FF6);
    }

    h1 {
        animation: none !important;
        opacity: 1 !important;
        text-shadow: 0 0 10px #307FF6, 0 0 20px #307FF6;
    }

    /* Disable card float animations */
    .card {
        animation: none !important;
        will-change: auto;
    }

    /* Simplify card hover effects */
    .card {
        transition: background 0.15s ease, transform 0.15s ease !important;
    }

    /* Remove spotlight effect */
    .card::before {
        display: none;
    }

    /* Disable 3D tilt */
    .card:hover {
        transform: none !important;
    }

    /* Disable canvas blur */
    .background_canvas {
        filter: none !important;
        opacity: 0.3;
    }

    /* Disable video thumbnail animation */
    .video-section:hover .video-thumbnail {
        transform: none !important;
    }

    /* Simplify button hover effects */
    .game__button:hover,
    .play-button:hover,
    .menu__link:hover {
        transform: none !important;
    }

    /* Remove will-change to save resources */
    * {
        will-change: auto !important;
    }
}


