/* Global Page Reset & Box Sizing from Solitaire */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrollbars globally */
    box-sizing: border-box;
    scroll-behavior: smooth; /* Added for smooth scrolling on anchor links */
}

*, *::before, *::after {
    box-sizing: inherit; /* All elements inherit box-sizing from html/body */
}

body {
    font-family: Arial, sans-serif;
    background-color: #166534; /* User specified page background */
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
    justify-content: flex-start; /* Align content to the top */
    min-height: 100vh;
    padding-top: 10px; /* Reduced top padding to accommodate logo */
}

/* Logo styles */
#logo-container {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

#site-logo {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}



/* Solitaire Top Bar Styles */
#page-top-bar {
    background: linear-gradient(to bottom, rgba(22, 101, 52, 0.85), rgba(20, 80, 45, 0.95)); /* Dark green translucent gradient */
    padding: 10px 25px; /* Reduced top/bottom padding */
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-bottom: 2px solid rgba(10, 60, 30, 0.9); /* Darker, almost opaque green border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Keep a subtle shadow for depth */
}

#page-menu a, .page-lobby-title {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Cleaner font for menu */
    color: #FFD700; /* Brighter Gold/Yellow color */
    text-decoration: none;
    margin: 0 10px; /* More margin */
    font-size: 0.95em; /* MATCHED to Solitaire menu links */
    padding: 5px 8px; /* Add padding to make them more like buttons */
    border-radius: 4px; /* Rounded corners for button feel */
    transition: background-color 0.2s ease, color 0.2s ease;
}
.page-lobby-title {
    /* font-weight: bold; /* REMOVED to match Solitaire menu links default weight */
    /* font-size: 1.1em; /* ALREADY CHANGED above to 0.95em */
    /* No hover effects needed for non-link title */
}
#page-menu a:hover {
    text-decoration: none; /* Remove underline on hover for button feel */
    background-color: rgba(255, 215, 0, 0.15); /* Light gold highlight on hover */
    color: #fff;
}

/* Solitaire Game Info Bar Styles */


/* Game Board Wrapper - Ensure it doesn't interfere with #game-board centering */
#game-board-wrapper {
    width: 100%; /* Takes full width to allow margin auto on #game-board to work */
    /* display: flex; and justify-content: center; are not needed here if #game-board uses margin:auto */
}

/* Game Board - Styled to EXACTLY MATCH Solitaire #game-board container */
#game-board {
    /* Internal content layout: */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; /* CHANGED from flex-start to center */
    gap: 0; /* No gap for the container itself, manage gaps inside .game-list */

    /* Exact sizing, padding, and appearance from Solitaire #game-board: */
    padding: 50px 50px 20px 50px; /* Match Solitaire's padding with extra top space */
    background-color: #15803d; 
    border: 1px solid #103F2E; 
    border-radius: 12px; 
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); 
    width: 100%; 
    max-width: 650px;  /* CRITICAL MATCH */
    margin: 30px auto 20px auto; /* CRITICAL MATCH for centering - matches Solitaire */
    min-height: 70vh;     /* CRITICAL MATCH */
    perspective: 1000px;  /* CRITICAL MATCH */
    box-sizing: border-box; /* CRITICAL MATCH */
    position: relative; /* Match Solitaire's relative positioning */
}

/* Game Selection Area inside the game-board */
#game-selection {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 20px; /* Add some padding at the top for the icons within the board */
}

.game-list {
    display: flex;
    flex-wrap: wrap;
    gap: 25px; /* Increased gap slightly for better visual separation */
    justify-content: center;
    align-items: flex-start;
    /* padding: 10px; /* Padding can be on #game-selection or here */
    max-width: 100%; 
}

/* Game Icon Card Styles */
.game-card {
    width: 100px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
}

.game-icon-image {
    width: 80px; 
    height: 80px;
    background-color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 15px;
    box-sizing: border-box;
    object-fit: contain;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    margin-bottom: 0px;
}

.game-card a:hover .game-icon-image {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.game-icon-title {
    font-size: 0.85em; 
    color: #ffffff;
    text-align: center;
    font-weight: bold;
}

/* Hide elements not relevant to lobby or styles from previous themes */
#top-page-nav, #avatar-section, #user-avatar, #user-name,
header:not(.blog-post-header):not(.blog-header), main:not(#game-board-wrapper):not(.blog-content):not(.blog-posts):not(.rules-content):not(.game-rules-grid), #game-selection h2
{
    display: none !important;
}

/* Remove old styles that are no longer needed or conflicting */
header:not(.blog-post-header):not(.blog-header), main:not(#main-game-panel):not(.blog-content):not(.blog-posts):not(.rules-content):not(.game-rules-grid):not(#game-board-wrapper), #game-selection h2, .game-card p {
    display: none !important; /* Hide old elements if they persist or for safety */
}

/* Ensure rules grid is always visible */
main.game-rules-grid {
    display: grid !important;
}

/* Ensure rules content is always visible */
main.rules-content {
    display: block !important;
}

/* Ensure blog posts are always visible */
main.blog-posts {
    display: grid !important;
}

/* Ensure blog content is always visible */
main.blog-content {
    display: block !important;
}

/* CRITICAL: Override any rules that might hide main elements */
main {
    display: block !important;
}

/* Further adjustments might be needed for specific game icon images to look good */

/* Mobile Styles */
@media (max-width: 519px) {
    #game-board {
        padding: 35px 10px 10px 10px; /* Match Solitaire's mobile padding */
        gap: 8px;
        display: inline-grid;
    }
    
    .game-list {
        gap: 15px;
    }
    
    .game-card {
        width: 80px;
    }
    
    .game-icon-image {
        width: 60px;
        height: 60px;
    }
    
    .game-icon-title {
        font-size: 0.8em;
    }
}

/* SEO Content Section Styles - Matching FreeCell Rules Style */
#seo-content {
    background-color: transparent !important;
    color: #e0e0e0;
    padding: 25px 30px;
    margin: 40px auto;
    width: 90%;
    max-width: 750px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-descriptions {
    padding: 0;
    color: #e0e0e0;
    line-height: 1.6;
}

.game-descriptions h1 {
    color: #a3d9a5;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.6em;
    font-size: 1.8em;
}

.game-descriptions > p {
    margin-bottom: 0.6em;
    line-height: 1.6;
    color: #e0e0e0;
}

.features, .game-benefits {
    margin-bottom: 1.2em;
}

.features h2, .game-benefits h2 {
    color: #a3d9a5;
    font-size: 1.4em;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

.features ul, .game-benefits ul {
    padding-left: 25px;
}

.features li, .game-benefits li {
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.features strong, .game-benefits strong {
    color: #f5f5f5;
    font-weight: 600;
}

.game-benefits p {
    margin-bottom: 0.6em;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Mobile Responsive Styles for SEO Content */
@media (max-width: 768px) {
    #seo-content {
        margin: 20px auto;
        padding: 20px 15px;
        width: 95%;
    }
    
    .game-descriptions h1 {
        font-size: 1.6em;
    }
    
    .features h2, .game-benefits h2 {
        font-size: 1.2em;
    }
} 