/* ===== COMMON STYLES - Dùng chung cho tất cả devices ===== */

/* ===== MOBILE HEADER - Ẩn mặc định (chỉ hiện trên mobile) ===== */
.mobile-header {
    display: none;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #6bfaf1;
    --sidebar-w: 600px;
    --unit: 106px;
    --gap: 6px;
    --grid-gap: 15px;
    --radius: 16px;
    --radius-sm: 10px;
    --pad: 20px;
    --cols: 17;
}

/* ===== RESPONSIVE: số cột theo màn hình ===== */
@media (max-width: 767px) {
    :root {
        --cols: 3;
        --pad: 12px;
        --grid-gap: 10px;
        --radius: 12px;
        --radius-sm: 8px;
    }

    /* Ẩn tile 3×3 trên mobile */
    .tile-3x3 {
        display: none !important;
    }
}

@media (min-width: 480px) {
    :root {
        --cols: 3;
        --grid-gap: 10px;
    }
}

@media (min-width: 768px) {
    :root {
        --cols: 7;
        --grid-gap: 12px;
        --pad: 20px;
    }
}

@media (min-width: 960px) {
    :root {
        --cols: 9;
        --grid-gap: 15px;
        --pad: 20px;
    }
}

@media (min-width: 1280px) {
    :root {
        --cols: 11;
        --grid-gap: 15px;
        --pad: 20px;
    }
}

@media (min-width: 1600px) {
    :root {
        --cols: 13;
        --grid-gap: 15px;
        --pad: 20px;
    }
}

@media (min-width: 1920px) {
    :root {
        --cols: 15;
        --grid-gap: 15px;
        --pad: 20px;
    }
}

@media (min-width: 2560px) {
    :root {
        --cols: 17;
        --grid-gap: 15px;
        --pad: 20px;
    }
}

/* ===== LOGIN BUTTON COLOR (Desktop) ===== */
/* Layout dọc - vertical */
#btn-login svg path {
    fill: #64748b;
    transition: fill 0.2s;
}

#btn-login[data-logged-in="true"] svg path {
    fill: #ec4899;
    /* Pink color when logged in */
}

/* Layout ngang - horizontal */
#btn-login-lg svg path {
    fill: #64748b;
    transition: fill 0.2s;
}

#btn-login-lg[data-logged-in="true"] svg path {
    fill: #ec4899;
    /* Pink color when logged in */
}

/* Legacy class support */
#btn-login-lg.logged-in svg path {
    fill: #ec4899;
}

html,
body {
    min-height: 100%;
    background: var(--bg);
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body {
    position: relative;
}

/* Background image với opacity đè lên toàn bộ - repeat xuống dưới */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    background-image: url('../images/background.png');
    background-repeat: repeat-y;
    opacity: 0.3;
    z-index: 2;
    pointer-events: none;
}

/* Mobile dùng background portrait */
@media (max-width: 768px) {
    body::before {
        background-image: url('../images/background-mobile.png');
    }
}

/* Chỉ ẩn overflow-x trên desktop, mobile không cần */
@media (min-width: 769px) {

    html,
    body {
        overflow-x: hidden;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: "Nunito", sans-serif;
    font-weight: 900;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
}

/* Play Again Banner - ẩn mặc định, chỉ hiện trên mobile */
.play-again-banner {
    display: none;
}

/* ===== MOSAIC WRAPPER ===== */
.mosaic-wrapper {
    padding: var(--pad) var(--pad);
    position: relative;
    z-index: 10;
}

/* ===== MOSAIC GRID ===== */
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-auto-rows: calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols));
    gap: var(--grid-gap);
    width: 100%;
    grid-auto-flow: row dense !important;
}

/* ===== GAME TILE ===== */
.game-tile {
    position: relative;
    border-radius: var(--radius);
    overflow: visible;
    /* Keep visible for label icon */
    background: rgba(0, 0, 0, 0.15);
    display: block;
    transition: transform 0.18s cubic-bezier(.4, 0, .2, 1), box-shadow 0.18s;
}

/* ===== CATEGORY TILE ===== */
.category-tile {
    position: relative;
    overflow: hidden;
    /* Để SVG không tràn ra ngoài */
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.18s cubic-bezier(.4, 0, .2, 1), box-shadow 0.18s;
    grid-column: span 2;
    grid-row: span 1;
}

/* Category tile as header (không hover, không pointer) */
.category-tile-header {
    pointer-events: none;
    cursor: default;
}

/* Mobile: 2x1 (2 ô mỗi hàng trên lưới 4 cột) */
@media (max-width: 768px) {
    .category-tile {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
    }
}

.category-tile-content {
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 48px;
    height: 48px;
    display: block;
}

