/* Base Styles */
body {
    margin: 0;
    overflow: hidden;
    background: #0f172a;
    /* Sleek Dark Mode Background */
    font-family: 'Nunito', 'Inter', 'Segoe UI', sans-serif;
    color: #f8fafc;
}

:root {
    --ua-panel: #243249;
    --ua-panel-dark: #1e293b;
    --ua-ink: #111827;
    --ua-muted: #94a3b8;
    --ua-title: #dbeafe;
    --ua-green: #10b981;
    --ua-green-shadow: #047857;
    --ua-blue: #3b82f6;
    --ua-blue-shadow: #1d4ed8;
    --ua-red: #ef4444;
    --ua-radius-lg: 20px;
    --ua-radius-md: 14px;
    --ua-border: 5px solid var(--ua-ink);
    --ua-shadow: 0 12px 0 var(--ua-ink);
}

html,
body,
* {
    cursor: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}

.settings_modal,
.settings_modal *,
.shop_modal,
.shop_modal *,
.settings_body,
.settings_body *,
#auth_panel,
#home_info_panel,
#auth_panel *,
#home_info_panel * {
    cursor: none !important;
}

#custom_cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background: url('./images/ui/mouse_cursor.png') no-repeat center;
    background-size: contain;
    transform: translate3d(-6px, -6px, 0);
    pointer-events: none;
    z-index: 200000;
    display: none;
    will-change: transform;
}

#custom_cursor.pointer {
    background-image: url('./images/ui/mouse_pointer.png');
}

#custom_cursor.palm {
    background-image: url('./images/ui/mouse_palm.png');
}

#custom_cursor.palm_clenched {
    background-image: url('./images/ui/mouse_palm_clenched.png');
}

/* Home Screen */
#home_screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: none;
}

#home_online_count {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02rem;
    backdrop-filter: blur(6px);
    text-transform: uppercase;
    pointer-events: none;
}

/* Respawn Screen */
#respawn_screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease, backdrop-filter 0.35s ease;
}

#respawn_screen.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#respawn_screen h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
    user-select: none;
    font-weight: 900;
}

#respawn_actions {
    display: flex;
    gap: 12px;
}

#respawnBtn,
#respawnHomeBtn {
    width: 200px;
    height: 60px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 900;
    letter-spacing: 0.08rem;
    box-sizing: border-box;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#respawnBtn {
    background: #2ecc71;
    border-bottom: 4px solid #27ae60;
    color: white;
}

#respawnBtn:hover {
    background: #27ae60;
    transform: translateY(2px);
    border-bottom-width: 2px;
}

#respawnBtn:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
}

#respawnHomeBtn {
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 4px solid rgba(255, 255, 255, 0.2);
    color: white;
}

#respawnHomeBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(2px);
    border-bottom-width: 2px;
}

#respawnHomeBtn:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
}

#home_screen.unblurred {
    backdrop-filter: none;
    background: transparent;
}

#home_screen.unblurred #home_logo,
#home_screen.unblurred #home_panels,
#home_screen.unblurred #input_container,
#home_screen.unblurred #credits,
#home_screen.unblurred #home_wheel,
#home_screen.unblurred #auth_panel,
#home_screen.unblurred #home_info_panel,
#home_screen.unblurred #home_discord_link,
#home_screen.unblurred #home_form_link,
#home_screen.unblurred #home_online_count,
#home_screen.unblurred #did_you_know_box,
#home_screen.unblurred #homeBlurBtn,
#home_screen.unblurred #home_overlay_triggers {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#home_logo,
#home_screen #input_container,
#home_screen #credits,
#home_screen #home_wheel,
#home_screen #auth_panel,
#home_screen #home_info_panel,
#home_screen #home_discord_link,
#home_screen #home_form_link,
#home_screen #home_overlay_triggers {
    transition: opacity 0.12s linear, visibility 0.12s linear;
}

#home_form_link {
    position: absolute;
    left: 16px;
    bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    z-index: 100001;
}

#home_form_link:hover {
    color: white;
}

#home_discord_link {
    position: absolute;
    left: 16px;
    bottom: 68px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}

#home_discord_link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Home Blur Toggle Button */
#homeBlurBtn {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: none;
    background-image: url('./images/ui/eye.png');
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease-out, filter 0.12s ease-out;
}

#homeBlurBtn:hover {
    transform: translateX(-50%) scale(1.1);
}

#homeBlurBtn.is_unblurred {
    background-image: url('./images/ui/crossed_eye.png');
}


#home_logo {
    width: min(420px, 80vw);
    height: auto;
    margin-bottom: 2rem;
    user-select: none;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

#home_panels {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(420px, calc(100vw - 48px));
}

#home_wheel {
    position: absolute;
    left: clamp(34px, 4vw, 70px);
    top: 50%;
    transform: translateY(-50%);
    width: min(42vw, 540px);
    min-width: 340px;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100001;
    pointer-events: none;
}

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

