/* Fly Waka Premium Design System */

:root {
    --bg-color: #0c0c0e;
    --card-bg: #141418;
    --card-bg-hover: #1c1c22;
    --text-primary: #ffffff;
    --text-secondary: #94949e;
    --accent-gold: #ffaa00;
    --accent-blue: #0066ff;
    --accent-blue-hover: #0052cc;
    --accent-diamond: #5cc2ff;
    --accent-green: #39d353;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 20, 24, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Keep SDK, Telegram CSS and iOS env() fallbacks in the calculation. */
    --safe-area-top: max(
        var(--js-safe-area-top, 0px),
        var(--tg-safe-area-inset-top, 0px),
        var(--tg-content-safe-area-inset-top, 0px),
        env(safe-area-inset-top, 0px)
    );
    --safe-area-bottom: max(
        var(--js-safe-area-bottom, 0px),
        var(--tg-safe-area-inset-bottom, 0px),
        var(--tg-content-safe-area-inset-bottom, 0px),
        env(safe-area-inset-bottom, 0px)
    );
    --safe-area-left: max(var(--js-safe-area-left, 0px), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px), env(safe-area-inset-left, 0px));
    --safe-area-right: max(var(--js-safe-area-right, 0px), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px), env(safe-area-inset-right, 0px));
    --content-safe-top: var(--js-csa-top, var(--tg-content-safe-area-inset-top, 0px));
    --content-safe-bottom: var(--js-csa-bottom, var(--tg-content-safe-area-inset-bottom, 0px));
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden; /* Prevent body-level scrolling — only .main-content scrolls */
    /* Reduce paint flicker on Telegram iOS/Android WebView */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    overscroll-behavior: none;
}

/* App Layout Container */
#app-container {
    width: 100%;
    max-width: 480px; /* Mobile width constraint */
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-color);
    overflow: hidden;
    /* Device safe area + Telegram content safe area + 12px visual spacing. */
    padding-top: 96px;
    padding-top: calc(var(--js-safe-area-top, 84px) + 12px);
}

/* Scrollable Main Area
   min-height: 0 is required so the flex child can shrink and actually scroll
   instead of growing with content (common Mini App / iOS WebView bug).
   Top: system/Telegram safe area + breathing room.
   Bottom: floating nav (~86px) + safe area. */
.main-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 12px;
    padding-right: calc(16px + var(--safe-area-right));
    padding-bottom: calc(110px + var(--safe-area-bottom));
    padding-left: calc(16px + var(--safe-area-left));
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    touch-action: pan-y;
    /* Prevent subpixel reflow jank while scrolling under fixed glass nav */
    transform: translateZ(0);
}

/* Fullscreen: extra top gap is already inside --safe-area-top (sa+csa) */
body.webapp-fullscreen .main-content {
    padding-top: 8px;
}

/* Admin panel button — hidden by default via [hidden], shown when role allows */
.open-admin-panel-btn {
    display: none;
    width: 100%;
    height: 50px;
    border-radius: 16px;
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.2);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--font-display);
    box-shadow: var(--glass-shadow);
    transition: background 0.2s, transform 0.2s;
    outline: none;
}
.open-admin-panel-btn.is-admin-visible,
.open-admin-panel-btn:not([hidden]) {
    display: flex !important;
}

.main-content::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* 1. Header Styles (Portals layout) */
.app-header-container {
    display: flex;
    flex-direction: column;
    padding: calc(16px + var(--safe-area-top)) 16px 8px 16px;
    z-index: 10;
    background-color: var(--bg-color);
    gap: 12px;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.app-title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-title-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.header-control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.header-control-btn:active {
    color: var(--text-primary);
}

.header-badges-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 4px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    backdrop-filter: blur(10px);
}

.points-badge {
    background-color: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: var(--accent-gold);
}

.points-badge .badge-icon {
    font-size: 14px;
    animation: rotateGold 3s linear infinite;
}

.coins-badge {
    background-color: rgba(28, 41, 61, 0.8);
    border: 1px solid rgba(92, 194, 255, 0.15);
    color: var(--text-primary);
}

.coins-badge .badge-icon {
    font-size: 14px;
    color: var(--accent-diamond);
}

.coins-badge .badge-currency {
    color: var(--text-secondary);
    font-size: 10px;
    margin-left: 2px;
    text-transform: uppercase;
}

/* 2. Promo Banner */
.banner-section {
    position: relative;
    height: 120px;
    border-radius: 20px;
    margin-bottom: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #0d4edd 0%, #7622f4 50%, #902bf5 100%);
    display: flex;
    align-items: center;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    touch-action: pan-y; /* allow vertical page scroll; horizontal handled in JS */
    cursor: grab;
    user-select: none;
}
.banner-section:active {
    cursor: grabbing;
}

.banner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(12, 12, 14, 0.8) 10%, rgba(12, 12, 14, 0.0) 80%);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    width: 60%;
}

.banner-content h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    color: #ffffff;
    transition: opacity 0.2s ease;
}

.banner-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s ease;
}

