/* ===== Global Styles ===== */
body {
    font-family: Arial, sans-serif; /* Revert font */
    background: #1a1a3d; /* Dark blue/purple background */
    color: white;
    margin: 0;
    padding: 0;
    text-align: center;
    min-height: 100vh;
    font-size: 18px;
}

body.home-page {
    --sidebar-collapsed: 76px;
    --sidebar-expanded: 250px;
    --home-content-offset: calc(var(--sidebar-collapsed) / 2);
    overflow-x: hidden;
}

.home-page .page-shell {
    min-height: 100vh;
}

.stats-page .page-shell {
    min-height: 100vh;
    padding-left: var(--sidebar-collapsed);
}

.home-page .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-collapsed);
    height: 100vh;
    padding: 88px 12px 18px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #24244f 0%, #181836 100%);
    border-right: 1px solid rgba(163, 155, 255, 0.18);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    z-index: 1100;
    transition: width 0.32s ease, box-shadow 0.32s ease;
}

.home-page .sidebar:hover {
    width: var(--sidebar-expanded);
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.28);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-divider {
    height: 1px;
    margin: 10px 4px;
    background: rgba(163, 155, 255, 0.2);
}

.sidebar-link {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: #d7d2ff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(163, 155, 255, 0.14);
    color: #ffffff;
}

.sidebar-link:hover {
    transform: translateX(2px);
}

.sidebar-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -1px;
}

.sidebar-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}

#navFavourites .sidebar-icon svg {
    width: 24px;
    height: 24px;
}

.sidebar-label {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.home-page .sidebar:hover .sidebar-label,
body.game-page .sidebar:hover .sidebar-label {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Top Bar ===== */
.topbar {
    --topbar-search-width: min(58%, 640px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Full width, fixed height */
    background: #2c2c5c; /* Dark purple bar */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 2.5%; /* responsive side padding */
    box-sizing: border-box;
    z-index: 1000;
}

.home-page .topbar {
    left: 0;
    width: 100%;
    z-index: 1200;
}

.stats-main {
    min-height: 100vh;
    padding: 120px 48px 48px;
    box-sizing: border-box;
}

.stats-hero {
    max-width: 1120px;
    margin: 0 auto 28px;
    text-align: left;
}

.stats-kicker {
    margin: 0 0 10px;
    color: #8f95ff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stats-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    line-height: 1.05;
    color: #ffffff;
}

.stats-hero p {
    margin: 14px 0 0;
    max-width: 680px;
    color: rgba(230, 231, 255, 0.78);
    font-size: 1.05rem;
    line-height: 1.6;
}

.stats-panel {
    max-width: 1120px;
    margin: 0 auto;
}

.stats-list {
    display: grid;
    gap: 14px;
}

.stats-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 24px 28px;
    border-radius: 22px;
    background: rgba(163, 155, 255, 0.08);
    border: 1px solid rgba(163, 155, 255, 0.12);
    text-align: left;
}

.stats-row-label {
    color: #f4f3ff;
    font-size: 1.15rem;
    font-weight: 800;
}

.stats-row-copy {
    margin-top: 6px;
    color: rgba(225, 223, 255, 0.62);
    font-size: 0.98rem;
    line-height: 1.5;
}

.stats-row-value {
    color: #9da4ff;
    font-size: clamp(1.08rem, 1.8vw, 1.62rem);
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.settings-main {
    min-height: 100vh;
    padding: 120px 48px 48px;
    box-sizing: border-box;
}

.settings-panel {
    max-width: 1120px;
    margin: 0 auto;
}

.settings-list {
    display: grid;
    gap: 14px;
}

.settings-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 24px 28px;
    border-radius: 22px;
    background: rgba(163, 155, 255, 0.08);
    border: 1px solid rgba(163, 155, 255, 0.12);
    text-align: left;
}

.settings-row.is-danger {
    border-color: rgba(255, 95, 95, 0.42);
    background: rgba(255, 95, 95, 0.08);
}

.settings-row-label {
    color: #f4f3ff;
    font-size: 1.15rem;
    font-weight: 800;
}

.settings-action-btn {
    padding: 0;
    border: none;
    background: transparent;
    color: #ff6b6b;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
}

.settings-action-btn:hover {
    color: #ff8a8a;
}

/* Title */
.topbar .title {
    font-size: 1.85rem;
    color: #a39bff;
    font-weight: bold;
}

.topbar .home-title {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.topbar-logo-btn {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.topbar-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    top: 2px;
    margin-left: -62px;
    margin-right: -10px;
}

/* Search Bar */
.topbar #searchBar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: var(--topbar-search-width);
    margin: 0;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 700;
    background: #25254d; /* Slightly darker than top bar */
    color: #a39bff;
    border-radius: 8px;
    border: none;
    outline: none;
    box-sizing: border-box;
}

.topbar #searchBar::placeholder {
    color: #a39bff;
    opacity: 1;
}

.games-sort-wrap {
    justify-self: end;
    margin-right: 74px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 6px;
    border-radius: 8px;
    background: #25254d;
}

#sortSelect {
    padding: 10px 12px;
    padding-right: 34px;
    min-width: 120px;
    font-size: 18px;
    line-height: 1;
    border: none;
    background: transparent;
    background-image: none;
    color: #a39bff;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: center;
    text-align-last: center;
}