#home_wheel_hover_label {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(260px, 78%);
    min-height: 42px;
    padding: 8px 14px;
    box-sizing: border-box;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
    color: #ffffff;
    font: 900 0.9rem Nunito, sans-serif;
    letter-spacing: 0;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.12;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.7),
        0 0 12px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.home_wheel_prize_popup {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 16;
    width: min(300px, calc(100% - 36px));
    box-sizing: border-box;
    padding: 14px 44px 14px 16px;
    border-radius: 12px;
    border: 3px solid #111827;
    background: #f8fafc;
    color: #111827;
    box-shadow: 0 8px 0 #111827, 0 18px 36px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.home_wheel_prize_popup.is_visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.home_wheel_prize_label {
    color: #475569;
    font: 900 0.72rem/1 Nunito, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home_wheel_prize_text {
    margin-top: 5px;
    color: #0f172a;
    font: 900 1.15rem/1.12 Nunito, sans-serif;
    letter-spacing: 0;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.home_wheel_prize_close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #dc2626;
    font: 900 1.45rem/1 Nunito, sans-serif;
    cursor: pointer;
}

.home_wheel_prize_close:hover {
    transform: scale(1.12);
}

#home_wheel_title {
    color: rgba(255, 255, 255, 0.92);
    font: 900 0.92rem Rajdhani, sans-serif;
    letter-spacing: 0.16rem;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

#home_wheel_shell {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: visible;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.15), transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.92) 68%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 0 10px rgba(255, 255, 255, 0.05),
        inset 0 0 40px rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
}

#home_wheel_shell:hover {
    transform: scale(1.015);
    filter: brightness(1.02);
}

#home_wheel_shell:focus,
#home_wheel_shell:focus-visible {
    outline: none;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 0 10px rgba(255, 255, 255, 0.05),
        inset 0 0 40px rgba(255, 255, 255, 0.08);
}

#home_wheel_shell::before {
    content: '';
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

#home_wheel_shell::after {
    content: none;
}

.home_wheel_svg {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    transform-origin: 50% 50%;
    will-change: transform;
    z-index: 1;
}

#home_wheel_marker {
    position: absolute;
    top: 0;
    left: 50%;
    width: 80px;
    height: 70px;
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: none;
}

#home_wheel_marker::before {
    content: none;
}

#home_wheel_marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -2px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 46px solid #141b28;
}

#play_panel,
#auth_panel {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(12, 18, 28, 0.24);
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
    box-sizing: border-box;
}

#play_panel {
    width: 100%;
    flex: none;
    padding: 22px;
}

#did_you_know_box {
    margin-top: 12px;
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(219, 234, 254, 0.16);
    background: rgba(15, 23, 42, 0.38);
    color: rgba(248, 250, 252, 0.9);
    font-family: 'Nunito', -apple-system, sans-serif;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.did_you_know_label {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06rem;
    color: #dbeafe;
    white-space: nowrap;
}

.did_you_know_text {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    color: rgba(248, 250, 252, 0.78);
}

#auth_panel {
    position: absolute;
    right: 16px;
    bottom: 92px;
    width: min(360px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 150px));
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: auto;
    z-index: 100001;
}

#auth_panel_title {
    color: white;
    font: 800 1.15rem Inter, sans-serif;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    text-align: left;
}

#home_info_tabs {
    display: flex;
    gap: 8px;
}

.home_info_tab {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
    font: 800 0.78rem Inter, sans-serif;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.home_info_tab.active {
    background: rgba(34, 184, 240, 0.16);
    border-color: rgba(34, 184, 240, 0.45);
    color: white;
}

#home_info_sections {
    min-height: 0;
}

.home_info_panel_section {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.home_info_panel_section.active {
    display: flex;
}

.home_info_section_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.home_info_section_title {
    color: white;
    font: 800 0.92rem Inter, sans-serif;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
}

#auth_panel_subtitle {
    color: rgba(255, 255, 255, 0.72);
    font: 600 0.92rem Inter, sans-serif;
    line-height: 1.35;
    text-align: left;
}

#input_container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#home_play_actions {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

#homeUsrnInput,
#homePassInput {
    padding: 0 15px;
    font-size: 1.08rem;
    width: 100%;
    height: 58px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: #333;
    outline: none;
    font-weight: 600;
    box-sizing: border-box;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

#homeUsrnInput:focus,
#homePassInput:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2);
}

#homeUsrnInput::placeholder,
#homePassInput::placeholder {
    color: #999;
}

#homeUsrnInput:disabled,
#homePassInput:disabled {
    background: rgba(235, 235, 235, 0.92);
    color: #666;
    cursor: not-allowed;
}

#homePassInput {
    height: 50px;
    padding: 0 14px;
    font-size: 0.98rem;
}

#leaderboardRefreshBtn {
    min-width: 90px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font: 800 0.74rem Inter, sans-serif;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
}

#home_leaderboard_status {
    color: rgba(255, 255, 255, 0.68);
    font: 600 0.82rem Inter, sans-serif;
    line-height: 1.35;
}

#home_leaderboard_scopes {
    display: flex;
    gap: 8px;
}

.home_leaderboard_scope_btn {
    flex: 1;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.72);
    font: 800 0.72rem Inter, sans-serif;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
}

.home_leaderboard_scope_btn.active {
    background: rgba(46, 204, 113, 0.18);
    border-color: rgba(46, 204, 113, 0.45);
    color: white;
}

#home_leaderboard_list,
#home_updates_log {
    max-height: 224px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.home_leaderboard_entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.home_leaderboard_rank {
    min-width: 38px;
    color: var(--ua-title);
    font: 900 0.95rem Rajdhani, sans-serif;
    letter-spacing: 0.04rem;
}

.home_leaderboard_entry_copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.home_leaderboard_name {
    color: white;
    font: 800 0.92rem Inter, sans-serif;
    line-height: 1.2;
    word-break: break-word;
}

.home_leaderboard_name_rainbow {
    color: hsl(0 100% 65%);
    display: inline-block;
    filter: saturate(1.45) brightness(1.06);
    animation: liberationRainbowHueShift 12s linear infinite;
    will-change: filter;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.16);
}

.home_leaderboard_name_admin {
    color: #7f1d1d;
}

.home_leaderboard_score {
    color: rgba(255, 255, 255, 0.64);
    font: 600 0.76rem Inter, sans-serif;
}