.category-tile-name {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

/* Larger font for header tile */
.category-tile-header .category-tile-name {
    font-size: 24px;
    font-weight: 900;
}

@media (hover: hover) and (pointer: fine) {
    .category-tile:hover:not(.category-tile-header) {
        transform: scale(1.03);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
}

/* Category tile SVG background icon */
.category-icon-bg {
    position: absolute;
    z-index: 0;
    right: -10px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.category-icon-bg svg {
    width: 100%;
    height: 100%;
    color: #fff;
    opacity: 0.18;
    stroke: currentColor;
    stroke-width: 1;
    transform: rotate(-8deg);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.category-tile:hover .category-icon-bg svg {
    opacity: 0.32;
    transform: rotate(0deg) scale(1.08);
}

/* Ensure content is above SVG */
.category-tile-content {
    position: relative;
    z-index: 1;
}

.tile-large {
    border-radius: 18px;
}

.tile-3x3 {
    border-radius: 20px;
}

/* ===== GAME IFRAME TILE (for game.php) ===== */
.game-iframe-tile {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Iframe container - chiếm phần còn lại */
.game-iframe-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Video preview - hidden on desktop, shown on mobile */
.game-preview-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 1;
    will-change: auto;
    /* Không force GPU cho video */
}

/* Play button - hidden on desktop, shown on mobile */
.game-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #00a8ff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 3;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 168, 255, 0.3);
    animation: playButtonPulse 2s ease-in-out infinite;
    will-change: transform;
    /* GPU acceleration chỉ cho animation này */
}

/* Zoom in/out animation - chậm hơn, nhẹ hơn */
@keyframes playButtonPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.game-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95) !important;
    box-shadow: 0 2px 6px rgba(0, 168, 255, 0.4);
    animation: none;
}

.game-play-btn svg {
    margin-left: 4px;
}

/* Responsive iframe spans */
@media (max-width: 768px) {
    .game-iframe-tile {
        grid-column: span 3 !important;
        grid-row: span 3 !important;
    }

    /* Show video and play button on mobile */
    .game-preview-video {
        display: block;
    }

    .game-play-btn {
        display: flex;
    }

    /* Hide iframe on mobile until play button clicked */
    .game-iframe {
        display: none;
    }

    /* Hide desktop fullscreen button on mobile */
    .fullscreen-btn {
        display: none !important;
    }

    /* When in fullscreen, show iframe and hide video/play button */
    .game-iframe-container:fullscreen .game-iframe {
        display: block !important;
    }

    .game-iframe-container:fullscreen .game-preview-video,
    .game-iframe-container:fullscreen .game-play-btn {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 959px) {
    .game-iframe-tile {
        grid-column: 2 / span 6 !important;
        /* Bắt đầu từ cột 2, chiếm 6 cột */
        grid-row: span 4 !important;
    }
}

@media (min-width: 960px) and (max-width: 1279px) {
    .game-iframe-tile {
        grid-column: span 7 !important;
        grid-row: span 5 !important;
    }
}

@media (min-width: 1280px) {
    .game-iframe-tile {
        grid-column: span 8 !important;
        grid-row: span 5 !important;
    }
}

.game-iframe-tile .game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    overflow: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.game-iframe-tile .game-iframe::-webkit-scrollbar {
    display: none;
}

/* Game info bar - nằm dưới iframe, không đè */
.game-info-bar {
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.game-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.game-info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-info-text {
    flex: 1;
    min-width: 0;
}

.game-info-title {
    font-size: 16px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
}

.game-info-author {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.game-info-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.game-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    color: #00a8ff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    min-height: 48px;
    position: relative;
}

.game-action-btn:hover {
    background: transparent;
}

.game-action-btn:active {
    transform: scale(0.96);
}

.game-action-btn svg {
    flex-shrink: 0;
    display: block;
    transition: transform 0.2s ease;
}

/* Filled state for buttons that have been clicked */
.game-action-btn svg[fill="currentColor"] {
    fill: #00a8ff;
    stroke: currentColor;
    /* Keep stroke for outline effect */
    stroke-width: 2;
}

/* Report button filled state */
#report-btn svg[fill="currentColor"] {
    fill: #00a8ff;
    stroke: currentColor;
    /* Keep stroke for outline effect */
    stroke-width: 2;
}

/* Dislike icon always rotated 180deg */
.dislike-icon {
    transform: rotate(180deg);
}

.game-action-btn:hover svg {
    transform: rotate(-10deg);
}

/* Dislike icon on hover: 180deg - 10deg = 170deg */
.game-action-btn:hover .dislike-icon {
    transform: rotate(170deg);
}

.action-count {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    line-height: 1;
    color: #5d6b84;
    font-size: 11px;
}

/* Hide count on hover, show label instead */
.game-action-btn:hover .action-count {
    display: none;
}

.game-action-btn:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    line-height: 1;
    color: white;
    font-size: 11px;
    font-weight: 900;
    background: #00a8ff;
    padding: 1px 5px;
    border-radius: 6px;
}

/* Fullscreen mode */
.game-iframe-container:fullscreen {
    border-radius: 0;
}

.game-iframe-container:fullscreen .game-iframe {
    width: 100%;
    height: 100%;
}

/* Exit fullscreen button */
.exit-fullscreen-btn {
    position: absolute;
    top: 15px;
    left: 0;
    height: 45px;
    border-radius: 0 16px 16px 0;
    background: white;
    color: #00a8ff;
    display: none;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: background 0.2s, left 0.3s, right 0.3s, border-radius 0.3s, padding 0.3s;
    z-index: 100;
    border: none;
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.1);
    padding: 0 15px 0 12px;
    user-select: none;
}

.exit-fullscreen-btn:hover {
    background: #f8f9fa;
}

