/* ========================================
   1. CUSTOM FONTS
   ======================================== */
@font-face {
    font-family: 'agdasima';
    src: url('../fonts/vcr.ttf') format('truetype');
    font-display: swap;
}

/* ========================================
   2. CSS VARIABLES
   ======================================== */
:root {
    --color-primary: rgb(197, 51, 51);
    --color-primary-dark: rgb(150, 30, 30);
    --color-secondary: rgb(132, 185, 255);
    --color-text-light: white;
    --color-shadow: black;
    --color-overlay: rgba(0, 0, 0, 0.4);

    --font-family-base: 'agdasima', serif;

    --shadow-text: 0 0 5px var(--color-shadow);
    --shadow-text-strong: 0 5px 2px var(--color-shadow);
    --shadow-box: 0 0 10px 7px rgba(0, 0, 0, 0.75);
    --shadow-box-medium: 0 0 10px 7px rgba(0, 0, 0, 0.6);

    --transition-fast: all 0.1s ease-in-out;
    --transition-normal: all 0.2s ease-in-out;
    
    /* Patreon glitch effect colors */
    --patreon-glitch-color1: #ff3b30;
    --patreon-glitch-color2: #00a3ff;
}

/* ========================================
   3. BASE & RESET
   ======================================== */
html,
body {
    font-family: var(--font-family-base);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
}

a {
    text-decoration: none;
}

/* ========================================
   4. LAYOUT COMPONENTS
   ======================================== */

/* Background */
.fullscreen-image {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -9999;
}

.fullscreen-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Logo */
.logo {
    margin: 20px auto;
    padding: 0;
    min-width: 400px;
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

.logo #cglogo a img {
    margin: 0;
    padding: 0;
    width: 60%;
}

/* Navigation */
.navcontainer {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-weight: bold;
}

.navmenu {
    margin: 0 auto 20px;
    text-align: center;
    width: fit-content;
}

.navmenu a {
    margin: auto 20px;
    padding: 0;
    color: var(--color-text-light);
    text-shadow: var(--shadow-text);
    filter: drop-shadow(var(--shadow-text));
    text-align: center;
    font-size: 40px;
    transition: var(--transition-fast);
}

.navmenu a:hover {
    color: brown;
    text-shadow: 0 4px var(--color-shadow);
}

/* Active navigation state */
.navmenu a.active {
    color: var(--color-primary);
    text-shadow: 0 4px var(--color-shadow);
}

.navcontainer .social {
    margin: 0 auto;
    padding: 0;
    width: fit-content;
    text-align: center;
}

.navcontainer .social a img {
    image-rendering: crisp-edges;
    margin: 10px;
    width: 40px;
    transition: var(--transition-fast);
}

.navcontainer .social a img:hover {
    filter: invert(38%) sepia(70%) saturate(9000%) hue-rotate(338deg) brightness(65%) contrast(91%);
}

/* Patreon specific styles with glitch effect */
.navmenu a[href*="patreon.com"] {
    position: relative;
    display: inline-block;
    /* Prevent default hover effect for glitch */
    transition: none;
}

/* Patreon glitch effect - using clip-path method */
.navmenu a[href*="patreon.com"]::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--color-text-light);
    z-index: -1;
    /* GPU acceleration hints */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Add chromatic aberration effect for more impact */
    text-shadow: 
        -2px 0 var(--patreon-glitch-color1),
        2px 0 var(--patreon-glitch-color2);
    /* This creates the glitch effect using clip-path */
    animation: patreonGlitch 0.3s infinite;
}

/* Stop ALL animations on hover and apply normal hover effect */
.navmenu a[href*="patreon.com"]:hover {
    color: brown;
    text-shadow: 0 4px var(--color-shadow);
    /* Remove glitch on hover */
    animation: none;
}

/* Hide the ::before element completely on hover */
.navmenu a[href*="patreon.com"]:hover::before {
    display: none;
}

/* Animation keyframes */
@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 5px var(--color-shadow), 0 0 10px var(--color-primary);
    }
    50% {
        text-shadow: 0 0 10px var(--color-shadow), 0 0 20px var(--color-primary);
    }
}