.home_leaderboard_empty {
    padding: 18px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.68);
    font: 600 0.82rem Inter, sans-serif;
    text-align: center;
}

.home_update_entry {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.home_update_version {
    color: white;
    font: 800 0.86rem Inter, sans-serif;
    margin-bottom: 6px;
}

.home_update_change {
    color: rgba(255, 255, 255, 0.72);
    font: 600 0.76rem Inter, sans-serif;
    line-height: 1.35;
}

.home_update_date {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.5);
    font: 600 0.72rem Inter, sans-serif;
    text-align: right;
}

@keyframes liberationRainbowHueShift {
    from {
        filter: hue-rotate(0deg) saturate(1.45) brightness(1.06);
    }
    to {
        filter: hue-rotate(360deg) saturate(1.45) brightness(1.06);
    }
}

#auth_actions {
    width: 100%;
    display: flex;
    gap: 10px;
}

#loginBtn,
#signupBtn,
#logoutBtn {
    flex: 1;
    height: 52px;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    border-bottom: 4px solid #0f5f8f;
    background: #22b8f0;
    color: white;
    font-size: 0.96rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 900;
    letter-spacing: 0.08rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.1s ease;
}

#loginBtn:hover,
#signupBtn:hover,
#logoutBtn:hover {
    background: #0ea5e9;
    transform: translateY(2px);
    border-bottom-width: 2px;
}

#loginBtn:active,
#signupBtn:active,
#logoutBtn:active {
    transform: translateY(4px);
    border-bottom-width: 0;
}

#logoutBtn {
    display: none;
}

#account_status {
    width: 100%;
    color: rgba(255, 255, 255, 0.8);
    font: 600 0.9rem Inter, sans-serif;
    text-align: left;
    line-height: 1.35;
}

#account_stats {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.account_stat_card {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.account_stat_label {
    color: rgba(255, 255, 255, 0.62);
    font: 700 0.72rem Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    margin-bottom: 6px;
}

.account_stat_value {
    color: white;
    font: 800 1rem Rajdhani, sans-serif;
    letter-spacing: 0.04rem;
}

#joinBtn,
#tutorialBtn {
    flex: 1 1 0;
    height: 65px;
    cursor: pointer;
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 1.4rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 900;
    letter-spacing: 0.1rem;
    box-sizing: border-box;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#joinBtn {
    background: #2ecc71;
    border-bottom: 4px solid #27ae60;
}

#joinBtn:hover {
    background: #27ae60;
    transform: translateY(2px);
    border-bottom-width: 2px;
}

#joinBtn:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
}

#tutorialBtn {
    background: #2f80ed;
    border-bottom: 4px solid #1f5fb8;
}

#tutorialBtn:hover {
    background: #1f5fb8;
    transform: translateY(2px);
    border-bottom-width: 2px;
}

#tutorialBtn:active {
    transform: translateY(4px);
    border-bottom-width: 0px;
}

/* HUD Overlay */
#game_hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    display: none;
}

/* Chat Styles */
#chat_history_panel {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 32px));
    height: min(340px, max(210px, 38vh));
    display: none;
    flex-direction: column;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(10, 16, 24, 0.58);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
    pointer-events: auto;
}

#chat_history_header {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

#chat_history_title {
    color: rgba(255, 255, 255, 0.78);
    font: 800 0.82rem Inter, sans-serif;
    letter-spacing: 0.04rem;
    user-select: none;
}

#chat_history_close {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font: 800 1rem/1 Inter, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#chat_history_close:hover {
    background: rgba(255, 255, 255, 0.16);
}

#chat_history_body {
    margin-top: 8px;
    padding: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

#chat_history_body::-webkit-scrollbar {
    width: 6px;
}

#chat_history_body::-webkit-scrollbar-track {
    background: transparent;
}

#chat_history_body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.32);
    border-radius: 999px;
}

.chat_history_message {
    color: rgba(255, 255, 255, 0.88);
    font: 600 0.82rem/1.38 Inter, sans-serif;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-bottom: 8px;
}

.chat_history_message:last-child {
    margin-bottom: 0;
}

.chat_history_username {
    color: #ffffff;
    font-weight: 800;
}

#chat_input_wrapper {
    position: absolute;
    bottom: 165px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    display: none;
    width: 400px;
}

#chat_command_hint {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 10px;
    right: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    display: none;
}

#chat_command_list {
    position: absolute;
    bottom: calc(100% + 36px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px;
    backdrop-filter: blur(6px);
    pointer-events: auto;
    z-index: 1;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#chat_command_list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#chat_suggest_list {
    position: absolute;
    bottom: calc(100% + 36px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px;
    backdrop-filter: blur(6px);
    pointer-events: auto;
    z-index: 2;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#chat_suggest_list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.chat_command_item {
    padding: 6px 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

.chat_command_item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.chat_command_item.active {
    background: rgba(59, 130, 246, 0.28);
    color: #fff;
    outline: 1px solid rgba(96, 165, 250, 0.82);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#chatInput {
    pointer-events: auto;
    width: 100%;
    min-height: 48px;
    max-height: 148px;
    padding: 12px 20px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.35;
    outline: none;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

#chatInput::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#chatInput:focus {
    border-color: var(--ua-blue);
}

/* Credits */
#credits {
    position: absolute;
    left: 16px;
    bottom: 48px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
    user-select: none;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 100001;
}

/* Settings Button */
#settingsBtn {
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

#settingsBtn:hover {
    transform: rotate(45deg) scale(1.1);
}

/* Fullscreen Button */
#fullscreenBtn {
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

#fullscreenBtn:hover {
    transform: scale(1.1);
}

