/* ==========================================================================
   Game 36 - base.css
   Design tokens, application shell and shared components.
   Layout: desktop = fixed left sidebar + content column
           mobile  = sticky top bar + bottom tab bar + bottom sheet
   ========================================================================== */

:root {
    --g36-bg: #f5f7fb;
    --g36-surface: #ffffff;
    --g36-ink: #12141d;
    --g36-ink-2: #575e73;
    --g36-ink-3: #8b91a3;
    --g36-line: #e7eaf3;
    --g36-brand: #4f46e5;
    --g36-brand-2: #7c6cf6;
    --g36-brand-soft: #eef0ff;
    --g36-accent: #ffb703;
    --g36-radius: 18px;
    --g36-radius-sm: 12px;
    --g36-shadow: 0 8px 24px rgba(24, 30, 66, .07);
    --g36-shadow-hover: 0 16px 34px rgba(24, 30, 66, .15);
    --g36-sidebar-w: 252px;
    --g36-tabbar-h: 62px;
    --g36-mobilebar-h: 58px;
    --g36-max: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--g36-bg);
    color: var(--g36-ink);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--g36-brand);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--g36-brand);
    outline-offset: 2px;
    border-radius: 6px;
}

.g36-ico {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

/* ==========================================================================
   Sidebar (desktop only)
   ========================================================================== */

.g36-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--g36-sidebar-w);
    height: 100vh;
    padding: 22px 18px 18px;
    background: var(--g36-surface);
    border-right: 1px solid var(--g36-line);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.g36-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 18px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--g36-ink);
}

.g36-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--g36-brand), var(--g36-brand-2));
    box-shadow: 0 6px 14px rgba(79, 70, 229, .32);
}

.g36-brand-mark .g36-ico {
    width: 18px;
    height: 18px;
}

.g36-brand-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* sidebar search */
.g36-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 12px;
    height: 42px;
    background: #f2f4fa;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background .18s ease, border-color .18s ease;
}

.g36-search:focus-within {
    background: #fff;
    border-color: var(--g36-brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .10);
}

.g36-search .g36-ico {
    width: 17px;
    height: 17px;
    color: var(--g36-ink-3);
}

.g36-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 14px;
    color: var(--g36-ink);
    outline: none;
}

.g36-search input::placeholder {
    color: var(--g36-ink-3);
}

/* sidebar navigation */
.g36-sidenav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 22px;
}

.g36-sidenav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--g36-ink-2);
    transition: background .16s ease, color .16s ease;
}

.g36-sidenav-link .g36-ico {
    width: 18px;
    height: 18px;
}

.g36-sidenav-link:hover {
    background: #f4f5fb;
    color: var(--g36-ink);
}

.g36-sidenav-link.is-active {
    background: var(--g36-brand-soft);
    color: var(--g36-brand);
}

.g36-sideblock {
    margin-bottom: 18px;
}

.g36-sideblock h4 {
    padding: 0 12px;
    margin-bottom: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--g36-ink-3);
}

.g36-sidelist {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 260px;
    overflow-y: auto;
}

.g36-sidelist a {
    display: block;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 14px;
    color: var(--g36-ink-2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.g36-sidelist a:hover {
    background: #f4f5fb;
    color: var(--g36-brand);
}

.g36-sidefoot {
    margin-top: auto;
    padding: 14px 12px 0;
    border-top: 1px solid var(--g36-line);
    font-size: 12.5px;
    color: var(--g36-ink-3);
}

.g36-sidefoot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.g36-sidefoot a:hover {
    color: var(--g36-brand);
}

/* ==========================================================================
   Main column
   ========================================================================== */

.g36-app {
    display: flex;
    min-height: 100vh;
}

.g36-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--g36-sidebar-w);
    padding: 30px 34px 72px;
}

.g36-page {
    width: 100%;
    max-width: var(--g36-max);
    margin: 0 auto;
}

/* ==========================================================================
   Mobile top bar
   ========================================================================== */

.g36-mobilebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--g36-mobilebar-h);
    padding: 0 16px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--g36-line);
}

.g36-mobilebar .g36-brand {
    padding: 0;
    font-size: 16.5px;
}

.g36-mobilebar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.g36-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--g36-ink-2);
    background: #f3f4fa;
    transition: background .16s ease, color .16s ease;
}

.g36-iconbtn:hover {
    background: var(--g36-brand-soft);
    color: var(--g36-brand);
}

/* ==========================================================================
   Section headings
   ========================================================================== */

.g36-sec {
    margin-bottom: 34px;
}