.banner-action {
    position: relative;
    z-index: 3;
    display: inline-flex;
    width: fit-content;
    margin-top: 9px;
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.banner-action[hidden] { display: none !important; }

.banner-stars-container {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-star-circle {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.circle-purple {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #a21bf5 0%, #7622f4 100%);
    top: 5px;
    right: 25px;
    transform: rotate(-15deg);
    animation: floatVape 4s ease-in-out infinite;
}

.circle-yellow {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ffb300 0%, #ff8800 100%);
    bottom: 5px;
    right: 0px;
    transform: rotate(15deg);
    animation: floatVape 4s ease-in-out infinite alternate;
}

.banner-glowing-dots {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.banner-glowing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
}

.banner-glowing-dots .dot.active {
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

/* 3. Category Tabs Scrolling */
.category-header-scroll {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 8px;
    scrollbar-width: none;
    width: 100%;
}

.category-header-scroll::-webkit-scrollbar {
    display: none;
}

.category-tab {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    opacity: 0.4;
    white-space: nowrap;
    position: relative;
    padding-bottom: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.category-tab.active {
    opacity: 1;
}

.category-tab.active::after {
    display: none;
}

/* 4. Search and Filter Bar (Portals style) */
.search-filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.search-bar-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    background-color: #17171c;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--border-color);
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    height: 42px;
    font-size: 14px;
    font-family: var(--font-body);
}

.search-input-wrapper input::placeholder {
    color: #555562;
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: #555562;
    flex-shrink: 0;
    line-height: 0;
}

.search-icon svg {
    display: block;
}

.circle-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #17171c;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.circle-btn:active {
    background-color: var(--card-bg-hover);
    color: var(--text-primary);
    transform: scale(0.95);
}

.filter-options-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    max-height: 48px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
    margin-top: 0;
}

.filter-options-row.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    /* drop from flex flow so gap under search doesn't leave empty air */
    display: none;
}

.circle-btn.select-arrow-btn svg {
    transition: transform 0.25s ease;
}

.circle-btn.select-arrow-btn.is-collapsed svg {
    transform: rotate(-90deg);
}

.filter-pill.icon-only-pill.active {
    color: var(--primary, #ffaa00);
    border-color: rgba(255, 170, 0, 0.45);
    background-color: rgba(255, 170, 0, 0.1);
}

.filter-pill {
    padding: 8px 14px;
    border-radius: 30px;
    background-color: #17171c;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:active {
    background-color: var(--card-bg-hover);
}

.filter-pill.icon-only-pill {
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    justify-content: center;
}

.filter-divider {
    width: 1px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.dropdown-pill {
    position: relative;
    padding: 6px 14px;
    border-radius: 30px;
    background-color: #17171c;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-pill svg {
    color: var(--text-secondary);
}

.invisible-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 5. Product Grid Layout */
.products-grid {
    display: grid;
    gap: 12px;
    width: 100%;
    /* avoid transition:all — causes layout flicker on re-render */
}

.products-grid.grid-layout {
    /* minmax(0,1fr) prevents grid blowout / crooked columns on iOS WebView */
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.products-grid.list-layout {
    grid-template-columns: minmax(0, 1fr);
}

/* 6. Product Card Styles — compact portrait cards (not rigid squares) */
.product-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    /* GPU layer only on press — no continuous will-change */
    transition: transform 0.15s ease, border-color 0.15s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

@supports (content-visibility: auto) {
    .product-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 310px;
    }
}

.product-card:active {
    transform: scale(0.985);
}

.list-layout .product-card {
    flex-direction: row;
    height: 112px;
    padding: 0;
    align-items: stretch;
}

.card-visual {
    width: 100%;
    /* Media plate — image covers full area; text lives below */
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0e0e12;
    flex-shrink: 0;
}

.list-layout .card-visual {
    width: 104px;
    min-width: 104px;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

/* Full-bleed product photo on the card plate */
.product-img-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
    user-select: none;
}

.card-mesh-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 8px 8px;
}

.card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}

.card-badge {
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    padding: 3px 7px;
    box-shadow: none;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badge.green-leaf {
    background-color: var(--accent-green);
    color: white;
}

.card-badge.white-card {
    background-color: white;
    color: #121214;
}

/* Custom vector illustrations using pure CSS & icons */
.vape-art-container {
    position: relative;
    width: 70px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(4px);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
}

.list-layout .vape-art-container {
    width: 50px;
    height: 70px;
}

.vape-art-drip {
    width: 14px;
    height: 18px;
    background: #222;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.vape-art-body {
    width: 44px;
    flex: 1;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b2b35 0%, #17171d 100%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 4px;
}

.list-layout .vape-art-body {
    width: 32px;
    border-radius: 8px;
    padding: 4px 2px;
}

.vape-art-window {
    width: 100%;
    height: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.list-layout .vape-art-window {
    height: 10px;
}

.vape-art-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    border-radius: 2px;
}

.vape-art-brand {
    font-family: var(--font-display);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.list-layout .vape-art-brand {
    display: none;
}

.vape-art-led {
    width: 14px;
    height: 4px;
    background: var(--color-glow);
    box-shadow: 0 0 8px var(--color-glow);
    border-radius: 2px;
    align-self: center;
}

/* Card Bottom Info */
.product-info {
    display: flex;
    flex-direction: column;
    padding: 10px 11px 11px;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
}

.list-layout .product-info {
    padding: 10px 14px;
    justify-content: center;
}

.product-title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.product-flavor {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-buy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
    min-width: 0;
}

.list-layout .product-buy-row {
    margin-top: 10px;
    gap: 12px;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
}

.capacity-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 12px;
}

.price-pill {
    padding: 7px 12px;
    border-radius: 12px;
    background-color: var(--accent-blue);
    color: white;
    font-weight: 700;
    font-size: 12px;
    font-family: var(--font-display);
    border: none;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.price-pill:active {
    background-color: var(--accent-blue-hover);
    transform: scale(0.96);
}

.price-pill.btn-disabled {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}

/* 7. Bottom Navigation Floating Bar (Portal-Market Style) */
:root {
  --bg-glass: #000;
  --c-light: #fff;
  --c-dark: #000;
  --c-content: #ffffff;
  --glass-reflex-dark: 2;
  --glass-reflex-light: .3;
  --saturation: 140%;
  --switcher-transition: .25s cubic-bezier(1, 0, .4, 1);
  --height: 62px;
  --primary: #00F5D4; /* Tifany */
  --glass-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03), inset 1.8px 3px 0px -2px rgba(255, 255, 255, .27), inset -2px -2px 0px -2px rgba(255, 255, 255, .24), inset -3px -8px 1px -6px rgba(255, 255, 255, .18), inset -.3px -1px 4px 0px rgba(0, 0, 0, .24), inset -1.5px 2.5px 0px -2px rgba(0, 0, 0, .4), inset 0px 3px 4px -2px rgba(0, 0, 0, .4), inset 2px -6.5px 1px -4px rgba(0, 0, 0, .2), 0px 1px 5px 0px rgba(0, 0, 0, .2), 0px 6px 16px 0px rgba(0, 0, 0, .16);
  --glass-shadow-modern: inset 0 0 0 1px color-mix( in srgb, var(--c-light) calc(var(--glass-reflex-light) * 10%), transparent ), inset 1.8px 3px 0px -2px color-mix( in srgb, var(--c-light) calc(var(--glass-reflex-light) * 90%), transparent ), inset -2px -2px 0px -2px color-mix( in srgb, var(--c-light) calc(var(--glass-reflex-light) * 80%), transparent ), inset -3px -8px 1px -6px color-mix( in srgb, var(--c-light) calc(var(--glass-reflex-light) * 60%), transparent ), inset -.3px -1px 4px 0px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 12%), transparent ), inset -1.5px 2.5px 0px -2px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent ), inset 0px 3px 4px -2px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 20%), transparent ), inset 2px -6.5px 1px -4px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent ), 0px 1px 5px 0px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 10%), transparent ), 0px 6px 16px 0px color-mix( in srgb, var(--c-dark) calc(var(--glass-reflex-dark) * 8%), transparent );
}

