@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Nosifer&display=swap');

/* Global Reset & Base Styles */
:root {
    --blood-red: #8a0303;
    --dark-blood: #4a0404;
    --deep-purple: #1a0525;
    --ink-black: #020202;
    --silver-grey: #c0c0c0;
    --fog-color: rgba(100, 0, 0, 0.1);
    --card-bg: #0a0a0a;
    --text-color: #e0e0e0;
    --font-main: 'Cinzel', serif;
    --font-horror: 'Nosifer', cursive;
}

html {
    overflow-x: hidden;
    width: 100%;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--ink-black);
    color: var(--text-color);
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    padding-top: 120px; /* Increased to ensure navbar doesn't cover content */
    /* Gothic Background: Dark with subtle red/purple noise */
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(74, 4, 4, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(26, 5, 37, 0.2) 0%, transparent 50%),
        repeating-linear-gradient(transparent, transparent 2px, rgba(0, 0, 0, 0.3) 2px, rgba(0, 0, 0, 0.3) 4px);
    background-attachment: fixed;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Navbar - Gothic Style */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 2, 2, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 2px solid var(--dark-blood);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
}

/* Thorns/Skull Border Effect (Simulated with pseudo-elements) */
.navbar::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        var(--dark-blood) 10px,
        var(--dark-blood) 12px
    );
    opacity: 0.7;
    pointer-events: none;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: var(--font-horror);
    font-size: 1.8rem;
    color: var(--blood-red);
    text-transform: uppercase;
    text-shadow: 
        2px 2px 0px #000,
        0 0 10px var(--dark-blood);
    letter-spacing: 2px;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--silver-grey);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: 0.4s;
}

.nav-links a:hover {
    color: var(--blood-red);
    text-shadow: 0 0 10px var(--blood-red), 0 0 20px var(--blood-red);
}

/* Hover "Blood Glimmer" Effect */
.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background: var(--blood-red);
    box-shadow: 0 0 8px var(--blood-red);
    transition: 0.3s;
}

.nav-links a:hover::before {
    width: 100%;
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--silver-grey);
    transition: all 0.3s ease;
}

/* Hero Section - Blood Gradient + Fog */
.hero {
    position: relative;
    padding: 8rem 0 6rem;
    text-align: center;
    overflow: hidden;
    margin: 0 0 4rem;
    background: linear-gradient(to bottom, #000 0%, var(--deep-purple) 100%);
    border-bottom: 3px solid var(--dark-blood);
}

/* Fog Animation */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.4"/%3E%3C/svg%3E');
    background-size: 50% 100%;
    opacity: 0.3;
    animation: fogMove 30s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes fogMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.hero h2 {
    font-family: var(--font-horror);
    font-size: 4rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: var(--blood-red);
    position: relative;
    z-index: 2;
    text-shadow: 3px 3px 0 #000, 0 0 20px var(--dark-blood);
    /* Corrosion Texture Effect */
    background: linear-gradient(to bottom, var(--blood-red) 40%, #300 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; 
    /* Fallback for text-fill-color if needed, but text-shadow usually conflicts with it. 
       Let's use simple color with shadow for better compatibility or just the gradient. */
    -webkit-text-fill-color: var(--blood-red); 
}

.hero p {
    font-size: 1.3rem;
    color: #ccc;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px #000;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem;
    border: 1px solid var(--dark-blood);
    box-shadow: 0 0 15px rgba(138, 3, 3, 0.3);
}

/* Categories & Titles */
.article-categories {
    margin: 4rem 0;
}

.category {
    margin-bottom: 5rem;
}

.category h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--silver-grey);
    text-transform: uppercase;
    border-bottom: 2px solid var(--blood-red);
    display: inline-block;
    padding-right: 2rem;
    text-shadow: 2px 2px 0 #000;
}

/* 
   3D Card Grid Layout 
   PC: 3 Columns
*/
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 20px;
    perspective: 1000px; /* Essential for 3D effect */
}

/* Game Card Styles - 3D & Gothic */
.game-card {
    position: relative;
    height: 400px;
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 2px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Keep content inside */
    transition: transform 0.1s ease-out, box-shadow 0.3s ease, z-index 0s; /* Fast transform for mouse move */
    transform-style: preserve-3d;
    
    /* 3D Thickness Simulation */
    box-shadow: 
        0 0 0 1px #000, /* Edge definition */
        5px 5px 15px rgba(0,0,0,0.5); /* Base shadow */
}

/* 3D Thickness Pseudo-elements (visual hack) */
.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 2;
}

/* Hover/Active State */
.game-card:hover {
    z-index: 10; /* Pop to front */
    box-shadow: 
        0 0 20px var(--blood-red),
        0 0 50px rgba(138, 3, 3, 0.3);
    border-color: var(--blood-red);
}

