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

* {
    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-color: var(--bg-color);
    color: white;
    overflow: hidden; /* Prevent scrolling on splash */
    width: 100vw;
    height: 100vh;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.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-x: hidden;
    padding-bottom: 120px; /* enough space for bottom nav */
}

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

.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 */
#ptr-indicator {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
    z-index: 100;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(57, 255, 20, 0.2);
    border-top-color: #39ff14;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 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)); /* Safe area padding */
    overflow-y: auto;
    overflow-x: hidden;
}

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

.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; /* Lowered opacity */
    filter: brightness(0.3); /* Darkened significantly */
    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;
}

.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: max(32px, env(safe-area-inset-bottom));
    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-x: hidden;
    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 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #32d74b;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
}
.invite-icon svg { width: 18px; height: 18px; }

.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%;
}