/* Pause Button */
#pauseBtn {
    width: 60px;
    height: 60px;
    z-index: 100001;
    pointer-events: auto;
    transition: all 0.2s ease;
}

#pauseBtn:hover {
    transform: scale(1.1);
}

/* Shop Button */
#shopBtn {
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
    position: relative;
}

#shopBtn:hover {
    transform: scale(1.1) translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
}

@keyframes shop-ping-dot {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

@keyframes shop-ping-ring {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(2.6); opacity: 0; }
}

.shop_item_alert {
    position: absolute;
    inset: 6px;
    border-radius: 10px;
    border: 2px solid rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4) inset, 0 0 12px rgba(239, 68, 68, 0.45);
    animation: shop_item_pulse 1.2s infinite;
    pointer-events: none;
    z-index: 2;
    transform-origin: center;
}

@keyframes shop_item_pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

#shop_alert_dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.9);
    transform-origin: center;
    animation: shop-ping-ring 1.2s infinite;
    pointer-events: none;
}

@keyframes shop-card-pulse {
    0% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35) inset, 0 0 10px rgba(239, 68, 68, 0.25);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0) inset, 0 0 26px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35) inset, 0 0 10px rgba(239, 68, 68, 0.25);
    }
}

/* Top HUD Bar */
#top_left_bar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    z-index: 100001;
}

#top_left_bar.canvas_topbar {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    gap: 0;
    pointer-events: none;
}

#top_left_hint {
    z-index: 100000;
}

#top_left_bar #settingsBtn,
#top_left_bar #fullscreenBtn,
#top_left_bar #shopBtn,
#top_left_bar #pauseBtn {
    position: relative;
    top: 0;
    left: 0;
    filter: invert(1) brightness(1.15) drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

#top_left_bar.tutorial_flat {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
}

#homeBlurBtn {
    filter: invert(1) brightness(1.15) drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Modal Overlay */
.modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.28);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100002;
    /* Block interaction with the page behind the modal */
    pointer-events: auto;
}

.settings_modal {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    width: 650px;
    max-width: 90vw;
    height: 520px;
    max-height: 80vh;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1025px) {
    .shop_modal {
        width: 720px;
        height: 520px;
        max-width: 92vw;
        max-height: 86vh;
    }
}

/* Shop modal base styles (parallel to settings_modal) */
.shop_modal {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    width: 92vw;
    max-width: 720px;
    height: min(520px, 86vh);
    max-height: 86vh;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Ensure only the modal content captures pointer events while the overlay background lets clicks through */
.modal_overlay > .shop_modal,
.modal_overlay > .settings_modal {
    pointer-events: auto;
}

.shop_sell_all {
    margin-top: 12px;
    width: 100%;
    padding: 10px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
}
.shop_sell_all:hover { background: #dc2626; transform: scale(1.02); }

.shop_header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.shop_header h2 { margin: 0; font-size: 1.4rem; font-weight: 900; color: #f8fafc; flex: 1; }
.shop_coin_box {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 104px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    font-weight: 800;
    justify-content: center;
}
.shop_tabs { display: flex; gap: 8px; padding: 6px; }
.shop_tab { flex: 1; padding: 8px 10px; border: 0; border-radius: 8px; cursor: pointer; background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.7); font-weight: 700; font-family: inherit; }
.shop_tab.active { background: var(--ua-blue); color: #ffffff; }
.shop_body { flex: 1; min-height: 0; padding: 18px; overflow-y: auto; }
.shop_sell_help {
    color: rgba(255,255,255,0.72);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.shop_sell_drop { background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.16); padding: 14px; border-radius: 10px; color: rgba(255,255,255,0.7); }
.shop_sell_title {
    text-align: left;
    color: rgba(255,255,255,0.85);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
    margin-bottom: 10px;
}
.shop_sell_empty {
    padding: 18px 8px;
    color: rgba(255,255,255,0.32);
    font-weight: 900;
    text-align: left;
}
.shop_sell_row {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: white;
    font-family: inherit;
    text-align: left;
}
.shop_sell_icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.shop_sell_name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}
.shop_sell_price {
    color: var(--ua-title);
    font-weight: 900;
}
.shop_sell_remove {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    font-size: 1rem;
    line-height: 1;
}

.settings_header {
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings_header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 900;
    user-select: none;
    letter-spacing: 1px;
    color: var(--ua-title);
}

.close_settings {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.close_settings:hover {
    color: white;
}

.settings_tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    padding: 5px;
    user-select: none;
}

.settings_tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

.settings_tab.active {
    background: var(--ua-blue);
    color: #ffffff;
}

.settings_body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.settings_body.visual_tab {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings_body.visual_tab::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.setting_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.setting_label {
    font-weight: 600;
    font-size: 1.1rem;
    user-select: none;
}

/* Toggle Switch */
.toggle_switch {
    width: 50px;
    height: 26px;
    background: #334155;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle_switch.on {
    background: var(--ua-blue);
}

.toggle_knob {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle_switch.on .toggle_knob {
    transform: translateX(24px);
}

.stat_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat_label {
    font-weight: 500;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.stat_value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ua-title);
}

.stat_upgrade_item .stat_value {
    min-width: 110px;
    text-align: right;
}

.stat_upgrade_btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(59, 130, 246, 0.25);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.stat_upgrade_btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.settings_section_header {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--ua-title);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.setting_input {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    width: 60%;
}

.setting_input:focus {
    border-color: var(--ua-blue);
}

.range_setting_item {
    margin-bottom: 10px;
    user-select: none;
}

.range_input_row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    user-select: none;
}

.range_input {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 24px;
    border-radius: 999px;
    background: transparent;
    margin: 0;
    outline: none;
    cursor: pointer;
}

.range_input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ua-blue);
    border: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
    margin-top: -5px;
}

