/* Global Reset */
:root {
    /* Color Palette - Story/Book Style */
    --bg-color: #2C3E50; /* Dark Blue Grey */
    --paper-color: #F5F5DC; /* Beige/Parchment */
    --text-primary: #2C3E50; /* Dark ink color for text on paper */
    --text-on-dark: #F5F5DC; /* Light text on dark backgrounds */
    --accent-gold: #C0392B; /* Deep Red/Gold for drop caps/accents */
    --border-color: #8E44AD; /* Purple/Gold mix or just Dark Grey */
    --ornament-color: #D35400;
    
    /* Typography */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Merriweather', serif;
    
    /* Layout */
    --container-width: 1000px;
    --header-height: 100px;
    --radius: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-on-dark);
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2334495e' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 30px;
}

/* Header */
.site-header {
    height: var(--header-height);
    background: #2C3E50;
    border-bottom: 3px double var(--paper-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--paper-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px #000;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-item {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #BDC3C7;
    position: relative;
    text-transform: uppercase;
}

.nav-item:hover, .nav-item.active {
    color: var(--paper-color);
}

.nav-item.active::before,
.nav-item.active::after {
    content: '•';
    margin: 0 5px;
    color: var(--ornament-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px auto;
    background-color: var(--paper-color);
    transition: all 0.3s ease;
}

/* Ad Container - Parchment Style */
.ad-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
    padding: 1.5rem;
    background: var(--paper-color);
    border: 1px solid #000;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5);
    position: relative;
}

.ad-container::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid #8E44AD;
    pointer-events: none;
}

.ad-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table of Contents / Tags */
.toc-wrapper {
    background: var(--paper-color);
    color: var(--text-primary);
    padding: 2rem;
    margin: 2rem 0 4rem 0;
    border-radius: 2px;
    text-align: center;
    border: 1px solid #000;
}

.toc-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--text-primary);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.tag-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag-btn {
    background: transparent;
    border: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s;
}

.tag-btn:hover {
    color: var(--ornament-color);
}

.tag-btn.active {
    font-weight: 900;
    text-decoration: underline;
    color: var(--ornament-color);
}

/* Chapter Divider */
.chapter-divider {
    text-align: center;
    margin: 4rem 0 2rem 0;
    color: var(--paper-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.chapter-divider span {
    font-size: 1.5rem;
    color: var(--ornament-color);
}

.block-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ornament-color);
}

/* Book Grid */
.games-grid.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem;
}

.game-card {
    background: transparent;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    aspect-ratio: 2/3; /* Portrait book ratio */
    overflow: hidden;
    position: relative;
    border: 4px solid var(--paper-color);
    box-shadow: 5px 5px 10px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(30%);
    transition: filter 0.3s;
}

.game-card:hover .card-image img {
    filter: sepia(0%);
}

.card-content {
    text-align: center;
}

.card-content h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--paper-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-content p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-style: italic;
    color: #BDC3C7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Detail Page - Chapter Style */
.breadcrumb {
    padding: 2rem 0;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: #BDC3C7;
    text-align: center;
}

.breadcrumb .ornament {
    color: var(--ornament-color);
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.chapter-card {
    background: var(--paper-color);
    color: var(--text-primary);
    padding: 4rem;
    max-width: 800px;
    margin: 0 auto 4rem auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
}

/* Book spine effect on left */
.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: rgba(0,0,0,0.1);
    border-right: 1px solid rgba(0,0,0,0.1);
}

.chapter-header {
    text-align: center;
    margin-bottom: 3rem;
}

.chapter-num {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #7F8C8D;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.chapter-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.chapter-line {
    width: 100px;
    height: 2px;
    background: var(--text-primary);
    margin: 0 auto;
}

.chapter-body {
    display: block;
}

.chapter-media {
    margin-bottom: 2rem;
    position: relative;
    padding: 10px;
    border: 1px solid #000;
}

.frame-ornament {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--ornament-color);
    pointer-events: none;
}

.chapter-media img {
    width: 100%;
    display: block;
    filter: sepia(20%);
}

.chapter-text {
    font-size: 1.1rem;
    text-align: justify;
}

.drop-cap-wrapper p::first-letter {
    float: left;
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 0.8;
    padding-top: 4px;
    padding-right: 8px;
    padding-left: 3px;
    color: var(--accent-gold);
}

.chapter-footer {
    margin-top: 4rem;
    border-top: 1px solid #000;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.btn-scroll {
    text-decoration: underline;
    font-weight: 700;
}

.related-section {
    margin: 4rem 0;
}

.section-head {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--paper-color);
    margin-bottom: 0.5rem;
}

.section-line {
    width: 50px;
    height: 1px;
    background: var(--ornament-color);
    margin: 0 auto;
}

/* Footer */
.footer {
    background: #1A252F;
    border-top: 3px double var(--paper-color);
    padding: 4rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-brand h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--paper-color);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: #95A5A6;
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    font-family: var(--font-heading);
    color: #BDC3C7;
    font-size: 1rem;
}

.footer-links a:hover {
    color: var(--paper-color);
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .chapter-card {
        padding: 2rem;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: #2C3E50;
        flex-direction: column;
        padding: 2rem;
        border-bottom: 3px double var(--paper-color);
        gap: 1.5rem;
        text-align: center;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: block;
    }
    
    .toc-wrapper {
        padding: 1.5rem;
    }
    
    .tag-nav {
        gap: 0.5rem;
    }
    
    .chapter-header h1 {
        font-size: 2rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}


/* Added by full_site_update.py */
.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Adaptive Colors with Fallbacks */
    background: var(--surface-color, rgba(0, 0, 0, 0.8));
    color: var(--accent-color, #ffffff);
    border: 1px solid var(--accent-color, #ffffff);
    font-family: var(--font-heading, sans-serif);
    
    /* Modern Styling */
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Effects */
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px var(--accent-dim, rgba(255, 255, 255, 0.1));
}

.game-card:hover .play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.game-card:hover .card-image img {
    opacity: 1;
    filter: brightness(0.7) blur(2px);
    transform: scale(1.05);
}
