/* ==========================================================================
   Minimalist Global Styles (solitr.com style)
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Menu Button - Hidden on Desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    padding: 10px;
    font-weight: bold;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background-color: #f0f0f0;
    color: #333;
    overflow-x: hidden;
}

/* ==========================================================================
   Global Header & Footer
   ========================================================================== */
.site-header {
    background-color: #000;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.site-header .logo:hover {
    color: #e0e0e0;
}

.site-footer {
    background-color: #e8e8e8;
    color: #555;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    font-size: 13px;
}

.site-footer a {
    color: #555;
    margin: 0 10px;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    color: #111;
}

.info-page-content {
    background-color: #fff;
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: 50vh;
    line-height: 1.6;
}

.info-page-content h1 {
    margin-bottom: 20px;
    font-size: 2rem;
    color: #111;
}

.info-page-content h2 {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.info-page-content p {
    margin-bottom: 15px;
}

a {
    color: #0000ee;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Top Navigation — flat centered games bar
   ========================================================================== */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid #ccc;
    padding: 0;
}

.games-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
}

.games-nav a {
    display: inline-block;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.games-nav a:hover {
    color: #000;
    text-decoration: none;
    border-bottom-color: #999;
}

.games-nav a.active-game {
    color: #000;
    font-weight: 700;
    border-bottom-color: #000;
}

/* ==========================================================================
   Page Wrapper — sidebar + game area
   ========================================================================== */
.page-wrapper {
    display: flex;
    height: calc(100vh - 44px); /* subtract nav height */
    overflow: hidden;
}

/* ==========================================================================
   Game Sidebar — New Game / Options / Help / Undo
   ========================================================================== */
.game-sidebar {
    width: 130px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 0;
    gap: 2px;
}

.game-sidebar a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.12s, border-color 0.12s;
}

.game-sidebar a:hover {
    background-color: #f5f5f5;
    color: #000;
    text-decoration: none;
    border-left-color: #999;
}

.game-sidebar a.disabled {
    color: #bbb;
    cursor: default;
    pointer-events: none;
}

.game-sidebar a.disabled:hover {
    background: none;
    border-left-color: transparent;
}

/* The main game area fills whatever space is left */
.game-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    /* hidden class handles display normally, but ensure it's absolute */
}

.modal:not(.hidden) {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border: 1px solid #999;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #0000ee;
}

.close-btn:hover {
    text-decoration: underline;
}

.modal h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: normal;
}

.modal h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.modal-section {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-section label {
    display: block;
    margin-top: 5px;
    cursor: pointer;
}

.modal-note {
    font-size: 0.85rem;
    color: #666;
}

/* ==========================================================================
   Victory
   ========================================================================== */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #d35400;
    /* Subtle gold/orange */
}

.btn-text {
    background: none;
    border: none;
    color: #0000ee;
    font-size: 1.2rem;
    cursor: pointer;
    text-decoration: underline;
}

/* Basic utilities */
.stats-minimal {
    font-size: 14px;
    color: #555;
    position: absolute;
    bottom: 20px;
    left: 20px;
}

/* ==========================================================================
   SEO Content Section
   ========================================================================== */
.content-section {
    background-color: #fff;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px 60px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.75;
    color: #333;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 48px 0 14px;
    color: #111;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
}

.content-section p {
    margin: 0 0 16px;
    font-size: 15px;
}

.content-section ul {
    margin: 0 0 16px 22px;
    font-size: 15px;
}

.content-section ul li {
    margin-bottom: 6px;
}

.content-bg {
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
    padding-top: 20px;
}

/* ==========================================================================
   Mobile Responsiveness (Max-width 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Show Hamburger Button */
    .mobile-menu-btn {
        display: block;
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        background-color: #fff;
        border-bottom: 1px solid #ddd;
    }

    /* Make top nav a dropdown menu */
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
    }

    .games-nav {
        display: none; /* Hidden by default */
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%; /* Dropdown directly below button */
        left: 0;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-bottom: 1px solid #ddd;
    }

    .games-nav.show-menu {
        display: flex; /* Shown when toggled */
    }
    
    .games-nav a {
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .games-nav a:last-child {
        border-bottom: none;
    }

    /* Stack sidebar and game area vertically */
    .page-wrapper {
        flex-direction: column;
    }

    /* Change sidebar to a horizontal button bar */
    .game-sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding: 5px 0;
        justify-content: space-around;
        gap: 0;
    }

    .game-sidebar a {
        padding: 8px 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
        flex: 1;
        font-size: 13px; /* Slightly smaller for mobile */
    }
    
    .game-sidebar a:hover {
        border-left-color: transparent;
        border-bottom-color: #999;
    }
    
    /* Ensure game area takes remaining space */
    .game-area {
        width: 100%;
        flex: 1;
    }

    .content-section {
        padding: 0 16px 40px; /* less padding on mobile */
    }
}