.range_input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ua-blue);
    border: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
    margin-top: -5px;
}

.range_input::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    margin-top: 0;
}

.range_input::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.range_value {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    color: var(--ua-title);
    user-select: none;
}

.range_default_note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    user-select: none;
}

/* Shop Specifics */
.shop_section_title {
    margin: 10px 0 4px 0;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ua-title);
}

.shop_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.shop_item {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}

.shop_item_info_corner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.shop_item_attention {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.55) inset, 0 0 16px rgba(239, 68, 68, 0.45);
    animation: shop-card-pulse 1.2s infinite;
}

.shop_item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

.shop_item_icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    object-fit: contain;
}

.shop_item_icon_text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ua-title);
    border: 1px solid rgba(219, 234, 254, 0.28);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    font-weight: 900;
}

.shop_item_name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 5px;
    text-align: center;
}

.shop_item_info {
    position: relative;
    margin: 4px 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    z-index: 5;
}

.shop_item_info_icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.shop_item_info_tip {
    position: fixed;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: 8px;
    white-space: normal;
    max-width: min(280px, calc(100vw - 16px));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 100010;
}

.shop_item_info_tip.visible {
    opacity: 1;
}

.shop_item_price {
    font-size: 0.9rem;
    color: #f8fafc;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.shop_price_row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.shop_price_icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.buy_button {
    margin-top: auto;
    width: 100%;
    padding: 8px;
    background: var(--ua-green);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.buy_button:hover {
    background: #059669;
    transform: scale(1.05);
}

.buy_button:active {
    transform: scale(0.95);
}

.buy_button.disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(1);
    opacity: 0.6;
}

.shop_modal .settings_body {
    overflow-x: hidden;
}

.shop_modal .shop_grid,
.shop_modal .shop_grid *,
.shop_modal .shop_item,
.shop_modal .shop_item *,
.shop_modal img {
    user-select: none;
}

.shop_modal .settings_body {
    overflow-x: hidden;
}

.shop_modal .shop_grid,
.shop_modal .shop_grid *,
.shop_modal .shop_item,
.shop_modal .shop_item * {
    user-select: none;
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ua-blue) rgba(17, 24, 39, 0.8);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block;
}

*::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.8);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--ua-blue);
    border-radius: 10px;
    border: 2px solid rgba(17, 24, 39, 0.8);
    background-clip: padding-box;
    cursor: none;
}

*::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-track {
    cursor: none;
}

#home_leaderboard_list,
#home_updates_log {
    scrollbar-color: transparent transparent;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    #home_screen,
    #respawn_screen,
    #game_hud {
        width: 100vw;
        height: 100dvh;
    }

    #home_screen,
    #respawn_screen {
        padding: calc(env(safe-area-inset-top) + 10px) 12px calc(env(safe-area-inset-bottom) + 10px);
        box-sizing: border-box;
    }

    #home_logo {
        width: min(280px, 80vw);
        margin-bottom: 0.8rem;
    }

    #respawn_screen h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
        letter-spacing: 0;
    }

    #input_container {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    #home_panels {
        align-items: center;
        width: 100%;
    }

    #home_wheel {
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        width: min(32vw, 330px);
        min-width: 240px;
        gap: 8px;
    }

    #home_wheel_title {
        font-size: 0.78rem;
        letter-spacing: 0.12rem;
    }

    #play_panel,
    #auth_panel {
        width: min(86vw, 320px);
        flex: none;
        padding: 12px;
        border-radius: 14px;
    }

    #auth_panel {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom) + 72px);
        max-height: min(56vh, 420px);
        gap: 8px;
    }

    #auth_panel_title,
    #auth_panel_subtitle,
    #account_status {
        text-align: center;
    }

    #homeUsrnInput,
    #homePassInput {
        width: 100%;
        height: 40px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    #homePassInput {
        height: 38px;
        font-size: 0.86rem;
    }

    #auth_actions,
    #account_status {
        width: 100%;
    }

    #account_stats {
        grid-template-columns: 1fr;
    }

    #loginBtn,
    #signupBtn,
    #logoutBtn {
        height: 40px;
        font-size: 0.78rem;
    }

    #home_play_actions {
        gap: 8px;
    }

    #joinBtn,
    #tutorialBtn {
        height: 40px;
        font-size: 0.92rem;
        letter-spacing: 0.04rem;
        border-radius: 6px;
    }

    #respawn_actions {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 10px;
    }

    #respawnBtn,
    #respawnHomeBtn {
        width: min(40vw, 170px);
        height: 42px;
        font-size: 0.86rem;
    }

    #home_online_count {
        font-size: 0.74rem;
        padding: 5px 8px;
    }

    #home_discord_link {
        left: 12px;
        bottom: 62px;
        width: 24px;
        height: 24px;
    }

    /* Small Mobile Buttons */
    #top_left_bar {
        top: calc(env(safe-area-inset-top) + 8px);
        left: 50%;
        padding: 6px;
        gap: 6px;
        transform: translateX(-50%);
    }

    #top_left_bar #settingsBtn,
    #top_left_bar #fullscreenBtn,
    #top_left_bar #shopBtn,
    #top_left_bar #pauseBtn {
        width: 34px;
        height: 34px;
    }

    #chat_input_wrapper {
        width: min(88vw, 330px);
        bottom: calc(env(safe-area-inset-bottom) + 122px);
    }

    #chatInput {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.86rem;
        border-radius: 14px;
    }

    #credits {
        left: 12px;
        bottom: calc(env(safe-area-inset-bottom) + 42px);
        font-size: 0.7rem;
        letter-spacing: 0.04rem;
    }
}

