body {
    background-color: #2C2C2C;
    color: #E0E0E0;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center; /* Center content horizontally */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
    overflow-y: auto; /* Ensure vertical scrollbar is present if needed */
    height: 100%;
    width: 100%;
    overflow-anchor: none; /* Prevent scroll jumps */
}

.site-header { /* Unified header style */
    width: 100%;
    padding: 5px 10px; /* Restored from previous adjustment */
    display: flex;
    justify-content: space-between; /* Restored */
    align-items: center;
    background-color: #333333;
    box-sizing: border-box;
    /* height: 40px; */ /* Removed, will be default or page-specific */
}

.logo-container {
    display: flex;
    align-items: center;
    /* margin-right: 20px; */ /* Removed, will be default or page-specific */
}

.logo {
    height: 50px; /* Restored */
    margin-right: 5px; /* Restored */
}

.logo-text { /* Restored */
    font-size: 32px;
    font-weight: bold;
    color: #E0E0E0;
}

/* Style for the logo link to remove text decoration */
.logo-container-link {
    text-decoration: none;
}

.logo-container-link:hover .logo-text,
.logo-container-link:visited .logo-text,
.logo-container-link:active .logo-text {
    color: #E0E0E0; /* Ensures text color remains consistent */
    text-decoration: none; /* Ensures no underline on hover/visited/active states */
}

/* Navigation Bar Styles */ /* Restored */
.main-nav {
    margin-left: auto;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: #E0E0E0;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 18px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: #8A2BE2; /* Purple for hover/active */
    color: white;
}

/* Styles specific to galatron_engine.html */
.engine-page-styles .site-header {
    height: 30px; /* Reduced header height for engine page */
    padding: 0 10px; /* Reduced vertical padding for engine page */
    justify-content: flex-start; /* Align logo to the left, tabs will follow */
}

.engine-page-styles .logo-container {
    margin-right: 20px; /* Space after logo before potential tabs */
}

.engine-page-styles .logo {
    height: 30px; /* Smaller logo for engine page */
    margin-right: 0; /* No margin as text is hidden */
}

/* On engine page, the main-nav is removed via HTML, and logo text is removed via HTML */
/* No specific CSS needed to hide .logo-text or .main-nav for .engine-page-styles */
/* as they are not rendered on that page. */

/* Secondary Menu Ribbon for Engine Page */
.secondary-menu-ribbon {
    width: 100%;
    background-color: #3a3a3a; /* Slightly different from header for distinction */
    padding: 0 10px; /* Adjusted padding to vertically center content with fixed height */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align items to the start */
    height: 30px; /* Match header height */
}

.menu-ribbon-button {
    background-color: #4A4A4A; /* Dark Gray for inactive buttons */
    color: #E0E0E0; /* Light Gray text for inactive buttons */
    border: none;
    padding: 3px 12px; /* Adjusted padding for smaller height */
    margin-right: 10px; /* Space between buttons */
    border-radius: 10px; /* Adjusted border-radius for new size */
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: normal; /* Ensure consistent line height */
}

.menu-ribbon-button:hover {
    background-color: #5A5A5A; /* Slightly Lighter Gray for inactive button hover */
    color: #FFFFFF;
}

.menu-ribbon-button.active {
    background-color: #8A2BE2; /* Purple for active button */
    color: white;
}

.menu-ribbon-button.active:hover {
    background-color: #9370DB; /* Lighter Purple for active button hover */
    color: white;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 800px; /* Max width for main content area */
}

