:root {
    --primary-color: #39ff14; /* Neon green to match the poster */
    --bg-color: #0b0e14;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg,#0b0e14 0%,#150a24 100%);
    color: white;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    height: 100dvh;
    min-height: -webkit-fill-available;
    overscroll-behavior: none;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    height: 100dvh;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.screen.active {
    display: flex;
}

/* Splash Screen */
#splash-screen {
    background-color: var(--bg-color);
    z-index: 9999;
}

.splash-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 300px;
    gap: 16px;
}

.splash-progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.splash-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #3390ec;
    border-radius: 10px;
    animation: fillProgress 2s ease-in-out forwards;
}

.splash-text {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.button-container {
    position: absolute;
    bottom: 8%; /* Placed elegantly above the bottom text on the poster */
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.tg-button {
    background-color: var(--tg-theme-button-color, #3390ec);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 85%;
    max-width: 340px;
    box-shadow: 0 4px 14px rgba(51, 144, 236, 0.4);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tg-button:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Main Screen */
#main-screen {
    background-color: var(--bg-color);
    padding: 20px;
    text-align: center;
}

.content-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease-out forwards;
}

#main-screen h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #39ff14;
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
    font-weight: 800;
}

#main-screen {
    justify-content: flex-start;
    overflow-y: auto;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: 120px; /* enough space for bottom nav */
}

/* Bottom Navigation */
.bottom-nav-container {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 95%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    -webkit-transform: translateX(-50%) translateZ(0);
    transform: translateX(-50%) translateZ(0);
    will-change: transform;
}

.nav-segment {
    background: rgba(26, 27, 31, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.circle-segment {
    border-radius: 35px;
    padding: 10px 18px;
}

.pill-segment {
    border-radius: 35px;
    flex: 1;
    padding: 10px 20px;
}

.profile-segment {
    border-radius: 50%;
    width: 65px;
    height: 65px;
    padding: 0;
    justify-content: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8e8e93;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 26px;
    height: 26px;
}

.nav-item.active {
    color: #3390ec;
}

.nav-item.profile {
    gap: 0;
}

.nav-item.profile img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid transparent;
    object-fit: cover;
}

.nav-item.active.profile img {
    border-color: #3390ec;
}

.billboards-container {
    width: 90%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
    width: 100%; /* Ensure it spans properly */
    padding: 0 20px;
}

.billboard {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #1a1b1f;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    color: #8e8e93;
    font-weight: 600;
    overflow: hidden;
}

.billboard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* hidden until an image is provided */
}

#main-screen p {
    font-size: 18px;
    color: #c0c0c0;
    line-height: 1.5;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pull to Refresh Indicator */

/* Balance Pill */
.balance-pill {
    position: absolute;
    top: 100px;
    right: 16px;
    background-color: #1c2438;
    border-radius: 30px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    z-index: 50;
    transition: transform 0.1s ease;
}

.balance-pill:active {
    transform: scale(0.95);
}

.dollar-icon {
    width: 16px;
    height: 16px;
    color: white;
}

.balance-amount {
    color: white;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
}

/* Wallet Screen */
#wallet-screen {
    background-color: var(--bg-color);
    align-items: stretch;
    justify-content: flex-start;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

#wallet-screen.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wallet-dashboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 0;
}

.wallet-container {
    width: 90%;
    max-width: 100%;
    background-color: #1a1b1f; /* dark gray */
    border-radius: 24px;
    padding: 6px;
    margin-top: 80px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.05);
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}

.icon-wallet {
    width: 18px;
    height: 18px;
    color: #fff;
}

.connect-btn {
    background-color: #1d8aed;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.icon-plus {
    width: 14px;
    height: 14px;
}

