.currency-grid {
    flex-wrap: wrap;
}

body.tma {
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
    min-height: var(--tg-viewport-stable-height, 100dvh);
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

body.tma #root {
    min-height: var(--tg-viewport-stable-height, 100dvh);
    padding-top: var(--tg-content-safe-area-inset-top, 108px);
}

body.tma header {
    padding-top: 0.35rem;
    padding-left: 8px;
    padding-right: 10px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Explicit return to casino */
#lj-tma-back {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    z-index: 2147483000;
    display: inline-flex !important;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: #7c3aed;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
}

#lj-tma-back.lj-tma-back--in-header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    flex-shrink: 0;
    margin-right: 4px;
    z-index: 5;
}

body.modal-open #lj-tma-back {
    visibility: hidden;
    pointer-events: none;
}

#lj-tma-back:active {
    transform: scale(0.97);
    opacity: 0.9;
}

body.modal-open header {
    pointer-events: none;
}

body.modal-open {
    overflow: hidden;
}

body.tma .wallet-panel,
body.tma .header-menu-panel,
body.tma .how-to-play-panel {
    z-index: 100000;
}

body.tma,
body.tma #root,
body.tma .main-app {
    max-width: 100vw;
    overflow-x: hidden;
}

body.tma .left-users-container,
body.tma .matches-list {
    -webkit-overflow-scrolling: touch;
}

body.tma button,
body.tma .header-button,
body.tma .left-control-button {
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body.tma .header-user-pfp {
    border-radius: 50%;
    overflow: hidden;
}

body.tma .main-right,
body.tma .graph-container {
    overflow: visible;
}

body.tma .box-wrapper {
    animation: guymove 10s infinite;
}

body.tma .jet-guy {
    animation: none;
}

body.tma .jet-fire {
    top: 108px;
    right: 122px;
    width: auto;
    height: 120% !important;
    z-index: 5;
    transform: scale(1.05, -1.05) !important;
    transform-origin: center center;
    filter: drop-shadow(0 0 5px rgba(255, 150, 35, 0.9))
        brightness(1.18) saturate(1.3);
}

body.tma .jet-light {
    display: none;
}

body.tma .jet-glow {
    display: block !important;
    position: absolute;
    top: 120px;
    right: 112px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 180, 70, 0.85) 0%,
        rgba(255, 120, 25, 0.45) 45%,
        rgba(255, 80, 10, 0) 72%);
    opacity: 0.6;
    filter: blur(3px);
    z-index: 2;
    pointer-events: none;
    animation: light 2.5s infinite;
}