.games-sort-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #a39bff;
    transform: translateY(-35%);
    pointer-events: none;
}

/* Random Button */
.topbar #requestGameBtn,
.topbar #topbarDisguiseBtn,
.topbar #randomBtn {
    padding: 10px 22px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: #25254d;
    color: #a39bff;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.topbar #requestGameBtn {
    position: absolute;
    left: calc(75% + (var(--topbar-search-width) / 4) - 127px);
    transform: translateX(-50%);
}

.topbar #topbarDisguiseBtn {
    position: absolute;
    left: calc(75% + (var(--topbar-search-width) / 4) + 65px);
    transform: translateX(-50%);
}

.topbar #requestGameBtn:hover,
.topbar #topbarDisguiseBtn:hover,
.topbar #randomBtn:hover {
    transform: translateX(-50%) scale(1.05); /* only zoom */
}

/* ===== Recently Played ===== */
.recently-played {
    display: none;
    padding: 90px 20px 10px 20px;
}

.recently-played h2 {
    margin: 0 0 16px 0;
    font-size: 1.6rem;
    color: #a39bff;
    text-align: center;
}

.all-games h2 {
    margin: 0 0 16px 0;
    font-family: inherit;
    font-size: 1.6rem;
    font-weight: 700;
    color: #a39bff;
    text-align: center;
}

.all-games {
    padding: 100px 20px 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 16px;
}

body.home-page.recent-page:not(.favourites-page) .all-games {
    padding-top: 100px;
}

body.home-page.recent-page:not(.favourites-page) .all-games + .games {
    padding-top: 16px;
}

body.home-page.favourites-page .all-games {
    padding-top: 110px;
}

body.home-page.favourites-page .all-games + .games {
    padding-top: 16px;
}

.all-games h2 {
    grid-column: 2;
    margin: 0;
    line-height: 1;
    align-self: center;
}

.all-games .games-sort-wrap {
    margin-right: 0;
}

.all-games-actions {
    grid-column: 3;
    align-self: center;
    justify-self: end;
    margin-right: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#disguiseTabBtn {
    padding: 10px 18px;
    font-size: 18px;
    font-weight: 400;
    border-radius: 8px;
    border: none;
    background: #25254d;
    color: #a39bff;
    cursor: pointer;
    transition: transform 0.2s;
}

#clearRecentsBtn {
    padding: 10px 18px;
    font-size: 18px;
    font-weight: 400;
    border-radius: 8px;
    border: none;
    background: #25254d;
    color: #a39bff;
    cursor: pointer;
    transition: transform 0.2s;
}

#disguiseTabBtn:hover,
#clearRecentsBtn:hover {
    transform: scale(1.05);
}

.has-recent .all-games {
    padding-top: 40px;
}

.recent-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: calc((138px * 8) + (25px * 7));
    margin: 0 auto;
}

.recent-row .game {
    width: 138px;
    height: 138px;
}

.has-recent .recently-played {
    display: block;
}

.is-searching .recently-played {

    display: none;
}

.is-searching .all-games {
    padding-top: 100px;
}

.is-searching .all-games .games-sort-wrap {
    display: none;
}

.is-searching #disguiseTabBtn,
.is-searching #clearRecentsBtn {
    display: none;
}

.is-searching .all-games + .games {
    padding-top: 24px;
}

.has-recent .games {
    padding-top: 40px;
}

/* ===== Adjust Games Grid for Topbar ===== */
.games {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 4px 20px 24px 20px;
    max-width: calc((138px * 8) + (25px * 7));
    margin: 0 auto;
}

#soundEffectsGrid {
    column-gap: 10px;
    row-gap: 25px;
}

body.home-page:not(.recent-page) .games {
    justify-content: flex-start;
}

body.home-page:not(.recent-page) .recent-row {
    justify-content: flex-start;
}

.home-page .recently-played,
.home-page .all-games,
.home-page .games,
.home-page .no-results {
    transition: max-width 0.32s ease;
}