.exit-fullscreen-btn svg {
    color: #00a8ff;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.exit-fullscreen-btn .fav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Show exit button only in fullscreen */
.game-iframe-container:fullscreen .exit-fullscreen-btn {
    display: flex;
}

/* Media wrapper - clips image and video */
.game-tile-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    z-index: 0;
}

/* Thumbnail image - absolute positioned inside wrapper */
.game-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

/* Video element - hidden by default, absolute positioned inside wrapper */
.game-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
    /* Faster transition */
    pointer-events: none;
    z-index: 1;
    background: rgba(0, 0, 0, 0.1);
    /* Subtle bg while loading */
}

/* Show video on hover (only devices with mouse) */
@media (hover: hover) and (pointer: fine) {
    .game-tile:hover .game-video {
        opacity: 1;
    }
}

/* Label icon góc trên trái - theo design TapWap */
.game-tile-label {
    position: absolute;
    top: 8px;
    left: -6px;
    height: 28px;
    width: 24px;
    pointer-events: none;
    z-index: 2;
}

/* Pseudo elements cho viền cong */
.game-tile-label::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 4px;
    height: 4px;
    background: white;
    z-index: 0;
}

.game-tile-label::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 6px;
    height: 8px;
    background: #bac9de;
    border-radius: 4px 0 0 4px;
    z-index: 1;
}

/* Container bên trong với background và border-radius */
.game-tile-label__container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: white;
    border-radius: 3px 14px 14px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-tile-label__container img {
    width: 20px;
    height: 20px;
    display: block;
}

.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    padding: 22px 8px 8px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
    z-index: 2;
}

.tile-name {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    text-transform: capitalize;
}

.tile-large .tile-name {
    font-size: 14px;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== SIDEBAR BASE ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100%;
    background: var(--bg);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}

.sidebar.open {
    overflow: initial;
}

/* Background image cho sidebar */
.sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100%;
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: top center;
    background-repeat: repeat-y;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

/* Mobile dùng background portrait cho sidebar */
@media (max-width: 768px) {
    .sidebar::before {
        background-image: url('../images/background-mobile.png');
        width: 100%;
    }
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-inner {
    padding: 20px 16px 0px 16px;
    min-height: 100%;
    position: relative;
    z-index: 1;
}

.sidebar-close {
    position: absolute;
    top: 50%;
    right: -40px;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
    flex-shrink: 0;
    transition: background 0.2s;
}

/* Mobile: nút < nằm trong flow, bên phải search-box */
@media (max-width: 768px) {
    .search-header {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .sidebar-close {
        position: relative;
        right: auto;
        top: auto;
        left: auto;
        transform: none;
        order: 2;
        width: 50px;
        height: 50px;
    }

    .search-box {
        order: 1;
        flex: 1;
    }
}

.sidebar-close:hover {
    background: #f0f0f0;
}

/* ===== SEARCH SIDEBAR ===== */
.search-header {
    position: relative;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 16px 24px;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    max-width: calc(100% - 25px);
}

.search-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #94a3b8;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    color: #1a1a2e;
    background: transparent;
    font-family: "Nunito", sans-serif;
    font-weight: 900;
}

.search-input::placeholder {
    color: #a0b3cc;
    font-weight: 900;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    cursor: grab;
}

.tag-list:active {
    cursor: grabbing;
}

.tag-list::-webkit-scrollbar {
    display: none;
}

.tag-row {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    pointer-events: none;
    padding-right: var(--pad);
}

.tag {
    background: white;
    color: #333;
    font-size: 13px;
    font-family: "Nunito", sans-serif;
    font-weight: 900;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, color 0.15s;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    pointer-events: auto;
    text-decoration: none;
    display: inline-block;
}

.tag:hover {
    background: #009cff;
    color: white;
}

.tag.active-tag {
    background: #00a8a0;
    color: white;
}

.popular-title {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 12px;
    margin-top: 30px;
    font-weight: 900;
}

/* Sidebar: Recently and Popular grids using mosaic structure */
.recently-mosaic,
.popular-mosaic,
.search-mosaic {
    /* Override to use sidebar-specific column count, not main --cols */
    grid-template-columns: repeat(var(--sidebar-cols, 3), 1fr);
    grid-auto-flow: row dense;
}

/* Sidebar game tiles need explicit sizing */
.recently-mosaic .game-tile,
.popular-mosaic .game-tile,
.search-mosaic .game-tile {
    aspect-ratio: 1;
    width: 100%;
}

.recently-mosaic {
    grid-template-rows: 1fr;
    /* 1 row */
    grid-auto-rows: 0;
    /* Collapse additional rows */
    margin-bottom: 24px;
}

/* Search mosaic can show multiple rows */
.search-mosaic {
    grid-template-rows: auto;
    /* Allow multiple rows */
    grid-auto-rows: 1fr;
    /* All rows same height */
    margin-bottom: 24px;
    overflow: visible;
    /* Don't hide overflow */
}

.popular-mosaic {
    grid-template-rows: repeat(2, 1fr);
    /* 2 rows */
    grid-auto-rows: 0;
    /* Collapse additional rows */
}

/* Hide tiles after visible rows - specific for each breakpoint */

/* Mobile ≤767px: 3 cols */
@media (max-width: 767px) {
    :root {
        --sidebar-cols: 3;
    }

    .recently-mosaic .game-tile:nth-child(n+4) {
        display: none;
    }

    .popular-mosaic .game-tile:nth-child(n+7) {
        display: none;
    }
}

/* Tablet 768px-959px: 5 cols */
@media (min-width: 768px) and (max-width: 959px) {
    :root {
        --sidebar-cols: 5;
    }

    .recently-mosaic .game-tile:nth-child(n+6) {
        display: none;
    }

    .popular-mosaic .game-tile:nth-child(n+11) {
        display: none;
    }

    /* Sidebar width vừa khít 5 games */
    .sidebar {
        width: calc(32px + 5*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 4*var(--grid-gap));
    }

    .sidebar::before {
        width: calc(32px + 5*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 4*var(--grid-gap));
    }
}

/* Desktop Small 960px-1279px: sidebar chỉ chứa 4 cols */
@media (min-width: 960px) and (max-width: 1279px) {
    :root {
        --sidebar-cols: 4;
    }

    .recently-mosaic .game-tile:nth-child(n+5) {
        display: none;
    }

    .popular-mosaic .game-tile:nth-child(n+9) {
        display: none;
    }

    /* Sidebar width vừa khít 4 games */
    .sidebar {
        width: calc(32px + 4*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 3*var(--grid-gap));
    }

    .sidebar::before {
        width: calc(32px + 4*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 3*var(--grid-gap));
    }
}

/* Desktop Medium 1280px-1599px: sidebar chứa 5 cols */
@media (min-width: 1280px) and (max-width: 1599px) {
    :root {
        --sidebar-cols: 5;
    }

    .recently-mosaic .game-tile:nth-child(n+6) {
        display: none;
    }

    .popular-mosaic .game-tile:nth-child(n+11) {
        display: none;
    }

    /* Sidebar width vừa khít 5 games */
    .sidebar {
        width: calc(32px + 5*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 4*var(--grid-gap));
    }

    .sidebar::before {
        width: calc(32px + 5*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 4*var(--grid-gap));
    }
}

/* Desktop Large ≥1600px: sidebar chứa 6 cols */
@media (min-width: 1600px) {
    :root {
        --sidebar-cols: 6;
    }

    .recently-mosaic .game-tile:nth-child(n+7) {
        display: none;
    }

    .popular-mosaic .game-tile:nth-child(n+13) {
        display: none;
    }

    /* Sidebar width vừa khít 6 games */
    .sidebar {
        width: calc(32px + 6*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 5*var(--grid-gap));
    }

    .sidebar::before {
        width: calc(32px + 6*((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)) + 5*var(--grid-gap));
    }
}

/* Search Results */
#search-results-section {
    max-height: calc(100vh - 85px);
    overflow-y: auto;
    overflow-x: hidden;
    margin: -10px -12px 0 -12px;
    padding: 10px 12px 24px 12px;
    /* Ẩn scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

#search-results-section::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}



/* Empty state message for search */
.search-empty-message {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 17px;
    width: 100%;
}

/* Make search tiles match popular-item / standard game-tile styling */
.search-game-tile {
    position: relative;
    overflow: visible;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
    transition: transform 0.18s cubic-bezier(.4, 0, .2, 1), box-shadow 0.18s;
    display: block;
    text-decoration: none;
    aspect-ratio: 1;
}

.search-game-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    z-index: 10;
}

