/* =========================================================
 *  Base
 *  ========================================================= */

* {
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    color: #ffffff;
    background-color: #111111;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #111111;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;

    color: #ffffff;
    text-decoration: none;

    font-size: 1.3rem;
    font-weight: 700;
}

.site-brand:hover {
    color: #dddddd;
}

.site-logo {
    display: block;

    width: 57px;
    height: 30px;

    object-fit: contain;
}

/* =========================================================
 *  Screen-reader-only text
 *  ========================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================================================
 *  Top bar
 *  ========================================================= */

.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    gap: 16px;

    width: 100%;
    min-height: 64px;
    padding: 10px 28px 10px 16px;

    background-color: #1a1a1a;
    border-bottom: 1px solid #333333;
}


/* =========================================================
 *  Menu button
 *  ========================================================= */

.menu-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;

    width: 42px;
    height: 42px;
    padding: 8px;

    border: 0;
    border-radius: 6px;

    background-color: transparent;
    cursor: pointer;
}

.menu-button:hover {
    background-color: #2a2a2a;
}

.menu-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.menu-button span {
    display: block;

    width: 100%;
    height: 3px;

    border-radius: 2px;
    background-color: #ffffff;
}


/* =========================================================
 *  Branding
 *  ========================================================= */

.site-brand {
    flex-shrink: 0;

    color: #ffffff;
    text-decoration: none;

    font-size: 1.3rem;
    font-weight: 700;
}

.site-brand:hover {
    color: #dddddd;
}


/* =========================================================
 *  Search
 *  ========================================================= */

.search-form {
    display: flex;
    flex: 1;

    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;

    min-width: 0;
    height: 40px;
    padding: 0 12px;

    border: 1px solid #444444;
    border-right: 0;
    border-radius: 6px 0 0 6px;

    color: #ffffff;
    background-color: #242424;

    font-size: 0.95rem;
}

.search-form input::placeholder {
    color: #aaaaaa;
}

.search-form input:focus {
    outline: none;
    border-color: #777777;
}

.search-form button {
    height: 40px;
    padding: 0 16px;

    border: 1px solid #444444;
    border-radius: 0 6px 6px 0;

    color: #ffffff;
    background-color: #333333;

    cursor: pointer;
}

.search-form button:hover {
    background-color: #444444;
}


/* =========================================================
 *  Main navigation
 *  ========================================================= */

.main-nav {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-left: 8px;
}

.main-nav a {
    color: #dddddd;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover {
    color: #ffffff;
}


/* =========================================================
 *  Account button
 *  ========================================================= */

.account-button {
    flex-shrink: 0;

    margin-right: 8px;
    padding: 9px 14px;

    border: 1px solid #444444;
    border-radius: 6px;

    color: #ffffff;
    background-color: #292929;

    text-decoration: none;
}

.account-button:hover {
    background-color: #383838;
}


/* =========================================================
 *  Side menu
 *  ========================================================= */

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;

    display: flex;
    flex-direction: column;

    width: min(320px, 85vw);
    height: 100vh;

    padding: 20px;

    background-color: #1a1a1a;
    border-right: 1px solid #333333;

    transform: translateX(-100%);
    transition: transform 0.25s ease;

    overflow-y: auto;
}

.side-menu.open {
    transform: translateX(0);
}


/* =========================================================
 *  Side menu header
 *  ========================================================= */

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.side-menu-header h2 {
    margin: 0;

    font-size: 1.3rem;
}


/* =========================================================
 *  Close button
 *  ========================================================= */

.close-menu-button {
    width: 40px;
    height: 40px;

    padding: 0;

    border: 0;
    border-radius: 6px;

    color: #ffffff;
    background-color: transparent;

    font-size: 2rem;
    line-height: 1;

    cursor: pointer;
}

.close-menu-button:hover {
    background-color: #2a2a2a;
}

.close-menu-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}


/* =========================================================
 *  Side menu links
 *  ========================================================= */

.side-menu-links {
    display: flex;
    flex-direction: column;
}

.side-menu-links > a,
.games-toggle {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 12px 8px;

    border: 0;
    border-radius: 6px;

    color: #dddddd;
    background-color: transparent;

    text-decoration: none;
    text-align: left;

    font-family: inherit;
    font-size: 1rem;

    cursor: pointer;
}

.side-menu-links > a:hover,
.games-toggle:hover {
    color: #ffffff;
    background-color: #2a2a2a;
}


/* =========================================================
 *  Games dropdown
 *  ========================================================= */

.games-toggle {
    justify-content: space-between;
}

.games-arrow {
    margin-left: 10px;

    font-size: 1.3rem;
    line-height: 1;

    transition: transform 0.2s ease;
}

.games-toggle[aria-expanded="true"] .games-arrow {
    transform: rotate(90deg);
}


/* =========================================================
 *  Games submenu
 *  ========================================================= */

.games-submenu {
    display: flex;
    flex-direction: column;

    margin-left: 12px;
    padding-left: 10px;

    border-left: 1px solid #3b3b3b;
}

.games-submenu[hidden] {
    display: none;
}

.games-submenu a {
    display: block;

    width: 100%;
    min-width: 0;

    padding: 10px 8px;

    border-radius: 5px;

    color: #bbbbbb;
    text-decoration: none;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.games-submenu a:hover {
    color: #ffffff;
    background-color: #252525;
}


/* =========================================================
 *  Bottom menu section
 *  ========================================================= */

.side-menu-bottom {
    display: flex;
    flex-direction: column;

    margin-top: auto;
    padding-top: 24px;
}

.side-menu-bottom a {
    display: block;

    padding: 10px 8px;

    border-radius: 6px;

    color: #dddddd;
    text-decoration: none;
}

.side-menu-bottom a:hover {
    color: #ffffff;
    background-color: #2a2a2a;
}


/* =========================================================
 *  Menu overlay
 *  ========================================================= */

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;

    background-color: rgba(0, 0, 0, 0.55);

    opacity: 0;
    visibility: hidden;

    transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
 *  Main content
 *  ========================================================= */

.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.welcome-section {
    padding: 30px;

    border: 1px solid #333333;
    border-radius: 8px;

    background-color: #1a1a1a;
}

.welcome-section h1 {
    margin-top: 0;
}


/* =========================================================
 *  Mobile layout
 *  ========================================================= */

@media (max-width: 800px) {

    .main-nav {
        display: none;
    }

    .site-brand {
        font-size: 1.1rem;
    }

    .top-bar {
        gap: 10px;
    }

    .search-form {
        max-width: none;
    }

    .search-form button {
        display: none;
    }

    .search-form input {
        border-right: 1px solid #444444;
        border-radius: 6px;
    }

    .account-button {
        display: none;
    }
}


@media (max-width: 500px) {

    .top-bar {
        padding: 8px 18px 8px 10px;
    }

    .site-brand {
        display: none;
    }

    .page-content {
        padding: 20px 12px;
    }
}


/* =========================================================
 *  Reduced motion
 *  ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .side-menu,
    .menu-overlay,
    .games-arrow {
        transition: none;
    }

}