body.home-page:not(.recent-page) .all-games,
body.home-page:not(.recent-page) .games,
body.home-page:not(.recent-page) .no-results {
    position: relative;
    left: var(--home-content-offset);
}

body.home-page:not(.recent-page) .recently-played {
    position: relative;
    left: var(--home-content-offset);
}

body.recent-page .all-games,
body.recent-page .games,
body.recent-page .no-results {
    position: relative;
    left: 34px;
}

.all-games + .games {
    padding-top: 10px;
}

.no-results {
    display: none;
    padding: 100px 20px 20px;
}

.no-results-text {
    margin: 0 0 20px;
    color: #a39bff;
    font-size: 1.6rem;
    font-weight: bold;
}

.sound-effect-card {
    all: unset;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    justify-content: center;
    overflow: visible;
    color: transparent;
    text-decoration: none;
}

.sound-effect-card img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.sound-effect-card p {
    display: block;
    margin: 16px 0 0;
    color: #a39bff;
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    max-width: 120px;
}

.sound-effect-card:hover,
.sound-effect-card:focus,
.sound-effect-card:focus-visible {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.sound-effect-card:active img {
    filter: brightness(0.7);
}

.recent-empty-copy {
    margin: 0;
    color: #d7d2ff;
    font-size: 1.05rem;
}

.request-game-btn {
    display: inline-block;
    margin: 0 0 34px;
    padding: 12px 20px;
    border-radius: 10px;
    background: #25254d;
    color: #a39bff;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.request-game-btn:hover {
    transform: scale(1.05);
}

.no-results-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: calc((138px * 8) + (25px * 7));
    margin: 0 auto;
}

/* ===== Individual Game Cards ===== */
.game {
    text-decoration: none;
    color: #fff;
    background: #2c2c5c;
    padding: 0;
    border-radius: 12px;
    width: 138px;
    height: 138px;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game:hover {
    transform: scale(1.05);
}

.game.sound-effect-card,
.game.sound-effect-card:hover,
.game.sound-effect-card:focus,
.game.sound-effect-card:focus-visible {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
}

.favorite-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #8f93ad;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.favorite-toggle:hover {
    transform: scale(1.08);
}

.game:hover .favorite-toggle,
body.game-page .recommendation-card:hover .favorite-toggle {
    opacity: 1;
}

.favorite-toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    display: block;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 1)) drop-shadow(0 0 3px rgba(0, 0, 0, 1)) drop-shadow(0 0 5px rgba(0, 0, 0, 0.95));
}

.favorite-toggle.is-favorite {
    color: #ffd54a;
}

.favorite-toggle.favorite-pop {
    animation: favorite-pop 0.22s ease-out;
}

@keyframes favorite-pop {
    0% {
        transform: scale(1);
    }
    55% {
        transform: scale(1.28);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== Game Images ===== */
/* Logo cards */
.game.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game.has-logo p {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.game.has-logo:hover p {
    opacity: 1;
}

/* Game Titles */
.game p {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #a39bff;
    text-align: center;
    padding: 0 8px;
    line-height: 1.25;
}

.game.sound-effect-card p {
    display: block;
    margin: 16px 0 0;
    color: #a39bff;
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    max-width: 120px;
    padding: 0;
}

.recent-page .games {
    display: none;
    grid-template-columns: repeat(8, 138px);
    justify-content: center;
    padding-top: 18px;
}

.recent-page .no-results {
    padding-top: 28px;
}

/* ===== Responsive ===== */
@media (max-width: 800px) {
    body.home-page {
        --sidebar-collapsed: 68px;
        --sidebar-expanded: 214px;
    }

    .topbar { --topbar-search-width: min(52%, 520px); }
    .topbar #searchBar { font-size: 16px; }
    .game { width: 110px; height: 110px; }
    .games { max-width: calc((110px * 6) + (25px * 5)); }
    .recent-row .game { width: 110px; height: 110px; }
    .recent-row { max-width: calc((110px * 6) + (25px * 5)); }
    .no-results-grid { max-width: calc((110px * 5) + (25px * 4)); }
    .stats-main,
    .settings-main { padding: 110px 28px 36px; }
    .stats-row { padding: 22px; }
    .settings-row { padding: 22px; }
    body.game-page .sidebar {
        width: 68px;
    }
    body.game-page .page {
        margin-left: 68px;
    }
}

@media (max-width: 500px) {
    body.home-page {
        --sidebar-collapsed: 0px;
        --sidebar-expanded: 0px;
    }

    .home-page .sidebar {
        display: none;
    }

    .home-page .page-shell {
        padding-left: 0;
    }

    .stats-page .page-shell {
        padding-left: 0;
    }

    .home-page .topbar {
        left: 0;
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .topbar #searchBar {
        position: static;
        transform: none;
        width: 90%;
        margin: 10px 0;
    }
    body.game-page .topbar-request,
    .topbar #requestGameBtn,
    .topbar #topbarDisguiseBtn {
        position: static;
        left: auto;
        transform: none;
        margin: 10px 0;
        width: 80%;
    }
    .topbar #randomBtn { margin: 10px 0; width: 80%; }
    .no-results-grid { max-width: calc((110px * 3) + (25px * 2)); }
    body.game-page .sidebar {
        display: none;
    }
    body.game-page .page {
        margin-left: 0;
    }

    .all-games {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }

    .all-games h2,
    .all-games .all-games-actions {
        grid-column: auto;
        justify-self: center;
    }

    .all-games-actions {
        flex-direction: column;
    }

    #sortSelect {
        width: 100%;
        min-width: 180px;
    }

    .stats-main,
    .settings-main {
        padding: 104px 18px 26px;
    }

    .stats-row,
    .settings-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-row-value {
        text-align: left;
        white-space: normal;
    }
}

/* ===== Game Pages ===== */
body.game-page {
    min-height: 100%;
    background: #1a1a3d;
    color: #f5f7ff;
    display: flex;
    justify-content: center;
    padding: 94px 16px 48px;
    box-sizing: border-box;
}

body.game-page .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 76px;
    height: 100vh;
    padding: 88px 12px 18px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #24244f 0%, #181836 100%);
    border-right: 1px solid rgba(163, 155, 255, 0.18);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    z-index: 1100;
    transition: width 0.32s ease, box-shadow 0.32s ease;
}

