/* =========================================
   COCKROACH RUNNER — Retro Comic / Vintage Khaki Design System
   Matches the Roach Brand Palette & Vibe of the Game Perfectly
   ========================================= */

:root {
    /* Core Game Palette */
    --bg-primary: #ECE6DC;       /* Vintage Khaki / Cream Sky */
    --bg-secondary: #DFD8CD;     /* Slightly darker khaki for cards/sections */
    --text-charcoal: #2B1E17;    /* Charcoal for contours, silhouettes, and text */
    --accent-orange: #D96B27;    /* Roach Orange accent */
    --accent-green: #1B4314;     /* Roach Green accent */
    --white: #FFFFFF;
    
    /* Font Choices */
    --font-primary: 'Montserrat', sans-serif;
    
    /* Layout Tokens */
    --border-width-bold: 3px;
    --border-width-thin: 2px;
    --radius-game: 12px;
    
    /* Retro Shadows (Solid, Hand-drawn Comic style) */
    --neo-shadow-sm: 3px 3px 0px 0px var(--text-charcoal);
    --neo-shadow-md: 6px 6px 0px 0px var(--text-charcoal);
    --neo-shadow-lg: 10px 10px 0px 0px var(--text-charcoal);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Dark Mode Theme Support (Inverted Vibe matching Game Over style) */
[data-theme="dark"] {
    --bg-primary: #2B1E17;       /* Charcoal Background */
    --bg-secondary: #1C130E;     /* Deep dark brown-charcoal */
    --text-charcoal: #ECE6DC;    /* Cream Text */
    --accent-orange: #D96B27;
    --accent-green: #295F20;
    --white: #1C130E;
    --neo-shadow-sm: 3px 3px 0px 0px #000000;
    --neo-shadow-md: 6px 6px 0px 0px #000000;
    --neo-shadow-lg: 8px 8px 0px 0px #000000;
}

/* ─── BASE RESET ────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-charcoal);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* ─── TYPOGRAPHY ────────────────────── */
h1, h2, h3, h4 {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.1;
    color: var(--text-charcoal);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    -webkit-text-stroke: 1.5px var(--text-charcoal);
    paint-order: stroke fill;
    text-shadow: 4px 4px 0px var(--accent-orange);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

p {
    font-weight: 700;
    color: var(--text-charcoal);
    opacity: 0.9;
}

/* ─── RETRO COMIC CONTAINERS ─────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
    border-bottom: var(--border-width-bold) solid var(--text-charcoal);
}

.section-alt {
    background-color: var(--bg-secondary);
}

/* ─── STICKY HEADER ──────────────────── */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--bg-primary);
    border-bottom: var(--border-width-bold) solid var(--text-charcoal);
    padding: 0.75rem 0;
    transition: padding var(--transition-fast);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 800;
    font-size: 1.4rem;
}

.nav-brand img {
    width: 48px;
    height: 48px;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    box-shadow: var(--neo-shadow-sm);
    background-color: var(--white);
}

.nav-links {
    display: none;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border: var(--border-width-thin) solid transparent;
    border-radius: var(--radius-game);
    transition: all var(--transition-fast);
}

.nav-links a:hover, .nav-links a.active {
    background-color: var(--accent-orange);
    color: #FFFFFF;
    border-color: var(--text-charcoal);
    box-shadow: var(--neo-shadow-sm);
    transform: translate(-2px, -2px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme toggle retro button */
.theme-toggle {
    background-color: var(--bg-secondary);
    border: var(--border-width-thin) solid var(--text-charcoal);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--neo-shadow-sm);
    transition: transform var(--transition-fast);
}

.theme-toggle:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Hamburger menu button */
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background-color: var(--text-charcoal);
    border-radius: 2px;
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
    .hamburger { display: none; }
}

/* Mobile Menu style */
.mobile-menu {
    display: none;
    position: fixed;
    top: 73px;
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    border-bottom: var(--border-width-bold) solid var(--text-charcoal);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    box-shadow: var(--neo-shadow-md);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* ─── HERO SECTION ──────────────────── */
.hero {
    padding-top: 8rem;
    padding-bottom: 5rem;
    text-align: center;
    position: relative;
    border-bottom: var(--border-width-bold) solid var(--text-charcoal);
}

.hero-icon {
    width: 130px;
    height: 130px;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: 24px;
    box-shadow: var(--neo-shadow-md);
    margin-bottom: 1.5rem;
    background-color: var(--white);
    display: inline-block;
}

.hero-tagline {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.hero-desc {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ─── RETRO GAME BUTTONS ─────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    padding: 0.85rem 2rem;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    cursor: pointer;
    box-shadow: var(--neo-shadow-md);
    transition: all var(--transition-fast);
    transform: translate(-3px, -3px);
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--neo-shadow-sm);
}

.btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.btn-orange {
    background-color: var(--accent-orange);
    color: #FFFFFF;
}

.btn-green {
    background-color: var(--accent-green);
    color: #FFFFFF;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-charcoal);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* ─── GRID LAYOUTS & COMIC CARDS ──────── */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-4 {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card {
    background-color: var(--white);
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    padding: 2rem;
    box-shadow: var(--neo-shadow-md);
    transition: all var(--transition-fast);
}

.card:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--neo-shadow-lg);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.card h3 {
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: var(--text-charcoal);
}