@supports (color-mix(in srgb,white,transparent)){
  :root {
    --glass-shadow: var(--glass-shadow-modern);
  }
}

/* Outer fixed wrapper */
.bottom-nav-fixed-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transform: translate3d(0, 0, 0);
  opacity: 1;
  /* Soft slide — no snap; no permanent will-change (causes continuous layer thrash) */
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
  pointer-events: auto;
}

.bottom-nav-fixed-wrapper.navbar-hidden {
  transform: translate3d(0, calc(100% + 28px), 0);
  opacity: 0;
  pointer-events: none;
}

.scroll-to-top-btn {
  position: fixed;
  left: 16px;
  bottom: calc(var(--safe-area-bottom) + 12px);
  z-index: 101;
  width: 58px;
  height: var(--height);
  border-radius: 99em;
  background-color: color-mix(in srgb, var(--bg-glass) 12%, transparent);
  backdrop-filter: blur(8px) saturate(var(--saturation));
  -webkit-backdrop-filter: blur(8px) saturate(var(--saturation));
  box-shadow: var(--glass-shadow);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
  transform: translate3d(0, 120%, 0) scale(0.85);
  opacity: 0;
  pointer-events: none;
}

.scroll-to-top-btn.visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.scroll-to-top-btn:active {
  transform: scale(0.9);
}

.bottom-nav-safe-padding {
  padding-top: 12px;
  width: 100%;
  padding-bottom: calc(var(--safe-area-bottom) + 12px);
  padding-left: calc(16px + var(--safe-area-left));
  padding-right: calc(16px + var(--safe-area-right));
  box-sizing: border-box;
}

/* SVG Filters */
._filter_khmv6_169 {
  position: absolute;
  width: 0;
  height: 0;
  z-index: -1;
  pointer-events: none;
}

/* Container */
._container_khmv6_95 {
  display: flex;
  flex-direction: row;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
}

/* Left Switcher Button */
._switcherBtn_khmv6_101 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  width: 58px;
  height: var(--height);
  border-radius: 99em;
  background-color: color-mix(in srgb, var(--bg-glass) 12%, transparent);
  backdrop-filter: blur(8px) saturate(var(--saturation));
  -webkit-backdrop-filter: blur(8px) saturate(var(--saturation));
  box-shadow: var(--glass-shadow);
  border: none;
  cursor: pointer;
  padding: 4px;
  box-sizing: border-box;
  transition: transform 0.2s ease, background-color var(--switcher-transition);
}

._switcherBtn_khmv6_101:active {
  transform: scale(0.92);
}

._switcherIcon_khmv6_121 {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff6;
  transition: color 0.2s ease, transform 0.2s ease;
}

._switcherIcon_khmv6_121 svg {
  width: 20px;
  height: 20px;
}

._switcherTitle_khmv6_133 {
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  line-height: 1.2;
  color: #fff6;
  letter-spacing: -.4px;
  transition: color 0.2s ease;
}

/* Active style for left button */
._switcherBtn_khmv6_101.active {
  background-color: color-mix(in srgb, var(--bg-glass) 30%, rgba(255, 255, 255, 0.05));
}

._switcherBtn_khmv6_101.active ._switcherIcon_khmv6_121 {
  color: #af51de; /* Purple color for active Games/Bonuses button like in original portals */
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px rgba(175, 81, 222, 0.4));
}

._switcherBtn_khmv6_101.active ._switcherTitle_khmv6_133 {
  color: #af51de;
}

/* Profile button (Right block) */
._profile_khmv6_142 {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background-color: #282727f2;
  border-radius: 99em;
  height: var(--height);
  width: var(--height);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: transform 0.2s ease;
}

._profile_khmv6_142:active {
  transform: scale(0.92);
}

._profileIcon_khmv6_156 {
  border-radius: 50% !important;
  width: 42px !important;
  height: 42px !important;
  overflow: hidden !important;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  transition: border-color var(--switcher-transition), box-shadow var(--switcher-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

._profileIcon_khmv6_156._profileIconActive_khmv6_161 {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.35);
}

/* Tabs switcher (Center block) */
._switcher_khmv6_101 {
  --tab-accent: var(--primary);
  --tab-count: 3;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tab-count), 1fr);
  align-items: center;
  gap: 0px;
  width: 100%;
  height: var(--height);
  padding: 4px;
  box-sizing: border-box;
  border: none;
  border-radius: 99em;
  background-color: color-mix(in srgb, var(--bg-glass) 12%, transparent);
  backdrop-filter: blur(8px) url(#distortion) saturate(var(--saturation));
  isolation: isolate;
  -webkit-backdrop-filter: blur(8px) saturate(var(--saturation));
  box-shadow: var(--glass-shadow);
  transition: background-color var(--switcher-transition), box-shadow var(--switcher-transition);
}

/* Toggle bubble indicator in switcher using pseudo-element :after */
._switcher_khmv6_101:after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  display: block;
  width: calc((100% - 8px) / var(--tab-count));
  height: 54px;
  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);
}

._switcher_khmv6_101[data-active="0"]:after {
  translate: 0 0;
  transform-origin: right;
  animation: _scaleToggle_khmv6_1 .44s ease;
}

