/* ═══════════════════════════════════════════════════
   getgems v2 — "Liquid Glass" Theme
   ═══════════════════════════════════════════════════ */

/* ─── Custom Font ─── */
@font-face {
    font-family: 'SF Pro Text';
    src: local('SF Pro Text'), local('.SFNSText'), local('SFProText-Regular');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ─── CSS Variables ─── */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --bottom-nav-height: 70px;
    --bottom-nav-offset: 0px;
    --tabbar-height: 72px;

    --tg-safe-area-top: 0px;
    --tg-safe-area-bottom: 0px;
    --tg-content-safe-area-top: 0px;
    --tg-content-safe-area-bottom: 0px;
    --tg-viewport-stable-height: 100vh;

    --color-bg: #141414;
    --color-bg-secondary: #1c1c1e;
    --color-bg-tertiary: #2c2c2e;
    --color-text: #ffffff;
    --color-text-secondary: #8e8e93;
    --color-text-muted: #6b7280;
    --color-accent: #2382ff;
    --color-accent-light: #60a8ff;
    --color-success: #22c55e;
    --color-error: #ff453a;
    --color-warning: #f59e0b;
    --color-border: rgba(255, 255, 255, 0.08);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;

    --primary: #2382ff;
    --switcher-transition: 0.25s cubic-bezier(1, 0, 0.4, 1);

    /* ═══ THE LIQUID GLASS EFFECT ═══ */
    --glass-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 1.8px 3px 0px -2px rgba(255, 255, 255, 0.27),
        inset -2px -2px 0px -2px rgba(255, 255, 255, 0.24),
        inset -3px -8px 1px -6px rgba(255, 255, 255, 0.18),
        inset -0.3px -1px 4px 0px rgba(0, 0, 0, 0.24),
        inset -1.5px 2.5px 0px -2px rgba(0, 0, 0, 0.4),
        inset 0px 3px 4px -2px rgba(0, 0, 0, 0.4),
        inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.2),
        0px 1px 5px 0px rgba(0, 0, 0, 0.2),
        0px 6px 16px 0px rgba(0, 0, 0, 0.16);
}

/* ─── Global Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
    color: var(--color-text);
}

/* ─── App Container ─── */
#app {
    width: 100%;
    min-height: 100vh;
    background: transparent;
    display: block;
    position: relative;
    padding-bottom: 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#app.visible {
    visibility: visible;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   PAGE LOADER
   ═══════════════════════════════════════════════════ */
.page-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.page-loader.hidden { display: none; }

.loader-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   TOP HEADER — Balance Cards
   ═══════════════════════════════════════════════════ */