.platform-description {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.action-buttons button {
    background-color: #8A2BE2; /* Purple */
    color: white;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 25px; /* Prominently rounded corners */
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-buttons button:hover {
    background-color: #9370DB; /* Lighter Purple */
}

.game-engine-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.prompt-input-area {
    display: flex;
    flex-direction: row;
    margin-bottom: 5px;
    width: 70%;
}

.prompt-input {
    flex-grow: 1;
    padding: 15px;
    border-radius: 25px;
    border: 1px solid #555;
    background-color: #3C3C3C;
    color: #E0E0E0;
    font-size: 16px;
    margin-right: 10px;
}

.prompt-input::placeholder {
    color: #888;
}

.prompt-textarea {
    flex-grow: 1;
    padding: 15px;
    border-radius: 25px;
    border: 1px solid #555;
    background-color: #3C3C3C;
    color: #E0E0E0;
    font-size: 16px;
    margin-right: 10px;
    resize: none; /* Disable manual resizing by user */
    overflow-y: hidden; /* Initially hide scrollbar, JS will manage */
    min-height: 50px; /* Minimum height, matches single line input approx */
    line-height: 1.4; /* Adjusted for tighter single line height */
    scrollbar-color: #8A2BE2 transparent; /* For Firefox - thumb and track */
}

/* Custom scrollbar for prompt-textarea - transparent track */
.prompt-textarea::-webkit-scrollbar {
    width: 8px;
}

.prompt-textarea::-webkit-scrollbar-track {
    background: transparent; /* Make scrollbar track transparent */
}

.prompt-textarea::-webkit-scrollbar-thumb {
    background-color: #555; /* Adjust thumb color as needed */
    border-radius: 4px;
}

.prompt-textarea::-webkit-scrollbar-thumb:hover {
    background-color: #777; /* Adjust thumb hover color as needed */
}

.prompt-textarea::placeholder {
    color: #888;
}

.char-count-display {
    display: none;
    font-size: 0.8em;
    color: #AAA;
    width: 70%;
    text-align: left;
    margin-top: 3px;
    padding-left: 5px;
}

.send-prompt-button {
    background-color: transparent;
    border: none;
    color: #E0E0E0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.games-list-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
}

.game-category {
    margin-bottom: 40px;
}

.game-category h2 {
    color: #8A2BE2; /* Purple */
    margin-bottom: 20px;
    border-bottom: 2px solid #8A2BE2;
    padding-bottom: 10px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.game-card {
    background-color: #333333;
    height: 150px;
    border-radius: 15px; /* Rounded corners */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #777;
    font-size: 14px;
}

footer {
    background-color: #333333;
    color: #E0E0E0;
    text-align: center;
    padding: 15px 0; /* User's manual edit */
    width: 100%;
    margin-top: auto;
}

footer p { /* Style for copyright text in footer */
    font-size: 12px; /* Retained */
    margin: 5px 0 0 0; /* Retained */
}

.disclaimer {
    font-size: 14px;
    color: #a0a0a0;
    margin-top: 10px;
}

.social-links a {
    margin: 0 5px; /* Retained */
    font-size: 16px; /* Retained */
    color: #E0E0E0;
    text-decoration: none;
}

.social-links a:hover {
    color: #8A2BE2; /* Purple on hover */
}

.social-links a img { /* Style for SVG icons in social links */
    height: 18px; /* Adjust size as needed, similar to old font-size */
    width: auto;
    vertical-align: middle; /* Align icons nicely with any potential text */
}

.social-links a:hover img {
    filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(5000%) hue-rotate(270deg);
    /* This creates a purple filter matching #8A2BE2. Adjust if a different hover effect is desired. */
}

/* Utility for main page layout */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Pushes footer down */
    min-height: 100vh;
    width: 100%;
    height: 100%; /* Ensure full height */
    overflow-anchor: none; /* Prevent scroll jumps for this container as well */
}

.home-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

/* Create page specific layout */
.create-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: space-between; Remove to allow header at top and content to flow */
    min-height: 100vh;
    width: 100%;
}

.create-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 800px; /* Max width for prompt input area - Increased from 600px */
}

/* Play page specific layout */
.play-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.play-main-content {
    flex-grow: 1;
    width: 100%;
    max-width: 1000px; /* Max width for game list */
    padding: 20px;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #2c2c2c; /* Dark background for track */
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #8A2BE2; /* Purple scrollbar thumb */
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9370DB; /* Lighter purple on hover */
}

/* For Firefox */
body, html {
    scrollbar-width: thin; /* "auto" or "thin" */
    scrollbar-color: #8A2BE2 #3C3C3C; /* thumb track */
}

html {
    overflow-anchor: none;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Translucent black */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    flex-direction: column; /* Align items vertically */
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align items to the start for vertical stacking */
    width: 100%;
    height: 100%; /* Ensure it takes full height */
    padding: 20px; /* Add some padding */
    box-sizing: border-box;
}

/* New style for the container of logo and text */
.loading-status-line {
    display: flex;
    align-items: center; /* Vertically align items in the line */
    justify-content: center; /* Center the line content horizontally */
    width: 100%;
    margin-bottom: 15px; /* Space below the status line */
}

.loading-logo {
    width: 50px; /* Adjust size as needed */
    height: 50px;
    animation: spin 3s linear infinite;
    margin-right: 15px; /* Space between logo and text */
}