@media (max-width: 480px) {
    #home_online_count {
        top: calc(env(safe-area-inset-top) + 8px);
        left: 10px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    #home_logo {
        width: min(240px, 78vw);
    }

    #home_wheel {
        top: calc(env(safe-area-inset-top) + 112px);
        left: 12px;
        transform: none;
        width: min(52vw, 230px);
        min-width: 0;
        gap: 6px;
    }

    #home_wheel_title {
        font-size: 0.66rem;
        letter-spacing: 0.1rem;
    }

    #respawn_screen h1 {
        font-size: 1.28rem;
    }

    #homeUsrnInput,
    #homePassInput {
        width: 100%;
        height: 36px;
    }

    #homeUsrnInput,
    #homePassInput {
        font-size: 0.82rem;
    }

    #homePassInput {
        height: 36px;
        font-size: 0.8rem;
    }

    #auth_actions,
    #account_status {
        width: 100%;
    }

    #loginBtn,
    #signupBtn,
    #logoutBtn {
        height: 36px;
        font-size: 0.74rem;
    }

    #home_play_actions {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }

    #joinBtn,
    #tutorialBtn {
        width: 100%;
        height: 36px;
        font-size: 0.82rem;
    }

    #input_container {
        gap: 5px;
    }

    #respawnBtn,
    #respawnHomeBtn {
        width: min(86vw, 320px);
    }

    #top_left_bar {
        gap: 5px;
        padding: 5px;
    }

    #top_left_bar #settingsBtn,
    #top_left_bar #fullscreenBtn,
    #top_left_bar #shopBtn,
    #top_left_bar #pauseBtn {
        width: 30px;
        height: 30px;
    }

    #home_form_link {
        font-size: 0.72rem;
        max-width: 56vw;
    }

    #home_info_tabs,
    #home_leaderboard_scopes {
        flex-wrap: wrap;
    }

    .home_info_tab,
    .home_leaderboard_scope_btn {
        min-width: calc(50% - 4px);
    }

    #chat_input_wrapper {
        width: min(84vw, 300px);
        bottom: calc(env(safe-area-inset-bottom) + 112px);
    }
}

.shop_modal.drag_disabled .settings_header {
    cursor: default !important;
}

/* Arcade UI skin */
#play_panel,
#auth_panel,
#home_info_panel,
.settings_modal,
.shop_modal,
#chat_history_panel {
    background: var(--ua-panel);
    border: var(--ua-border);
    border-radius: var(--ua-radius-lg);
    box-shadow: var(--ua-shadow);
    backdrop-filter: none;
}

#auth_panel,
#home_info_panel,
#chat_history_panel {
    scrollbar-color: var(--ua-blue) rgba(17, 24, 39, 0.8);
}

#auth_panel_title,
#home_info_panel_title,
.home_info_section_title,
.settings_header h2,
.shop_header h2,
#chat_history_title {
    color: var(--ua-title);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: none;
}

.settings_header,
.shop_header,
#chat_history_header {
    background: var(--ua-panel-dark);
    border-bottom: 5px solid var(--ua-ink);
}

.settings_header {
    padding: 16px;
}

.shop_header {
    padding: 14px 16px;
}

.close_settings,
#chat_history_close {
    color: var(--ua-red);
    background: transparent;
    border: 0;
    font-weight: 900;
    transition: transform 0.1s ease;
}

.close_settings:hover,
#chat_history_close:hover {
    color: var(--ua-red);
    background: transparent;
    transform: scale(1.18);
}

.settings_tabs,
.shop_tabs,
#home_info_tabs,
#home_leaderboard_scopes {
    background: var(--ua-panel-dark);
    border-bottom: 5px solid var(--ua-ink);
    padding: 8px;
    gap: 8px;
}

.settings_tab,
.shop_tab,
.home_info_tab,
.home_leaderboard_scope_btn {
    border: 4px solid var(--ua-ink);
    border-radius: var(--ua-radius-md);
    background: #334155;
    color: #ffffff;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    box-shadow: 0 4px 0 var(--ua-ink);
    transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.1s ease;
}

.settings_tab.active,
.shop_tab.active,
.home_info_tab.active,
.home_leaderboard_scope_btn.active {
    background: var(--ua-blue);
    color: #ffffff;
    border-color: var(--ua-ink);
}

.settings_tab:active,
.shop_tab:active,
.home_info_tab:active,
.home_leaderboard_scope_btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--ua-ink);
}

.settings_body,
.shop_body {
    background: var(--ua-panel);
    padding: 22px 20px;
}

.settings_section_header,
.setting_label,
.shop_sell_title,
.home_info_tab,
.home_leaderboard_scope_btn {
    color: var(--ua-muted);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.setting_item,
.range_setting_item,
.shop_sell_drop,
.shop_sell_row,
.shop_item,
.home_leaderboard_entry,
.home_update_entry,
.home_leaderboard_empty,
#chat_history_body {
    background: var(--ua-panel-dark);
    border: 4px solid var(--ua-ink);
    border-radius: var(--ua-radius-md);
    box-shadow: 0 5px 0 var(--ua-ink);
}

.setting_item,
.range_setting_item {
    padding: 14px 16px;
    margin-bottom: 18px;
}

.range_setting_item .setting_label,
.setting_item .setting_label {
    margin-bottom: 8px;
}

.range_input {
    height: 24px;
    background: transparent;
    border-radius: 10px;
}

.range_input::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 10px;
    background: var(--ua-ink);
    margin-top: 0;
}