.search-game-tile .game-tile-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius);
}

.search-game-tile .game-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
}

.search-game-tile .game-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-game-tile:hover .game-video,
.game-tile:hover .game-video {
    opacity: 1;
}

.search-game-tile .tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    padding: 22px 8px 8px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
    z-index: 2;
}

.search-game-tile:hover .tile-overlay {
    opacity: 1;
}

.search-game-tile .tile-name {
    display: block;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    text-transform: capitalize;
}

/* ===== LOGIN SIDEBAR ===== */
.auth-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 900;
    color: #aaa;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
    color: #00a8a0;
    border-bottom-color: #00a8a0;
}

.auth-title {
    font-size: 17px;
    font-weight: 900;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 18px;
}

.auth-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-provider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 900;
    color: #333;
    background: white;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
}

.auth-provider:hover {
    border-color: #00cec2;
    background: #f0fffe;
    transform: translateY(-1px);
}

.auth-note {
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.5;
}

.auth-note a {
    color: #00a8a0;
    text-decoration: underline;
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-block {
    background: var(--cat-bg, #f0f0f0);
    border-radius: 0;
    padding-top: var(--pad);
    padding-bottom: var(--pad);
    padding-left: 0;
    padding-right: 0;
    position: relative;
}


.category-header,
.category-games {
    position: relative;
    z-index: 2;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 var(--pad);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 24px;
    color: #1a1a2e;
    margin: 0;
}

.category-title-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.category-title-link:hover .category-title {
    opacity: 0.8;
}

.category-icon {
    display: none;
}

.category-more {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}

.category-more:hover {
    background: white;
}

.category-nav {
    display: flex;
    gap: 8px;
}

.category-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.category-nav-btn:hover {
    background: white;
}

.category-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.category-nav-btn:disabled:hover {
    background: transparent;
}

/* Hide navigation buttons on touch devices */
@media (hover: none) {
    .category-nav {
        display: none;
    }
}

.category-games {
    display: grid;
    grid-template-rows: repeat(2, calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols)));
    grid-auto-flow: column dense;
    grid-auto-columns: calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols));
    gap: var(--grid-gap);
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-left: var(--pad);
    padding-right: var(--pad);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-top: 20px;
    padding-bottom: 30px;
}