@keyframes patreonGlitch {
    0%, 100% {
        transform: translateX(0) translateY(0);
        clip-path: inset(0 0 0 0);
    }
    10% {
        transform: translateX(-2px) translateY(2px);
        clip-path: inset(33% 0 66% 0);
    }
    20% {
        transform: translateX(2px) translateY(-2px);
        clip-path: inset(66% 0 33% 0);
    }
    30% {
        transform: translateX(-2px) translateY(2px);
        clip-path: inset(33% 0 66% 0);
    }
    40% {
        transform: translateX(2px) translateY(-2px);
        clip-path: inset(50% 0 50% 0);
    }
    50% {
        transform: translateX(0) translateY(0);
        clip-path: inset(0 0 0 0);
    }
    60% {
        transform: translateX(-1px) translateY(1px);
        clip-path: inset(20% 0 80% 0);
    }
    70% {
        transform: translateX(1px) translateY(-1px);
        clip-path: inset(80% 0 20% 0);
    }
    80% {
        transform: translateX(-1px) translateY(1px);
        clip-path: inset(40% 0 60% 0);
    }
    90% {
        transform: translateX(1px) translateY(-1px);
        clip-path: inset(60% 0 40% 0);
    }
    100% {
        transform: translateX(0) translateY(0);
        clip-path: inset(0 0 0 0);
    }
}

@keyframes patreonHoverGlitch {
    0%, 100% {
        text-shadow: none;
    }
    25% {
        text-shadow: 
            -1px 0 var(--patreon-glitch-color1),
            1px 0 var(--patreon-glitch-color2);
    }
    50% {
        text-shadow: 
            1px 0 var(--patreon-glitch-color1),
            -1px 0 var(--patreon-glitch-color2);
    }
    75% {
        text-shadow: 
            -1px -1px var(--patreon-glitch-color1),
            1px 1px var(--patreon-glitch-color2);
    }
}

/* ========================================
   5. CONTENT SECTIONS
   ======================================== */

/* Latest Game */
.latest-game {
    margin: 0 auto;
    padding: 0;
    text-align: center;
    width: 70%;
    max-width: 1600px;
    height: 50%;
    min-height: 520px;
    box-shadow: var(--shadow-box);
}

.latest-game #lastgame {
    display: flex;
    text-align: left;
    width: 100%;
    height: 100%;
}

.cover {
    padding: 0;
    margin: auto;
    height: 100%;
}

.cover img {
    width: auto;
    height: 100%;
}

.lastgame-container {
    margin: 0 1% 1% 1%;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.lastgame-container h2 {
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--color-primary);
    font-size: clamp(24px, 4vw, 50px);
    text-align: left;
    text-shadow: 0 5px var(--color-shadow);
}

.lastgame-container p {
    text-shadow: 0 1px 5px var(--color-shadow);
    filter: drop-shadow(0 1px 5px var(--color-shadow));
    text-align: left;
}

.lastgame-container #lastgame-d1 {
    margin: 0 auto;
    color: var(--color-secondary);
    font-size: 23px;
}

.lastgame-container #lastgame-d2 {
    color: var(--color-text-light);
    font-size: clamp(14px, 1.7vw, 17px);
    max-height: 60%;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

/* Update the lastgame-stores section to properly align buttons */
.lastgame-container #lastgame-stores {
    display: flex;
    justify-content: flex-end;
    margin: 0 auto;
}

.lastgame-container #lastgame-stores a img {
    width: 90%;
    max-width: 350px;
    height: auto;
    transition: var(--transition-fast);
}
.lastgame-container #lastgame-stores a img:hover {
    width: 92%;
    height: auto;
    transition: var(--transition-fast);
}

/* Last Games */
.last-games {
    margin: 40px auto;
    padding: 0;
    text-align: center;
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.last-games h3 {
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    color: var(--color-primary);
    text-shadow: 0 4px var(--color-shadow);
    font-size: 55px;
}

.lastgames-preview {
    flex: 0 1 calc(31% - 10px);
    transition: var(--transition-fast);
    min-width: 280px;
}

.lastgames-preview:hover {
    filter: brightness(130%);
}

.lastgames-preview img {
    width: 100%;
    box-shadow: var(--shadow-box-medium);
}

/* Contact */
.contact {
    margin: 100px 0 0;
    padding: 0;
    color: var(--color-text-light);
    text-align: center;
}

.contact #email {
    display: flex;
    justify-content: center;
}

.contact #email p {
    font-size: 25px;
    margin: 0 10px;
}

.contact p {
    font-size: 30px;
}

.contact #email p span {
    font-weight: bold;
    color: brown;
}

/* Newsletter */
.newsletter {
    margin: 25px auto;
    padding: 20px;
    width: 80%;
    max-width: 1100px;
    text-align: center;
    background-color: var(--color-overlay);
    border: 1px solid rgba(197, 51, 51, 0.5);
    box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.6);
}