.top-header {
    position: relative;
    width: 100%;
    z-index: 1000;
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-area-top));
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    background: transparent;
    gap: 10px;
}
body.mobile-fullscreen .top-header {
    padding-top: calc(16px + var(--tg-safe-area-top, 0px) + var(--tg-content-safe-area-top, 0px));
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #142637;
    border-radius: 99em;
    padding: 8px 12px;
    pointer-events: auto;
    box-shadow:
        0px 1px 5px 0px rgba(0,0,0,0.2),
        0px 6px 16px 0px rgba(0,0,0,0.16),
        inset 0 0 0 1px rgba(255,255,255,0.05);
}
.balance-card.stars-balance { background-color: #352b12; }

.ton-icon { width: 18px; height: 18px; color: #1f6acc; flex-shrink: 0; }
.star-icon { width: 18px; height: 18px; color: #fbbf24; flex-shrink: 0; }

.balance-amount {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.add-balance-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    color: #000000;
    flex-shrink: 0;
}
.add-balance-btn svg { width: 16px; height: 16px; }
.add-balance-btn:active { transform: scale(0.95); opacity: 0.8; }

/* ═══════════════════════════════════════════════════
   VIEW CONTAINERS
   ═══════════════════════════════════════════════════ */
.view-container {
    position: relative;
    width: 100%;
    display: block;
    background: transparent;
    padding: 0;
    padding-bottom: calc(var(--bottom-nav-height) + var(--bottom-nav-offset) + var(--safe-area-bottom) + 20px);
    z-index: 2;
}
.view-container.hidden { display: none; }

.section-placeholder {
    padding: 60px 24px;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.section-placeholder-title {
    font-size: 20px; font-weight: 600; margin-bottom: 8px; margin-top: 16px;
}
.section-placeholder-subtitle {
    color: #9ca3af; font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   BANNERS CAROUSEL
   ═══════════════════════════════════════════════════ */
.banners-carousel {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    padding: 16px 8px;
    padding-left: calc(8px + var(--safe-area-left));
    padding-right: calc(8px + var(--safe-area-right));
}
.banners-wrapper {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    position: relative;
    z-index: 2;
}
.banners-wrapper::-webkit-scrollbar { display: none; }

.banner-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-right: 12px;
}
.banner-item:last-child { margin-right: 0; }

.banner-placeholder {
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-height: 140px;
    justify-content: center;
}
.banner-placeholder-alt {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a1033 50%, #0d0d2b 100%);
}
.banner-placeholder-icon {
    font-size: 42px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 4px;
}
.banner-placeholder-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.banner-placeholder-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

.banners-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.banner-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}
.banner-dot.active {
    background: var(--primary);
    width: 18px;
    border-radius: 3px;
}

/* ═══════════════════════════════════════════════════
   FILTERS SECTION
   ═══════════════════════════════════════════════════ */
.filters-section {
    width: 100%;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    margin-top: 0;
}

.filters-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    width: 100%;
    padding: 4px;
    position: relative;
    border-radius: 99em;
    background-color: #1a1a1a;
    box-shadow: var(--glass-shadow);
}
.filter-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    border-radius: 99em;
    position: relative;
    z-index: 1;
}
.filter-tab.active {
    color: var(--primary);
    background-color: rgba(0,0,0,0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.03),
        inset 1px 1px 0 0 rgba(255,255,255,0.15),
        inset -1px -1px 0 0 rgba(255,255,255,0.1),
        0 2px 4px rgba(0,0,0,0.15);
}
.filter-tab:active { transform: scale(0.97); }

/* Search Row */
.quick-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.quick-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1a1a1a;
    border-radius: 99em;
    padding: 12px 16px;
    flex: 1;
    box-shadow: var(--glass-shadow);
}
.quick-search-icon { color: rgba(255,255,255,0.4); font-size: 18px; flex-shrink: 0; }
.quick-search-input {
    flex: 1;
    background: transparent;
    border: none; outline: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 400;
}
.quick-search-input::placeholder { color: rgba(255,255,255,0.4); }

.collection-toggle-btn, .filter-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background-color: #212020;
    box-shadow: var(--glass-shadow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255,255,255,0.7);
    flex-shrink: 0;
    font-size: 20px;
}
.collection-toggle-btn:active, .filter-expand-btn:active {
    background-color: #1f1f1ff2;
    transform: scale(0.95);
}
.collection-toggle-btn.has-filter {
    background-color: var(--primary);
    color: #ffffff;
}
.filter-expand-btn.active {
    background-color: #ffffff;
    color: #1a1a1a;
}
.filter-expand-icon { transition: transform 0.2s ease; }
.filter-expand-btn.active .filter-expand-icon { transform: rotate(180deg); }
.view-icon.hidden { display: none; }

