/* RESET & BASE STYLES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #0a0a0a; /* Dark Noir: Very dark gray, almost black */
    color: #8c8c8c; /* Dark Noir: Medium gray text */
    font-family: 'VT323', monospace;
    text-align: center;
    line-height: 1.2;
}

.pixel-art {
    image-rendering: pixelated;
}

/* HEADER SECTION */
.site-header {
    padding-top: 50px;
    padding-bottom: 20px;
}

.main-logo {
    max-width: 350px;
    height: auto;
    margin-bottom: 20px;
}

.subtitle {
    color: #555555; /* Darker gray for subtitle */
    font-size: 22px;
    margin-bottom: 30px;
}

.center-sprite-container {
    margin-bottom: 40px;
}

.center-sprite {
    width: 80px; 
    height: auto;
}

/* NAVIGATION */
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.main-nav a {
    color: #999999; /* Light gray links */
    text-decoration: none;
    font-size: 28px;
    text-transform: uppercase;
    transition: color 0.2s, text-shadow 0.2s;
}

.main-nav a:hover {
    color: #ffffff; /* Turns pure white on hover */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); /* Subtle white glow effect */
}

/* SEPARATOR LINE */
.separator {
    border: none;
    border-top: 1px solid #222222; /* Dark gray separator */
    width: 100%;
    margin: 0;
}

/* MAIN CONTENT */
.main-content {
    padding: 40px 20px;
}

