@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Orbitron:wght@400;700&display=swap');

/* General Body and Page Styles */
body {
    background-color: #1a1f26; /* Dark blue-grey background */
    color: #e0e0e0; /* Light grey text */
    font-family: 'Orbitron', sans-serif; /* Thematic sci-fi font */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers .header and .main-content if they don't have width: 100% */
    min-height: 100vh;
    font-size: 16px; /* Base font size */
}

.main-content {
    flex-grow: 1;
    width: 95%; /* Use percentage for better responsiveness */
    max-width: 1200px; /* Max width for main content area */
    margin: 0 auto; /* auto for horizontal centering, 0 top/bottom here as header has margin-bottom */
    padding: 0 10px; /* Minimal padding for smaller screens, content inside can have more */
    box-sizing: border-box;
}

/* Links */
a {
    color: #00ffff; /* Cyan links */
    text-decoration: none;
}

a:hover {
    color: #ff00ff; /* Magenta on hover */
    text-decoration: underline;
}

/* --- Header Styles --- */
header {
    background-color: #0d1014;
    padding: 10px 0;
    width: 100%;
    border-bottom: 4px solid #00ffff; /* Cyan border */
    margin-bottom: 20px;
    display: flex;
    justify-content: center; /* Center .header-content within the full-width header */
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

.header-content {
    display: flex;
    //justify-content: space-between; /* Pushes logo/title left and nav right on pages with nav */
    align-items: center;
    width: 95%;
    max-width: 1200px;
}

.logo-and-title { /* Used on index.html, blog.html */
    display: flex;
    align-items: center; /* Vertically centers the logo and title */
    text-decoration: none; /* If wrapped in <a> */
}

.section-title {
    text-align: center;
    color: #00ffff; /* Or #ff00ff, or another thematic color */
    font-family: 'Press Start 2P', cursive; /* Or 'Orbitron' if you prefer */
    margin-top: 30px;    /* Adjust as needed */
    margin-bottom: 20px; /* Adjust as needed */
    font-size: 1.5em;     /* Adjust as needed */
    /* text-shadow: 1px 1px #ff00ff; /* Optional shadow */
}

.header-logo {
    height: 45px;
    width: auto;
    margin-right: 15px;
    vertical-align: middle; 
    flex-shrink: 0;
}

.site-title { /* Applies to general site title and game page title via id sharing class */
    font-family: 'Press Start 2P', cursive;
    font-size: 2em;
    color: #00ffff;
    text-shadow: 2px 2px #ff00ff, 4px 4px #000000;
    margin: 0;
    line-height: 1; /* Keeps bounding box tight */
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    margin-left: auto; /* This pushes the nav to the far right */
}

.header-nav .nav-link {
    font-family: 'Press Start 2P', cursive;
    color: #00ffff;
    text-decoration: none;
    font-size: 0.8em; 
    margin-left: 25px; 
    text-shadow: 1px 1px #ff00ff;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}
.header-nav .nav-link:first-child { 
   // margin-left: 0;
}


.header-nav .active-nav-link, 
.header-nav .nav-link:hover {
    color: #ff00ff;
    text-shadow: 1px 1px #00ffff; 
}

.glitch-link-animated { 
    animation: alternateColors 2s infinite;
}

@keyframes alternateColors {
    0%, 25% { color: #ff00ff; text-shadow: 1px 1px #00ffff; }
    50%, 75% { color: #00ffff; text-shadow: 1px 1px #ff00ff; }
    100% { color: #ff00ff; text-shadow: 1px 1px #00ffff; }
}

/* === Styles for game_page.html header centering === */
body.game-page-body .header-content {
    justify-content: center; 
}

.game-page-logo-title-container {
    display: flex;
    align-items: center; 
    text-decoration: none; 
}


/* --- Footer Styles --- */
footer {
    text-align: center;
    padding: 15px;
    margin-top: auto;
    width: 100%;
    background-color: #0d1014;
    border-top: 2px solid #007777;
    font-size: 0.75em;
    box-sizing: border-box;
    color: #e0e0e0;
}
footer p {
    margin: 5px 0; 
}
.footer-privacy-link {
    color: #ff00ff;
    text-decoration: underline;
    font-weight: bold;
}
.footer-privacy-link:hover {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}


/* ===== STORYLINE STYLES (index.html) ===== */
.storyline-container {
    background-color: #2a3038;
    border: 3px solid #007777;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 25px; 
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    color: #c0c0c0; 
    text-align: left; 
}
.storyline-alert {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2em;
    color: #FF0000;
    text-align: center;
    text-decoration: underline;
    margin-bottom: 1.5em;
    font-weight: bold;
    animation: pulse-red 1.5s infinite; 
}
@keyframes pulse-red { 
    0% { text-shadow: 0 0 5px #ff0000; }
    50% { text-shadow: 0 0 15px #ff0000, 0 0 20px #ff0000; }
    100% { text-shadow: 0 0 5px #ff0000; }
}
.storyline-container p {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95em;
    line-height: 1.6;
    color: #e0e0e0;
    margin: 0;
    text-align: justify;
}
.storyline-container p strong {
    color: #00ffff;
    font-weight: 700;
}

/* ===== GAME GRID STYLES (index.html) ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px;
    padding: 10px;
}

.game-thumbnail { 
    background-color: #2a3038;
    border: 3px solid #007777;
    border-radius: 8px;
    text-align: center;
    padding: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-thumbnail:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 10px rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

.game-thumbnail img { 
    width: 100%;       
    max-width: 100%;   
    height: auto;      
    display: block;    
    border: 2px solid #004444;
    border-radius: 4px;
    margin-bottom: 10px; 
}

.game-thumbnail h3 {
    margin: 0; 
    font-size: 11px; /* Adjusted from 1em, can be 10px, 11px, 12px etc. */
    color: #00ffff;
    font-family: 'Press Start 2P', cursive;
    font-weight: normal; /* Added to ensure not additionally bolded */
    word-spacing: -2px; /* Added: try values like -1px, -2px or -0.05em, -0.1em */
    white-space: normal;  
    overflow: visible;    
    text-overflow: unset; 
    line-height: 1.2;     
}

/* ===== GAME PAGE SPECIFIC STYLES (game_page.html) ===== */
body.game-page-body { 
    justify-content: flex-start; 
}

.game-page-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between; 
    align-items: flex-start;
    width: 95%;
    max-width: 1400px;
    margin: 10px auto; 
    gap: 15px; 
}

.game-suggestion {
    width: 20%;
    min-width: 150px;
    background-color: #2a3038; 
    padding: 10px;
    border: 2px solid #007777; 
    border-radius: 8px; 
    text-align: center;
    flex-shrink: 0;
}

.game-suggestion h4 {
    color: #00ffff; 
    margin-top: 0;
    font-size: 0.8em;
    font-family: 'Press Start 2P', cursive;
    border-bottom: 1px solid #007777; 
    padding-bottom: 5px; 
    margin-bottom: 10px; 
}

.game-suggestion a { 
    display: block;
    margin: 5px 0;
    text-decoration: none;
}

.game-suggestion img { 
    width: 100%;
    max-width: 100%; 
    height: auto;
    border-radius: 4px; 
    border: 1px solid #004444;
    transition: transform 0.2s ease;
    margin-bottom: 5px; 
    object-fit: cover; 
}

.game-suggestion img:hover {
    transform: scale(1.03);
}

.game-suggestion p {
    font-size: 0.8em;
    line-height: 1.4; 
    color: #e0e0e0; 
    margin: 0;
    font-family: 'Orbitron', sans-serif; 
    text-align: center; 
}
.game-suggestion a:hover p { 
    color: #00ffff;
}
.dynamic-suggestion-item { 
    margin-bottom: 15px; 
}
.dynamic-suggestion-item a { 
    display: block; 
    text-decoration: none;
    color: #e0e0e0; 
    text-align: center; 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    padding: 5px; 
    border-radius: 4px; 
}
.dynamic-suggestion-item a:hover { 
    transform: scale(1.02);
    background-color: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}


.game-main-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    max-width: 800px; 
}

.game-embed-container {
    width: 100%;
    max-width: 800px;
    height: 610px;
    margin-bottom: 15px; 
    border: 5px solid #00ffff;
    border-radius: 10px; 
    background-color: #000;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    margin-left: auto;
    margin-right: auto;
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.game-embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-instructions {
    background-color: #2a3038; 
    padding: 15px;
    border: 2px solid #007777; 
    border-radius: 8px; 
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px; 
    color: #c0c0c0; 
}

.game-instructions h2 {
    color: #00ffff;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2em;
    text-align: center; 
    margin-top: 0;
    margin-bottom: 15px; 
    border-bottom: 1px dashed #007777; 
    padding-bottom: 5px; 
}

.game-instructions p {
    line-height: 1.5;
    font-size: 0.9em;
    margin: 0;
}
.game-instructions p > span,
.game-instructions p > strong {
    margin-bottom: 1em;
    display: block;
}
.game-story-text { color: #FF00FF; font-style: italic; }
.game-description-text { color: #98FB98; }
.how-to-play-heading { color: #00ffff; font-family: 'Press Start 2P', cursive; font-size: 1em; margin-bottom: 0.3em; font-weight: bold; }
.how-to-play-content { white-space: pre-line; margin-bottom: 0 !important; line-height: 1.6; }


.back-to-home {
    display: inline-block;
    margin-top: 20px; 
    margin-bottom: 20px;
    padding: 8px 16px; 
    background-color: #00ffff;
    color: #0d1014;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7em; 
    border: 2px solid #007777;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}
.back-to-home:hover {
    background-color: #ff00ff;
    color: #fff;
    border-color: #c000c0;
}

/* --- Blog/Grid Logs Listing Page (blog.html) Styles --- */
/* (Assuming these styles are generally fine, not directly related to current font/header centering query) */
.log-listing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 0;
    margin-top: 30px;
}
.log-card {
    background-color: #1f242d;
    border: 2px solid #007777;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.log-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.3);
    border-color: #00ffff;
}
.log-card-thumbnail { /* This is the container for the image */
    width: 100%;
    height: 180px; /* Fixed height for consistent card appearance */
    overflow: hidden; /* Hide parts of image that don't fit */
    border-bottom: 2px solid #007777;
    background-color: #000; /* Fallback if image fails */
}
.log-card-thumbnail img { /* The actual image */
    width: 100%;
    height: 100%;
    display: block; /* Removes extra space below image */
    object-fit: cover; /* Scales image to maintain aspect ratio while filling container, cropping if necessary */
}
.log-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.log-card-content h3 {
    font-family: 'Press Start 2P', cursive;
    color: #ff00ff;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
}
.log-card-content h3 a { text-decoration: none; color: inherit; }
.log-card-content h3 a:hover { text-decoration: underline; }
.log-card-meta {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75em;
    color: #777f8d;
    margin-bottom: 10px;
}
.log-card-meta .log-date { color: #00ffff; }
.log-card-meta .log-source { color: #ffab00; }
.log-card-excerpt {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
    color: #c0c0c0;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 15px;
    /* For multi-line ellipsis (works in WebKit/Blink browsers) */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-more-link {
    font-family: 'Press Start 2P', cursive;
    color: #00ffff;
    text-decoration: none;
    font-size: 0.8em;
    align-self: flex-start;
    padding: 8px 12px;
    border: 1px solid #007777;
    border-radius: 4px;
    display: inline-block;
    margin-top: auto;
}
.read-more-link:hover {
    background-color: #00ffff;
    color: #0d1014;
    border-color: #00ffff;
}

/* --- Individual Log Page Styles (logs/log-###.html) --- */
.log-entry-full {
    background-color: #1f242d;
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}
.log-entry-full h1.log-title {
    font-family: 'Press Start 2P', cursive;
    color: #ff00ff;
    font-size: 1.8em;
    margin-top: 0;
    border-bottom: 1px dashed #007777;
    padding-bottom: 10px;
    text-align: center;
}
.log-entry-full .log-meta {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
    color: #777f8d;
    margin-bottom: 20px;
    text-align: center;
}
.log-entry-full .log-meta .log-date { color: #00ffff; }
.log-entry-full .log-meta .log-source { color: #ffab00; }
.log-entry-full p {
    line-height: 1.8;
    color: #e0e0e0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05em;
    margin-bottom: 1em;
}
.log-entry-full strong { color: #ffff00; }
.log-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-family: 'Press Start 2P', cursive;
}
.log-navigation a, .log-navigation span.disabled-link {
    color: #00ffff;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid #007777;
    border-radius: 5px;
}
.log-navigation a:hover {
    background-color: #00ffff;
    color: #0d1014;
}
.log-navigation span.disabled-link {
    color: #4a5568;
    border-color: #2d3748;
    cursor: not-allowed;
}
.back-to-logs-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-family: 'Press Start 2P', cursive;
    color: #00ffff;
    text-decoration: none;
    padding: 10px;
    border: 1px solid #00ffff;
    border-radius: 5px;
    background-color: rgba(0, 255, 255, 0.1);
}
.back-to-logs-link:hover {
    background-color: #00ffff;
    color: #0d1014;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    .logo-and-title { 
        margin-bottom: 10px;
    }
    body.game-page-body .header-content .game-page-logo-title-container {
        margin-bottom: 10px; 
    }
    .header-nav {
        margin-left: 0;
        justify-content: center;
        width:100%;
    }
    .header-nav .nav-link {
        margin: 0 10px; 
        font-size: 0.7em; 
    }
    .site-title { font-size: 1.8em; } 
    .header-logo { height: 40px; }

    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .game-page-container { flex-direction: column; align-items: center; width: 100%; padding: 0 5px; box-sizing: border-box;}
    .game-suggestion { width: 90%; max-width: 350px; margin-bottom: 20px; }
    .game-embed-container { max-width: 100%; height: 550px; max-height: 75vh; }
    .game-instructions { max-width: 100%; }

    .storyline-container { max-width: 95%; padding: 15px; }
    .storyline-alert { font-size: 1.1em; }
    .storyline-container p { font-size: 0.9em; }

    .log-listing-container { 
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.5em; }
    .header-logo { height: 35px; margin-right: 10px;}

     .header-nav .nav-link {
        font-size: 0.65em; 
        margin: 0 8px; 
    }

    .game-grid { grid-template-columns: 1fr; gap: 15px; }
    .game-thumbnail { padding: 15px; }
    .game-thumbnail img { height: 100px; } /* Or adjust as needed */
    .game-thumbnail h3 { font-size: 10px; /* Adjust if 11px is too big here */ word-spacing: -1px; /* May need less reduction at smaller font size */ }


    .game-embed-container { height: 500px; max-height: 70vh; }
    .game-suggestion { max-width: 95%; }


    .storyline-container { padding: 15px 10px; }
    .storyline-alert { font-size: 1.0em; }
    .storyline-container p { font-size: 0.85em; text-align: left; }

    .log-card-content h3 { font-size: 1em; }
    .log-card-excerpt { font-size: 0.85em; }
    .read-more-link { font-size: 0.75em; }
    .log-entry-full h1.log-title { font-size: 1.5em; }
    .log-entry-full p { font-size: 1em; }
}