:root {
    --bg-color: #030303;
    --text-primary: #e0e0e0;
    --text-secondary: #8a8a8a;
    --accent: #d4af37;
    --accent-hover: #f3ce56;
    --door-glow: rgba(255, 255, 255, 0.8);
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* Loading Screen */
body.loading {
    overflow: hidden;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 1s ease-in-out;
}

#loading-screen.fade-bg {
    background-color: transparent;
    pointer-events: none;
}

#loader-logo-container {
    transition: transform 1.2s cubic-bezier(0.8, 0, 0.2, 1);
    transform-origin: top left;
    margin-bottom: 0;
}

/* Animate the door in the loader */
.loader-anim-door .door-inner {
    animation: door-open-loader 4s infinite alternate ease-in-out;
}
.loader-anim-door .door-light {
    animation: light-spill-loader 4s infinite alternate ease-in-out;
}

@keyframes door-open-loader {
    0% { transform: rotateY(5deg); }
    100% { transform: rotateY(85deg); }
}

@keyframes light-spill-loader {
    0% { transform: skewX(-50deg) scaleX(0); opacity: 0; }
    100% { transform: skewX(-50deg) scaleX(1.2); opacity: 0.8; }
}

/* Hide real logo while loading */
body.loading #hero-logo-container {
    opacity: 0;
}

/* Content Layout */
.content-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Navigation */
.top-nav {
    position: fixed;
    top: 2rem;
    right: 3rem;
    z-index: 100;
    display: flex;
    gap: 2rem;
}

.top-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    transition: color 0.3s ease;
    position: relative;
}

.top-nav a:hover {
    color: var(--text-primary);
}

.top-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.top-nav a:hover::after {
    width: 100%;
}

/* Fade In Utility */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 2rem;
    padding-left: calc(2rem + 100vw - 100%); /* Offset scrollbar to keep perfectly centered */
}

/* Logo CSS */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    transform: translateZ(0); /* Force hardware acceleration to prevent font shifting */
    will-change: transform;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 4rem;
    letter-spacing: 1.2rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
    margin-right: -1.2rem; /* Compensate for tracking on last letter */
    font-weight: 400;
}

.logo-subtext {
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-right: -0.8rem;
    font-weight: 300;
}

/* CSS door representing the icon */
.logo-door {
    position: relative;
    width: 35px;
    height: 55px;
    border: 2px solid var(--text-primary);
    border-bottom: none;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-end;
    transform-style: preserve-3d;
    perspective: 300px;
}

.door-inner {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--text-primary);
    transform-origin: left;
    transform: rotateY(35deg);
    transition: transform 0.5s ease;
    position: relative;
    z-index: 2;
}

.door-inner::after {
    content: '';
    position: absolute;
    right: 3px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-primary);
}

.logo-door:hover .door-inner {
    transform: rotateY(75deg);
}

.door-light {
    position: absolute;
    top: 100%;
    right: 0;
    width: 35px;
    height: 25px;
    background: linear-gradient(to left, rgba(255,255,255,0.6) 0%, transparent 100%);
    opacity: 0;
    transform-origin: top right;
    transform: skewX(-50deg) scaleX(0);
    filter: blur(3px);
    z-index: 1;
    transition: transform 0.5s ease, opacity 0.5s ease;
    pointer-events: none;
}

.logo-door:hover .door-light {
    opacity: 1;
    transform: skewX(-50deg) scaleX(1);
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    font-weight: 300;
    letter-spacing: 0.05rem;
}

/* Games Section */
.games-section {
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 4rem;
    letter-spacing: 0.1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    position: relative;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background-color: var(--text-secondary);
}

.game-showcase {
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 3rem;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-showcase:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

.game-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

.game-description-long {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.game-description-long p {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 300;
    line-height: 1.8;
}

.game-description-long p:first-child {
    font-size: 1.15rem;
}

/* Choice Buttons */
.game-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.choice-btn {
    display: inline-block;
    text-decoration: none;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transition: left 0.3s ease;
}

.choice-btn:hover::before {
    left: 0;
}

.choice-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

/* About Section */
.about-section {
    min-height: 50vh;
    width: 100%;
    max-width: 800px;
    padding: 2rem 2rem 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.about-content {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.join-btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 2rem;
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.join-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255,255,255,0.1);
}

/* Footer & Socials */
.footer {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.15rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.social-links a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .social-links {
        flex-direction: column;
        gap: 1.5rem;
    }
    .top-nav {
        top: 0;
        right: 0;
        left: 0;
        justify-content: center;
        gap: 1.5rem;
        font-size: 0.8rem;
        background: rgba(3, 3, 3, 0.85);
        padding: 1rem;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    }
    .top-nav.nav-hidden {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }
    .logo-text {
        font-size: 2.5rem;
        letter-spacing: 0.8rem;
        margin-right: -0.8rem;
    }
    .logo-subtext {
        font-size: 0.7rem;
        letter-spacing: 0.5rem;
        margin-right: -0.5rem;
    }
    .logo-door {
        width: 25px;
        height: 40px;
    }
    .games-section {
        padding: 4rem 1.5rem;
    }
    .news-section {
        padding: 4rem 1.5rem 1.5rem;
    }
    .about-section {
        padding: 2rem 1.5rem 4rem;
    }
    .game-showcase {
        padding: 2rem 1.5rem;
    }
    .news-item {
        padding: 2rem 1.5rem;
    }
    .game-actions {
        flex-direction: column;
        width: 100%;
    }
    .choice-btn {
        text-align: center;
        width: 100%;
    }
    .section-title {
        font-size: 2rem;
        margin-bottom: 3rem;
    }
    .hero {
        padding: 1rem;
    }
}

/* News Page CSS */
.news-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem; /* Add top padding to match other sections */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.news-item {
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    position: relative;
}

.news-date {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.15rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.news-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1rem;
}

.news-content {
    color: #b0b0b0;
    font-size: 1rem;
    line-height: 1.8;
}

/* Nav Active State */
.top-nav a.active {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.3);
}
