/* ==============================================
Global Stylesheet for Pavinku's Arcade
============================================== */

.arcade-title {
    text-align: center;
    font-family: 'Press Start 2P', monospace, sans-serif;
    color: #fff;
    text-shadow: 4px 4px 0px #333;
    margin-bottom: 30px;
    letter-spacing: 0px;
    line-height: 1.4; /* Better spacing for wrapped text */
    width: 100%;
    padding: 0 10px; /* Prevent text touching edges */
}

/* Intro Text Block */
.intro-text {
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
    line-height: 1.6;
    color: #bbb; /* Softer white for readability */
    font-size: 0.95em;
    padding: 0 20px;
}

/* Search Panel - Adapted to Dark Mode */
.arcade-panel {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    background: #1e1e1e;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.arcade-panel form {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    flex-grow: 1; /* Forces search box to fill remaining space */
    min-width: 0; /* Allows flex item to shrink below content size if needed */
}

.search-box input {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #2a2a2a;
    color: white;
    font-size: 1rem;
}

.arcade-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background 0.2s;
}

.arcade-btn:hover {
    background: #357abd;
}

.footer-content p {
    font-size: 0.6rem; /* Ultra small for mobile */
    margin: 10px;
    line-height: 1.2;
    color: #8b949e;
}

/* -------------------------
1. Body and Font Setup
------------------------- */
body {
    font-family: 'Press Start 2P', cursive;
    background-color: #0d1117;
    color: #c9d1d9;
    text-shadow: 2px 2px #000000;
    /* Add padding at the bottom to avoid content being hidden by banner/buttons */
    padding-bottom: 120px; /* Adjust as needed based on banner/button height */
}

/* -------------------------
2. Typography Classes
------------------------- */
.pixel-text {
    text-shadow: 3px 3px #000000;
    letter-spacing: 2px;
}

/* -------------------------
3. Game Card Styling
------------------------- */
#game-overlay {
    position: absolute; /* Changed from fixed, relative to game-container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 17, 23, 0.95);
    display: flex; /* Initially visible */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    z-index: 100;
    border-radius: 8px; /* Optional: round corners */
}

.game-card {
    background-color: #161b22;
    border: 4px solid #30363d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* NEW: Compatibility Icon Styles */
.compatibility-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
    color: #9ca3af; /* Gray icon color */
}
.compatibility-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* -------------------------
4. Button Styling ("btn" class)
------------------------- */
.btn {
    background-color: #238636; /* Default Green for accept/other buttons */
    border: 4px solid #2ea043;
    padding: 10px 20px;
    text-transform: uppercase;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px #000000;
    display: inline-block;
    text-align: center;
    font-size: 0.8rem; /* Slightly smaller base font */
}

.btn:hover {
    background-color: #2ea043;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px #000000;
}

.btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.btn.error-flash {
  animation: errorFlash 0.3s ease-out;
}

.btn.disabled {
    background-color: #30363d;
    border-color: #484f58;
    color: #8b949e;
    cursor: not-allowed;
    box-shadow: 4px 4px #000000;
    transform: none;
}

.btn.reject {
    background-color: #da3633; /* Red */
    border-color: #f85149;
}
.btn.reject:hover {
    background-color: #f85149;
}

.filter-btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    background-color: #161b22;
    border-radius: 8px;
    padding: 8px;
    border: 2px solid #30363d;
}
.filter-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    color: #8b949e; /* Gray text */
    background-color: transparent;
    border: 2px solid transparent;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}
.filter-btn:hover {
    color: #c9d1d9; /* Lighter gray on hover */
    background-color: #21262d;
}
.filter-btn.selected {
    color: #ffffff; /* White text */
    background-color: #238636; /* Green background */
    border-color: #2ea043; /* Green border */
    text-shadow: 1px 1px #000;
}

/* -------------------------
5. Floating Buttons (Individual Positioning)
------------------------- */
/* Removed .floating-buttons-container styles */