.category-games::-webkit-scrollbar {
    display: none;
}

/* Sessions Horizontal Scrollbar Hidden */
.game-sessions-scroll {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.game-sessions-scroll::-webkit-scrollbar,
.game-sessions-scroll::-webkit-scrollbar-thumb,
.game-sessions-scroll::-webkit-scrollbar-track,
.game-sessions-scroll::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Category Show More Button */
.category-show-more {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
}

.category-show-more-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.category-show-more-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.category-show-more-btn:active {
    transform: scale(0.98);
}

.category-show-more-btn svg {
    color: #1a9be6;
}

.category-show-more-text {
    font-size: 14px;
    font-weight: 900;
    color: #1a1a2e;
    white-space: nowrap;
}

.cat-game-tile {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    transition: transform 0.18s cubic-bezier(.4, 0, .2, 1), box-shadow 0.18s, z-index 0s;
    position: relative;
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
    .cat-game-tile:hover {
        transform: scale(1.07);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        z-index: 10;
    }
}

.cat-tile-large {
    border-radius: 18px;
}

.cat-game-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

/* Label icon cho category tiles - theo design TapWap */
.cat-tile-label {
    position: absolute;
    top: 8px;
    left: -6px;
    height: 28px;
    width: 24px;
    pointer-events: none;
    z-index: 2;
}

/* Pseudo elements cho viền cong */
.cat-tile-label::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 4px;
    height: 4px;
    background: white;
    z-index: 0;
}

.cat-tile-label::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 6px;
    height: 8px;
    background: #bac9de;
    border-radius: 4px 0 0 4px;
    z-index: 1;
}

/* Container bên trong với background và border-radius */
.cat-tile-label__container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: white;
    border-radius: 3px 14px 14px 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-tile-label__container img {
    width: 20px;
    height: 20px;
    display: block;
}

/* ===== PAGE CONTENT SECTION ===== */
.page-content {
    background: white;
    margin: 0;
    border-radius: 0;
    padding: 32px 40px;
    position: relative;
    z-index: 10;
}

.page-content:after {
    clip-path: polygon(0 0, 0 100%, 50% 0, 60% 100%, 100% 0);
    content: "";
    background: #fff;
    height: 25px;
    margin-top: -1px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
}

.about-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Page game tiles - hide on mobile, show on desktop */
.page-game-tile {
    display: none;
}

@media (min-width: 769px) {
    .page-game-tile {
        display: block;
    }
}

/* Page mosaic - fix header placeholder to row 1 */
.page-mosaic .header-placeholder {
    grid-row: 1;
}

/* Page mosaic - only show row 1, completely hide row 2+ */
@media (min-width: 769px) {
    .page-mosaic .mosaic-grid {
        grid-template-rows: calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols));
        max-height: calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols));
        overflow: hidden;
    }
}

.about-label {
    font-size: 11px;
    font-weight: 900;
    color: #00a8a0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.about-heading {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a2e;
    margin-bottom: 24px;
    line-height: 1.2;
}

.about-subheading {
    font-size: 16px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 20px 0 8px;
}

.about-inner p {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 10px;
}

.about-inner strong {
    color: #1a1a2e;
}

.about-top-list {
    list-style: none;
    margin-top: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    counter-reset: li;
}

.about-top-list li {
    font-size: 14px;
    color: #444;
    counter-increment: li;
}

.about-top-list li::before {
    content: counter(li) '. ';
}

.about-top-list a {
    color: #0066cc;
    font-weight: 900;
    text-decoration: none;
}

.about-top-list a:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
.footer {
    background: white;
    margin: 0;
    margin-top: 20px;
    border-radius: 0;
    padding: 36px 40px;
    position: relative;
    z-index: 10;
}

.footer:before {
    clip-path: polygon(0 100%, 50% 0, 60% 100%, 100% 0, 100% 100%);
    content: "";
    background: #fff;
    height: 25px;
    margin-bottom: -1px;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    pointer-events: none;
}

/* ===== PAGE LAYOUT ===== */
.page-wrapper {
    min-height: calc(100vh - 200px);
    padding: 40px var(--pad);
    position: relative;
    z-index: 1;
}

/* Desktop: Mosaic above page content */
@media (min-width: 769px) {
    .desktop-only-mosaic {
        display: block;
    }

    .desktop-only-mosaic+.page-wrapper {
        margin-top: 0;
        padding-top: 20px;
    }

    /* Limit mosaic to exactly 1 row */
    .desktop-only-mosaic .mosaic-grid {
        grid-template-rows: calc((100vw - 2*var(--pad) - (var(--cols) - 1)*var(--grid-gap)) / var(--cols));
        /* First row with proper height */
        grid-auto-rows: 0;
        /* Collapse additional rows */
        overflow: visible;
        /* Keep shadow visible */
    }
}

/* Hide tiles after first row - specific for each breakpoint */
/* nth-child counts ALL children (placeholder + header-tile + game-tiles) */