body.game-page .sidebar:hover {
    width: 250px;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.28);
}

body.game-page .page {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-left: 76px;
}

body.game-page .topbar,
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #2c2c5c;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 5%;
    box-sizing: border-box;
    z-index: 1000;
}

body.game-page .topbar {
    z-index: 1200;
}

body.game-page .topbar-title,
.topbar .title,
.topbar .home-title {
    padding: 0;
    margin-left: -16px;
    border: none;
    background: transparent;
    color: #a39bff;
    font-size: 1.85rem;
    font-weight: bold;
    cursor: pointer;
}

body.game-page .topbar-search,
.topbar #searchBar {
    position: absolute;
    left: 45%;
    transform: translateX(-50%);
    width: var(--topbar-search-width);
    margin: 0;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 700;
    background: #25254d;
    color: #a39bff;
    border-radius: 8px;
    border: none;
    outline: none;
    box-sizing: border-box;
}

body.game-page .topbar-search::placeholder,
.topbar #searchBar::placeholder {
    color: #a39bff;
    opacity: 1;
}

body.game-page .topbar-request,
body.game-page .topbar-random,
.topbar #requestGameBtn,
.topbar #topbarDisguiseBtn,
.topbar #randomBtn {
    padding: 10px 22px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    background: #25254d;
    color: #a39bff;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.game-page .topbar-request,
.topbar #requestGameBtn {
    position: absolute;
    left: calc(75% + (var(--topbar-search-width) / 4) - 127px);
    transform: translateX(-50%);
}

.topbar #topbarDisguiseBtn {
    position: absolute;
    left: calc(75% + (var(--topbar-search-width) / 4) + 65px);
    transform: translateX(-50%);
}

body.game-page .topbar-request:hover,
.topbar #requestGameBtn:hover,
.topbar #topbarDisguiseBtn:hover,
.topbar #randomBtn:hover {
    transform: translateX(-50%) scale(1.05);
}

body.game-page .topbar-random {
    display: none;
}