/* Gothic Corner Accents */
.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid transparent;
    transition: 0.3s;
    z-index: 3;
    pointer-events: none;
    /* Corner patterns */
    background: 
        linear-gradient(135deg, var(--blood-red) 5px, transparent 5px) top left,
        linear-gradient(225deg, var(--blood-red) 5px, transparent 5px) top right,
        linear-gradient(315deg, var(--blood-red) 5px, transparent 5px) bottom right,
        linear-gradient(45deg, var(--blood-red) 5px, transparent 5px) bottom left;
    background-size: 10px 10px;
    background-repeat: no-repeat;
    opacity: 0.5;
}

.game-card:hover::before {
    opacity: 1;
    background-size: 20px 20px; /* Expand corners */
}

.card-img-wrapper {
    height: 250px;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    filter: grayscale(80%) contrast(1.2); /* Gothic gloom */
}

.game-card:hover img {
    transform: scale(1.1);
    filter: grayscale(0%) contrast(1.1); /* Reveal color */
}

.game-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    background: linear-gradient(to bottom, #111, #050505);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    transform: translateZ(20px); /* Push text forward in 3D */
}

.game-card h4 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-scanline {
    /* Reused as "Blood Trail" */
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
    margin-top: auto;
    opacity: 0.5;
    box-shadow: 0 0 5px var(--blood-red);
}

/* Footer */
.footer {
    background: #020202;
    border-top: 3px solid var(--dark-blood);
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-links a {
    color: #888;
    margin: 0 10px;
    text-decoration: none;
    transition: 0.3s;
    font-family: var(--font-main);
}

.footer-links a:hover {
    color: var(--blood-red);
    text-shadow: 0 0 5px var(--blood-red);
}

/* =========================================
   Ad Boxes - DO NOT TOUCH styles generally
   But ensure they fit in container
   ========================================= */
#adv1, #adv2, #adv3 {
    /* Keep existing inline styles or ensure they don't break */
    margin: 20px auto;
    max-width: 100%;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr); /* Tablet */
    }
}

@media (max-width: 768px) {
    /* Mobile: 2 Columns Grid */
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 10px;
        perspective: none; /* Disable deep perspective for performance */
    }

    .game-card {
        height: 280px; /* Smaller cards on mobile */
        /* Retain 3D thickness visually but simplify transform */
        transform: none !important; /* Disable JS tilt on mobile to prevent jank */
        transition: transform 0.3s ease;
    }
    
    .game-card:active {
         /* Touch: Slight float up + glow */
        transform: translateY(-5px) !important;
        box-shadow: 0 0 15px var(--blood-red);
    }

    .card-img-wrapper {
        height: 160px;
    }
    
    .game-card-content {
        padding: 1rem;
    }
    
    .game-card h4 {
        font-size: 0.9rem;
    }

    .navbar .container {
        padding: 0 1rem;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        height: calc(100vh - 60px);
        width: 70%;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.4s;
        border-left: 2px solid var(--dark-blood);
    }

    .nav-links.active {
        right: 0;
    }
    
    /* Mobile Detail Page Adjustments */
    .game-detail {
        margin: 1.5rem 0;
        padding: 1rem;
    }

    .game-detail-info h2 {
        font-size: 1.8rem;
        text-align: center;
    }

    .game-detail-info p {
        padding: 0.5rem 0;
        font-size: 1rem;
        text-align: left; /* Better readability on mobile */
        line-height: 1.6;
    }

    .game-detail-image {
        margin: 1rem auto;
        width: 100%;
    }

    .game-detail-image img {
        width: 100%;
        height: auto;
        border-radius: 4px;
    }
    
    .auxiliary-page {
        padding: 1rem;
        margin: 1.5rem 0;
    }
}

/* Detail Page & Auxiliary Pages Restyling */
.game-detail, .auxiliary-page {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--dark-blood);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.game-detail h2, .auxiliary-page h2 {
    color: var(--blood-red);
    text-shadow: 0 0 5px var(--dark-blood);
}

.play-button {
    background: linear-gradient(45deg, var(--dark-blood), #000);
    border: 1px solid var(--blood-red);
    color: #fff;
    /* Gothic clip-path */
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

.play-button:hover {
    background: var(--blood-red);
    box-shadow: 0 0 20px var(--blood-red);
}

.contact-form input, .contact-form textarea {
    background: #000;
    border: 1px solid #333;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--blood-red);
    box-shadow: 0 0 10px rgba(138, 3, 3, 0.3);
}

.submit-button {
    border-color: var(--blood-red);
    color: var(--blood-red);
}

.submit-button:hover {
    background: var(--blood-red);
    color: #fff;
}