.floating-btn {
    position: fixed; /* Position individually */
    background: #161b22;
    border: 3px solid #30363d;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding: 0;
    z-index: 1001; /* Above cookie banner */
}

/* Individual button positions */
#toggle-music-button {
    bottom: 20px;
    right: 20px;
}
#manage-cookies-btn {
    bottom: 20px;
    left: 20px; /* Positioned bottom left */
}


/* Styles for the new game control buttons */
.game-control-btn {
    position: absolute; /* Position relative to the game container's parent or body */
    background: #161b22;
    border: 3px solid #30363d;
    border-radius: 8px;
    height: 40px;
    padding: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 1001; /* Above game canvas, below overlay */
    color: #c9d1d9;
    font-size: 0.7rem; /* Smaller font */
    text-transform: uppercase;
    text-shadow: 1px 1px #000;
    line-height: 1;
    text-decoration: none; /* For the 'a' tag */
}
.game-control-btn:hover {
    background: #30363d;
}

/* NEW: Positioning and styling for Info Button with 'i' */
#info-btn { /* UPDATED ID and position */
    bottom: 20px;
    right: 90px; /* Positioned to the left of the speaker button */
}

/* Ensure the inner dot of the question mark has fill */
#info-btn svg line {
    fill: none; /* The dot is a line, keep stroke */
    stroke: currentColor;
}

#info-btn svg path {
  fill: none;
  stroke: currentColor;
}

/* Ensure the circle border of the question mark has stroke */
#info-btn svg circle, #info-btn svg path {
    fill: none; /* Make circle hollow */
    stroke: currentColor;
}

#info-btn:hover { /* UPDATED ID */
    background: #f97316; /* Orange */
}

/* Persistent Controls Display */
#controls-display {
    font-size: 0.6rem;
    color: #9ca3af; /* Lighter gray */
    margin-top: 10px;
    width: 100%;
    max-width: 600px; /* Match canvas width */
    text-align: center;
    line-height: 1.5;
}

/* Positioning */
#fullscreen-btn {    
    top: 10px;
    left: 10px;
}
#back-to-main-btn {
    top: 10px;
    right: 10px;
}
@media (max-width: 768px) {
    #fullscreen-btn, #back-to-main-btn {
        display: none;
    }
}


/* Specific hover colors */
#toggle-music-button:hover {
    background: #ff00cc; /* Magenta */
}
#manage-cookies-btn:hover {
    background: #f97316; /* Orange */
}

/* Helper class for the SVG icons inside the floating buttons */
.icon {
    width: 28px;
    height: 28px;
    stroke: #c9d1d9; /* Default stroke color */
    fill: #c9d1d9; /* Default fill color (for cookie icon) */
}
/* Ensure mute icon only uses stroke */
#mute-icon, #info-btn svg {
    fill: none;
}


/* -------------------------
6. Cookie Consent Banner
------------------------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #161b22; /* Dark background */
    border-top: 4px solid #30363d; /* Dark border */
    padding: 15px 20px; /* Default padding */
    display: flex;
    flex-direction: column; /* Stack text and buttons vertically by default */
    align-items: center; /* Center items */
    gap: 10px; /* Space between text and buttons */
    z-index: 1000;
    text-align: center;
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner-text {
    font-size: 0.7rem; /* Smaller text size */
    color: #c9d1d9; /* Lighter text */
    margin: 0; /* Remove default paragraph margin */
    text-shadow: 1px 1px #000; /* Lighter shadow */
    line-height: 1.5; /* Improve readability */
}

.cookie-banner-buttons {
    display: flex;
    flex-direction: column; /* Stack buttons vertically on small screens */
    gap: 10px; /* Space between buttons */
    width: 100%; /* Take full width for centering */
    align-items: center; /* Center buttons */
}