.range_input::-moz-range-track {
    height: 14px;
    border-radius: 10px;
    background: var(--ua-ink);
}

.range_input::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    background: var(--ua-blue);
    box-shadow: 0 4px 0 var(--ua-blue-shadow);
    margin-top: -5px;
}

.range_input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 4px solid #ffffff;
    background: var(--ua-blue);
    box-shadow: 0 4px 0 var(--ua-blue-shadow);
    box-sizing: border-box;
}

.settings_body.visual_tab,
.settings_body,
.shop_body,
#auth_panel,
#home_info_panel,
#chat_history_body,
#home_leaderboard_list,
#home_updates_log {
    scrollbar-width: thin;
    scrollbar-color: var(--ua-blue) rgba(17, 24, 39, 0.8);
}

.settings_body.visual_tab::-webkit-scrollbar,
.settings_body::-webkit-scrollbar,
.shop_body::-webkit-scrollbar,
#auth_panel::-webkit-scrollbar,
#home_info_panel::-webkit-scrollbar,
#chat_history_body::-webkit-scrollbar,
#home_leaderboard_list::-webkit-scrollbar,
#home_updates_log::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block;
}

.settings_body.visual_tab::-webkit-scrollbar-track,
.settings_body::-webkit-scrollbar-track,
.shop_body::-webkit-scrollbar-track,
#auth_panel::-webkit-scrollbar-track,
#home_info_panel::-webkit-scrollbar-track,
#chat_history_body::-webkit-scrollbar-track,
#home_leaderboard_list::-webkit-scrollbar-track,
#home_updates_log::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.8);
    border-radius: 10px;
}

.settings_body.visual_tab::-webkit-scrollbar-thumb,
.settings_body::-webkit-scrollbar-thumb,
.shop_body::-webkit-scrollbar-thumb,
#auth_panel::-webkit-scrollbar-thumb,
#home_info_panel::-webkit-scrollbar-thumb,
#chat_history_body::-webkit-scrollbar-thumb,
#home_leaderboard_list::-webkit-scrollbar-thumb,
#home_updates_log::-webkit-scrollbar-thumb {
    background: var(--ua-blue);
    border: 2px solid rgba(17, 24, 39, 0.8);
    border-radius: 10px;
    background-clip: padding-box;
}

.settings_body.visual_tab::-webkit-scrollbar-thumb:hover,
.settings_body::-webkit-scrollbar-thumb:hover,
.shop_body::-webkit-scrollbar-thumb:hover,
#auth_panel::-webkit-scrollbar-thumb:hover,
#home_info_panel::-webkit-scrollbar-thumb:hover,
#chat_history_body::-webkit-scrollbar-thumb:hover,
#home_leaderboard_list::-webkit-scrollbar-thumb:hover,
#home_updates_log::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

.settings_header h2,
.settings_section_header,
.range_value,
.stat_value,
.shop_section_title,
.shop_sell_price,
.shop_item_icon_text,
.home_leaderboard_rank {
    color: var(--ua-title);
}

.shop_item_icon_text {
    border-color: rgba(219, 234, 254, 0.28);
    background: rgba(59, 130, 246, 0.08);
}

.setting_input,
#homeUsrnInput,
#homePassInput,
#chatInput,
select {
    background: var(--ua-ink);
    border: 3px solid #475569;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    box-shadow: none;
}

.setting_input:focus,
#homeUsrnInput:focus,
#homePassInput:focus,
#chatInput:focus,
select:focus {
    border-color: var(--ua-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

#loginBtn,
#signupBtn,
#logoutBtn,
#playBtn,
#leaderboardRefreshBtn,
.buy_button,
.sell_button,
.shop_sell_all {
    border: 0;
    border-radius: 12px;
    background: var(--ua-green);
    color: #ffffff;
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 6px 0 var(--ua-green-shadow);
    transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.1s ease;
}

#loginBtn:hover,
#signupBtn:hover,
#logoutBtn:hover,
#playBtn:hover,
#leaderboardRefreshBtn:hover,
.buy_button:hover,
.sell_button:hover,
.shop_sell_all:hover {
    background: #059669;
    transform: none;
}

#loginBtn:active,
#signupBtn:active,
#logoutBtn:active,
#playBtn:active,
#leaderboardRefreshBtn:active,
.buy_button:active,
.sell_button:active,
.shop_sell_all:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--ua-green-shadow);
}

.shop_coin_box,
.shop_sell_price,
.home_leaderboard_rank,
.home_update_version,
.range_value {
    color: var(--ua-title);
    font-weight: 900;
}

#chat_history_body {
    box-shadow: none;
}

.chat_history_message {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-weight: 800;
}

.chat_history_username {
    color: var(--ua-title);
}

#chat_history_header {
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    padding: 0;
}

#home_info_tabs,
#home_leaderboard_scopes {
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    padding: 0;
}

#top_left_bar {
    background: var(--ua-panel);
    border: 4px solid var(--ua-ink);
    border-radius: 14px;
    box-shadow: 0 6px 0 var(--ua-ink);
    backdrop-filter: none;
}

#top_left_bar.canvas_topbar {
    background: transparent;
    border: 0;
    box-shadow: none;
}

#top_left_bar #settingsBtn,
#top_left_bar #fullscreenBtn,
#top_left_bar #shopBtn,
#top_left_bar #pauseBtn {
    width: 46px;
    height: 46px;
    padding: 7px;
    border: 4px solid var(--ua-ink);
    border-radius: 12px;
    background-color: var(--ua-panel-dark);
    box-shadow: 0 4px 0 var(--ua-ink);
    filter: none;
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
}