._switcher_khmv6_101[data-active="1"]:after {
  translate: 100% 0;
  transition: background-color var(--switcher-transition), box-shadow var(--switcher-transition), translate var(--switcher-transition);
  animation: _scaleToggle2_khmv6_1 .44s ease;
}

._switcher_khmv6_101[data-previous="0"][data-active="1"]:after {
  transform-origin: left;
}

._switcher_khmv6_101[data-previous="2"][data-active="1"]:after {
  transform-origin: right;
}

._switcher_khmv6_101[data-active="2"]:after {
  translate: 200% 0;
  transform-origin: left;
  transition: background-color var(--switcher-transition), box-shadow var(--switcher-transition), translate var(--switcher-transition);
  animation: _scaleToggle3_khmv6_1 .44s ease;
}

._switcher_khmv6_101[data-previous="1"][data-active="2"]:after {
  transform-origin: left;
}

._switcher_khmv6_101[data-active="-1"]:after {
  display: none;
}

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

@keyframes _scaleToggle2_khmv6_1 {
  0% { scale: 1 1 }
  50% { scale: 1.1 1.1 }
  to { scale: 1 1 }
}

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

._optionWrap_khmv6_324 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
}

._option_khmv6_324 {
  --c: var(--c-content);
  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: .4;
  color: var(--c);
  transition: all .16s;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

._option_khmv6_324:hover {
  opacity: .7;
  cursor: pointer;
}

._option_khmv6_324:hover ._icon_khmv6_357 {
  scale: 1.1;
}

._option_khmv6_324:active {
  transform: scale(0.94);
}

/* Active option style mapping to .active class */
._option_khmv6_324.active {
  --c: var(--tab-accent, var(--primary));
  opacity: 1;
  cursor: auto;
  color: var(--c);
}

._option_khmv6_324.active:hover {
  opacity: 1;
  cursor: pointer;
}

._option_khmv6_324.active:hover ._icon_khmv6_357 {
  scale: 1.1;
}

._icon_khmv6_357 {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: scale .2s cubic-bezier(.5,0,0,1);
  color: currentColor;
}

._icon_khmv6_357 svg {
  width: 24px;
  height: 24px;
}

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

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-badge-indicator {
    position: absolute;
    top: -2px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background-color: #ff3b30;
    color: white;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #141418;
    display: none; /* Injected by JS */
}

/* 8. Tab Views Container */
.tab-view {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

.tab-view.active {
    display: block;
}

/* 9. Games View (Clicker) */
.games-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.clicker-stats {
    display: flex;
    width: 100%;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-box {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-val {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.energy-bar-outer {
    width: 100%;
    height: 8px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.energy-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-diamond) 100%);
    border-radius: 4px;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
}

/* Glowing Clicker Object */
.vape-click-area {
    width: 250px;
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
}

.vape-click-object-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.4) 0%, rgba(0, 102, 255, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(10px);
    animation: floatGlow 4s infinite alternate;
}

.vape-click-object {
    width: 100px;
    height: 180px;
    z-index: 2;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: floatVape 4s ease-in-out infinite;
    transform-origin: center bottom;
    transition: transform 0.05s ease;
}

.vape-click-object:active {
    transform: scale(0.92) rotate(2deg);
}

.vape-drip-tip {
    width: 26px;
    height: 35px;
    background: #18181c;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    position: relative;
}

.vape-body {
    width: 90px;
    flex: 1;
    border-radius: 24px;
    background: linear-gradient(135deg, #1c1c24 0%, #0d0d10 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    padding: 14px;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.vape-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.vape-liquid-window {
    width: 100%;
    height: 32px;
    background: rgba(0,0,0,0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.liquid-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 75%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-diamond) 50%, var(--accent-blue) 100%);
    opacity: 0.85;
    border-radius: 35%;
    animation: waveMove 4s linear infinite;
}

.vape-branding {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 10px 0;
}

.vape-indicator {
    width: 32px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 3px;
    align-self: center;
    box-shadow: 0 0 10px var(--accent-blue);
    animation: ledPulse 2s infinite alternate;
}

/* Floating Clicker Numbers */
.floating-num {
    position: absolute;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 4px 15px rgba(0, 102, 255, 0.6), 0 0 4px #000;
    pointer-events: none;
    z-index: 100;
    animation: floatUp 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

/* Vapor Particles */
.vapor-clouds-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
}

.vapor-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: driftCloud 1.2s ease-out forwards;
}

/* Upgrades store */
.upgrades-section {
    width: 100%;
    margin-top: 10px;
}

.upgrades-section h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin-bottom: 12px;
}

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

.upgrade-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.upg-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    background-color: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.upg-details {
    flex: 1;
}

.upg-name {
    font-weight: 700;
    font-size: 14px;
}

.upg-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.upg-cost {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-top: 2px;
}

.upg-buy-btn {
    padding: 8px 16px;
    border-radius: 14px;
    background-color: #1c1c24;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.upg-buy-btn:active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* 10. Staking View */
.staking-container h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 20px 0 12px 0;
}

.staking-summary-card {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, rgba(92, 194, 255, 0.05) 100%);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.staking-title {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--accent-diamond);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.staking-rate-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 16px;
}

.staking-rate-val {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.staking-rate-unit {
    color: var(--text-secondary);
    font-weight: 600;
}

.staking-accumulated {
    background-color: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.accumulated-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.accumulated-val-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
}

.accumulated-val {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-gold);
}

.accumulated-unit {
    color: var(--accent-gold);
    font-weight: 600;
}

.claim-btn {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    border: none;
    background-color: var(--accent-blue);
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
    transition: all 0.2s;
}

.claim-btn.disabled {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255,255,255,0.2);
    box-shadow: none;
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

.claim-btn:not(.disabled):active {
    transform: scale(0.98);
    background-color: var(--accent-blue-hover);
}

/* Staked list device cards */
.staked-devices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-list-message {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-secondary);
    background-color: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.staked-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.staked-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.staked-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.staked-name {
    font-weight: 700;
}

.staked-rate {
    font-size: 11px;
    color: var(--accent-diamond);
    font-weight: 600;
}