.cookie-btn {
    padding: 8px 15px; /* Smaller padding */
    font-size: 0.7rem; /* Smaller font size */
    width: 180px; /* Fixed width for consistency */
    max-width: 80%; /* Ensure they don't get too wide */
    box-shadow: 2px 2px #000; /* Smaller shadow */
}

.cookie-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px #000;
}
.cookie-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.cookie-btn.accept {
    background-color: #238636; /* Green */
    border-color: #2ea043;
}
.cookie-btn.accept:hover {
    background-color: #2ea043;
}
.cookie-btn.reject {
    background-color: #da3633; /* Red */
    border-color: #f85149;
}
.cookie-btn.reject:hover {
    background-color: #f85149;
}

/* Simple custom modal styles */
.custom-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Ensure it's on top */
}
.custom-modal-content {
    background-color: #161b22;
    border: 4px solid #30363d;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    max-width: 90%;
    width: 400px;
}
.custom-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.info-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}
.info-modal-content {
    background-color: #161b22;
    border: 4px solid #58a6ff;
    padding: 20px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}
.info-modal-content h2,
.info-modal-content h3 {
    text-shadow: 2px 2px #000;
}
.info-modal-content p {
    color: #c9d1d9;
    text-shadow: 1px 1px #000;
    line-height: 1.6;
}
.info-modal-content #info-close-btn {
    display: block; /* Make button block level */
    margin: 1.5rem auto 0; /* Center the button */
}

/* -------------------------
7. Omni-news Card Styles
------------------------- */

/* Base overrides for the news section - blending original template with dark mode */
.news-container {
    max-width: 1600px;
    width: 100%; /* Ensure it doesn't exceed viewport */
    margin: 0 auto;
    padding: 20px;
    color: #e0e0e0; /* Light text for dark mode */
    background-color: #121212; /* Deep dark background */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Original font */
    overflow-x: hidden; /* Prevent horizontal scroll on container */
}

:root {
    --neon-green: #00FF00;
    --glitch-cyan: #00FFFF;
    --glitch-magenta: #FF00FF;
    --dark-bg: #0d0d0d;
    --text-color: #e0e0e0;
}

