:root {
    --bg-color: #F5F5DC;
    --main-black: #1A1A1A;
    --main-red: #8B0000;
    --main-brown: #8B4513;
    --light-gray: #DCDCDC;
    --text-color: #1A1A1A;
    --text-red: #8B0000;
    
    --font-title: 'Ma Shan Zheng', cursive;
    --font-game: 'ZCOOL KuaiLe', cursive;
    --font-body: 'Noto Sans SC', sans-serif;
}

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

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* PC Header */
.pc-header {
    text-align: center;
    padding: 2rem 0;
    background: transparent;
}

.pc-header .logo h1 {
    font-family: var(--font-title);
    font-size: 4rem;
    color: var(--main-black);
    text-shadow: 2px 2px 0px var(--main-red);
    margin: 0;
}

/* Mobile Nav (Hidden on PC) */
.mobile-nav-wrapper {
    display: none;
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--main-brown);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.mobile-logo h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--main-black);
}

.mobile-menu-toggle {
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-scroll-tabs {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 15px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23F5F5DC"/><path d="M0 0 L100 100" stroke="%23DCDCDC" stroke-width="1"/></svg>');
}

.mobile-scroll-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    white-space: nowrap;
    padding: 8px 16px;
    background-color: var(--light-gray);
    color: var(--main-black);
    text-decoration: none;
    border: 1px solid var(--main-brown);
    border-radius: 4px;
    font-family: var(--font-game);
    font-size: 1.1rem;
    position: relative;
    /* Scroll decoration simulation */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.tab-item.active {
    background-color: var(--main-red);
    color: #fff;
    border-color: var(--main-black);
}

/* Main Layout Wrapper */
.main-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

/* PC Sidebar */
.pc-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-right: 2px solid var(--main-brown);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--main-black);
    font-family: var(--font-game);
    font-size: 1.3rem;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='50' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,25 Q100,5 200,25' stroke='%238B4513' fill='none' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center bottom;
    transition: all 0.3s ease;
}

.sidebar-item:hover {
    color: var(--main-red);
    transform: translateX(5px);
}

.sidebar-item .icon {
    margin-right: 10px;
    font-size: 1.5rem;
}

.sidebar-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.sidebar-links a {
    color: var(--main-brown);
    text-decoration: none;
}

/* Content Area */
.content-area {
    flex-grow: 1;
}

/* Categories */
.category {
    margin-bottom: 40px;
}

.category h3 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--main-black);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--main-red);
    display: inline-block;
    padding-bottom: 5px;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on PC */
    gap: 30px;
}

/* Game Card (Scroll Design) */
.game-card {
    background-color: #fff8e1; /* Light parchment */
    border: none;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.game-card::before, .game-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 15px;
    background: var(--main-brown);
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.game-card::before { top: -8px; }
.game-card::after { bottom: -8px; }

.game-card:hover {
    transform: translateY(-5px);
}

.game-card img {
    width: 100%;
    aspect-ratio: 4/3; /* Cover 75% roughly */
    object-fit: cover;
    filter: sepia(0.4) contrast(1.1); /* Ink wash feel */
    border: 2px solid var(--main-black);
    margin-bottom: 15px;
}

.game-info {
    text-align: center;
    width: 100%;
}

.game-info h4 {
    font-family: var(--font-game);
    font-size: 1.5rem;
    color: var(--main-black);
    margin-bottom: 5px;
}

.game-meta {
    font-family: var(--font-title);
    color: var(--main-red);
    font-size: 1.1rem;
    display: flex;
    justify-content: space-around;
    width: 100%;
}

/* Ad Scroll Border */
.ad-scroll-border {
    position: relative;
    padding: 20px;
    background-color: #fff8e1;
    display: inline-block;
    margin: 10px 0;
}

.ad-scroll-border::before, .ad-scroll-border::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    background: var(--main-brown);
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.ad-scroll-border::before { left: -8px; }
.ad-scroll-border::after { right: -8px; }


/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    background-color: var(--main-black);
    color: var(--bg-color);
    margin-top: 50px;
}

.footer a {
    color: var(--light-gray);
    margin: 0 10px;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pc-header, .pc-sidebar {
        display: none;
    }

    .mobile-nav-wrapper {
        display: block;
    }

    .main-wrapper {
        display: block;
        margin-top: 10px;
    }
    
    .games-grid {
        display: flex;
        overflow-x: auto;
        padding-bottom: 20px;
        scroll-snap-type: x mandatory;
        gap: 20px;
    }
    
    .game-card {
        min-width: 80vw;
        scroll-snap-align: center;
        /* Page turning effect simulation */
        transform-origin: left center;
        transition: transform 0.5s ease;
    }
    
    .game-card:active {
        transform: rotateY(-15deg);
    }

    .category {
        overflow: hidden; /* Prevent horizontal scroll on body */
    }
    
    .category h3 {
        margin-left: 20px;
        font-size: 2rem;
    }
    
    /* Ads on mobile */
    .ad-scroll-border {
        display: block;
        width: 90%;
        margin: 10px auto;
    }
    
    /* Ensure ads are centered */
    #adv1, #adv2, #adv3 {
        width: 100%;
    }
}