.newsletter h3 {
    color: var(--color-primary);
    margin-top: 0;
    font-size: 28px;
    text-shadow: 0 2px 2px var(--color-shadow);
}

.newsletter p {
    color: var(--color-text-light);
    text-shadow: var(--shadow-text);
    margin-bottom: 20px;
    font-size: 18px;
}

.newsletter form {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    gap: 10px;
}

.newsletter input[type="email"] {
    font-family: var(--font-family-base);
    padding: 10px 15px;
    width: 280px;
    border: none;
    outline: none;
    background-color: rgba(45, 45, 45, 0.6);
    color: var(--color-text-light);
    font-size: 20px;
}

.newsletter button {
    font-family: var(--font-family-base);
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-normal);
}

.newsletter button:hover {
    background-color: var(--color-primary-dark);
}

/* Games Page */
.pcgames {
    color: var(--color-text-light);
    font-size: 40px;
    width: 80%;
    margin: 50px auto 0;
    padding: 0;
    text-align: center;
}

.game {
    margin: 10px;
    padding: 0;
    display: inline-block;
}

.game a {
    margin: 0;
    padding: 0;
    height: 100%;
    width: auto;
    transition: var(--transition-fast);
}

.game a:hover {
    filter: brightness(130%);
}

.game p {
    text-align: center;
    margin: 0 0 10px;
    padding: 0;
    font-size: 22px;
    font-weight: bold;
    text-shadow: var(--shadow-text-strong);
}

.game a img {
    margin: 0;
    padding: 0;
    width: 400px;
    box-shadow: var(--shadow-box);
}

/* ========================================
   6. UI ELEMENTS
   ======================================== */

/* Badges and Overlays */
.badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.badge-overlay .badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1;
    display: inline-block;
}

.badge-prototype {
    background-color: #2f9e44; /* Green */
}

.badge-patreon {
    background-color: #e03131; /* Orange-red */
}

/* Messages */
.message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 4px;
    width: auto;
    min-width: 200px;
    max-width: 400px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeInUp 0.3s ease-out;
}

.message.success {
    background-color: rgb(25, 38, 74);
    color: var(--color-text-light);
}

.message.error {
    background-color: rgb(244, 67, 54);
    color: var(--color-text-light);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ========================================
   7. MEDIA QUERIES
   ======================================== */

/* Mobile: Up to 576px */
@media only screen and (max-width: 576px) {
    .latest-game {
        all: revert;
        display: block;
        margin: 0;
        padding: 0;
        width: 100%;
        min-height: auto;
        text-align: center;
        background-image: none !important;
        transition: var(--transition-fast);
    }

    .latest-game:hover {
        filter: brightness(130%);
    }

    .latest-game #lastgame {
        display: block;
        width: 100%;
        height: 100%;
    }

    .latest-game #lastgame a img {
        display: block;
        margin: auto;
        padding: 0;
        width: 98%;
        height: auto;
        box-shadow: var(--shadow-box-medium);
    }

    .lastgame-container {
        display: block !important;
        position: relative;
        margin: 20px auto;
        width: 100%;
    }

    .lastgame-container h2,
    .lastgame-container #lastgame-d1,
    .lastgame-container #lastgame-d2 {
        display: none;
    }

    .lastgame-container #lastgame-stores {
        position: relative;
        margin: 0 auto;
        padding: 10px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    .lastgame-container #lastgame-stores a {
        display: block;
        width: 80%;
        max-width: 350px;
        margin: 0 auto;
    }

    .lastgame-container #lastgame-stores a img {
        width: 100%;
        height: auto;
        margin: 0;
        min-height: 40px;
    }

    .last-games {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
        padding: 0;
        width: 100%;
        gap: 20px;
    }

    .last-games h3 {
        display: none;
    }

    .lastgames-preview {
        width: 98%;
        flex: none;
    }

    .lastgames-preview a img {
        width: 100%;
        height: auto;
        box-shadow: var(--shadow-box-medium);
    }

    .contact {
        font-size: 20px;
    }

    .contact #email {
        display: block;
    }

    .newsletter {
        width: 90%;
        padding: 15px;
    }

    .newsletter h3 {
        font-size: 24px;
    }

    .newsletter p {
        font-size: 16px;
    }

    .newsletter form {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .newsletter input[type="email"] {
        width: 90%;
        margin-bottom: 0;
    }

    .newsletter button {
        width: 95%;
    }
}

/* Tablet: 577px to 768px */
@media only screen and (min-width: 577px) and (max-width: 768px) {
    .newsletter {
        width: 80%;
    }

    .newsletter input[type="email"] {
        width: 60%;
    }
}