.loading-text {
    font-size: 1.2em; /* Adjust size as needed */
    color: #FFFFFF;
    margin: 0; /* Remove default paragraph margins */
}

.streaming-response-area {
    width: 95vw; /* 90% of viewport width */
    flex-grow: 1; /* Allow it to take available vertical space */
    overflow-y: auto;
    background-color: #222; /* Slightly darker than chat input for contrast */
    border: 1px solid #444;
    border-radius: 15px;
    padding: 15px;
    height: 40vh; /* Adjust as needed */
    margin-top: 20px;
    color: #E0E0E0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap; /* Allows text to wrap and respects newlines */
    word-wrap: break-word;
    scrollbar-color: #8A2BE2 transparent; /* For Firefox - thumb and track */
}

/* Custom scrollbar for streaming-response-area - transparent track */
.streaming-response-area::-webkit-scrollbar {
    width: 8px;
}

.streaming-response-area::-webkit-scrollbar-track {
    background: transparent; /* Make scrollbar track transparent */
}

.streaming-response-area::-webkit-scrollbar-thumb {
    background-color: #555; /* Adjust thumb color as needed */
    border-radius: 4px;
}

.streaming-response-area::-webkit-scrollbar-thumb:hover {
    background-color: #777; /* Adjust thumb hover color as needed */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.minimize-overlay-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above other overlay content */
}

.minimize-overlay-button:hover {
    background-color: #777;
}

.loading-overlay.minimized {
    height: 50px; /* Or whatever height you prefer for minimized state */
    width: 250px; /* Adjust width as needed */
    bottom: 0;
    right: 20px;
    left: auto;
    top: auto;
    border-top-left-radius: 15px; /* Rounded corners for minimized state */
    border-top-right-radius: 15px;
    overflow: hidden;
}

.loading-overlay.minimized .loading-content {
    padding: 10px;
    align-items: center; /* Center content horizontally */
    flex-direction: row; /* For minimized view, status line elements can be row*/
    justify-content: flex-start;
}

.loading-overlay.minimized .loading-status-line {
    margin-bottom: 0; /* No margin needed in minimized view if side by side */
}

.loading-overlay.minimized .loading-logo {
    display: block; /* Show logo in minimized state but smaller */
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.loading-overlay.minimized .streaming-response-area {
    display: none; /* Hide streaming response in minimized state for simplicity */
}

.loading-overlay.minimized .loading-text {
    font-size: 0.9em; /* Adjust font size for minimized state */
    margin: 0;
}

.loading-overlay.minimized .minimize-overlay-button {
    bottom: 5px;
    right: 5px;
    top: auto;
    left: auto;
}

/* System Message Container Styles */
.system-message-container {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8); /* Black with opacity */
    padding: 10px 20px;
    border-radius: 15px; /* Rounded corners */
    z-index: 2000; /* Ensure it's above other content */
    display: none; /* Hidden by default */
    text-align: center;
    max-width: 80%;
    opacity: 0; /* Initially transparent when display is not none */
    transition: opacity 0.5s ease-out; /* Transition for fade in/out */
}

.system-message {
    padding: 8px 15px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    margin: 5px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.system-message.show {
    opacity: 1;
    transform: translateY(0);
}

.system-message.error {
    background-color: transparent; /* Container has background */
    color: #FF6B6B; /* Red */
}

.system-message.warning {
    background-color: transparent;
    color: #FFD166; /* Yellow */
}

.system-message.success {
    background-color: transparent;
    color: #06D6A0; /* Green */
}

.system-message.neutral {
    background-color: transparent;
    color: #FFFFFF; /* White */
} 

/* reCAPTCHA Overlay Styles */
.recaptcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.recaptcha-content {
    background-color: #333333;
    border: 2px solid #8A2BE2;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.recaptcha-content p {
    color: #E0E0E0;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Hide the default reCAPTCHA badge */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure reCAPTCHA widget is properly contained within the overlay */
.recaptcha-overlay .grecaptcha-badge {
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 auto;
    display: block;
}

/* Style the reCAPTCHA widget container */
.recaptcha-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* Ensure the reCAPTCHA iframe is properly centered */
.recaptcha-widget iframe {
    margin: 0 auto;
}

/* Close button for reCAPTCHA overlay */
.recaptcha-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #E0E0E0;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.recaptcha-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Make recaptcha-content relative for absolute positioning of close button */
.recaptcha-content {
    position: relative;
} 