/* Date Divider */
.date-divider {
    text-align: center;
    color: #666;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    margin: 20px 0 10px 0;
    position: relative;
}
/* Grid Layout */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-row {
    display: flex;
    flex-direction: column; /* Vertical Stack */
    gap: 15px;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.topic-header {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: bold;
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-badge {
    background-color: #333;
    color: #ddd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: normal;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #555;
}

/* --- CARDS (Original Structure adapted to Dark) --- */
/* Perspective Cards */
.card {
    flex: 1;
    background: #222;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    border-top: 4px solid #555; /* Default Top Border */
    transition: transform 0.2s;
}

.card h3 { margin-top: 0; font-size: 1.1em; margin-bottom: 10px; color: #fff; }
.card p { font-size: 0.95em; line-height: 1.5; flex-grow: 1; color: #ccc; }

.card a {
    margin-top: 10px;
    display: inline-block;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85em;
}

/* --- POLITICAL VIEW STYLES (Original Colors) --- */

/* Left (Blue) */
.view-left {
    background-color: #0d1b2a; /* Darker blue for dark mode contrast */
    border-top-color: #2196f3;
    color: #64b5f6;
}
.view-left .badge { background: #2196f3; color: white; }
.view-left a { color: #64b5f6; }

/* Centrist (White/Grey) */
.view-centrist {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-top: 5px solid #9e9e9e;
    color: #e0e0e0;
}
.view-centrist .badge { background: #9e9e9e; color: white; }
.view-centrist a { color: #bdbdbd; }

/* Right (Red) */
.view-right {
    background-color: #2b0505; /* Darker red background */
    border-top-color: #f44336;
    color: #ef9a9a;
}
.view-right .badge { background: #f44336; color: white; }
.view-right a { color: #ef9a9a; }

/* Conspiracy (Black/Green) */
.view-conspiracy {
    background-color: #000000;
    border-top-color: #000000; /* Or keeping border specifically if desired */
    color: #ddd; 
    border: 1px solid #333;
}
.view-conspiracy h3 { color: #ff3333; font-family: 'Courier New', monospace; }
.view-conspiracy p { color: #00ff00; font-family: 'Courier New', monospace; } /* Matrix text */
.view-conspiracy .badge { background: #333; color: #00ff00; border: 1px solid #00ff00; }
.view-conspiracy a { color: #00ff00; }

/* Badges & Tags */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tag-container {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: #aaa;
}

/* Specific Tag Styles for Conspiracy View */
.view-conspiracy .tag {
    background: #333;
    color: #00ff00;
    border: 1px solid #00ff00;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 16px;
    background: #333;
    border: 1px solid #555;
    text-decoration: none;
    color: #fff;
    border-radius: 4px;
}

.pagination a.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.error-box {
    background: #300;
    color: #f88;
    padding: 20px;
    text-align: center;
    border: 1px solid #600;
    border-radius: 8px;
    margin-top: 20px;
}

/* ==============================================
   Desktop Layout Overrides (Grid)
============================================== */
@media (min-width: 1024px) {
    .article-row {
        display: grid;
        /* 3 Equal columns */
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    /* Header spans full width across the top */
    .topic-header {
        grid-column: 1 / -1; 
        margin-bottom: 10px;
    }
    
    .topic-header h3 {
        font-size: 1.4rem;
    }

    .card {
        /* Grid handles width, so just reset flex */
        width: auto; 
    }
}


/* -------------------------
7. Media Queries for Responsiveness
------------------------- */

/* Small screens (e.g., mobile phones) */
@media (max-width: 639px) {
    body {
        padding-bottom: 160px; /* Increased bottom padding for stacked banner buttons */
    }

    /* Reduce header size */
    header h1 {
        font-size: 2.5rem; /* Smaller main title */
    }
    header p {
        font-size: 0.9rem; /* Smaller subtitle */
    }

    .news-container {
        padding: 10px; /* Reduced padding for mobile */
    }

    .arcade-title {
        font-size: 1.25rem; /* Reduced from 1.5rem to prevent clipping */
        margin-bottom: 20px;
    }
    
    /* Search Bar: Stack vertically on small mobile */
    .arcade-panel form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .arcade-btn {
        width: 100%; /* Full width button on mobile */
    }

    .article-row {
        padding: 15px; /* Reduced internal padding */
    }

    /* Floating buttons smaller and slightly repositioned */
    /* Adjust individual button positions */
    #toggle-music-button {
        bottom: 10px;
        right: 10px;
    }
    #info-btn { /* UPDATED ID and position for mobile */
        bottom: 10px;
        right: 70px; /* Closer to speaker on mobile */
    }
    #manage-cookies-btn {
        bottom: 10px;
        left: 10px;
    }
    .floating-btn {
        width: 50px; /* Smaller buttons */
        height: 50px;
    }
    .icon {
        width: 24px; /* Smaller icons */
        height: 24px;
    }

    /* Banner adjustments already handled by flex-direction: column */
}

/* Medium screens (e.g., tablets) */
@media (min-width: 640px) {
    /* Banner buttons side-by-side */
    .cookie-banner {
        flex-direction: row; /* Text and buttons side-by-side */
        justify-content: space-between; /* Space items out */
        text-align: left;
        padding: 15px 30px; /* More horizontal padding */
    }
    .cookie-banner-text {
        font-size: 0.75rem; /* Slightly larger text */
        flex-grow: 1; /* Allow text to take available space */
        margin-right: 20px; /* Space between text and buttons */
    }
    .cookie-banner-buttons {
        flex-direction: row; /* Buttons side-by-side */
        width: auto; /* Don't take full width */
    }
    .cookie-btn {
        width: 150px; /* Adjust button width */
    }
}

