/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: "Segoe UI", sans-serif;
    background: #6ca1a8;
    color: #5e9ad6;
    height: 100%;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

body {
    flex: 1;
}

/* === Header === */
.site-header {
    height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 0px 16px 0px 0px;
    z-index: 10;
    position: relative;
}

.logo-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    gap: 20px;
}

.site-logo {
    height: 70px;
}

#searchInput {
    flex: 1;
    max-width: 400px;
    padding: 12px 18px;
    border: 1px solid #c4dff0;
    border-radius: 50px;
    font-size: 16px;
    background: #f9fdff;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#searchInput:focus {
    outline: none;
    border-color: #121b20;
    box-shadow: 0 0 0 3px rgba(0, 114, 181, 0.2);
}

#menuToggle.hamburger {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    display: none;
}

/* === Main Wrapper === */
main.layout-container {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 100%;
    margin: 0px auto 40px auto;
    position: relative;
}

/* === Sidebar === */
.sidebar {
    position: absolute;
    left: 0;
    top: 0px;
    width: 64px;
    background: #121b20;
    border-right: 1px solid #6ca1a8;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    z-index: 2;
    transition: width 0.3s ease;
    overflow: visible;
    height: auto;
    border-radius: 0px 0px 10px 0px;
    border-top: 1px solid #6ca1a8;
    border-bottom: 1px solid #6ca1a8;
}

.sidebar:hover {
    width: 180px;
}

.sidebar .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    width: 100%;
    align-items: flex-start;
    padding-left: 0px;
}

.sidebar .nav-menu li {
    display: flex;
    align-items: center;
    width: 100%;
}

.sidebar .nav-menu a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff !important;
    padding-left: 9px;
    padding-right: 9px;
}

.sidebar .nav-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(145deg, #f2f8fc, #dbeef6);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    color: #121b20;
    margin-left: 6px;
}

.sidebar .nav-icon:hover {
    background: linear-gradient(145deg, #d1ecf7, #bce3f2);
    transform: scale(1.1);
}

.sidebar .nav-label {
    margin-left: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar:hover .nav-label {
    opacity: 1;
    pointer-events: auto;
}

/* === Main Content === */
.site-main {
    flex: 1;
    padding: 30px 16px 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 775px;
}

body:not(.game-page) .site-main {
    margin-left: 60px !important;
    min-height: 1000px;
}

.main-inner {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* === Game Page === */
.main-game {
    display: flex;
    justify-content: center;
}

.main-game iframe#gameFrame {
    width: 70%;
    height: 385px;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.game-page .game-info-row,
body.game-page .games-grid,
body.game-page .about-section {
    max-width: 100%;
    margin: 0 auto 30px;
}

.game-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: white;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    gap: 20px;
}

.info-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.info-left .game-logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-left h1 {
    font-size: 26px;
    color: #00334d;
    font-weight: 600;
    margin: 0;
}

.game-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    color: #121b20;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-actions button:hover,
.game-actions button.active {
    background: #121b20;
    color: white;
    transform: translateY(-1px);
}

.about-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.about-section h2,
.about-section h3 {
    margin-top: 10px;
    margin-bottom: 10px;
    color: #00334d;
}

.about-section p {
    color: #333;
    line-height: 1.6;
}

/* === Overlay === */
.overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: #121b20;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    padding: 20px;
    z-index: 999;
    display: none;
}

.overlay.show {
    right: 0;
}

.overlay .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    list-style: none;
}

/* === Game Grid === */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.game-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    background: white;
}

.game-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-4px);
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-card:hover .game-title {
    opacity: 1;
}

/* === Footer === */
.site-footer {
    text-align: center;
    padding: 30px 16px;
    background: white;
    font-size: 14px;
    color: #444;
    border-top: 1px solid #ddd;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 60px;
    flex-shrink: 0;
}

.site-footer .main-inner {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    margin: 0 10px;
    color: #121b20;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 26px;
    color: #121b20;
    cursor: pointer;
    z-index: 1000;
}

/* === Static Pages (About, Terms, etc.) === */
.about-section {
    background: white;
    padding: 40px 48px;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    margin: 40px 0px 0px 0px;
    max-width: 90%;
    line-height: 1.8;
    color: #2b2b2b;
    font-size: 16px;
    margin-left: 5% !important;
}

.about-section h2 {
    font-size: 28px;
    font-weight: 700;
    text-align: left !important;
    margin-bottom: 5px;
    color: #1b2c3d;
}

.about-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 0px;
    margin-bottom: 5px;
    color: #00334d;
    text-align: left;
}

.about-section p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
    color: #444;
}

.about-section strong {
    color: #1b2c3d;
}

.about-section a {
    color: #121b20;
    text-decoration: underline;
}

.about-section a:hover {
    text-decoration: none;
}

.about-section-home {
    max-width: 100% !important;
    margin-left: 0% !important;
}

.about-section-game {
    max-width: 100% !important;
    margin-left: 0% !important;
}

.hidden-card {
    display: none;
}

.modern-button {
    background: #121b20;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin: 24px auto;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.modern-button:hover {
    background: #005a94;
}

@media (min-width: 769px) {
    .close-button {
        display: none !important;
    }
}

/* === Responsive Fix === */
@media (min-width: 769px) {
    .sidebar {
        display: flex;
    }

    .hamburger {
        display: none !important;
    }

    .overlay {
        display: none !important;
    }
}

@media (max-width: 768px) {
    body:not(.game-page) .site-main {
        margin-left: 0px !important;
    }

    #searchInput {
        max-width: 100%;
        width: 100%;
    }

    .game-actions {
        flex-direction: column;
        align-items: center;
    }

    .site-main {
        padding: 0 10px;
        margin-left: 0;
    }

    .game-info-row {
        flex-direction: column;
        text-align: center;
    }

    .info-left {
        justify-content: center;
    }

    .sidebar {
        display: none !important;
    }

    .hamburger {
        display: block !important;
    }

    .overlay {
        display: block !important;
    }

    .site-main {
        flex: 1;
        padding: 30px 16px 40px;
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        min-height: 775px;
    }

    .main-game iframe#gameFrame {
        width: 90%;
        height: 385px;
        border: none;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
    }

    .overlay .nav-menu li {
        margin-bottom: 10px;
    }

    .about-section {
        padding: 24px 20px;
    }

    .about-section h2 {
        font-size: 22px;
    }

    .about-section h3 {
        font-size: 18px;
    }

    .about-section-home {
        max-width: 100% !important;
    }

    .about-section-game {
        max-width: 100% !important;
    }

}