.g36-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.g36-sec-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 19px;
    font-weight: 700;
}

.g36-sec-title small {
    font-size: 13px;
    font-weight: 500;
    color: var(--g36-ink-3);
    letter-spacing: 0;
}

.g36-sec-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--g36-brand);
    white-space: nowrap;
}

.g36-sec-more .g36-ico {
    width: 15px;
    height: 15px;
    transition: transform .16s ease;
}

.g36-sec-more:hover .g36-ico {
    transform: translateX(2px);
}

/* ==========================================================================
   Game grid + card
   ========================================================================== */

.g36-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 20px 16px;
}

.g36-card-link {
    display: block;
}

.g36-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: #e8ebf4;
    box-shadow: var(--g36-shadow);
    transition: transform .22s ease, box-shadow .22s ease;
}

.g36-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .38s ease;
}

.g36-card-link:hover .g36-card-thumb {
    transform: translateY(-4px);
    box-shadow: var(--g36-shadow-hover);
}

.g36-card-link:hover .g36-card-thumb img {
    transform: scale(1.07);
}

.g36-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 9px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--g36-ink);
}

.g36-card-type {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--g36-ink-3);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.g36-card-hot {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(12, 14, 22, .62);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.g36-card-hot .g36-ico {
    width: 12px;
    height: 12px;
    color: var(--g36-accent);
}

/* ==========================================================================
   Feature card (large, 16:9)
   ========================================================================== */

.g36-featured {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.g36-feature {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--g36-radius);
    overflow: hidden;
    background: #dfe3ef;
    box-shadow: var(--g36-shadow);
    transition: transform .22s ease, box-shadow .22s ease;
}

.g36-feature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.g36-feature::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 12, 20, 0) 34%, rgba(10, 12, 20, .78) 100%);
}

.g36-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--g36-shadow-hover);
}

.g36-feature:hover img {
    transform: scale(1.05);
}

.g36-feature-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 16px 18px;
}

.g36-feature-name {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.g36-feature-meta {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .78);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Horizontal rail
   ========================================================================== */

.g36-rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.g36-rail::-webkit-scrollbar {
    display: none;
}

.g36-rail > * {
    flex: 0 0 138px;
    scroll-snap-align: start;
}

.g36-rail .g36-card-thumb {
    border-radius: 14px;
}

/* ==========================================================================
   Chips
   ========================================================================== */

.g36-chips {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
}

.g36-chips::-webkit-scrollbar {
    display: none;
}

.g36-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 999px;
    background: var(--g36-surface);
    border: 1px solid var(--g36-line);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--g36-ink-2);
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.g36-chip:hover {
    border-color: var(--g36-brand);
    color: var(--g36-brand);
}

.g36-chip.is-active {
    background: var(--g36-brand);
    border-color: var(--g36-brand);
    color: #fff;
}

.g36-chip--soft {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}

.g36-chip--soft:hover {
    background: rgba(255, 255, 255, .26);
    color: #fff;
    border-color: rgba(255, 255, 255, .5);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.g36-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.g36-btn .g36-ico {
    width: 17px;
    height: 17px;
}

.g36-btn-primary {
    background: var(--g36-brand);
    color: #fff;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .28);
}

.g36-btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(79, 70, 229, .34);
}

.g36-btn-ghost {
    background: var(--g36-surface);
    border: 1px solid var(--g36-line);
    color: var(--g36-ink);
}

.g36-btn-ghost:hover {
    border-color: var(--g36-brand);
    color: var(--g36-brand);
}

.g36-btn-block {
    width: 100%;
}

.g36-btn-play {
    min-height: 52px;
    font-size: 16px;
    letter-spacing: .01em;
    border-radius: 14px;
}

/* ==========================================================================
   Advertisement slots
   ========================================================================== */

.g36-ad {
    margin: 26px 0;
    padding: 12px;
    background: var(--g36-surface);
    border: 1px dashed var(--g36-line);
    border-radius: 14px;
    text-align: center;
    overflow: hidden;
}

.g36-ad-tag {
    margin-bottom: 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--g36-ink-3);
}

.g36-ad-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    overflow: hidden;
}

/* ==========================================================================
   Bottom tab bar (mobile only)
   ========================================================================== */

.g36-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 46;
    height: calc(var(--g36-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--g36-line);
}

.g36-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--g36-ink-3);
    transition: color .16s ease;
}

.g36-tab .g36-ico {
    width: 21px;
    height: 21px;
}

.g36-tab.is-active {
    color: var(--g36-brand);
}