.stake-action-btn {
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background-color: #17171c;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.stake-action-btn.active {
    background-color: rgba(57, 211, 83, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* 11. Cart View */
.cart-container h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
}

.cart-item-row {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.cart-item-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-name {
    font-weight: 700;
    font-size: 14px;
}

.cart-item-price {
    font-size: 12px;
    color: var(--accent-diamond);
    font-weight: 600;
    margin-top: 2px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255,255,255,0.03);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background-color: #1c1c24;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background-color: var(--accent-blue);
}

.qty-val {
    font-weight: 700;
    min-width: 14px;
    text-align: center;
}

.cart-totals-section {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.total-price-row {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
    margin-top: 8px;
    color: var(--text-primary);
    font-weight: 700;
}

.total-price-val {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--accent-diamond);
}

/* Checkout Form */
.checkout-form {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 16px;
}

.checkout-form h4 {
    font-family: var(--font-display);
    font-size: 14px;
    margin-bottom: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.input-group input {
    height: 42px;
    border-radius: 12px;
    background-color: #17171c;
    border: 1px solid var(--border-color);
    padding: 0 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-blue);
}

.checkout-option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}

.checkout-option-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.checkout-option-title { color: var(--text-primary); font-size: 13px; font-weight: 700; }
.checkout-option-subtitle { color: var(--text-secondary); font-size: 11px; line-height: 1.35; }

.ios-switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; cursor: pointer; }
.ios-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ios-switch-track {
    display: block;
    width: 48px;
    height: 28px;
    padding: 2px;
    border-radius: 999px;
    background: #313138;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    transition: background .22s ease, box-shadow .22s ease;
}
.ios-switch-thumb {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 7px rgba(0,0,0,.35);
    transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.ios-switch input:checked + .ios-switch-track { background: var(--accent-blue); box-shadow: 0 0 16px rgba(0,102,255,.35); }
.ios-switch input:checked + .ios-switch-track .ios-switch-thumb { transform: translateX(20px); }
.ios-switch input:focus-visible + .ios-switch-track { outline: 2px solid var(--accent-diamond); outline-offset: 2px; }

.checkout-inline-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.checkout-inline-btn {
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(92,194,255,.3);
    border-radius: 12px;
    background: rgba(0,102,255,.14);
    color: var(--accent-diamond);
    font: 700 12px var(--font-body);
}
.checkout-inline-btn:disabled { opacity: .55; }
.checkout-field-hint { min-height: 16px; color: var(--text-secondary); font-size: 11px; }
.checkout-field-hint.success { color: var(--accent-green); }
.checkout-field-hint.error { color: #ff6b70; }
.checkout-balance-row { display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: center; gap: 10px; }
.checkout-balance-limit { color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.checkout-discount-row { color: var(--accent-green); }

/* Product details follow the native mobile drawer pattern: fixed bottom sheet,
   dimmed backdrop and a dedicated drag handle. */
.product-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,.68);
    opacity: 0;
    transition: opacity .28s ease;
    overscroll-behavior: contain;
}
.product-sheet {
    width: 100%;
    max-width: 500px;
    max-height: min(88dvh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 20px calc(24px + var(--safe-area-bottom,0px));
    border: 1px solid rgba(255,255,255,.1);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(180deg,#19191e 0%,#111114 100%);
    box-shadow: 0 -20px 60px rgba(0,0,0,.65);
    transform: translate3d(0,100%,0);
    transition: transform .34s cubic-bezier(.16,1,.3,1);
    will-change: transform;
}
.product-sheet.dragging { transition: none; }
.product-sheet-handle-hit { display:flex; justify-content:center; padding: 4px 0 14px; touch-action:none; cursor:grab; }
.product-sheet-handle { width: 42px; height: 5px; border-radius:999px; background:rgba(255,255,255,.22); }
body.product-sheet-open { overflow:hidden; }

.totals-row[hidden] { display: none !important; }

.checkout-btn {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    border: none;
    background-color: var(--accent-blue);
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
    transition: all 0.2s;
}

.checkout-btn:active {
    background-color: var(--accent-blue-hover);
    transform: scale(0.98);
}

/* 12. Profile View */
.profile-container h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 20px 0 12px 0;
}

.profile-user-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.avatar-container {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-diamond) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.3);
}

.avatar-placeholder {
    color: white;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

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

.user-info-text h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.user-info-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.status-gear-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 2px;
}

.user-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px 6px 4px 10px;
    border-radius: 12px;
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-body);
    line-height: 1;
}

.user-status-label {
    white-space: nowrap;
}

.settings-gear-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 9px;
    flex-shrink: 0;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.settings-gear-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.settings-gear-btn:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.94);
}

/* Daily Reward Card */
.daily-reward-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-top: 16px;
}

.daily-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daily-title h4 {
    font-family: var(--font-display);
    font-size: 14px;
}

.streak-text {
    font-size: 11px;
    color: var(--text-secondary);
}

.streak-text b {
    color: var(--accent-gold);
}

.daily-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.daily-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.daily-day-cell {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.daily-day-cell.claimed {
    background-color: rgba(57, 211, 83, 0.05);
    border-color: rgba(57, 211, 83, 0.2);
    color: var(--accent-green);
}

.daily-day-cell.active {
    border-color: var(--accent-gold);
    background-color: rgba(255, 170, 0, 0.05);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.15);
}

.cell-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
}

.daily-day-cell.active .cell-num {
    color: var(--accent-gold);
}

.cell-reward {
    font-size: 12px;
    font-weight: 700;
}

.cell-status {
    font-size: 10px;
}

.daily-claim-btn {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    background-color: var(--accent-gold);
    color: black;
    border: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.daily-claim-btn.disabled {
    background-color: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.2);
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

.daily-claim-btn:not(.disabled):active {
    transform: scale(0.98);
}

/* Referral System */
.referral-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-top: 16px;
}

.referral-card h4 {
    font-family: var(--font-display);
    font-size: 14px;
    margin-bottom: 6px;
}

.referral-card p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.referral-card b {
    color: var(--text-primary);
}

.ref-link-box {
    display: flex;
    background-color: #17171c;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 4px;
    align-items: center;
}

.ref-link-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 10px;
    color: var(--text-secondary);
    font-size: 11px;
}