.card p {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Character gallery card variations */
.character-card {
    text-align: center;
    border-style: solid;
}

.char-emoji {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.char-title {
    color: var(--accent-orange);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* ─── SCREENSHOTS GALLERY ──────────── */
.screenshots-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-orange) var(--text-charcoal);
}

.screenshot-item {
    flex: 0 0 auto;
    width: 240px;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    overflow: hidden;
    box-shadow: var(--neo-shadow-md);
    background-color: var(--text-charcoal);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── FAQ PAGE ACCORDIONS ────────────── */
.faq-item {
    background-color: var(--white);
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    margin-bottom: 1rem;
    box-shadow: var(--neo-shadow-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-charcoal);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent-orange);
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 250px;
    padding: 0 1.5rem 1.25rem;
    border-top: var(--border-width-thin) dashed var(--text-charcoal);
    padding-top: 1rem;
}

/* ─── COOKIE CONSENT BANNER ────────── */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--bg-primary);
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    padding: 1.5rem;
    box-shadow: var(--neo-shadow-lg);
    z-index: 1000;
    display: none;
}

.cookie-banner.show {
    display: block;
}

.cookie-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .cookie-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.cookie-actions .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

/* ─── POLICY PAGES STYLING ───────────── */
.policy-page {
    padding-top: 8rem;
    padding-bottom: 4rem;
}

.policy-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    padding: 3rem 2rem;
    box-shadow: var(--neo-shadow-md);
}

.policy-content h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 5vw, 3rem);
}

.policy-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-orange);
    display: block;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.policy-content h2 {
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px dashed var(--text-charcoal);
    padding-bottom: 0.25rem;
}

.policy-content h3 {
    font-size: 1.2rem;
    margin-top: 1.25rem;
    color: var(--accent-orange);
}

.policy-content p {
    margin-bottom: 1rem;
}

.policy-content ul, .policy-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.policy-content li {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.policy-highlight {
    background-color: var(--bg-secondary);
    border-left: 5px solid var(--accent-orange);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

/* ─── FOOTER ────────────────────────── */
.footer {
    background-color: var(--bg-secondary);
    border-top: var(--border-width-bold) solid var(--text-charcoal);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.footer-brand img {
    width: 40px;
    height: 40px;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
}

.footer h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    color: var(--text-charcoal);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 700;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-orange);
}

.footer-bottom {
    text-align: center;
    border-top: var(--border-width-thin) dashed var(--text-charcoal);
    padding-top: 2rem;
    font-size: 0.85rem;
}

/* =========================================
   ADVANCED GALLERY & LIGHTBOX MODAL
   ========================================= */
.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-tab {
    background-color: var(--bg-secondary);
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    padding: 0.6rem 1.5rem;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-charcoal);
    cursor: pointer;
    box-shadow: var(--neo-shadow-sm);
    transition: all var(--transition-fast);
}

.gallery-tab:hover {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--text-charcoal);
}

.gallery-tab.active {
    background-color: var(--accent-orange);
    color: #FFFFFF;
    box-shadow: var(--neo-shadow-sm);
    transform: translate(-2px, -2px);
}

.gallery-content {
    display: none;
}

.gallery-content.active {
    display: block;
    animation: galleryFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes galleryFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.screenshot-item.tablet {
    width: 420px; /* Wider container for landscape tablet screenshots */
}

.lightbox-trigger {
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.screenshot-item:hover .lightbox-trigger {
    transform: scale(1.04);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 19, 14, 0.95); /* Deep translucent brown matching theme */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #FFFFFF;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent-orange);
    transform: scale(1.1);
}

.lightbox-box {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border: var(--border-width-bold) solid var(--text-charcoal);
    border-radius: var(--radius-game);
    box-shadow: var(--neo-shadow-lg);
    background-color: #000;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.lightbox-modal.active .lightbox-img {
    transform: scale(1);
}

.lightbox-caption {
    margin-top: 1.5rem;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.1rem;
    max-width: 600px;
}