/* 768px-959px: 7 cols total → placeholder(1) + header(1) + 6 games → hide from position 9 onwards */
@media (min-width: 768px) and (max-width: 959px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 9) {
        display: none;
    }
}

/* 960px-1279px: 9 cols → placeholder(1) + header(1) + 8 games → hide from position 11 */
@media (min-width: 960px) and (max-width: 1279px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 11) {
        display: none;
    }
}

/* 1280px-1599px: 11 cols → placeholder(1) + header(1) + 10 games → hide from position 13 */
@media (min-width: 1280px) and (max-width: 1599px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 13) {
        display: none;
    }
}

/* 1600px-1919px: 13 cols → placeholder(1) + header(1) + 12 games → hide from position 15 */
@media (min-width: 1600px) and (max-width: 1919px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 15) {
        display: none;
    }
}

/* 1920px-2559px: 15 cols → placeholder(1) + header(2) + 13 games → hide from position 16 */
@media (min-width: 1920px) and (max-width: 2559px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 16) {
        display: none;
    }
}

/* 2560px+: 17 cols → placeholder(1) + header(2) + 15 games → hide from position 18 */
@media (min-width: 2560px) {
    .desktop-only-mosaic .game-tile:nth-child(n + 18) {
        display: none;
    }
}

/* ===== SIDEBAR RECENTLY PLAYED MOSAIC ===== */
/* Hide games beyond first row for sidebar recently played */
/* Sidebar has NO placeholder or header-tile, so count starts from game-tile:nth-child(1) */

/* 768px-959px: 5 cols → hide from position 6 onwards */
@media (min-width: 768px) and (max-width: 959px) {
    .recently-mosaic .game-tile:nth-child(n + 6) {
        display: none;
    }
}

/* 960px-1279px: 4 cols → hide from position 5 */
@media (min-width: 960px) and (max-width: 1279px) {
    .recently-mosaic .game-tile:nth-child(n + 5) {
        display: none;
    }
}

/* 1280px-1599px: 5 cols → hide from position 6 */
@media (min-width: 1280px) and (max-width: 1599px) {
    .recently-mosaic .game-tile:nth-child(n + 6) {
        display: none;
    }
}

/* 1600px+: 6 cols → hide from position 7 */
@media (min-width: 1600px) {
    .recently-mosaic .game-tile:nth-child(n + 7) {
        display: none;
    }
}

/* Mobile: Hide mosaic, show only page content */
@media (max-width: 768px) {
    .desktop-only-mosaic {
        display: none !important;
    }
}

.page-container .page-content {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.page-container .page-content:after {
    display: none;
}

.page-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .page-container {
        padding: 32px 24px;
        border-radius: 16px;
    }
}

.page-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f0f0f0;
}

.page-heading {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .page-heading {
        font-size: 28px;
    }
}

.page-content {
    margin-bottom: 40px;
}

.page-intro {
    font-size: 18px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 32px;
}

.page-section {
    margin-bottom: 32px;
}

.page-section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .page-section-title {
        font-size: 20px;
    }
}

.page-section-text {
    font-size: 16px;
    color: #444;
    line-height: 1.7;
    margin: 0;
}

.page-footer {
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
}

.page-updated {
    font-size: 14px;
    color: #999;
    margin: 0;
    text-align: center;
}



.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: auto;
    height: 32px;
    object-fit: contain;
}