.ref-copy-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.ref-copy-btn:active {
    background-color: var(--accent-blue-hover);
}

/* Fly Waka profile and guaranteed welcome bonus */
.games-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 14px 0 30px;
}

.bonus-heading { width: 100%; text-align: left; margin-bottom: 14px; }
.bonus-kicker { color: var(--accent-diamond); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.bonus-heading h2 { margin: 7px 0 7px; font-family: var(--font-display); font-size: 27px; line-height: 1.05; }
.bonus-heading p { margin: 0; max-width: 390px; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.welcome-wheel-wrap { position: relative; width: min(72vw, 300px); aspect-ratio: 1; margin: 28px auto 24px; filter: drop-shadow(0 22px 40px rgba(0,0,0,.45)); }
.welcome-wheel-pointer { position: absolute; z-index: 5; top: -9px; left: 50%; width: 31px; height: 38px; transform: translateX(-50%); background: linear-gradient(180deg, #fff 0%, #aeb9c7 100%); clip-path: polygon(50% 100%, 0 0, 100% 0); border-radius: 6px; filter: drop-shadow(0 5px 8px rgba(0,0,0,.45)); }
.welcome-wheel { position: relative; width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(from -45deg, #05d8c7 0 25%, #101b2d 25% 50%, #1668ff 50% 75%, #22293a 75% 100%); border: 8px solid rgba(255,255,255,.13); box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), inset 0 0 35px rgba(0,0,0,.35), 0 0 50px rgba(0,140,255,.16); transform: rotate(0deg); }
.welcome-wheel::after { content: ""; position: absolute; inset: 8px; border-radius: inherit; border: 1px solid rgba(255,255,255,.14); pointer-events: none; }
.welcome-wheel.is-spinning { animation: welcomeWheelSpin 3.15s cubic-bezier(.14,.67,.09,1) forwards; }
@keyframes welcomeWheelSpin { from { transform: rotate(0deg); } to { transform: rotate(1800deg); } }
.wheel-label { position: absolute; z-index: 2; color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 850; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.wheel-label-50 { top: 16%; left: 50%; transform: translate(-50%,-50%); }
.wheel-label-100 { top: 50%; right: 14%; transform: translate(50%,-50%); }
.wheel-label-200 { bottom: 15%; left: 50%; transform: translate(-50%,50%); }
.wheel-label-500 { top: 50%; left: 14%; transform: translate(-50%,-50%); }
.wheel-center { position: absolute; z-index: 3; inset: 50% auto auto 50%; width: 84px; height: 84px; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 28%, #28334a, #090c12 74%); border: 5px solid rgba(255,255,255,.18); box-shadow: 0 9px 22px rgba(0,0,0,.5); }
.wheel-center b { font-family: var(--font-display); font-size: 18px; line-height: 1; }
.wheel-center small { margin-top: 3px; color: var(--accent-diamond); font-size: 8px; letter-spacing: .18em; }
.welcome-spin-btn { width: 100%; min-height: 52px; border: 0; border-radius: 17px; color: #06110f; background: linear-gradient(135deg, #00f5d4, #43ffc8); box-shadow: 0 12px 28px rgba(0,245,212,.19); font: 800 14px var(--font-display); cursor: pointer; transition: transform .16s ease, opacity .16s ease; }
.welcome-spin-btn:active { transform: scale(.985); }
.welcome-spin-btn:disabled { cursor: default; opacity: .48; box-shadow: none; }

.profile-container { max-width: 520px; margin: 0 auto; padding-bottom: 26px; }
.profile-user-card { position: relative; margin-bottom: 12px !important; background: linear-gradient(145deg, rgba(26,29,39,.96), rgba(13,15,21,.96)) !important; }
.profile-stat-grid { display: grid; grid-template-columns: 1.25fr .8fr; gap: 10px; margin: 0 0 12px; }
.profile-stat-card { min-width: 0; min-height: 104px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(255,255,255,.075); border-radius: 19px; background: rgba(255,255,255,.032); }
.profile-stat-card:first-child { grid-row: span 2; min-height: 218px; background: radial-gradient(circle at 15% 10%, rgba(0,245,212,.15), transparent 52%), linear-gradient(145deg, rgba(17,32,35,.96), rgba(10,14,18,.96)); }
.profile-stat-card > span { color: var(--text-secondary); font-size: 11px; }
.profile-stat-card strong { color: var(--text-primary); font-family: var(--font-display); font-size: 24px; line-height: 1; }
.profile-stat-card:first-child strong { font-size: clamp(30px, 8vw, 42px); }
.profile-stat-card small { color: var(--text-secondary); font-size: 9px; line-height: 1.4; }
.profile-action-card { display: grid; grid-template-columns: 45px 1fr; gap: 10px 12px; padding: 15px; margin-bottom: 10px; border: 1px solid rgba(0,245,212,.15); border-radius: 21px; background: linear-gradient(145deg, rgba(0,245,212,.075), rgba(255,255,255,.025)); }
.profile-action-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 15px; color: var(--accent-diamond); background: rgba(0,245,212,.09); }
.profile-action-copy h4 { margin: 1px 0 5px; font-family: var(--font-display); font-size: 15px; }
.profile-action-copy p { margin: 0; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.profile-primary-action, .profile-secondary-action { min-height: 42px; border-radius: 13px; font: 750 12px var(--font-body); cursor: pointer; }
.profile-primary-action { grid-column: 1 / -1; color: #06110f; border: 0; background: var(--accent-diamond); }
.profile-secondary-action { grid-column: 1 / -1; color: var(--text-primary); border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.04); }
.profile-row-action { width: 100%; display: grid; grid-template-columns: 43px 1fr 20px; align-items: center; gap: 11px; padding: 12px; margin-bottom: 10px; color: var(--text-primary); text-align: left; border: 1px solid rgba(255,255,255,.075); border-radius: 18px; background: rgba(255,255,255,.03); }
.profile-row-icon { width: 43px; height: 43px; display: grid; place-items: center; color: #fff; border-radius: 14px; background: linear-gradient(145deg, #1265ff, #6545e8); }
.profile-row-action > span:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.profile-row-action b { font-size: 13px; }
.profile-row-action small { color: var(--text-secondary); font-size: 10px; }
.profile-chevron { color: var(--text-secondary); }
.profile-ledger-card { padding: 14px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,.075); border-radius: 20px; background: rgba(255,255,255,.025); }
.profile-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.profile-section-title h4 { margin: 0; font-family: var(--font-display); font-size: 14px; }
.profile-section-title span { color: var(--text-secondary); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.profile-ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.055); }
.profile-ledger-row > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-ledger-row b { overflow: hidden; color: var(--text-primary); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-ledger-row small, .profile-empty-copy { color: var(--text-secondary); font-size: 9px; }
.profile-ledger-row strong { flex-shrink: 0; font-size: 11px; }
.profile-ledger-row .is-positive { color: #38e9bd; }
.profile-ledger-row .is-negative { color: #ff6d7b; }
.profile-empty-copy { margin: 14px 0 4px; text-align: center; }

@media (min-width: 420px) {
    .profile-action-card { grid-template-columns: 45px 1fr auto; }
    .profile-primary-action { grid-column: 1 / 3; }
    .profile-secondary-action { grid-column: 3; min-width: 96px; }
}

/* Achievements List */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ach-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.ach-card.completed {
    border-color: rgba(57, 211, 83, 0.2);
}

.ach-badge {
    width: 44px;
    height: 44px;
    background-color: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-color);
}

.ach-card.completed .ach-badge {
    background-color: rgba(57, 211, 83, 0.1);
    border-color: var(--accent-green);
}

.ach-info {
    flex: 1;
}

.ach-name {
    font-weight: 700;
    font-size: 14px;
}

.ach-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ach-progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
}

.ach-progress-fill {
    height: 100%;
    background-color: var(--accent-blue);
    width: 0%;
    transition: width 0.3s ease;
}

.ach-card.completed .ach-progress-fill {
    background-color: var(--accent-green);
}

.ach-reward {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-gold);
    position: absolute;
    top: 12px;
    right: 12px;
}

/* 13. Toast Notification Styles */
#toast-container {
    position: fixed;
    top: calc(24px + var(--safe-area-top));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    width: 90%;
    max-width: 320px;
    pointer-events: none;
}

.toast {
    background-color: rgba(20, 20, 24, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDownToast 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    pointer-events: auto;
    touch-action: pan-y;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast:active {
    cursor: grabbing;
}

.toast.success {
    border-color: rgba(57, 211, 83, 0.35);
}

.toast.info {
    border-color: rgba(90, 170, 255, 0.35);
}

.toast.error {
    border-color: rgba(255, 90, 90, 0.4);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.toast-icon svg {
    display: block;
}

.toast.success .toast-icon {
    background: rgba(57, 211, 83, 0.14);
    color: #39d353;
}

.toast.info .toast-icon {
    background: rgba(90, 170, 255, 0.14);
    color: #5aaaff;
}

.toast.error .toast-icon {
    background: rgba(255, 90, 90, 0.14);
    color: #ff6b6b;
}

.toast-msg {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    letter-spacing: -0.1px;
}

.toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.toast-close:active {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.toast.swiping {
    transition: none !important;
    animation: none !important;
}

.toast.dismissing {
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    animation: none !important;
    pointer-events: none;
}

/* Keyframes */

@keyframes rotateGold {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes pulseGlow {
    from { opacity: 0.6; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

@keyframes ledPulse {
    from { opacity: 0.7; box-shadow: 0 0 5px var(--accent-blue); }
    to { opacity: 1; box-shadow: 0 0 15px var(--accent-blue), 0 0 5px var(--accent-diamond); }
}

@keyframes floatGlow {
    from { transform: scale(0.95); opacity: 0.8; }
    to { transform: scale(1.05); opacity: 1; }
}

@keyframes floatVape {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes waveMove {
    0% { transform: translateX(0) translateZ(0) scaleY(1); }
    50% { transform: translateX(-25%) translateZ(0) scaleY(0.85); }
    100% { transform: translateX(-50%) translateZ(0) scaleY(1); }
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(0.8); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

@keyframes driftCloud {
    0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
    10% { opacity: 0.5; }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(2); }
}

@keyframes slideDownToast {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 14. Fullscreen Mode Adaptations */
body.webapp-fullscreen {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

body.webapp-fullscreen #app-container {
    max-width: 100% !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
}

/* 15. Gear Animations for Banner */
@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounter {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.gear-rotate-clockwise svg {
    animation: rotateClockwise 12s linear infinite;
    transform-origin: center;
}

.gear-rotate-counter svg {
    animation: rotateCounter 18s linear infinite;
    transform-origin: center;
}

/* --- Catalog badges & price (no heavy backdrop-filter — less WebView flicker) --- */
.card-badge.category-tag-badge {
    background: rgba(0, 0, 0, 0.62);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-right: auto;
}

.card-badge.badge-instock {
    background: rgba(52, 199, 89, 0.18);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.28);
    margin-left: auto;
}

.card-badge.badge-out {
    background: rgba(255, 59, 48, 0.18);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.28);
    margin-left: auto;
}

.old-price-tag {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    line-height: 1.1;
}

.main-price {
    font-weight: 800;
    color: #ffffff;
    font-size: 14px;
    font-family: var(--font-display);
    letter-spacing: -0.2px;
    line-height: 1.15;
}

.product-img-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* --- Maintenance screen --- */
.maintenance-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + var(--safe-area-top, 0px)) 20px calc(24px + var(--safe-area-bottom, 0px));
    box-sizing: border-box;
    background: #0c0c0e;
    overflow: hidden;
}

.maintenance-screen[hidden] {
    display: none !important;
}

body.maintenance-locked #app-container,
body.maintenance-locked .bottom-nav-fixed-wrapper {
    visibility: hidden !important;
    pointer-events: none !important;
}

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

.maintenance-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
}

.maintenance-orb-a {
    width: 220px;
    height: 220px;
    top: -40px;
    right: -50px;
    background: radial-gradient(circle, rgba(118, 34, 244, 0.55), transparent 70%);
    animation: maintFloat 7s ease-in-out infinite;
}

.maintenance-orb-b {
    width: 260px;
    height: 260px;
    bottom: -60px;
    left: -70px;
    background: radial-gradient(circle, rgba(0, 245, 212, 0.28), transparent 70%);
    animation: maintFloat 9s ease-in-out infinite reverse;
}

.maintenance-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
    opacity: 0.7;
}

.maintenance-card {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    text-align: center;
    padding: 28px 22px 24px;
    border-radius: 28px;
    background: rgba(18, 18, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.maintenance-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffb060;
    background: rgba(255, 140, 0, 0.12);
    border: 1px solid rgba(255, 170, 0, 0.28);
    margin-bottom: 18px;
    font-family: var(--font-body);
}

.maintenance-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
    animation: maintPulse 1.4s ease-in-out infinite;
}

.maintenance-icon-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
}

.maintenance-gear {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
}

.maintenance-gear-lg {
    inset: 0;
    background: radial-gradient(circle at 35% 30%, #af52de, #5b1fa2 70%);
    box-shadow: 0 12px 30px rgba(118, 34, 244, 0.4);
    animation: maintSpin 10s linear infinite;
}

.maintenance-gear-sm {
    width: 42px;
    height: 42px;
    right: -4px;
    bottom: -2px;
    background: radial-gradient(circle at 35% 30%, #ffcc55, #ff8800 75%);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.35);
    animation: maintSpin 7s linear infinite reverse;
}

.maintenance-title {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #fff;
}

.maintenance-text {
    margin: 0 auto;
    max-width: 280px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.62);
    font-family: var(--font-body);
}

.maintenance-meta {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.maintenance-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.maintenance-meta-pill svg {
    color: var(--primary, #00f5d4);
}

.maintenance-brand {
    margin-top: 22px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.28);
}

/* Admin can still use the app during maintenance — soft strip */
.maint-admin-banner {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 0 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #ffb060;
    background: rgba(255, 140, 0, 0.12);
    border: 1px solid rgba(255, 170, 0, 0.28);
    font-family: var(--font-body);
}

@keyframes maintSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes maintPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

@keyframes maintFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(18px); }
}

/* --- Purchases / Orders (cart-style) --- */
.empty-orders-view,
.empty-cart-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 16px 48px;
    text-align: center;
    min-height: 42vh;
}

.empty-orders-icon-wrapper,
.empty-cart-icon-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.45);
}

.empty-orders-text,
.empty-cart-text {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.3px;
}

.empty-orders-cta {
    margin-top: 18px;
    height: 44px;
    padding: 0 22px;
    border-radius: 14px;
    border: none;
    background: var(--primary);
    color: #000;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 14px;
    cursor: pointer;
}

.checkout-cancel-btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-display);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-cancel-btn:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12);
}

.purchases-list {
    width: 100%;
}

.purchase-order-group {
    margin-bottom: 18px;
}

.purchase-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px 10px;
}

.purchase-order-meta-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.purchase-order-id {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.purchase-order-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 245, 212, 0.12);
    color: var(--primary);
    white-space: nowrap;
}

.purchase-item-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.purchase-item-qty {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-display);
}

.purchase-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    padding: 12px 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
}