.g36-tab.is-active .g36-ico {
    stroke-width: 2.2;
}

/* ==========================================================================
   Bottom sheet (mobile navigation)
   ========================================================================== */

.g36-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.g36-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 22, .45);
    opacity: 0;
    transition: opacity .2s ease;
}

.g36-sheet-panel {
    position: relative;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--g36-surface);
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform .24s cubic-bezier(.22, .61, .36, 1);
}

.g36-sheet.is-open .g36-sheet-backdrop {
    opacity: 1;
}

.g36-sheet.is-open .g36-sheet-panel {
    transform: translateY(0);
}

.g36-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 10px;
    font-size: 16px;
    font-weight: 700;
}

.g36-sheet-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 18px 16px;
    overflow-y: auto;
}

.g36-sheet-link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f4f5fb;
    font-size: 14px;
    font-weight: 600;
    color: var(--g36-ink-2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.g36-sheet-link:hover {
    background: var(--g36-brand-soft);
    color: var(--g36-brand);
}

.g36-sheet-all {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--g36-brand), var(--g36-brand-2));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.g36-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 12px 18px 18px;
    border-top: 1px solid var(--g36-line);
    font-size: 13px;
    color: var(--g36-ink-3);
}

.g36-sheet-foot a:hover {
    color: var(--g36-brand);
}

html.is-sheet-open,
html.is-sheet-open body {
    overflow: hidden;
}

/* ==========================================================================
   Back to top
   ========================================================================== */

.g36-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--g36-surface);
    border: 1px solid var(--g36-line);
    color: var(--g36-ink-2);
    box-shadow: 0 10px 24px rgba(24, 30, 66, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s, color .16s ease, border-color .16s ease;
}

.g36-top:hover {
    color: var(--g36-brand);
    border-color: var(--g36-brand);
}

.g36-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.g36-foot {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--g36-line);
    font-size: 13px;
    color: var(--g36-ink-3);
}

.g36-foot-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 10px;
}

.g36-foot-nav a {
    font-weight: 600;
    color: var(--g36-ink-2);
}

.g36-foot-nav a:hover {
    color: var(--g36-brand);
}

.g36-foot-copy {
    line-height: 1.7;
}

/* ==========================================================================
   Rich text block
   ========================================================================== */

.g36-rich {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--g36-ink-2);
}

.g36-rich h2,
.g36-rich h3 {
    margin: 20px 0 8px;
    font-size: 16px;
    color: var(--g36-ink);
}

.g36-rich p {
    margin: 0 0 10px;
}

.g36-rich ul {
    margin: 0 0 12px;
    padding-left: 20px;
    list-style: disc;
}

.g36-rich li {
    margin-bottom: 6px;
}

.g36-rich a {
    color: var(--g36-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.g36-rich .hidden {
    display: none;
}

.g36-rich.is-expanded .hidden {
    display: block;
}

/* ==========================================================================
   Breadcrumb + page head
   ========================================================================== */

.g36-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--g36-ink-3);
}

.g36-crumb a:hover {
    color: var(--g36-brand);
}

.g36-crumb .g36-ico {
    width: 14px;
    height: 14px;
}

.g36-pagehead {
    margin-bottom: 22px;
}

.g36-pagehead h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.g36-pagehead p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--g36-ink-2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
    .g36-main {
        padding: 26px 24px 70px;
    }
}

@media (max-width: 1023px) {
    .g36-sidebar {
        display: none;
    }

    .g36-mobilebar {
        display: flex;
    }

    .g36-top {
        display: inline-flex;
    }

    .g36-tabbar {
        display: flex;
    }

    .g36-main {
        margin-left: 0;
        padding: calc(var(--g36-mobilebar-h) + 18px) 16px calc(var(--g36-tabbar-h) + 5px);
    }

    .g36-top {
        right: 16px;
        bottom: calc(var(--g36-tabbar-h) + 16px);
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .g36-grid {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        gap: 18px 12px;
    }

    .g36-card-thumb {
        border-radius: 14px;
    }

    .g36-featured {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .g36-feature-body {
        padding: 10px 8px;
    }

    .g36-pagehead h1 {
        font-size: 22px;
    }

    .g36-sec {
        margin-bottom: 28px;
    }
}

@media (max-width: 480px) {
    .g36-grid {
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
        gap: 16px 10px;
    }

    .g36-card-name {
        font-size: 13px;
    }

    .g36-sec-title {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}


.logo-img {
    height: 34px;
    width: auto;
    aspect-ratio: auto;
}