.footer-tagline {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.social-link.social-facebook:hover {
    background: #1877F2;
    color: #ffffff;
}

.social-link.social-youtube:hover {
    background: #FF0000;
    color: #ffffff;
}

.social-link.social-tiktok:hover {
    background: #010101;
    color: #ffffff;
}

.footer-links {
    display: flex;
    gap: 80px;
    flex-wrap: wrap;
    margin-left: auto;
}

.footer-col h4.footer-col-title {
    font-size: 11px;
    font-weight: 900;
    color: #00a8a0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul li a {
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col ul li a:hover {
    color: #00a8a0;
}

/* Mobile footer */
@media (max-width: 768px) {
    .footer {
        padding: 32px 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 32px;
    }

    .footer-left {
        min-width: auto;
    }

    .footer-links {
        gap: 40px;
        margin-left: 0;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}


/* ===== GAME ABOUT (INSIDE PAGE-CONTENT) ===== */

.game-about-hero {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto auto;
    gap: 0 24px;
    margin-bottom: 24px;
}

.game-about-thumb {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
    grid-row: 1 / -1;
    grid-column: 1;
}

.game-about-meta {
    grid-row: 1;
    grid-column: 2;
    display: flex;
    flex-direction: column;
}

.game-about-desc {
    grid-row: 2;
    grid-column: 2;
}

.game-breadcrumb {
    font-size: 12px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.game-about-title {
    font-size: 32px;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    text-transform: capitalize;
}

.game-about-author {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
}

.game-about-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.show-less-btn {
    font-size: 13px;
    color: #00a8ff;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.show-less-btn:hover {
    color: #0088cc;
}

.game-about-full-desc {
    margin-bottom: 32px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-about-full-desc p {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-line;
}

.game-about-full-desc h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin: 24px 0 8px 0;
}

.game-about-full-desc a {
    color: #00a8ff;
    text-decoration: none;
}

.game-about-full-desc a:hover {
    text-decoration: underline;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 32px;
    padding: 24px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #64748b;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 20px;
    color: #1a1a2e;
}

.game-about-details {
    margin-bottom: 48px;
}

.about-details-title {
    font-size: 24px;
    color: #1a1a2e;
    margin: 0 0 24px 0;
}

/* Game details table */
.game-details-table {
    width: 100%;
    border-collapse: collapse;
}

.game-details-table tr {
    border-bottom: 1px solid #e5e7eb;
}

.game-details-table tr:last-child {
    border-bottom: none;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    font-size: 15px;
    color: #1a1a2e;
    width: 200px;
    vertical-align: top;
}

.detail-label svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #64748b;
}

.detail-value {
    padding: 16px 0;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
}

.detail-value a {
    color: #00a8ff;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* Related categories */
.related-categories {
    margin-bottom: 48px;
}

.related-title {
    font-size: 24px;
    color: #1a1a2e;
    margin: 0 0 16px 0;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    color: #1a1a2e;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.category-tag:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.tag-count {
    color: #00a8ff;
}

/* More games by developer */
.more-games-developer {
    margin-bottom: 0;
    padding-bottom: var(--pad);
    padding-right: 0;
    position: relative;
}

.more-games-wrapper {
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
}

.more-games-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 4px;
    position: relative;
    z-index: 2;
}

.show-more-link {
    font-size: 13px;
    color: #00a8ff;
    text-decoration: none;
    transition: color 0.2s;
}

.show-more-link:hover {
    color: #0088cc;
}

.developer-games-grid {
    padding-left: var(--pad);
    margin-right: -17px;
}

/* Responsive */
@media (max-width: 768px) {

    .detail-label {
        width: 140px;
        font-size: 14px;
    }

    .detail-label svg {
        width: 18px;
        height: 18px;
    }

    .detail-value {
        font-size: 14px;
    }

    .more-games-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .game-about-hero {
        display: grid;
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto;
        gap: 12px 16px;
    }

    .game-about-thumb {
        width: 120px;
        height: 120px;
        grid-row: 1 / 2;
        grid-column: 1;
    }

    .game-about-meta {
        grid-row: 1 / 2;
        grid-column: 2;
    }

    .game-about-desc {
        grid-row: 2 / 3;
        grid-column: 1 / -1;
        margin: 0;
    }

    .game-stats {
        flex-wrap: wrap;
        gap: 16px;
    }

    .game-stat {
        flex: 1 1 40%;
    }

    .detail-label {
        width: 140px;
        font-size: 14px;
    }

    .detail-label svg {
        width: 18px;
        height: 18px;
    }

    .detail-value {
        font-size: 14px;
    }

    .more-games-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


/* ===== REPORT FORM BOX - Bottom Right ===== */
.report-form-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 420px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    display: none;
}

.report-form-header {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    padding: 20px;
    position: relative;
}

.report-form-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.report-form-title-row svg {
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

.report-form-title {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    margin: 0;
}

.report-form-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    cursor: pointer;
}

.report-form-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.report-form-body {
    padding: 20px;
}

.report-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: #1a1a2e;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    background: #f8f9fa;
}

.report-textarea:focus {
    border-color: #00a8ff;
    background: white;
}

.report-textarea::placeholder {
    color: #94a3b8;
}

.report-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.report-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: white;
    position: relative;
    transition: all 0.2s;
}

.report-checkbox input[type="checkbox"]:checked {
    background: #00a8ff;
    border-color: #00a8ff;
}

.report-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.report-checkbox label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.report-form-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.report-crown {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.report-send-btn {
    padding: 12px 32px;
    background: #00a8ff;
    color: white;
    font-size: 16px;
    font-weight: 700;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.report-send-btn:hover {
    background: #0090e0;
}

.report-send-btn:active {
    transform: scale(0.98);
}

/* ===== THANK YOU BOX - Bottom Right (same position as form) ===== */
.report-thank-you-box {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    width: 420px;
    height: 200px;
    background: linear-gradient(135deg, #0099ff 0%, #00d4ff 100%);
    border-radius: 32px;
    box-shadow: 0 16px 64px rgba(0, 153, 255, 0.4);
    z-index: 9999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.report-box-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    cursor: pointer;
    z-index: 10;
}

.report-box-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.report-thank-you {
    font-size: 48px;
    font-weight: 800;
    color: white;
    margin: 0;
    text-align: center;
    letter-spacing: -1px;
    z-index: 2;
    position: relative;
}

/* Sparkle decorations */
.report-sparkle {
    position: absolute;
    color: white;
    opacity: 0.8;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle-1 {
    top: 15%;
    left: 12%;
    animation-delay: 0s;
}

.sparkle-2 {
    top: 25%;
    right: 15%;
    animation-delay: 0.5s;
}

.sparkle-3 {
    bottom: 25%;
    left: 18%;
    animation-delay: 1s;
}

.sparkle-4 {
    bottom: 20%;
    right: 20%;
    animation-delay: 1.5s;
}

@keyframes sparkleFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .report-form-box {
        width: calc(100% - 40px);
        bottom: 10px;
        right: 20px;
        left: 20px;
    }

    .report-thank-you-box {
        width: calc(100% - 40px);
        height: 180px;
        bottom: 10px;
        right: 20px;
        left: 20px;
    }

    .report-thank-you {
        font-size: 40px;
    }
}


/* ===== ACCOUNT PANEL ===== */
#panel-account {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    padding-bottom: 24px;
}

.account-header {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.account-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.account-header-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-title {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.2;
}

.account-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.account-logout-btn-small {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s, color 0.2s;
    flex-shrink: 0;
}

.account-logout-btn-small:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
    transform: scale(1.05);
}

.account-logout-btn-small:active {
    transform: scale(0.95);
}

.account-logout-btn-small svg {
    flex-shrink: 0;
}

.account-stats {
    display: flex;
    gap: 12px;
}

.account-stat {
    flex: 1;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.account-stat svg {
    color: #00a8ff;
    flex-shrink: 0;
}

.account-stat span {
    font-size: 24px;
    font-weight: 900;
    color: #1a1a2e;
}

.account-section {
    margin-bottom: 24px;
}

.account-section-title {
    font-size: 20px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 0 0 16px 0;
}

/* Account panel grids now use .mosaic-grid .recently-mosaic classes */
/* See .recently-mosaic responsive rules above for column/visibility settings */

/* Account Most Played Grid with Category Tile */
#account-most-played-grid {
    grid-template-rows: auto;
    grid-auto-rows: auto;
    overflow: visible;
    margin-bottom: 24px;
    container-type: inline-size;
}

.account-category-tile {
    position: relative;
    border-radius: var(--radius-sm, 12px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    grid-column: span 2;
    grid-row: span 1;
    min-height: 100%;
    order: 99;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s;
}

@media (hover: hover) and (pointer: fine) {
    .account-category-tile:hover {
        transform: scale(1.03);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
}

/* Big background watermark icon - exactly like category-tile outside */
.account-category-tile .category-icon-bg {
    position: absolute;
    z-index: 0;
    right: -10px;
    bottom: -20px;
    width: 105px;
    height: 105px;
    pointer-events: none;
}

.account-category-tile .category-icon-bg svg {
    width: 100%;
    height: 100%;
    color: #fff;
    opacity: 0.22;
    stroke: currentColor;
    stroke-width: 1.2;
    transform: rotate(-8deg);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.account-category-tile:hover .category-icon-bg svg {
    opacity: 0.35;
    transform: rotate(0deg) scale(1.08);
}

.account-category-tile .category-tile-content {
    position: relative;
    z-index: 1;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

.account-category-tile .category-tile-name {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    line-height: 1.25;
}

/* Responsive display for Account Most Played Grid */
/* Mobile (≤767px): 3 cols -> Row 1 has 3 games, Row 2 has category tile spanning 3 cols */
@media (max-width: 767px) {
    #account-most-played-grid .game-tile:nth-child(n+4) {
        display: none !important;
    }

    #account-most-played-grid .account-category-tile {
        grid-column: span 3 !important;
        grid-row: span 1 !important;
        aspect-ratio: 3.17 / 1;
        height: calc((100cqw - 2 * var(--grid-gap, 10px)) / 3) !important;
        min-height: calc((100cqw - 2 * var(--grid-gap, 10px)) / 3) !important;
        max-height: calc((100cqw - 2 * var(--grid-gap, 10px)) / 3) !important;
    }

    .account-category-tile .category-icon-bg {
        width: 125px;
        height: 125px;
        right: 10px;
        bottom: -22px;
    }

    .account-category-tile .category-tile-name {
        font-size: 18px;
    }
}

/* Tablet (768px-959px): 5 cols -> 3 games + 2-col category tile = 5 cols */
@media (min-width: 768px) and (max-width: 959px) {
    #account-most-played-grid .game-tile:nth-child(n+4) {
        display: none !important;
    }
}

/* Desktop Small (960px-1279px): 4 cols -> 2 games + 2-col category tile = 4 cols */
@media (min-width: 960px) and (max-width: 1279px) {
    #account-most-played-grid .game-tile:nth-child(n+3) {
        display: none !important;
    }
}

/* Desktop Medium (1280px-1599px): 5 cols -> 3 games + 2-col category tile = 5 cols */
@media (min-width: 1280px) and (max-width: 1599px) {
    #account-most-played-grid .game-tile:nth-child(n+4) {
        display: none !important;
    }
}

.account-category {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.account-category-info h4 {
    font-size: 18px;
    font-weight: 900;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.account-category-info p {
    font-size: 14px;
    font-weight: 900;
    color: #64748b;
    margin: 0;
}
.about-inner h2 {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 28px 0 12px;
    line-height: 1.3;
}
.about-inner h3 {
    font-size: 17px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 22px 0 10px;
    line-height: 1.35;
}
.about-inner .about-feature-list {
    margin: 10px 0 20px 22px;
    padding: 0;
    list-style-type: disc;
}
.about-inner .about-feature-list li {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 6px;
}
.page-content a,
.page-content a strong,
.about-inner a,
.about-inner a strong {
    color: #0077e6 !important;
    text-decoration: none;
    font-weight: 700;
}
.page-content a:hover,
.page-content a:hover strong,
.about-inner a:hover,
.about-inner a:hover strong {
    color: #0055b3 !important;
    text-decoration: underline;
}