.order-total-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.order-total-val {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.cart-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #101014;
    border: 1px solid var(--border-color);
}

.cart-item-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
}

/* --- Checkout Option Pills & Payment Modal --- */
.option-pills-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.opt-pill {
    flex: 1;
    min-width: 95px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    color: rgba(255, 255, 255, 0.8);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.opt-pill.active {
    background: var(--primary, #00f2fe);
    color: #000;
    font-weight: 700;
    border-color: var(--primary, #00f2fe);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.payment-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.payment-card {
    background: #14151b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 24px 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.payment-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.payment-card-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.copy-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.copy-info {
    display: flex;
    flex-direction: column;
}

.copy-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-val {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: monospace, monospace;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-copy:active {
    background: var(--primary, #00f2fe);
    color: #000;
}

/* --- Modern Sleek Order Cards in "Мои покупки" --- */
.order-card {
    background: linear-gradient(145deg, rgba(22, 22, 28, 0.96), rgba(16, 16, 20, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.order-id {
    font-family: var(--font-display, Outfit, sans-serif);
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.2px;
}

.order-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.order-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.2px;
}

.order-status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.status-new { background: rgba(255, 193, 7, 0.12); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.28); }
.status-pending-check { background: rgba(0, 245, 212, 0.12); color: #00f5d4; border: 1px solid rgba(0, 245, 212, 0.32); }
.status-paid { background: rgba(13, 202, 240, 0.12); color: #0dcaf0; border: 1px solid rgba(13, 202, 240, 0.28); }
.status-processing { background: rgba(163, 112, 247, 0.12); color: #a370f7; border: 1px solid rgba(163, 112, 247, 0.28); }
.status-delivering { background: rgba(13, 110, 253, 0.12); color: #0d6efd; border: 1px solid rgba(13, 110, 253, 0.28); }
.status-completed { background: rgba(32, 201, 151, 0.12); color: #20c997; border: 1px solid rgba(32, 201, 151, 0.28); }
.status-cancelled { background: rgba(220, 53, 69, 0.12); color: #dc3545; border: 1px solid rgba(220, 53, 69, 0.28); }

.order-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.order-meta-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
}

.purchase-order-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.purchase-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.order-total-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.order-total-val {
    font-family: var(--font-display, Outfit, sans-serif);
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.order-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 2px;
}

.order-btn-receipt {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 245, 212, 0.35);
    background: rgba(0, 245, 212, 0.12);
    color: #00f5d4;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.order-btn-receipt:active {
    transform: scale(0.98);
    background: rgba(0, 245, 212, 0.2);
}

.order-btn-receipt.attached {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.35);
    color: #34c759;
}

.order-btn-cancel {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 59, 48, 0.22);
    background: rgba(255, 59, 48, 0.08);
    color: #ff5c5c;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.order-btn-cancel:active {
    background: rgba(255, 59, 48, 0.16);
    transform: scale(0.98);
}

.order-item-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
}

/* Settings Modal & Toggle Switches */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    background: #121217;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-family: var(--font-display);
}

.setting-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #af52de;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.settings-footer-info {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
