:root {
    --mobile-nav-height: calc(68px + env(safe-area-inset-bottom, 0px));
}

body:has(.mobile-bottom-nav) {
    padding-bottom: var(--mobile-nav-height) !important;
}

body .mobile-bottom-nav {
    display: flex !important;
    min-height: var(--mobile-nav-height);
    padding: 7px max(12px, env(safe-area-inset-left, 0px)) calc(7px + env(safe-area-inset-bottom, 0px));
    background: #10151f;
    border-top: 1px solid #293040;
}

.mobile-bottom-nav .nav-item {
    min-height: 48px;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #a9b1c3;
    border-radius: 12px;
}

.mobile-bottom-nav .nav-item.active {
    color: #c8b8ff;
    background: #252039;
}

.mobile-bottom-nav .nav-item i {
    font-size: 23px;
}

.mobile-bottom-nav a:focus-visible,
.mobile-home a:focus-visible,
.mobile-disclosure summary:focus-visible {
    outline: 3px solid #c8b8ff;
    outline-offset: 3px;
}

body:has(.mobile-bottom-nav) .arcade-header-nav {
    display: none;
}

body.mobile-home {
    background: #0d1117;
    color: #f3f4fa;
}

.mobile-home .mobile-home-header {
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 20px;
    background: transparent;
    border: 0;
    gap: 16px;
}

.mobile-home-header .header-left {
    flex-shrink: 0;
    gap: 9px;
    color: inherit;
}

.mobile-home-header .brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.mobile-home-header .brand-name {
    font-size: 22px;
}

.mobile-home-header .header-right {
    min-width: 0;
}

.mobile-home-header .arcade-user-link {
    max-width: 150px;
    min-height: 44px;
}

.mobile-home-header .arcade-user-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-home .mobile-home-main {
    max-width: 760px;
    padding: 8px 20px 28px;
    margin: 0 auto;
}

.mobile-hero {
    padding: 25px 0 28px;
}

.mobile-hero h1 {
    max-width: 520px;
    margin: 0 0 12px;
    font-size: clamp(30px, 7.8vw, 44px);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -1px;
    color: #f3f4fa;
}

.mobile-hero p {
    margin: 0 0 24px;
    color: #b1b8c9;
    font-size: 16px;
    line-height: 1.55;
}

.mobile-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 13px 18px;
    border-radius: 16px;
    background: #b9a0ff;
    color: #171123;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}

.mobile-primary:hover {
    background: #cbbbff;
    color: #171123;
}

.mobile-quick h2 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: #f3f4fa;
}

.mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mobile-quick-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 19px 6px 15px;
    min-height: 114px;
    border: 1px solid #2c3040;
    border-radius: 18px;
    background: #191d29;
    color: #f3f4fa;
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mobile-quick-card > i {
    font-size: 29px;
    color: #c3b1ff;
}

.mobile-quick-card:nth-child(2) > i {
    color: #ffcc8b;
}

.mobile-quick-card:nth-child(3) > i {
    color: #83d9c0;
}

.mobile-quick-card:hover,
.mobile-game-link:hover,
.mobile-together:hover {
    color: #fff;
    background: #242938;
}

.mobile-disclosure {
    margin-top: 18px;
    border: 1px solid #2c3040;
    border-radius: 16px;
    background: #151a24;
}

.mobile-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 15px 17px;
    list-style: none;
    cursor: pointer;
    color: #ececf6;
    font-size: 15px;
    font-weight: 600;
}

.mobile-disclosure > summary::-webkit-details-marker {
    display: none;
}

.mobile-disclosure[open] > summary > i {
    transform: rotate(180deg);
}

.mobile-game-list {
    padding: 0 8px 8px;
}

.mobile-game-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 56px;
    padding: 12px 10px;
    border-top: 1px solid #292e3c;
    color: #ecedf4;
    font-size: 15px;
}

.mobile-game-link > i:first-child {
    color: #c3b1ff;
    font-size: 23px;
}

.mobile-game-link > span {
    flex: 1;
}

.mobile-game-link > i:last-child {
    color: #a9b1c3;
}

.mobile-together {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 18px;
    padding: 18px 16px;
    border: 1px solid #2c3040;
    border-radius: 16px;
    background: #191d29;
    color: #f3f4fa;
}

.mobile-together > i:first-child {
    font-size: 26px;
    color: #83d9c0;
}

.mobile-together > span {
    flex: 1;
    min-width: 0;
}

.mobile-together strong,
.mobile-together small {
    display: block;
}

.mobile-together strong {
    font-size: 16px;
    font-weight: 600;
}

.mobile-together small {
    margin-top: 4px;
    color: #b1b8c9;
    line-height: 1.4;
    font-size: 13px;
}

.mobile-shortcuts {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.mobile-shortcuts > a {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 48px;
    color: #c4c9d8;
    font-size: 14px;
}

.mobile-progress[open] {
    padding: 0 12px 12px;
}

.mobile-progress .arcade-quest {
    margin: 0 0 20px;
}

.mobile-progress .leaderboard-section,
.mobile-progress .achievements-section {
    margin-top: 18px;
}

.mobile-save-prompt {
    padding: 20px;
    margin: 0 0 20px;
    border: 1px solid #3c3454;
    border-radius: 18px;
    background: #1d1a2b;
}

.mobile-save-prompt h2 {
    font-size: 19px;
    margin: 0 0 10px;
}

.mobile-save-prompt p {
    color: #c4c9d8;
    font-size: 14px;
    line-height: 1.5;
}

.mobile-login .bg-particles {
    display: none;
}

@media (min-width: 768px) {
    .mobile-hero {
        padding-top: 36px;
    }

    .mobile-quick-card {
        min-height: 140px;
        font-size: 15px;
    }

    .mobile-game-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 16px;
    }

    body .mobile-bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(100%, 760px);
        border: 1px solid #293040;
        border-bottom: 0;
        border-radius: 18px 18px 0 0;
    }
}

body.mobile-chat {
    overflow-x: clip;
}

.mobile-chat .offcanvas {
    max-width: calc(100vw - 16px);
}

.mobile-chat .chat-navbar .nav-actions a[href="/channels"],
.mobile-chat .chat-navbar .nav-actions a[href="/shop"],
.mobile-chat .chat-navbar .nav-actions a[href="/arcade"] {
    display: none;
}

.mobile-chat-guide {
    margin-top: 14px;
    color: #b1b8c9;
    font-size: 14px;
}

.mobile-chat-guide > summary {
    min-height: 44px;
    padding: 12px 0;
    cursor: pointer;
}

.mobile-chat .offcanvas:not(.show):not(.showing):not(.hiding) {
    display: none;
}

body.mobile-chat .chat-navbar {
    z-index: 1020;
}

.mobile-bottom-nav .mobile-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 18px;
}

.mobile-bottom-nav .mobile-chat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 18px;
    padding: 0 5px;
    border-radius: 6px;
    background: #1e3a32;
    color: #a4edc7;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