.highlight-text {
    color: #cccccc; /* Off-white for emphasis */
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.news-title {
    color: #aaaaaa; /* Lighter gray for titles */
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.video-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive iframe for smaller screens */
.video-container iframe {
    max-width: 100%;
}
/* =========================================
   ABOUT PAGE STYLES
   ========================================= */

.about-section {
    max-width: 700px; /* Prevents the container from stretching too wide */
    margin: 0 auto;
    text-align: left; /* Left-aligned text for better readability */
}

.text-box {
    background-color: #111111; /* Slightly lighter than the main background */
    border: 1px solid #333333; /* Subtle dark border */
    padding: 30px;
    margin-top: 20px;
}

.text-box p {
    margin-bottom: 15px;
    font-size: 22px;
    line-height: 1.4; /* Comfortable spacing between paragraphs */
}

/* --- ACTIVE LINK STYLES --- */
/* Highlights the current active page in the navigation menu */
.active-link {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
/* =========================================
   RAW CREDITS STYLES
   ========================================= */

.raw-credits {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: #cccccc;
    white-space: pre-wrap; /* Makes sure long lines don't break the box */
    line-height: 1.5;
    background: transparent;
    border: none;
    overflow-x: hidden;
}
/* =========================================
   COMIC PAGE STYLES
   ========================================= */

.comic-section {
    max-width: 900px;
    margin: 0 auto;
}

/* Creates the grid for the panels */
.comic-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Creates 2 equal columns */
    gap: 20px; /* Space between panels */
    margin-top: 30px;
    margin-bottom: 40px;
}

/* Individual Panel Styling */
.panel {
    background-color: #ffffff; /* White background just like the reference photo */
    border: 3px solid #000000; /* Black border around the white box */
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* This forces the 3rd panel to span across both columns and center itself */
.centered-panel {
    grid-column: 1 / -1; /* Spans from the first line to the last */
    width: 60%; /* Makes the box slightly narrower so it looks centered */
    margin: 0 auto; /* Centers the box */
}

/* Credits styling at the bottom */
.author-credits {
    margin-top: 50px;
    font-size: 24px;
    text-align: center;
}

.author-credits p {
    margin-bottom: 10px;
}

/* Make it responsive for Mobile Phones (Stacks them 1 by 1) */
@media screen and (max-width: 700px) {
    .comic-panel-grid {
        grid-template-columns: 1fr; /* Forces 1 column on phones */
    }
    .centered-panel {
        width: 100%; /* Resets width on phones */
    }
}
/* =========================================
   INTRO SEQUENCE / STORY STYLES
   ========================================= */

.intro-sequence {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.intro-image-container {
    margin-top: 20px;
    margin-bottom: 40px;
}

.intro-image {
    max-width: 100%;
    height: auto;
    /* Optional: Adds a slight border to match the retro aesthetic */
    border: 2px solid #333333; 
}

.intro-text {
    text-align: left; /* Aligning text to the left just like the game intro */
    font-size: 24px; /* Slightly larger text for readability */
    line-height: 1.6;
    color: #cccccc;
    margin-bottom: 50px;
}

.intro-text p {
    margin-bottom: 10px;
}

.intro-title {
    text-align: center; /* Center the title at the very end */
    color: #ffffff;
    font-weight: bold;
    margin-top: 30px !important;
}
/* =========================================
   CAST PAGE STYLES (GRID LAYOUT)
   ========================================= */

.cast-section {
    max-width: 850px;
    margin: 0 auto;
}

/* Quick Jump Menu Styles */
.quick-jump {
    background-color: #111111;
    border: 1px dashed #444444;
    padding: 15px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-jump p { color: #888888; margin: 0; }
.quick-jump a { color: #cccccc; text-decoration: none; transition: color 0.2s; }
.quick-jump a:hover { color: #ffffff; text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }

/* Category Titles */
.category-title {
    color: #ffffff;
    font-size: 32px;
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
}

/* --- GRID LAYOUT FOR CHARACTERS --- */
.cast-grid {
    display: grid;
    /* Automatically fits as many 150px boxes as possible in a row */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Character Box */
.char-card {
    background-color: #080808;
    border: 2px solid #222222;
    padding: 15px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.char-card:hover {
    border-color: #555555;
}

.char-card img {
    max-width: 100%;
    height: 100px; /* Forces images to have a consistent height */
    object-fit: contain;
    margin-bottom: 10px;
}

.char-name {
    color: #cccccc;
    font-size: 22px;
    margin: 0;
}
/* =========================================
   CAST PAGE MODAL (POP-UP) STYLES
   ========================================= */

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    border-color: #ffffff; 
    background-color: #1a1a1a;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); 
    align-items: center; 
    justify-content: center; 
}

.modal-content {
    background-color: #050505;
    border: 3px solid #ffffff; 
    padding: 30px;
    width: 90%;
    max-width: 750px; /* Made slightly wider to fit everything nicely */
    position: relative;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.close-btn {
    color: #aaaaaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff0000;
}

.modal-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

/* FIX: Forces the left image box to contain the image properly */
.modal-image-box {
    flex-shrink: 0;
    width: 200px; 
    text-align: center;
    border-right: 2px dashed #333333;
    padding-right: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* FIX: Forces the huge image to shrink down to fit the box */
.modal-image-box img {
    width: 100%; 
    max-width: 200px;
    height: auto; 
    object-fit: contain; 
}

.modal-info-box {
    flex-grow: 1;
    text-align: left;
}

.modal-lore {
    color: #cccccc;
    font-size: 24px;
    line-height: 1.5;
    margin-top: 15px;
}

/* Extra image inside the lore description */
.modal-extra-img {
    width: 100%;
    max-width: 200px; 
    max-height: 250px; 
    object-fit: contain; 
    margin-top: 20px;
    margin-left: auto; 
    margin-right: auto; 
     border: none !important; 
    display: none; 
}

/* Responsive adjustment for small screens (Mobile) */
@media screen and (max-width: 650px) {
    .modal-layout {
        flex-direction: column; 
        align-items: center;
    }
    .modal-image-box {
        border-right: none;
        border-bottom: 2px dashed #333333;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    .modal-info-box {
        text-align: center;
    }
}
/* =========================================
   ART GALLERY STYLES
   ========================================= */

.art-section {
    max-width: 900px;
    margin: 0 auto;
}

.art-gallery {
    display: grid;
    /* This creates a responsive grid that fits as many 250px images as possible */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.art-piece {
    background-color: #050505;
    border: 2px solid #222222;
    padding: 10px;
    transition: border-color 0.2s, transform 0.2s;
}

/* Adds a cool hover effect where the image glows and slightly zooms in */
.art-piece:hover {
    border-color: #ffffff;
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.art-piece img {
    width: 100%;
    height: auto;
    display: block; /* Removes weird spacing at the bottom of images */
    border: 1px solid #111111;
}

.art-title {
    color: #cccccc;
    font-size: 22px;
    margin-top: 15px;
    margin-bottom: 5px;
    text-align: center;
}
/* =========================================
   IDEAS / FIREBASE CHAT STYLES
   ========================================= */

.ideas-section {
    max-width: 700px;
    margin: 0 auto;
}

.chatbox-container {
    background-color: #050505;
    border: 3px solid #ffffff;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Chat Messages Display Area */
.chat-messages-area {
    height: 350px;
    overflow-y: auto;
    padding: 20px;
    background-color: #000000;
    text-align: left;
    border-bottom: 2px dashed #333333;
}

/* Scrollbar styling for Webkit browsers */
.chat-messages-area::-webkit-scrollbar {
    width: 8px;
}
.chat-messages-area::-webkit-scrollbar-track {
    background: #111111; 
}
.chat-messages-area::-webkit-scrollbar-thumb {
    background: #555555; 
}

.system-message {
    color: #555555;
    font-style: italic;
    margin-bottom: 15px;
}

.single-message {
    margin-bottom: 10px;
    font-size: 24px;
    word-wrap: break-word;
}

.chat-user {
    color: #ff8c00; /* Distinct color for usernames */
    font-weight: bold;
    margin-right: 5px;
}

.chat-text {
    color: #cccccc;
}

/* Input Area */
.chat-input-area {
    display: flex;
    padding: 10px;
    background-color: #111111;
    gap: 10px;
}

/* Inputs and Buttons */
.chat-input-name, .chat-input-msg, .chat-send-btn {
    font-family: 'VT323', monospace;
    font-size: 22px;
    background-color: #000000;
    border: 1px solid #444444;
    color: #ffffff;
    padding: 5px 10px;
}

.chat-input-name:focus, .chat-input-msg:focus {
    outline: none;
    border-color: #ffffff;
}

.chat-input-name {
    width: 120px;
}

.chat-input-msg {
    flex-grow: 1;
}

.chat-send-btn {
    cursor: pointer;
    background-color: #222222;
    transition: background-color 0.2s, color 0.2s;
}

.chat-send-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

/* Responsive fix for phones */
@media screen and (max-width: 600px) {
    .chat-input-area {
        flex-direction: column;
    }
    .chat-input-name {
        width: 100%;
    }
}