body.game-page .player-meta {
    width: min(100%, 1000px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    background: #13172f;
    border: 1px solid rgba(163, 155, 255, 0.25);
    border-top: none;
    border-radius: 0 0 22px 22px;
    min-height: 68px;
    padding: 0 18px;
    box-sizing: border-box;
}

body.game-page .title {
    margin: 0;
    margin-right: auto;
    width: auto;
    text-align: left;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    padding-left: 8px;
    box-sizing: border-box;
    color: #a39bff;
}

body.game-page .player-meta > .title,
body.game-page .player-meta > .player-meta-favorite,
body.game-page .player-meta > .player-meta-random,
body.game-page .player-meta > .panic-btn,
body.game-page .player-meta > .fullscreen-btn {
    position: relative;
    top: -8px;
}

body.game-page .player-meta-favorite,
body.game-page .fullscreen-btn {
    padding: 10px 16px;
    min-width: 132px;
    border: none;
    border-radius: 999px;
    background: #25254d;
    color: #a39bff;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

body.game-page .player-meta-favorite {
    margin-right: -8px;
}

body.game-page .player-meta-random {
    padding: 10px 16px;
    min-width: 132px;
    border: none;
    border-radius: 999px;
    background: #25254d;
    color: #a39bff;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-right: -8px;
}

body.game-page .panic-btn {
    padding: 10px 16px;
    min-width: 132px;
    border: none;
    border-radius: 999px;
    background: #25254d;
    color: #a39bff;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    margin-left: 0;
    margin-right: -8px;
}

body.game-page .panic-btn:hover {
    transform: scale(1.05);
}

body.game-page .player-meta-random:hover {
    transform: scale(1.05);
}

body.game-page .player-meta-favorite:hover {
    transform: scale(1.05);
}

body.game-page .fullscreen-btn:hover {
    transform: scale(1.05);
}

body.game-page .recommendations {
    width: min(100%, 1215px);
    margin-top: 30px;
}

body.game-page .recommendation-grid {
    display: grid;
    grid-template-columns: repeat(8, 130px);
    justify-content: center;
    gap: 25px;
    margin: 0 auto;
}

body.game-page .recommendation-card {
    text-decoration: none;
    color: #fff;
    background: #2c2c5c;
    border-radius: 12px;
    width: 130px;
    height: 130px;
    overflow: hidden;
    position: relative;
    display: block;
    transition: transform 0.2s;
}

body.game-page .recommendation-card:hover {
    transform: scale(1.05);
}

body.game-page .recommendation-card .favorite-toggle {
    top: 7px;
    right: 7px;
    width: 36px;
    height: 36px;
}

body.game-page .recommendation-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.game-page .recommendation-card span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

body.game-page .recommendation-card:hover span {
    opacity: 1;
}

body.game-page .player-shell {
    width: min(100%, 1000px);
    background: #13172f;
    border: 1px solid rgba(163, 155, 255, 0.25);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    padding: 18px 18px 14px;
    box-sizing: border-box;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

body.game-page .player-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 520px;
    border: none;
    border-radius: 14px;
    background: #000;
    display: block;
}

body.game-page .player-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #000;
    box-shadow: none;
}

body.game-page .player-shell:fullscreen .player-frame {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
}

@media (max-width: 800px) {
    body.game-page {
        padding: 98px 12px 32px;
    }

    body.game-page .player-shell {
        padding: 12px;
        border-radius: 18px 18px 0 0;
    }

    body.game-page .player-frame {
        min-height: 360px;
    }

    body.game-page .player-meta {
        border-radius: 0 0 18px 18px;
        min-height: 60px;
        padding: 0 12px;
    }

    body.game-page .topbar-search {
        width: min(52%, 520px);
        font-size: 16px;
    }

    body.game-page .recommendation-grid {
        grid-template-columns: repeat(5, 104px);
    }

    body.game-page .recommendation-card {
        width: 104px;
        height: 104px;
    }
}

@media (max-width: 560px) {
    .topbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .topbar #searchBar {
        position: static;
        transform: none;
        width: 90%;
        margin: 10px 0;
    }

    .topbar #requestGameBtn,
    .topbar #topbarDisguiseBtn,
    .topbar #randomBtn {
        margin: 10px 0;
        width: 80%;
    }

    .topbar #requestGameBtn {
        margin-left: 0;
    }

    body.game-page {
        padding-top: 170px;
    }

    body.game-page .topbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    body.game-page .topbar-search {
        position: static;
        transform: none;
        width: 90%;
        margin: 10px 0;
    }

    body.game-page .topbar-request,
    body.game-page .topbar-random {
        margin: 10px 0;
        width: 80%;
    }

    body.game-page .topbar-request {
        margin-left: 0;
    }

    body.game-page .player-frame {
        min-height: 240px;
    }

    body.game-page .player-meta {
        gap: 10px;
    }

    body.game-page .player-meta-favorite,
    body.game-page .fullscreen-btn {
        padding: 9px 14px;
        min-width: 118px;
        font-size: 0.9rem;
    }

    body.game-page .player-meta-favorite {
        margin-right: 2px;
    }

    body.game-page .panic-btn {
        padding: 9px 14px;
        min-width: 118px;
        font-size: 0.9rem;
        margin-left: 0;
        margin-right: 2px;
    }

    body.game-page .recommendations {
        margin-top: 24px;
    }

    body.game-page .recommendation-grid {
        grid-template-columns: repeat(3, 104px);
        gap: 18px;
    }
}
