@font-face {
    font-family: 'GreenEnergy';
    src: url('../assets/GreenEnergy.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --text-shadow: 0 0 12px rgba(255, 255, 255, 1), 0 0 24px rgba(255, 255, 255, .8), 0 0 36px rgba(255, 255, 255, .6);
    --white: #fff;
    --pad: clamp(12px, 2vw, 24px);
    --vh: 100vh;
}

* {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    cursor: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* стандарт */
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
}

body {
    color: var(--white);
    font-family: 'GreenEnergy', Arial, sans-serif;
    cursor: none;
    background: #000;
}

/* Скроллбар */
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: #111;
}

*::-webkit-scrollbar-thumb {
    background: #fff;
    border-radius: 6px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #fff #111;
}

/* BG */
.bg {
    position: fixed;
    inset: 0;
    z-index: -3;
}

.bg video {
    width: 100vw;
    height: 100%;
    object-fit: cover;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .55) 65%, rgba(0, 0, 0, .9));
    pointer-events: none;
}

/* PRELOADER */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .85);
    transition: opacity .4s ease;
}

.preloader video {
    height: 100vh;
    object-fit: cover;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* CRT EFFECT */
.crt-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .08), rgba(0, 0, 0, 0.3));
    mix-blend-mode: overlay;
    backdrop-filter: contrast(1.05) saturate(1.1); /* Removed blur */
    animation: crt-glitch 1s infinite linear alternate, crt-scanlines 0.05s infinite;
}

@keyframes crt-scanlines {
    0% {
        background-image: linear-gradient(rgba(255, 0, 0, 0.2) 1px, transparent 1px);
    }
    50% {
        background-image: linear-gradient(rgba(0, 255, 0, 0.2) 1px, transparent 1px);
    }
    100% {
        background-image: linear-gradient(rgba(0, 0, 255, 0.2) 1px, transparent 1px);
    }
}

.fisheye {
    position: fixed;
    inset: 0;
    z-index: 3999;
    pointer-events: none;
    backdrop-filter: contrast(1.05); /* Removed blur */
    transform: scale(1.02);
    border-radius: 50% / 45%;
    overflow: hidden;
}

#stage {
    transition: opacity 0.3s ease;
    opacity: 1;
}

#stage.fade-out {
    opacity: 0;
}

#stage.bfcache-show {
    opacity: 1 !important;
    transition: none !important; /* отключаем анимацию */
}

/* LAYOUT */
.stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 3vh, 32px);
}

/* Shake Effect */
@keyframes shake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(-1px, 1px) rotate(-0.5deg);
    }
    40% {
        transform: translate(-1px, -1px) rotate(0.5deg);
    }
    60% {
        transform: translate(1px, 1px) rotate(-0.5deg);
    }
    80% {
        transform: translate(1px, -1px) rotate(0.5deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* CART Sidebar */
.cart-sidebar {
    font-family: Roboto, sans-serif;
    position: fixed;
    top: 0;
    transform: translateX(min(100vw, 480px));
    right: 0;
    width: min(100vw, 480px);
    height: calc(var(--vh) * 100);
    background: rgba(0, 0, 0, .95);
    color: #fff;
    z-index: 2500;
    padding: 16px;
    box-shadow: -2px 0 18px rgba(0, 0, 0, .7);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 1px solid #333;
}

.cart-sidebar.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2rem;
    color: var(--white);
    margin: 0 10px 0 10px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #333;
    font-size: clamp(16px, 2vw, 20px);
    text-align: center;
}

.cart-item-details * {
    margin: 4px;
}

.cart-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: clamp(16px, 2vw, 20px);
}

.cart-item-remove:hover {
    color: #dc2626;
}

.cart-footer {
    border-top: 1px solid #333;
    padding-top: 10px;
    display: grid;
    gap: 10px;
    font-size: clamp(14px, 2vw, 28px);
}

.cart-total {
    text-align: left;
    margin: 0;
}

.cart-footer div {
    font-size: clamp(14px, 2vw, 28px);
    padding: 5px;
    background: #111;
    border: 1px solid #444;
    color: #fff;
}

.cart-footer button:hover {
    background: #444;
}

#clearCartBtn {
    text-align: center;
}

#clearCartBtn:hover {
    background-color: #222;
}

#checkoutBtn {
    text-align: center;
}

#checkoutBtn:hover {
    background-color: #222;
}

/* CROSSHAIR */
.crosshair {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.crosshair.shown {
    opacity: 1;
}

.crosshair-line {
    position: absolute;
    background: var(--white);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.crosshair-horizontal-top, .crosshair-horizontal-bottom {
    width: 100%;
    height: 2px;
}

.crosshair-vertical-left, .crosshair-vertical-right {
    height: 100%;
    width: 2px;
}

/* TV overlay (off on mobile) */
.tv-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    pointer-events: none;
    background: url('../assets/tv.png') no-repeat center;
    background-size: contain;
}

#cartClose {
    font-weight: normal;
    font-style: normal;
    background-color: black;
    color: var(--white);
    border: none;
    font-size: 24px;
}

@media (max-width: 768px) {
    .preloader video {
        max-width: 100vw;
        height: auto;
        object-fit: cover;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .tshirt-row {
        flex-direction: column;
        align-items: center;
    }

    .tv-overlay {
        display: none;
    }

    .crosshair,
    .crosshair.shown {
        display: none;
    }

    .cart-sidebar {
        width: 100vw !important;
        right: unset;
        left: 0;
        transform: translateX(100%);
    }

    .cart-item img {
        width: 80px;
        height: 80px;
        object-fit: cover;
    }

    .cart-item-details {
        font-size: 12px;
    }

    .cart-sidebar.open {
        transform: translateX(0);
    }

    #cartClose {
        font-size: 36px;
    }
}

.hidden {
    display: none !important;
}