.balance-card {
    background: linear-gradient(100deg, #202b40 0%, #1555c0 60%, #1d82ff 100%);
    border-radius: 20px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}


.balance-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.balance-title {
    font-size: 36px;
    font-weight: 800;
    color: white;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.currency-text {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.balance-buttons {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.btn-deposit {
    flex: 1;
    background-color: white;
    color: black;
    border: none;
    border-radius: 16px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.btn-withdraw {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.icon-small {
    width: 16px;
    height: 16px;
}

/* Background graphic / Image */
.balance-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    filter: brightness(0.3);
    z-index: 1;
    pointer-events: none;
}

#wallet-screen .header {
    width: 100%;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 16px;
}

#wallet-screen h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Transactions Section */
.transactions-section {
    width: 90%;
    max-width: 100%;
    margin-top: 24px;
    text-align: left;
    flex-shrink: 0;
}

.transactions-header {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.transactions-list {
    background-color: #1a1b1f; /* dark gray */
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.tx-date-header {
    font-size: 13px;
    color: #8e8e93;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
    margin-top: 8px;
    letter-spacing: 0.5px;
}
.tx-date-header:first-child {
    margin-top: 0;
}

.tx-item {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}
.tx-item:last-child {
    margin-bottom: 8px;
}

.tx-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-right: 14px;
}

.withdraw-wrapper { background-color: #8b7d4d; } /* Khaki for Khabib */
.deposit-wrapper { background-color: #1d2b44; }
.withdraw-basic-wrapper { background-color: #2a2b30; }
.item-wrapper { background-color: #5b646c; } /* Grey for book */

.tx-icon {
    font-size: 22px;
    color: white;
    font-weight: bold;
}

.tx-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #1a1b1f;
}

.tg-badge { background-color: #3390ec; }
.gift-badge { background-color: #3390ec; }
.pink-badge { background-color: #d845ab; }

.tg-badge svg, .gift-badge svg, .pink-badge svg {
    width: 10px;
    height: 10px;
}

.tx-details {
    flex: 1;
}

.tx-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

.tx-subtitle {
    font-size: 13px;
    color: #8e8e93;
}

.tx-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-amount {
    font-size: 15px;
    font-weight: 700;
}

.tx-amount.negative { color: #ff453a; }
.tx-amount.positive { color: #32d74b; }

.tx-chevron {
    color: #48484a;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 2px;
}

/* Transaction Details Screen */
#tx-details-screen {
    background-color: var(--bg-color);
    align-items: stretch;
    justify-content: flex-start;
    padding-top: max(80px, env(safe-area-inset-top));
    overflow: hidden;
}

.txd-container {
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 120px;
    height: 100%;
}

.txd-header-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    margin-top: 20px;
}

.txd-big-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: #2a2b30;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    color: white;
    font-weight: bold;
    margin-bottom: 16px;
}

.txd-big-amount {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}
.txd-big-amount.positive { color: #32d74b; }
.txd-big-amount.negative { color: #ff453a; }

.txd-big-type {
    font-size: 15px;
    color: #8e8e93;
}

.txd-card {
    background-color: #1a1b1f;
    border-radius: 20px;
    width: 100%;
    padding: 8px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin-bottom: 32px;
}

.txd-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.txd-row-icon {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #3390ec;
    margin-right: 16px;
}
.txd-row-icon svg { width: 24px; height: 24px; }

.txd-row-content {
    flex: 1;
}

.txd-label {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 4px;
}

.txd-value {
    font-size: 15px;
    font-weight: 600;
    color: white;
}
.address-value {
    display: flex;
    align-items: center;
    gap: 8px;
}
.icon-copy {
    width: 16px;
    height: 16px;
    color: #8e8e93;
    cursor: pointer;
}

.txd-bottom-actions {
    display: flex;
    width: 100%;
    gap: 12px;
    margin-top: auto;
}

.txd-btn {
    flex: 1;
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.txd-btn-primary {
    background-color: #3390ec;
    color: white;
    flex: 1.5;
}

.txd-btn-secondary {
    background-color: #2a2b30;
    color: white;
}

/* Profile Screen */
#profile-screen {
    justify-content: flex-start;
    padding-top: max(160px, env(safe-area-inset-top));
    overflow-y: hidden;
}

.profile-top-bar {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2a2b30;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }

.balance-pill-profile {
    background-color: #1c2438;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.balance-pill-profile svg {
    width: 14px;
    height: 14px;
}

.profile-scroll-container {
    width: 90%;
    max-width: 100%;
    overflow-y: auto;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: 150px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card {
    background-color: #1a1b1f;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: white;
}

.profile-rank {
    display: inline-block;
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.profile-inventory {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.inv-label {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 4px;
}

.inv-value {
    font-size: 15px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}
.inv-value svg { width: 16px; height: 16px; color: #8e8e93; }

.profile-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.stat-col {
    display: flex;
    flex-direction: column;
}
.center-align { align-items: center; }
.right-align { align-items: flex-end; }

.stat-val {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 11px;
    color: #8e8e93;
}

.profile-two-cards {
    display: flex;
    gap: 12px;
}

.pc-left, .pc-right {
    flex: 1;
    border-radius: 24px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.pc-left {
    background: linear-gradient(135deg, #0e1e38 0%, #173863 100%);
}

.pc-right {
    background: linear-gradient(135deg, #3a2a0d 0%, #2a2b30 100%);
}

.pc-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 12px;
}
.pc-badge.transparent {
    background-color: transparent;
    padding: 0;
    color: #8e8e93;
}

.pc-left h4, .pc-right h4 {
    margin: 0;
    font-size: 18px;
    color: white;
    line-height: 1.2;
    z-index: 2;
}

.pc-right h4 {
    color: #ffc107;
}

.pc-bottom {
    margin-top: auto;
    font-size: 10px;
    color: #8e8e93;
    z-index: 2;
}
.pc-bottom span {
    color: white;
    font-weight: 700;
}

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

.section-title {
    margin: 0;
    font-size: 12px;
    color: #8e8e93;
    font-weight: 700;
}

.invite-card {
    background-color: #1a1b1f;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invite-info {
    display: flex;
    gap: 12px;
}

.invite-icon svg { width: 18px; height: 18px; }

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    width: 100%; /* avoid 100vw causing horizontal scroll */
    max-width: 100%;
    height: 100%; /* use % height; 100vh can mis-size on mobile browsers */
}
.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: #1a1b1f;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1001;
    padding: 16px 20px 40px 20px;
    transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
    overscroll-behavior: none;
}
.bottom-sheet.active {
    bottom: 0;
}

.bottom-sheet.full-height-sheet {
    height: 90vh; /* cover most of screen */
    display: flex;
    flex-direction: column;
}

.bottom-sheet.full-height-sheet.active {
    bottom: 0;
}
.sheet-handle {
    width: 40px;
    height: 4px;
    background-color: #3a3b3f;
    border-radius: 2px;
    margin: 0 auto 20px auto;
}

.sheet-title {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin: 0 0 4px 0;
}

.sheet-subtitle {
    font-size: 14px;
    color: #8e8e93;
    margin: 0 0 24px 0;
}

.sheet-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #2a2b30;
    padding: 16px;
    border-radius: 16px;
}

.benefit-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
}
.benefit-icon svg { width: 18px; height: 18px; }

.benefit-text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: white;
}

.benefit-text p {
    margin: 0;
    font-size: 12px;
    color: #8e8e93;
}

.sheet-link-section {
    margin-top: 24px;
}
.sheet-link-section > p {
    font-size: 12px;
    color: #8e8e93;
    margin: 0 0 8px 0;
}

.ref-link-box {
    background-color: #2a2b30;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.ref-link-box span {
    color: white;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.sheet-buttons {
    display: flex;
    gap: 12px;
}

.sheet-btn-primary, .sheet-btn-secondary {
    flex: 1;
    padding: 14px 0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
}

.sheet-btn-primary {
    background-color: #3390ec;
    color: white;
}

.sheet-btn-secondary {
    background-color: #3a3b3f;
    color: white;
}

.sheet-collect-btn {
    background-color: #3a3b3f;
    color: #3390ec;
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.sheet-collect-btn:active {
    background-color: #2a2b30;
}

.invite-text h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: white;
}

.invite-text p {
    margin: 0;
    font-size: 12px;
    color: #8e8e93;
    line-height: 1.4;
}

.invite-btn {
    background-color: #3390ec;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

/* --- Chat & Admin Panel CSS --- */

/* Report Chat Sheet */
#report-sheet {
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 70px; /* Space for input */
}

.chat-message {
    display: flex;
    max-width: 85%;
}

.chat-message.received {
    align-self: flex-start;
}

.chat-message.sent {
    align-self: flex-end;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message.received .chat-bubble {
    background: #1c1c1e;
    color: white;
    border-bottom-left-radius: 4px;
}

.chat-message.sent .chat-bubble {
    background: #3390ec;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: #0d0d0d;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-input-area input {
    flex-grow: 1;
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 12px 16px;
    color: white;
    font-size: 15px;
    outline: none;
}

.chat-input-area button {
    background: #3390ec;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    flex-shrink: 0;
}

.chat-input-area button svg {
    width: 20px;
    height: 20px;
    transform: translateX(1px);
}

/* Admin Panel */
.admin-report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.admin-report-item {
    background: #1c1c1e;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
}

.ari-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ari-user {
    font-weight: 600;
    color: #3390ec;
}

.ari-time {
    font-size: 12px;
    color: #8e8e93;
}

.ari-preview {
    font-size: 14px;
    color: #aeaeb2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- CRASH GAME STYLES --- */
.crash-header {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #1c1c1e;
    border-bottom: 1px solid #2c2c2e;
    z-index: 10;
}

.crash-title {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-align: center;
}

.crash-history {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.crash-history::-webkit-scrollbar {
    display: none;
}

.history-chip {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.history-chip.low { color: #ff453a; background: rgba(255, 69, 58, 0.15); }
.history-chip.mid { color: #ffd60a; background: rgba(255, 214, 10, 0.15); }
.history-chip.high { color: #32d74b; background: rgba(50, 215, 75, 0.15); }

.crash-game-area {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #1a1b26 0%, #0b0e14 100%);
    overflow: hidden;
}

#crash-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.crash-multiplier {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    z-index: 5;
    transition: color 0.3s;
}

.crash-multiplier.crashed {
    color: #ff453a;
    text-shadow: 0 0 20px rgba(255,69,58,0.5);
}

.crash-multiplier.won {
    color: #32d74b;
    text-shadow: 0 0 20px rgba(50,215,75,0.5);
}

.crash-status-text {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: #aeaeb2;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.rocket-emoji {
    position: absolute;
    font-size: 32px;
    z-index: 10;
    bottom: 20px;
    left: 20px;
    transform: rotate(45deg);
    transition: transform 0.1s;
    filter: drop-shadow(0 0 10px rgba(255,165,0,0.8));
}

.crash-controls {
    background: #1c1c1e;
    padding: 20px;
    border-top: 1px solid #2c2c2e;
    z-index: 10;
}

.crash-balance-row {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 15px;
    margin-bottom: 15px;
}

.crash-bet-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bet-input-wrapper {
    flex: 1;
    background: #2c2c2e;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.bet-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    outline: none;
    width: 100%;
}

.bet-input-wrapper span {
    color: #8e8e93;
    font-size: 14px;
    font-weight: 700;
}

.bet-adjust-btn {
    background: #3a3a3c;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    padding: 0 15px;
    cursor: pointer;
}

.bet-adjust-btn:active {
    opacity: 0.7;
}

.crash-action-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.crash-action-btn.bet-btn {
    background: #3390ec;
    box-shadow: 0 4px 15px rgba(51,144,236,0.4);
}

.crash-action-btn.cashout-btn {
    background: #ff9f0a;
    box-shadow: 0 4px 15px rgba(255,159,10,0.4);
}

.crash-action-btn.disabled-btn {
    background: #3a3a3c;
    color: #8e8e93;
    box-shadow: none;
    pointer-events: none;
}

.crash-action-btn:active {
    transform: scale(0.98);
}


/* ============================================
   ANDROID-ONLY RESPONSIVE OVERRIDES
   Applied ONLY on Android via html.android class
   iOS keeps original fixed sizes (perfect as-is)
   ============================================ */

/* Android: scale down all key elements to match iOS visual proportions */
html.android .balance-pill {
    top: max(80px, calc(var(--tg-safe-top, 0px) + 68px));
    right: 12px;
    padding: 5px 11px;
}
html.android .balance-amount { font-size: 12px; }
html.android .dollar-icon { width: 13px; height: 13px; }

/* Android Nav */
html.android .circle-segment { padding: 8px 14px; }
html.android .pill-segment { padding: 8px 16px; }
html.android .profile-segment { width: 58px; height: 58px; }
html.android .nav-item { font-size: 10px; }
html.android .nav-item svg { width: 23px; height: 23px; }
html.android .nav-item.profile img { width: 52px; height: 52px; }

/* Android Games screen top padding */
html.android #games-menu {
    padding-top: max(115px, calc(var(--tg-safe-top, 0px) + 105px)) !important;
}

/* Android Games list padding */
html.android #games-list-section {
    padding-left: 14px !important;
    padding-right: 14px !important;
}

/* Android: scale game banner frosted glass panels */
html.android .banner-item [style*="position: absolute; bottom: 8px"] {
    padding: 9px 12px !important;
}

/* Android RWA screen top padding */
html.android #staking-screen > div {
    padding-top: max(52px, calc(var(--tg-safe-top, 0px) + 44px)) !important;
}

/* Android: scale down RWA hero banner text */
html.android #staking-screen [style*="font-size:42px"] {
    font-size: 34px !important;
}
html.android #staking-screen [style*="font-size:18px"][style*="font-weight:800"] {
    font-size: 15px !important;
}

/* Android Profile screen */
html.android #profile-screen {
    padding-top: max(140px, calc(var(--tg-safe-top, 0px) + 128px));
}
html.android .profile-top-bar {
    top: max(82px, calc(var(--tg-safe-top, 0px) + 72px));
}

/* Android Wallet screen */
html.android #wallet-screen {
    padding-top: max(14px, calc(var(--tg-safe-top, 0px) + 8px));
}
html.android .wallet-container {
    margin-top: max(52px, calc(var(--tg-safe-top, 0px) + 42px));
}
html.android .balance-title { font-size: 30px; }

/* Small Android (narrow phones) */
html.android.small-screen .balance-pill { top: 68px; right: 10px; }
html.android.small-screen .nav-item { font-size: 9px; }
html.android.small-screen .nav-item svg { width: 20px; height: 20px; }
html.android.small-screen .profile-segment { width: 52px; height: 52px; }
html.android.small-screen .nav-item.profile img { width: 46px; height: 46px; }
html.android.small-screen .circle-segment { padding: 7px 11px; }
html.android.small-screen .pill-segment { padding: 7px 13px; }

/* Admin Sub Sections (like Analytics) */
.adm-sub-sec {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f11;
    z-index: 200;
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
    padding-bottom: 50px;
}
.adm-sub-sec.open {
    opacity: 1;
    transform: translateX(0);
}
.adm-sec-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.adm-sec-back {
    color: #007aff;
    font-size: 16px;
    font-weight: 500;
    margin-right: 16px;
    cursor: pointer;
}
.adm-sec-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}
.adm-sec-content {
    padding: 16px;
}

/* ── RWA Bottom Sheet ── */
.rwa-bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.rwa-bottom-sheet-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.rwa-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #161618;
    border-radius: 28px 28px 0 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 1001;
    min-height: 80vh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.rwa-bottom-sheet.open {
    transform: translateY(0);
}
.rwa-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 12px auto 0;
}
.rwa-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.rwa-sheet-body {
    padding: 20px;
    flex: 1;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Extra bottom padding so buy button clears the nav bar */
    padding-bottom: max(110px, calc(env(safe-area-inset-bottom, 0px) + 110px));
}

/* ── Batch detail sheet: fixed height + scrollable body ── */
#batch-detail-sheet {
    min-height: 62vh !important;
    max-height: 62vh !important;
    overflow: hidden;
}
#batch-detail-sheet .rwa-sheet-body {
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
}
.rwa-stat-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.rwa-stat-pill {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}
.rwa-stat-pill .pill-label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.rwa-stat-pill .pill-val {
    font-size: 14px;
    font-weight: 800;
    color: white;
}
.rwa-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.rwa-qty-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(251,146,60,0.4);
    background: rgba(251,146,60,0.1);
    color: #fb923c;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.rwa-qty-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    color: white;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    padding: 12px;
    outline: none;
    -moz-appearance: textfield;
}
.rwa-qty-input::-webkit-inner-spin-button,
.rwa-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rwa-buy-btn {
    width: 100%;
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 18px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    margin-top: 8px;
}
.rwa-buy-btn:active { transform: scale(0.97); opacity: 0.9; }

/* ── Chicken Type Tabs ── */
.chicken-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.chicken-tab.active {
    background: rgba(251,146,60,0.15);
    border-color: rgba(251,146,60,0.4);
    color: #fb923c;
}