#home_screen,
#home_screen button,
#home_screen input,
#home_screen select,
#home_screen textarea,
#chat_history_panel,
#chat_history_panel button,
#chatInput,
#chat_command_list,
#chat_suggest_list {
    font-family: 'Nunito', 'Inter', sans-serif;
}

.inventory_slot_large:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

/* Prevent selection for UI labels and chrome */
.no_select,
.close_settings,
.settings_section_header,
.setting_item,
.stat_item,
.settings_tab,
.settings_header h2,
.shop_item_name,
.shop_item_price,
#shop_sell_slot,
#shop_sell_slot *,
#shopBtn,
#settingsBtn,
#fullscreenBtn,
#pauseBtn,
#homeBlurBtn {
    user-select: none;
}

/* Home overlays */
#home_overlay_triggers {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(190px, calc(100vw - 32px));
}

.home_overlay_trigger {
    min-height: 50px;
    padding: 0 14px;
    border: 4px solid var(--ua-ink);
    border-radius: 14px;
    background: var(--ua-panel);
    color: var(--ua-title);
    box-shadow: 0 5px 0 var(--ua-ink);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease, opacity 0.12s linear, visibility 0.12s linear;
}

.home_overlay_trigger:hover,
.home_overlay_trigger.active {
    background: var(--ua-blue);
    color: #ffffff;
}

.home_overlay_trigger:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--ua-ink);
}

#home_overlay_backdrop {
    position: absolute;
    inset: 0;
    z-index: 100002;
    display: none;
    background: rgba(2, 6, 23, 0.38);
    pointer-events: auto;
}

#home_overlay_backdrop.is_open {
    display: block;
}

#home_screen.home_overlay_open #home_logo,
#home_screen.home_overlay_open #home_panels,
#home_screen.home_overlay_open #credits,
#home_screen.home_overlay_open #home_form_link,
#home_screen.home_overlay_open #home_online_count,
#home_screen.home_overlay_open #did_you_know_box,
#home_screen.home_overlay_open #homeBlurBtn,
#home_screen.home_overlay_open #home_overlay_triggers {
    filter: blur(5px);
}

.home_overlay_panel {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 100003;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -48%) scale(0.96);
    transition: transform 0.16s ease, opacity 0.12s linear, visibility 0.12s linear;
}

#auth_panel.home_overlay_panel,
#home_info_panel.home_overlay_panel,
#home_wheel.home_overlay_panel {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -48%) scale(0.96);
}

.home_overlay_panel.is_open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

#auth_panel.home_overlay_panel.is_open,
#home_info_panel.home_overlay_panel.is_open,
#home_wheel.home_overlay_panel.is_open {
    transform: translate(-50%, -50%) scale(1);
}

.home_overlay_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
}

.home_overlay_close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ua-red);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.1s ease;
}

.home_overlay_close:hover {
    transform: scale(1.16);
}

#home_wheel .home_overlay_header {
    position: relative;
    justify-content: center;
}

#home_wheel .home_overlay_close {
    position: absolute;
    right: 0;
}

#auth_panel,
#home_info_panel {
    right: auto;
    bottom: auto;
    z-index: 100003;
    width: min(390px, calc(100vw - 32px));
    max-height: min(620px, calc(100dvh - 72px));
    overflow-y: auto;
    padding: 18px;
}

#home_info_panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home_account_section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#home_wheel {
    z-index: 100003;
    width: min(500px, calc(100vw - 32px));
    min-width: 0;
    max-width: 500px;
    padding: 18px;
    gap: 0;
    pointer-events: none;
}

#home_wheel.is_open {
    pointer-events: auto;
}

#home_wheel_shell {
    width: min(430px, calc(100vw - 68px));
    margin: 0 auto;
}

#home_wheel_title,
#home_info_panel_title {
    color: var(--ua-title);
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#home_screen.unblurred #home_overlay_backdrop,
#home_screen.unblurred .home_overlay_panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#home_screen.unblurred #auth_panel.home_overlay_panel,
#home_screen.unblurred #home_info_panel.home_overlay_panel,
#home_screen.unblurred #home_wheel.home_overlay_panel {
    transform: translate(-50%, -48%) scale(0.96);
}

@media (max-width: 1024px) {
    #home_overlay_triggers {
        right: 12px;
        width: min(150px, 38vw);
        gap: 8px;
    }

    .home_overlay_trigger {
        min-height: 42px;
        padding: 0 10px;
        border-width: 3px;
        border-radius: 12px;
        font-size: 0.68rem;
    }

    #auth_panel,
    #home_info_panel {
        width: min(340px, calc(100vw - 24px));
        max-height: min(72dvh, 470px);
        padding: 14px;
    }

    #home_wheel {
        width: min(360px, calc(100vw - 24px));
        padding: 14px;
    }

    #home_wheel_shell {
        width: min(310px, calc(100vw - 52px));
    }
}

@media (max-width: 480px) {
    #home_overlay_triggers {
        top: auto;
        right: 10px;
        bottom: calc(env(safe-area-inset-bottom) + 54px);
        transform: none;
        width: min(132px, 38vw);
        gap: 7px;
    }

    .home_overlay_trigger {
        min-height: 38px;
        padding: 0 8px;
        font-size: 0.6rem;
    }

    #auth_panel,
    #home_info_panel {
        width: min(320px, calc(100vw - 18px));
        max-height: min(76dvh, 440px);
        padding: 12px;
    }

    #home_wheel {
        width: min(320px, calc(100vw - 18px));
        padding: 12px;
    }

    #home_wheel_shell {
        width: min(270px, calc(100vw - 42px));
    }

    .home_overlay_header {
        margin-bottom: 8px;
    }
}