/* Tablet: 576px to 769px */
@media only screen and (min-width: 576px) and (max-width: 769px) {
    .latest-game {
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
        text-align: center;
        background-image: none !important;
        box-shadow: revert;
        transition: var(--transition-fast);
    }

    .latest-game #lastgame {
        display: block;
    }

    .latest-game #lastgame a img {
        display: block;
        margin: auto;
        padding: 0;
        width: 95%;
        height: auto;
        min-height: auto;
    }

    .lastgame-container {
        display: block;
        width: 98%;
        margin: auto;
        padding: 0;
    }

    .lastgame-container h2 {
        text-align: center;
        font-size: 40px;
    }

    .lastgame-container #lastgame-d1 {
        width: 95%;
        text-align: justify;
        margin-bottom: 10px;
    }

    .lastgame-container #lastgame-d2 {
        padding: 0;
        width: 95%;
        margin: auto auto 15px;
        text-align: justify;
        font-size: 20px;
        line-clamp: none;
        -webkit-line-clamp: none;
    }

    .lastgame-container #lastgame-stores {
        position: relative;
    }

    .lastgame-container #lastgame-stores a img {
        width: 45%;
        max-width: 250px;
    }

    .contact {
        font-size: 20px;
    }

    .contact #email {
        display: block;
    }

    .contact p {
        width: 95%;
    }
}

/* Medium Tablet: 769px to 1100px */
@media only screen and (min-width: 769px) and (max-width: 1100px) {
    .latest-game {
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
        text-align: center;
        background-image: none !important;
        box-shadow: revert;
        transition: var(--transition-fast);
    }

    .latest-game #lastgame {
        display: block;
    }

    .latest-game #lastgame a img {
        display: block;
        margin: auto;
        padding: 0;
        width: 95%;
        max-width: 900px;
        height: auto;
        min-height: auto;
    }

    .lastgame-container {
        display: block;
        width: 98%;
        margin: auto;
        padding: 0;
    }

    .lastgame-container h2 {
        text-align: center;
        font-size: 4.2em;
    }

    .lastgame-container #lastgame-d1 {
        width: 95%;
        text-align: justify;
        font-size: 2.7em;
        margin-bottom: 10px;
    }

    .lastgame-container #lastgame-d2 {
        padding: 0;
        width: 95%;
        margin: auto auto 20px;
        text-align: justify;
        font-size: 2.4em;
        line-clamp: none;
        -webkit-line-clamp: none;
    }

    .lastgame-container #lastgame-stores {
        position: inherit;
        margin: auto;
        text-align: center;
    }

    .lastgame-container #lastgame-stores a img {
        width: 33.3%;
    }

    .pcgames {
        width: 90%;
    }

    .game p {
        margin: 15px 0;
        font-size: 60px;
    }

    .game a img {
        width: 100%;
    }
}

/* Desktop: 1100px to 1400px */
@media only screen and (min-width: 1100px) and (max-width: 1400px) {
    .latest-game {
        width: 95%;
        max-width: 1200px;
    }

    .lastgame-container {
        display: inline-block;
    }

    .lastgame-container h2 {
        font-size: 31px;
    }

    .lastgame-container #lastgame-d1 {
        font-size: 20px;
    }

    .lastgame-container #lastgame-d2 {
        color: var(--color-text-light);
        font-size: 16px;
        max-height: 60%;
        display: -webkit-box;
        overflow: hidden;
        line-clamp: 10;
        -webkit-line-clamp: 10;
        -webkit-box-orient: vertical;
    }
}

/* Large Desktop: 1400px to 1900px */
@media only screen and (min-width: 1400px) and (max-width: 1900px) {
    .latest-game {
        width: 95%;
        max-width: 1200px;
    }

    .lastgame-container h2 {
        font-size: 34px;
    }

    .lastgame-container #lastgame-d1 {
        font-size: 23px;
    }

    .lastgame-container #lastgame-d2 {
        color: var(--color-text-light);
        font-size: 16px;
        max-height: 60%;
        display: -webkit-box;
        overflow: hidden;
        line-clamp: 10;
        -webkit-line-clamp: 10;
        -webkit-box-orient: vertical;
    }
}

/* Extra Large Desktop: 1900px to 2100px */
@media only screen and (min-width: 1900px) and (max-width: 2100px) {
    .lastgame-container #lastgame-d2 {
        font-size: 15px;
        display: -webkit-box;
        overflow: hidden;
        line-clamp: 11;
        -webkit-line-clamp: 11;
        -webkit-box-orient: vertical;
    }
}