/* Price Filter */
.price-filter-panel {
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    max-height: 80px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease;
}
.price-filter-panel.hidden {
    max-height: 0; opacity: 0; padding: 0 16px; margin-bottom: 0; pointer-events: none;
}
.price-filter-slider-row {
    display: flex; align-items: center; gap: 16px; width: 100%;
}
.price-filter-slider {
    flex: 1; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px; outline: none;
}
.price-filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px;
    background: #ffffff; border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.price-filter-info {
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; min-width: 80px;
}
.price-filter-value { font-size: 15px; font-weight: 600; color: #ffffff; }
.price-filter-count { font-size: 12px; color: rgba(255,255,255,0.5); }

/* Sort + Collection Row */
.filters-row {
    display: flex; gap: 8px; align-items: center; width: 100%; padding-bottom: 4px;
}
.filter-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    background-color: #1a1a1a;
    box-shadow: var(--glass-shadow);
    border: none; border-radius: 99em;
    padding: 12px 20px;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
}
.filter-btn:active { background-color: #1f1f1ff2; transform: scale(0.97); }

.filter-label { font-size: 11px; color: #9ca3af; font-weight: 400; line-height: 1.2; white-space: nowrap; }
.filter-value {
    display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 6px;
}
.filter-value span { font-size: 14px; color: #ffffff; font-weight: 500; line-height: 1.2; }
.filter-arrows {
    display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center;
    color: #9ca3af; flex-shrink: 0;
}
.filter-arrows svg { width: 8px; height: 4px; }

.collection-btn-text { font-size: 14px; font-weight: 600; color: #ffffff; }
.collection-btn-arrow { color: rgba(255,255,255,0.5); transition: transform 0.2s ease; }

/* Sort active state */
.filter-btn.sort-active {
    background-color: rgba(35, 130, 255, 0.15);
}
.filter-btn.sort-active .filter-value span {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════
   NFT CARDS GRID
   ═══════════════════════════════════════════════════ */
.nft-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    margin-top: 20px;
    padding-bottom: 20px;
}

/* List View */
.nft-cards-grid.list-view {
    grid-template-columns: 1fr;
    gap: 0;
}
.nft-cards-grid.list-view .nft-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.nft-cards-grid.list-view .nft-card-image {
    width: 48px; height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.nft-cards-grid.list-view .nft-card-image .nft-preview-img {
    border-radius: 10px;
}
.nft-cards-grid.list-view .nft-card-content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 12px 0;
}
.nft-cards-grid.list-view .nft-card-info { display: contents; }
.nft-cards-grid.list-view .nft-card-title {
    grid-column: 1; grid-row: 1;
    font-size: 16px; font-weight: 600; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.nft-cards-grid.list-view .nft-card-id {
    grid-column: 1; grid-row: 2;
    font-size: 13px; color: rgba(255,255,255,0.5); margin: 0;
}
.nft-cards-grid.list-view .nft-card-footer {
    grid-column: 2; grid-row: 1 / 3;
    display: flex; align-items: center; gap: 8px; margin-top: 0;
}
.nft-cards-grid.list-view .nft-card-price-btn {
    padding: 8px 14px; font-size: 14px; min-width: 90px; justify-content: center;
}

/* ─── Individual Card ─── */
.nft-card {
    background: transparent;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
}
.nft-card:active { transform: scale(0.98); }

.nft-card-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.nft-card:nth-child(even) .nft-card-image {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}
.nft-card:nth-child(3n) .nft-card-image {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}
.nft-card:nth-child(4n+1) .nft-card-image {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.nft-preview-img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nft-preview-img.loaded { opacity: 1; }

.nft-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.nft-card-title {
    font-size: 17px; font-weight: 700; color: #ffffff; margin: 0; line-height: 1.2;
}
.nft-card-id {
    font-size: 14px; color: #9ca3af; margin: 0; line-height: 1.2;
}
.nft-card-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px;
}
.nft-card-price-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: rgba(255,255,255,0.12);
    border: none; border-radius: 99em;
    padding: 10px 14px;
    color: #ffffff; font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    box-shadow: var(--glass-shadow);
}
.nft-card-price-btn > span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0;
}
.nft-card-price-btn:active {
    background: rgba(255,255,255,0.18);
    transform: scale(0.98);
}

.nft-card-cart-btn {
    width: 42px; min-width: 42px; height: auto;
    padding: 10px;
    background: rgba(255,255,255,0.12);
    border: none; border-radius: 99em;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: var(--glass-shadow);
}
.nft-card-cart-btn:active {
    background: rgba(255,255,255,0.18);
    transform: scale(0.95);
}
.nft-card-cart-btn.in-cart {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
}

.ton-icon-small {
    width: 14px; height: 14px; color: currentColor; flex-shrink: 0;
}

/* ─── Load More ─── */
.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 20px 16px 28px;
    padding: 16px 28px;
    background: rgba(255,255,255,0.12);
    border: none; border-radius: 99em;
    box-shadow: var(--glass-shadow);
    color: #ffffff; font-size: 16px; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.load-more-btn:active {
    transform: scale(0.97);
    background: rgba(80,80,87,0.6);
}
.load-more-btn.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   BOTTOM BAR + NAV
   ═══════════════════════════════════════════════════ */
.bottom-bar {
    position: fixed;
    bottom: calc(var(--bottom-nav-offset) + var(--safe-area-bottom) + 6px);
    left: 10px; right: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.profile-avatar-btn {
    display: flex; flex-shrink: 0;
    align-items: center; justify-content: center;
    background-color: rgba(0,0,0,0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 99em;
    height: var(--tabbar-height);
    width: var(--tabbar-height);
    box-shadow: var(--glass-shadow);
    cursor: pointer; border: none; padding: 0;
    transition: transform 0.2s ease;
    position: relative;
}
.profile-avatar-btn:active { transform: scale(0.94); }

.profile-avatar-img {
    width: 80%; height: 80%;
    object-fit: cover;
    border-radius: 99em;
    border: 2px solid rgba(255,255,255,0.1);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    display: block;
    margin: auto;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.profile-avatar-btn.active .profile-avatar-img {
    border: 2px solid var(--primary);
}

.bottom-nav {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    height: var(--tabbar-height);
    padding: 4px;
    box-sizing: border-box;
    border: none;
    border-radius: 99em;
    background-color: rgba(0,0,0,0.12);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--glass-shadow);
    transition: background-color var(--switcher-transition), box-shadow var(--switcher-transition);
}

/* Sliding active indicator */
.bottom-nav::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    width: calc((100% - 16px - 8px) / 3);
    height: calc(var(--tabbar-height) - 8px);
    border-radius: 99em;
    background-color: #0000004d;
    z-index: -1;
    box-shadow:
        inset 0 0 0 1px #ffffff08,
        inset 2px 1px 0 -1px #ffffff45,
        inset -1.5px -1px 0 -1px #ffffff3d,
        inset -2px -6px 1px -5px #ffffff2e,
        inset -1px 2px 3px -1px #0006,
        inset 0 -4px 1px -2px #0003,
        0 3px 6px #00000029;
    transition:
        background-color var(--switcher-transition),
        box-shadow var(--switcher-transition),
        translate var(--switcher-transition);
}
.bottom-nav[data-active="0"]::after {
    translate: 0 0;
    animation: _scaleToggle 0.44s ease;
}
.bottom-nav[data-active="1"]::after {
    translate: calc(100% + 8px) 0;
    animation: _scaleToggle 0.44s ease;
}
.bottom-nav[data-active="2"]::after {
    translate: calc(200% + 16px) 0;
    animation: _scaleToggle 0.44s ease;
}
.bottom-nav[data-active="3"]::after { display: none; }

@keyframes _scaleToggle {
    0% { scale: 1 1; }
    50% { scale: 1.05 1.1; }
    to { scale: 1 1; }
}

.nav-btn {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 4px; padding: 0 12px;
    width: 100%; height: 100%;
    box-sizing: border-box;
    border-radius: 99em;
    background: transparent; border: none;
    cursor: pointer;
    opacity: 0.6;
    color: var(--color-text);
    transition: all 0.16s;
    position: relative; z-index: 1;
}
.nav-btn:hover { opacity: 0.7; }
.nav-btn:hover .nav-icon { scale: 1.1; }
.nav-btn.active {
    --c: var(--primary);
    opacity: 1;
    color: var(--primary);
}
.nav-btn.active .seasons-icon { color: var(--primary); }
.nav-btn.active .gifts-icon { color: var(--primary); }

.nav-icon {
    font-size: 22px; color: currentColor;
    transition: scale 0.16s, color 0.16s;
    line-height: 1;
}
.nav-btn .seasons-icon { color: rgba(255,255,255,0.7); }
.nav-btn .gifts-icon { color: rgba(255,255,255,0.7); }

.nav-text {
    font-size: 10px; color: currentColor;
    font-weight: 500; line-height: 1.2;
}

/* ═══════════════════════════════════════════════════
   DRAWER (Product Detail)
   ═══════════════════════════════════════════════════ */
.drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--color-bg-secondary);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 16px 16px 36px 16px;
    padding-bottom: calc(36px + var(--safe-area-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2001;
    display: flex; flex-direction: column; align-items: center;
}
.drawer.open { transform: translateY(0); }
.drawer-elevated { z-index: 2005; }

.drawer-handle {
    width: 36px; height: 5px;
    background: rgba(255,255,255,0.4);
    border-radius: 5px;
    margin-bottom: 24px;
}
.drawer-close-btn {
    position: absolute;
    top: 16px; right: 16px;
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.12);
    border: none; border-radius: 99em;
    box-shadow: var(--glass-shadow);
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10;
}

.drawer-body {
    width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: 10px;
}
.drawer-image-wrapper {
    width: 160px; height: 160px; margin-bottom: 16px; position: relative;
    display: flex; justify-content: center;
}
.drawer-image-bg {
    width: 160px; height: 160px;
    border-radius: 32px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.drawer-image {
    width: 100%; height: 100%; object-fit: cover; z-index: 1;
}

.drawer-title {
    color: #ffffff; font-size: 24px; font-weight: 700;
    margin-bottom: 8px; text-align: center; width: 100%;
}
.drawer-subtitle {
    color: #9ca3af; font-size: 16px; font-weight: 500;
    margin-bottom: 32px; text-align: center; width: 100%;
}

.drawer-actions {
    display: flex; gap: 12px; width: 100%; justify-content: center;
}
.drawer-btn-secondary, .drawer-btn-primary {
    flex: 1; border: none; border-radius: 99em;
    padding: 14px 16px; cursor: pointer;
    font-size: 15px; font-weight: 600;
    transition: transform 0.1s ease, background 0.2s;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    line-height: 1.25;
}
.drawer-btn-secondary {
    background: rgba(255,255,255,0.12); color: #ffffff;
    box-shadow: var(--glass-shadow);
}
.drawer-btn-secondary:active { background: rgba(255,255,255,0.18); transform: scale(0.98); }
.drawer-btn-primary { background: var(--primary); color: #ffffff; }
.drawer-btn-primary:active { background: #006add; transform: scale(0.98); }
.btn-subtitle { font-size: 12px; font-weight: 600; opacity: 0.9; margin-top: 2px; }

/* ─── Collection Drawer ─── */
.drawer-header-row {
    display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 8px;
}
.drawer-header-block { flex-direction: column; align-items: flex-start; }
.drawer-title-left { color: #ffffff; font-size: 24px; font-weight: 700; margin: 0; }
.drawer-subtitle-left { color: #8e8e93; font-size: 14px; margin-top: 4px; }

.collection-search-wrapper { position: relative; margin-bottom: 16px; width: 100%; }
.collection-search-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #8e8e93; font-size: 18px;
}
.collection-search-input {
    width: 100%;
    background: rgba(255,255,255,0.12);
    border: none; border-radius: 99em;
    padding: 14px 20px 14px 48px;
    color: #fff; font-size: 15px; outline: none;
    box-shadow: var(--glass-shadow);
    transition: background 0.2s;
}
.collection-search-input:focus { background: rgba(255,255,255,0.16); }
.collection-search-input::placeholder { color: #636366; }

.collection-list {
    max-height: 50vh; overflow-y: auto;
    margin-bottom: 16px; margin-left: -16px; margin-right: -16px;
    width: calc(100% + 32px);
}
.collection-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #2c2c2e; cursor: pointer;
}
.collection-item:last-child { border-bottom: none; }
.collection-item-left { display: flex; align-items: center; gap: 12px; }
.collection-checkbox {
    width: 22px; height: 22px;
    border: 2px solid #3a3a3c; border-radius: 6px;
    position: relative; transition: all 0.2s;
}
.collection-item.selected .collection-checkbox {
    background: #007aff; border-color: #007aff;
}
.collection-item.selected .collection-checkbox::after {
    content: '';
    position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.collection-item-name { color: #ffffff; font-size: 16px; font-weight: 600; }
.collection-item-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.collection-item-price { color: #ffffff; font-size: 15px; font-weight: 600; }
.collection-item-label { color: #636366; font-size: 11px; }

#collectionDrawer {
    padding-bottom: calc(16px + var(--safe-area-bottom));
    max-height: 85vh; overflow-y: auto;
}

/* ═══════════════════════════════════════════════════
   BUNDLES GRID & CARDS
   ═══════════════════════════════════════════════════ */
.bundles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    margin-top: 20px;
    padding-bottom: 20px;
}

/* ─── Bundle Card ─── */
.bundle-card {
    background: rgba(255,255,255,0.04);
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
}
.bundle-card:active { transform: scale(0.97); }

/* Image collage container */
.bundle-collage {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    gap: 2px;
    overflow: hidden;
    border-radius: 18px;
    position: relative;
}
.bundle-collage.cols-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.bundle-collage.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
/* For 2 items — side by side */
.bundle-collage.cols-1x2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}
/* For 3 items — 1 big + 2 small */
.bundle-collage.cols-1p2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.bundle-collage.cols-1p2 .collage-cell:first-child {
    grid-row: 1 / 3;
}
/* For 5 items — 2+3 */
.bundle-collage.cols-2p3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.bundle-collage.cols-2p3 .collage-cell:nth-child(1) {
    grid-column: 1 / 2;
}
.bundle-collage.cols-2p3 .collage-cell:nth-child(2) {
    grid-column: 2 / 4;
}

.collage-cell {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
}
.collage-cell:nth-child(1) { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.collage-cell:nth-child(2) { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.collage-cell:nth-child(3) { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.collage-cell:nth-child(4) { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
.collage-cell:nth-child(5) { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.collage-cell:nth-child(6) { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }

.collage-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.collage-cell img.loaded { opacity: 1; }

/* Extra count badge ("+3" etc) */
.collage-extra {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    z-index: 2;
}

/* Bundle tag badge */
.bundle-tag {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border-radius: 99em;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
}
.bundle-tag i { font-size: 12px; }

/* Bundle card content */
.bundle-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.bundle-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bundle-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.2;
}
.bundle-card-meta .meta-dot {
    width: 3px; height: 3px;
    background: #6b7280;
    border-radius: 50%;
    flex-shrink: 0;
}
.bundle-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}
.bundle-card-price-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 99em;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    box-shadow: var(--glass-shadow);
}
.bundle-card-price-btn:active {
    background: rgba(255,255,255,0.18);
    transform: scale(0.98);
}
.bundle-card-discount {
    font-size: 11px;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34,197,94,0.12);
    padding: 2px 8px;
    border-radius: 99em;
    white-space: nowrap;
}

/* ─── Bundle Drawer Items List ─── */
.bundle-items-list {
    width: 100%;
    max-height: 50vh;
    overflow-y: auto;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.bundle-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bundle-item-row:last-child { border-bottom: none; }

.bundle-item-img {
    width: 48px; height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    position: relative;
}
.bundle-item-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.bundle-item-info {
    flex: 1;
    min-width: 0;
}
.bundle-item-name {
    font-size: 15px; font-weight: 600; color: #ffffff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bundle-item-id {
    font-size: 13px; color: #9ca3af; margin-top: 2px;
}
.bundle-item-price {
    font-size: 15px; font-weight: 700; color: #ffffff;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Bundle total row */
.bundle-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 8px;
}
.bundle-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #9ca3af;
}
.bundle-total-value {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════
   SNOW PARTICLES
   ═══════════════════════════════════════════════════ */
.snow-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════
   MY GIFTS PAGE
   ═══════════════════════════════════════════════════ */
.my-gifts-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 16px;
    margin-bottom: 12px;
    background-color: #212020;
    box-shadow: var(--glass-shadow);
    border-radius: 99em;
}

.my-gifts-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    text-align: center;
    border-radius: 99em;
}

.my-gifts-tab.active {
    color: var(--primary);
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 1px 1px 0 0 rgba(255, 255, 255, 0.15),
        inset -1px -1px 0 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

.my-gifts-tab:active {
    transform: scale(0.97);
}

/* ─── Status Bar ─── */
.my-gifts-status-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 16px 12px;
    background-color: #212020;
    box-shadow: var(--glass-shadow);
    border-radius: 99em;
}

.my-gifts-status-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 99em;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.my-gifts-status-btn.active {
    color: var(--primary);
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 1px 1px 0 0 rgba(255, 255, 255, 0.15),
        inset -1px -1px 0 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

.my-gifts-status-btn:active {
    transform: scale(0.97);
}

.my-gifts-status-text {
    font-size: 14px;
}

.my-gifts-status-count {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99em;
    background: rgba(255, 255, 255, 0.1);
    min-width: 24px;
    text-align: center;
}

.my-gifts-status-btn.active .my-gifts-status-count {
    background: rgba(35, 130, 255, 0.2);
    color: var(--primary);
}

/* ─── Action Buttons ─── */
.my-gifts-actions {
    display: flex;
    gap: 8px;
    padding: 4px;
    margin: 0 16px 12px;
    background-color: #212020;
    box-shadow: var(--glass-shadow);
    border-radius: 99em;
}

.my-gifts-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: none;
    border-radius: 99em;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 56px;
}

.my-gifts-action-btn i {
    font-size: 22px;
    color: currentColor;
    transition: color 0.2s ease, scale 0.2s ease;
}

.my-gifts-action-label {
    font-size: 10px;
    font-weight: 500;
    color: currentColor;
}

.my-gifts-action-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.my-gifts-action-btn:hover i {
    scale: 1.1;
}

.my-gifts-action-btn:active {
    transform: scale(0.96);
    color: var(--primary);
    background-color: rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 1px 1px 0 0 rgba(255, 255, 255, 0.15),
        inset -1px -1px 0 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ─── Content ─── */
.my-gifts-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

.my-gifts-content .nft-cards-grid {
    margin-top: 8px;
    padding-bottom: 0;
}

.my-gifts-content .nft-card-footer {
    justify-content: center;
}

.my-gifts-content .my-gifts-price-btn {
    width: auto;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    background: #ffffff !important;
    color: #1f2937;
    min-width: 0;
    overflow: hidden;
}

.my-gifts-content .my-gifts-price-btn > span {
    flex-shrink: 0;
    white-space: nowrap;
}

.my-gifts-content .my-gifts-price-btn .ton-icon-small {
    color: #1f2937;
    flex-shrink: 0;
}

.my-gifts-price-label {
    font-size: 12px;
    opacity: 0.9;
    color: #1f2937;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Purchase History ─── */
.purchase-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    margin-top: 8px;
    padding-bottom: 20px;
}

.purchase-history-item {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
}

.purchase-history-item:active {
    transform: scale(0.98);
    background: #222222;
}

.purchase-history-image {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    position: relative;
}

.purchase-history-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.purchase-history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.purchase-history-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-history-id {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.2;
}

.purchase-history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.purchase-history-date {
    font-size: 11px;
    color: #6b7280;
}

.purchase-history-price {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.purchase-history-price-value {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #2382ff;
    border-radius: 8px;
    padding: 6px 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.purchase-history-price-value .ton-icon-small {
    width: 14px;
    height: 14px;
    color: currentColor;
    flex-shrink: 0;
}

/* ─── Offers List ─── */
.my-gifts-offers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-area-left));
    padding-right: calc(16px + var(--safe-area-right));
    margin-top: 8px;
    padding-bottom: 20px;
}

.offer-item {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.offer-item:active {
    transform: scale(0.98);
}

.offer-item-image {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    position: relative;
}

.offer-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.offer-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-item-detail {
    font-size: 12px;
    color: #9ca3af;
}

.offer-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.offer-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.offer-item-status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 99em;
}

.offer-item-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.offer-item-status.accepted {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.offer-item-status.expired {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

/* ═══════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════
   POPUP / MODAL
   ═══════════════════════════════════════════════════ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.popup-overlay.open {
    opacity: 1;
    visibility: visible;
}

.popup-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #1c1c1e;
    border-radius: 20px;
    padding: 24px;
    width: 80%;
    max-width: 320px;
    z-index: 3001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.popup-card.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.popup-icon-wrapper {
    margin-bottom: 16px;
}

.popup-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.popup-text {
    color: #9ca3af;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 24px;
}

.popup-text strong {
    color: var(--primary);
    font-weight: 600;
}

.popup-btn {
    background: rgba(255, 255, 255, 0.12);
    width: 100%;
    padding: 14px;
    border-radius: 99em;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    box-shadow: var(--glass-shadow);
    transition: background 0.2s, transform 0.1s;
}

.popup-btn:active {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0.98);
}

.popup-btn:last-of-type {
    margin-bottom: 0;
}

.popup-btn-primary {
    background: var(--primary);
}

.popup-btn-primary:active {
    background: #1a6de0;
}

/* ═══════════════════════════════════════════════════
   GIFT ACTION DRAWER
   ═══════════════════════════════════════════════════ */
#giftActionDrawer {
    padding-bottom: calc(16px + var(--safe-area-bottom));
    max-height: 75vh;
}

.gift-action-list {
    max-height: 55vh;
    overflow-y: auto;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
}

.gift-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #2c2c2e;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.gift-action-item:last-child {
    border-bottom: none;
}

.gift-action-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.gift-action-item-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.gift-action-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-action-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gift-action-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-action-item-id {
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-action-item-arrow {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.gift-action-empty {
    text-align: center;
    padding: 48px 16px;
    color: #636366;
    font-size: 15px;
}

.my-gifts-content .my-gifts-price-btn.received {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #9ca3af;
}

.my-gifts-content .my-gifts-price-btn.received .my-gifts-price-label {
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════════
   SEASONS PAGE
   ═══════════════════════════════════════════════════ */

/* ─── Header Hero ─── */
.seasons-header {
    position: relative;
    text-align: center;
    padding: 40px 16px 32px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 20%, rgba(251,191,36,0.12) 0%, transparent 70%);
}

.seasons-bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.season-star {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: season-twinkle 2s ease-in-out infinite alternate;
}
.season-star.star-1  { top: 15%; left: 10%; animation-delay: 0s; }
.season-star.star-2  { top: 25%; left: 85%; animation-delay: 0.3s; width: 4px; height: 4px; }
.season-star.star-3  { top: 10%; left: 50%; animation-delay: 0.7s; width: 5px; height: 5px; }
.season-star.star-4  { top: 40%; left: 20%; animation-delay: 1s; width: 3px; height: 3px; }
.season-star.star-5  { top: 35%; left: 75%; animation-delay: 0.5s; }
.season-star.star-6  { top: 55%; left: 90%; animation-delay: 1.2s; width: 4px; height: 4px; }
.season-star.star-7  { top: 60%; left: 5%;  animation-delay: 0.8s; width: 3px; height: 3px; }
.season-star.star-8  { top: 20%; left: 35%; animation-delay: 1.4s; width: 4px; height: 4px; }
.season-star.star-9  { top: 45%; left: 60%; animation-delay: 0.2s; width: 5px; height: 5px; }
.season-star.star-10 { top: 70%; left: 45%; animation-delay: 0.9s; width: 3px; height: 3px; }

@keyframes season-twinkle {
    0%   { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1;   transform: scale(1.3); }
}

.seasons-rocket {
    margin: 0 auto 16px;
    width: 80px;
    height: 80px;
    animation: season-float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(251, 191, 36, 0.4));
}

@keyframes season-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.seasons-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.seasons-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.4;
}

/* ─── Seasons Content Card ─── */
.seasons-content {
    padding: 0 12px;
    margin-top: -8px;
}

.seasons-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ─── Seasons Tabs ─── */
.seasons-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
}

.seasons-tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.seasons-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ─── Main Stat ─── */
.seasons-main-stat {
    text-align: center;
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.seasons-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.seasons-info-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.25);
}

.seasons-stat-value-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.seasons-stat-value {
    font-size: 40px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
}

.seasons-star-icon {
    flex-shrink: 0;
}

/* ─── Stats List ─── */
.seasons-stats-list {
    padding-top: 12px;
}

.seasons-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.seasons-stats-row:last-child {
    border-bottom: none;
}

.seasons-stats-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.seasons-stats-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.seasons-stats-right .ssv {
    font-weight: 700;
}

.seasons-stats-right .ssd {
    color: rgba(255, 255, 255, 0.2);
    margin: 0 2px;
}

.seasons-icon-gift  { color: #f59e0b; font-size: 14px; }
.seasons-icon-user  { color: var(--primary); font-size: 14px; }
.seasons-icon-check { color: #22c55e; font-size: 14px; }

.seasons-star-sm {
    flex-shrink: 0;
    vertical-align: middle;
}

/* ─── Tasks Section ─── */
.seasons-tasks-section {
    padding: 20px 12px 0;
}

.seasons-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.seasons-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.seasons-section-badge {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

.seasons-section-badge i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
}

.seasons-tasks-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 4px 0;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.seasons-tasks-group {
    padding: 12px 16px;
}

.seasons-tasks-group + .seasons-tasks-group {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.seasons-group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.seasons-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.seasons-group-header .seasons-group-title {
    margin: 0;
}

.seasons-timer {
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
    font-variant-numeric: tabular-nums;
}

/* Task Items */
.seasons-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.seasons-task-item + .seasons-task-item {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.seasons-task-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.task-icon-telegram {
    background: linear-gradient(135deg, #2aabee, #229ed9);
    color: #ffffff;
}

.task-icon-purple {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #ffffff;
}

.task-icon-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
}

.task-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.task-icon-yellow {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #ffffff;
}

.seasons-task-info {
    flex: 1;
    min-width: 0;
}

.seasons-task-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seasons-task-reward {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 4px;
}

.seasons-task-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: 99em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.seasons-task-btn:active {
    background: #1a6de0;
    transform: scale(0.96);
}

/* ─── Leaderboard Section ─── */
.seasons-leaderboard-section {
    padding: 20px 12px 120px;
}

.seasons-leaderboard-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row.is-me {
    background: rgba(35, 130, 255, 0.1);
}

.leaderboard-rank {
    width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.leaderboard-rank.rank-1 { color: #fbbf24; }
.leaderboard-rank.rank-2 { color: #d1d5db; }
.leaderboard-rank.rank-3 { color: #d97706; }

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #60a8ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    overflow: hidden;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-score {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ─── Telegram fullscreen tweaks ─── */
body.mobile-fullscreen {
    overflow-anchor: none;
}
body.mobile-fullscreen #app {
    min-height: var(--tg-viewport-stable-height, 100vh);
}
