/* Base Reset & Fonts */
:root {
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 20px);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: #0f172a; /* Fallback */
    color: #f8fafc;
    /* overflow handled in individual views */
}

/* --- DYNAMIC NATURE THEMES --- */

/* The background layer that transitions */
#app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 0.5s ease-in-out;
    background-size: 200% 200%;
    animation: gradientMove 20s ease infinite;
}

 #ambient-canvas {
     position: fixed;
     inset: 0;
     width: 100%;
     height: 100%;
     z-index: 1;
     pointer-events: none;
     opacity: 0.8;
 }

 @media (prefers-reduced-motion: reduce) {
     #ambient-canvas {
         display: none;
     }
 }

/* Thematic Background Icon Overlay */
#app-background::after {
    content: '';
    position: absolute;
    bottom: -5%;
    right: -10%;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 50vh;
    opacity: 0.04;
    transform: rotate(-15deg);
    pointer-events: none;
    transition: all 0.5s ease;
    color: white;
    z-index: -1;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 1. Wallet: RAINFOREST (Growth & Stability) */
/* Deep emeralds and teals for a secure, wealthy feel */
body.theme-forest #app-background {
    background: radial-gradient(circle at top left, #059669, transparent 50%),
                radial-gradient(circle at bottom right, #065f46, transparent 50%),
                linear-gradient(to bottom, #022c22, #0f172a);
}
/* Живое дерево: покачивается, из кроны падают листья.
   Показывается только на theme-forest (кошелёк/чеки). */
.forest-scene {
    display: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
body.theme-forest #app-background .forest-scene { display: block; }

.forest-glow {
    position: absolute;
    right: -22vh;
    bottom: -20vh;
    width: 95vh;
    height: 95vh;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 65%);
}

.forest-tree {
    position: absolute;
    bottom: -8%;
    right: -12%;
    height: 72vh;
    aspect-ratio: 2 / 3;
    opacity: 0.42;
    transform-origin: 50% 100%;
    animation: forest-sway 9s ease-in-out infinite alternate;
}
@keyframes forest-sway {
    from { transform: rotate(-0.8deg); }
    to   { transform: rotate(1deg); }
}
/* Крона качается со своим периодом — движение получается органичным */
.forest-tree__crown {
    transform-box: fill-box;
    transform-origin: 50% 92%;
    animation: forest-crown-sway 6s ease-in-out infinite alternate;
}
@keyframes forest-crown-sway {
    from { transform: rotate(-1.2deg); }
    to   { transform: rotate(1.2deg); }
}

.forest-leaves {
    position: absolute;
    inset: 0;
}
.f-leaf {
    position: absolute;
    left: var(--x, 60%);
    top: var(--y0, 45vh);
    opacity: 0;
    animation: f-leaf-fall var(--dur, 10s) linear infinite;
    animation-delay: var(--delay, 0s);
}
.f-leaf i {
    display: block;
    width: var(--size, 10px);
    height: var(--size, 10px);
    background: linear-gradient(135deg, #6ee7b7, #059669);
    border-radius: 0 100% 0 100%;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.35);
}
@keyframes f-leaf-fall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    7%   { opacity: var(--o, 0.45); }
    25%  { transform: translate(var(--sway, 24px), calc(var(--fall, 55vh) * 0.28)) rotate(calc(var(--spin, 320deg) * 0.3)); }
    50%  { transform: translate(calc(var(--sway, 24px) * -0.6), calc(var(--fall, 55vh) * 0.55)) rotate(calc(var(--spin, 320deg) * -0.4)); }
    75%  { transform: translate(calc(var(--sway, 24px) * 0.8), calc(var(--fall, 55vh) * 0.8)) rotate(calc(var(--spin, 320deg) * 0.75)); }
    88%  { opacity: var(--o, 0.45); }
    100% { transform: translate(calc(var(--sway, 24px) * -0.2), var(--fall, 55vh)) rotate(var(--spin, 320deg)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .forest-tree,
    .forest-tree__crown {
        animation: none;
    }
    .f-leaf {
        display: none;
    }
}

/* 2. P2P: OCEAN (Global Flow) */
/* Deep ocean blues and cyans */
body.theme-ocean #app-background {
    background: radial-gradient(circle at top center, #0891b2, transparent 50%),
                radial-gradient(circle at bottom left, #1e3a8a, transparent 50%),
                linear-gradient(to bottom, #0c4a6e, #0f172a);
}
body.theme-ocean #app-background::after {
    content: '\f773'; /* fa-water */
    bottom: -15%;
}

/* 3. History: DESERT (Time & Data) */
/* Warm ambers and deep browns, sands of time */
body.theme-canyon #app-background {
    background: radial-gradient(circle at top right, #d97706, transparent 50%),
                radial-gradient(circle at bottom left, #7c2d12, transparent 50%),
                linear-gradient(to bottom, #451a03, #0f172a);
}
body.theme-canyon #app-background::after {
    content: '\f72e'; /* fa-wind (Dunes/Wind) */
    font-size: 60vh;
}

/* 4. Settings: AURORA (System & Control) */
/* Mystical purples and deep space */
body.theme-aurora #app-background {
    background: radial-gradient(circle at 50% 0%, #d946ef, transparent 40%),
                radial-gradient(circle at 0% 100%, #6366f1, transparent 40%),
                linear-gradient(to bottom, #312e81, #0f172a);
}
body.theme-aurora #app-background::after {
    content: '\f085'; /* fa-cogs */
}


/* --- ORGANIC UI COMPONENTS --- */

/* Natural Glass Card */
.glass-panel {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    border-radius: 24px; /* More organic/rounded */
}

.glass-panel-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
}

/* Ripple/Glow effects for interactions */
.interactive-card {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
.interactive-card:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.12);
}

 button,
 a,
 .nav-item,
 .btn-primary,
 .interactive-card {
     -webkit-tap-highlight-color: transparent;
 }

 button,
 a,
 .nav-item {
     transition: transform 0.15s ease, filter 0.2s ease, background-color 0.2s ease, color 0.2s ease;
 }

 button:active,
 a:active {
     transform: translateY(0.5px) scale(0.98);
 }

 button:hover,
 a:hover {
     filter: brightness(1.03);
 }

 button:focus-visible,
 a:focus-visible,
 input:focus-visible,
 textarea:focus-visible,
 select:focus-visible {
     outline: none;
     box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
 }

 .glass-panel,
 .glass-panel-ultra,
 .glass-panel-heavy,
 .glass-panel-dark {
     transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
 }

 .glass-panel:hover,
 .glass-panel-ultra:hover,
 .glass-panel-heavy:hover {
     border-color: rgba(255, 255, 255, 0.18);
 }

 @media (prefers-reduced-motion: reduce) {
     button,
     a,
     .nav-item,
     .btn-primary,
     .interactive-card,
     .glass-panel,
     .glass-panel-ultra,
     .glass-panel-heavy,
     .glass-panel-dark {
         transition: none !important;
     }
 }

/* Floating Action Button (Natural feel) */
.fab-natural {
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

/* Custom Scrollbar (Minimal) */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

 .ui-icon {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     vertical-align: -0.125em;
     width: 1.25em;
     height: 1.25em;
 }

 .ui-icon__img {
     width: 100%;
     height: 100%;
     object-fit: contain;
 }

 .ui-icon__fallback {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     width: 100%;
     height: 100%;
     line-height: 1;
 }

/* Transitions */
.fade-enter {
    animation: fadeIn 0.3s ease forwards;
}
.view-enter {
    animation: viewSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Directional Slide Animations */
.slide-left-enter {
    animation: slideLeftEnter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.slide-left-exit {
    animation: slideLeftExit 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
.slide-right-enter {
    animation: slideRightEnter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.slide-right-exit {
    animation: slideRightExit 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

@keyframes slideLeftEnter {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideLeftExit {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}
@keyframes slideRightEnter {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideRightExit {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes viewSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* Ultra Glass - Newer, cleaner glassmorphism */
.glass-panel-ultra {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 28px;
}

.glass-panel-heavy {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
}

/* Modern Card Interactions */
.modern-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-4px) scale(1.01);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
}

.modern-card:active {
    transform: scale(0.98);
}

/* Gradient Text Utilities */
.text-gradient-gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Crypto Watermark */
.crypto-watermark {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
    transition: transform 0.5s ease;
}

.modern-card:hover .crypto-watermark {
    transform: rotate(0deg) scale(1.1);
    opacity: 0.08;
}

/* Status Badges */
.badge-modern {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
}

/* Improved Inputs */
.input-modern {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.input-modern:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.02);
}

/* Floating Navigation Menu */
.floating-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 30, 40, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 100;
    width: auto;
    transition: bottom 0.3s;
}

.floating-nav.nav-hidden {
    bottom: -100px !important;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.nav-item i {
    font-size: 16px;
    transition: transform 0.2s;
}

.nav-item span {
    display: none;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item.active i {
    transform: scale(1.05);
}

/* Active indicator dot */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* Theme-specific active states */
.theme-forest .nav-item.active { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)); color: #6ee7b7; }
.theme-forest .nav-item.active::after { background: #6ee7b7; box-shadow: 0 0 6px #6ee7b7; }

.theme-ocean .nav-item.active { background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1)); color: #67e8f9; }
.theme-ocean .nav-item.active::after { background: #67e8f9; box-shadow: 0 0 6px #67e8f9; }

.theme-canyon .nav-item.active { background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1)); color: #fdba74; }
.theme-canyon .nav-item.active::after { background: #fdba74; box-shadow: 0 0 6px #fdba74; }

.theme-aurora .nav-item.active { background: linear-gradient(135deg, rgba(217, 70, 239, 0.2), rgba(217, 70, 239, 0.1)); color: #f0abfc; }
.theme-aurora .nav-item.active::after { background: #f0abfc; box-shadow: 0 0 6px #f0abfc; }

.organic-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: rgba(255, 255, 255, 0.8);
    animation: organicSpin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.organic-loader-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: rgba(6, 182, 212, 0.8);
    animation: organicSpin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Scrollbar hiding */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Mask gradient for horizontal scroll */
.mask-gradient-right {
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

@keyframes organicSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Modal Animations */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Modals */
#modal-container {
    perspective: 1000px;
}

.modal-content {
    background: rgba(23, 33, 43, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform-origin: bottom;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 640px) {
    .modal-content {
        border-radius: 24px;
        margin: 20px;
        animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

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

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-exit {
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* Form Elements */
.input-group {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.2s;
}

.input-group:focus-within {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.01);
}

.input-ghost {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    padding: 16px;
    outline: none;
    font-size: 16px;
}

.input-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    margin-left: 4px;
}

/* Crypto Icons Gradients */
.icon-btc { background: linear-gradient(135deg, #f7931a, #c8750f); }
.icon-eth { background: linear-gradient(135deg, #627eea, #4558a3); }
.icon-usdt { background: linear-gradient(135deg, #26a17b, #186950); }
.icon-ton { background: linear-gradient(135deg, #0098ea, #006499); }
.icon-bnb { background: linear-gradient(135deg, #f3ba2f, #cfa12f); }
.icon-trx { background: linear-gradient(135deg, #ef0027, #a1001b); }
.icon-ltc { background: linear-gradient(135deg, #345d9d, #24406b); }
.icon-usdc { background: linear-gradient(135deg, #2775ca, #1a518c); }

/* Action Buttons in Modal */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 16px;
    font-weight: 600;
    width: 100%;
    transition: transform 0.1s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:active { transform: scale(0.98); }

.theme-forest .btn-primary { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3); }
.theme-ocean .btn-primary { background: linear-gradient(135deg, #06b6d4, #0891b2); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3); }
.theme-canyon .btn-primary { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3); }
.theme-aurora .btn-primary { background: linear-gradient(135deg, #d946ef, #9333ea); box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3); }

/* P2P Specific Styles */
.crypto-filter {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crypto-filter:active {
    transform: scale(0.95);
}

.order-card {
    transition: all 0.3s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Nav Bar Styling - REMOVED (Legacy) */

/* Smooth View Transitions */
.view-transition {
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.view-transition-enter {
    opacity: 0;
    transform: translateX(10px);
}

.view-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
}

/* Slide animations for modal steps */
.animate-slide-left-enter {
    animation: slideLeftEnter 0.25s ease-out forwards;
}

@keyframes slideLeftEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input validation states */
input.border-red-500\/50 {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

input.border-green-500\/50 {
    border-color: rgba(34, 197, 94, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

/* Prevent layout shift during transitions */
#p2p-orders-list {
    min-height: 200px;
}

/* Smoother scroll */
.glass-panel-heavy {
    scroll-behavior: smooth;
}

/* Button disabled state */
button:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* Organic loader small */
.organic-loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============== GAME ZONE STYLES ============== */

/* Game Zone Theme - Cyber/Neon Aesthetics */
body.theme-games #app-background {
    background: radial-gradient(circle at 50% -20%, #1e1b4b, #0f172a);
}

body.theme-games #app-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(90deg, rgba(99, 102, 241, 0.03) 0px, rgba(99, 102, 241, 0.03) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(99, 102, 241, 0.03) 0px, rgba(99, 102, 241, 0.03) 1px, transparent 1px, transparent 40px);
    background-position: center top;
    mask-image: linear-gradient(to bottom, black 40%, transparent 90%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 90%);
    z-index: 0;
    pointer-events: none;
}

body.theme-games #app-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50vh;
    background: radial-gradient(ellipse at top, rgba(124, 58, 237, 0.15), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Game Hero Section */
.game-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(20px);
}

.game-hero-content {
    position: relative;
    z-index: 10;
}

.game-hero-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    filter: blur(40px);
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.1); }
}

/* Enhanced Game Cards */
.game-card {
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

.game-card-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    transition: transform 0.5s ease, opacity 0.3s ease;
    mix-blend-mode: overlay;
}

.game-card:hover .game-card-bg-image {
    transform: scale(1.1);
    opacity: 0.2;
}

.game-card-content {
    position: relative;
    z-index: 10;
}

/* Game Specific Themes */
.game-card[data-game="cases"] { --game-color: #f59e0b; --game-shadow: rgba(245, 158, 11, 0.4); }
.game-card[data-game="cases"] .game-card-bg-image { background-image: url('../assets/games/cases_bg.svg'); }

.game-card[data-game="wheel"] { --game-color: #ec4899; --game-shadow: rgba(236, 72, 153, 0.4); }
.game-card[data-game="wheel"] .game-card-bg-image { background-image: url('../assets/games/wheel_bg.svg'); }

.game-card[data-game="roulette"] { --game-color: #ef4444; --game-shadow: rgba(239, 68, 68, 0.4); }
.game-card[data-game="roulette"] .game-card-bg-image { background-image: url('../assets/games/roulette_bg.svg'); }

.game-card[data-game="coinflip"] { --game-color: #eab308; --game-shadow: rgba(234, 179, 8, 0.4); }
.game-card[data-game="coinflip"] .game-card-bg-image { background-image: url('../assets/games/coinflip_bg.svg'); }

.game-card[data-game="dice"] { --game-color: #8b5cf6; --game-shadow: rgba(139, 92, 246, 0.4); }
.game-card[data-game="dice"] .game-card-bg-image { background-image: url('../assets/games/dice_bg.svg'); }

.game-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    color: var(--game-color);
}

.game-card:hover .game-icon-box {
    background: var(--game-color);
    color: white;
    box-shadow: 0 0 20px var(--game-shadow);
    transform: scale(1.1) rotate(-5deg);
}

/* Stat Pills in Cards */
.game-stat-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-stat-pill i {
    font-size: 10px;
}

/* Live Ticker Enhanced */
.wins-ticker-enhanced {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.8) 15%, rgba(15, 23, 42, 0.8) 85%, rgba(15, 23, 42, 0) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 0;
    margin-top: 16px;
    position: relative;
    overflow: hidden;
}

.ticker-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    padding: 4px 12px 4px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.ticker-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ticker-game-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Play Button Overlay */
.play-btn-overlay {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--game-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px var(--game-shadow);
}

.game-card:hover .play-btn-overlay {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Quick Actions in Hero */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.hero-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
}

.hero-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

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

/* Animations */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-in-up {
    animation: slideInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

body.theme-games #game-content {
    background: rgba(10, 10, 14, 0.94) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.theme-games .currency-selector {
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255, 203, 129, 0.14);
    border-radius: 14px;
}

body.theme-games .currency-pill {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 203, 129, 0.12);
    border-radius: 12px;
}

body.theme-games .currency-pill:hover {
    background: rgba(255, 203, 129, 0.07);
    color: rgba(255, 255, 255, 0.88);
}

body.theme-games .currency-pill.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(180, 83, 9, 0.12));
    color: rgba(255, 230, 178, 0.98);
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

/* Case Animation */
.case-bounce {
    animation: caseBounce 2s ease-in-out infinite;
}

@keyframes caseBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.case-shaking {
    animation: caseShake 0.1s linear infinite;
}

@keyframes caseShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
}

.case-opening {
    animation: caseOpen 1s ease-out forwards;
}

@keyframes caseOpen {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) rotate(10deg); }
    100% { transform: scale(0); opacity: 0; }
}

/* Prize Reveal */
.prize-reveal {
    animation: prizeReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes prizeReveal {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.prize-common { text-shadow: 0 0 20px rgba(156, 163, 175, 0.5); }
.prize-uncommon { text-shadow: 0 0 20px rgba(34, 197, 94, 0.5); }
.prize-rare { text-shadow: 0 0 20px rgba(59, 130, 246, 0.5); }
.prize-epic { text-shadow: 0 0 30px rgba(168, 85, 247, 0.7); }
.prize-legendary { 
    text-shadow: 0 0 40px rgba(234, 179, 8, 0.8);
    animation: legendaryGlow 1s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Roulette Wheel */
.roulette-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #16a34a 0deg 9.73deg,
        #dc2626 9.73deg 19.46deg,
        #1f2937 19.46deg 29.19deg,
        #dc2626 29.19deg 38.92deg,
        #1f2937 38.92deg 48.65deg,
        #dc2626 48.65deg 58.38deg,
        #1f2937 58.38deg 68.11deg,
        #dc2626 68.11deg 77.84deg,
        #1f2937 77.84deg 87.57deg,
        #dc2626 87.57deg 97.3deg,
        #1f2937 97.3deg 107.03deg,
        #dc2626 107.03deg 116.76deg,
        #1f2937 116.76deg 126.49deg,
        #dc2626 126.49deg 136.22deg,
        #1f2937 136.22deg 145.95deg,
        #dc2626 145.95deg 155.68deg,
        #1f2937 155.68deg 165.41deg,
        #dc2626 165.41deg 175.14deg,
        #1f2937 175.14deg 184.87deg,
        #dc2626 184.87deg 194.6deg,
        #1f2937 194.6deg 204.33deg,
        #dc2626 204.33deg 214.06deg,
        #1f2937 214.06deg 223.79deg,
        #dc2626 223.79deg 233.52deg,
        #1f2937 233.52deg 243.25deg,
        #dc2626 243.25deg 252.98deg,
        #1f2937 252.98deg 262.71deg,
        #dc2626 262.71deg 272.44deg,
        #1f2937 272.44deg 282.17deg,
        #dc2626 282.17deg 291.9deg,
        #1f2937 291.9deg 301.63deg,
        #dc2626 301.63deg 311.36deg,
        #1f2937 311.36deg 321.09deg,
        #dc2626 321.09deg 330.82deg,
        #1f2937 330.82deg 340.55deg,
        #dc2626 340.55deg 350.28deg,
        #1f2937 350.28deg 360deg
    );
    box-shadow: 0 0 0 8px rgba(255,255,255,0.1), 
                0 0 30px rgba(0,0,0,0.5),
                inset 0 0 30px rgba(0,0,0,0.3);
    position: relative;
}

.wheel-inner {
    position: absolute;
    inset: 30%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.wheel-number {
    font-size: 2rem;
    font-weight: bold;
}

.wheel-number.color-red { color: #ef4444; }
.wheel-number.color-black { color: #9ca3af; }
.wheel-number.color-green { color: #22c55e; }

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #fbbf24;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.roulette-wheel.spinning {
    animation: wheelSpin 3s cubic-bezier(0.17, 0.67, 0.12, 0.99) forwards;
}

@keyframes wheelSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}

/* Bet Type Buttons */
.bet-type-btn {
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.bet-type-btn:hover {
    background: rgba(255,255,255,0.1);
}

.bet-type-btn.active {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.5);
}

.bet-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Coin Flip */
.coin-3d {
    transition: transform 0.3s;
}

.coin-flipping {
    animation: coinFlip 2s ease-in-out;
}

@keyframes coinFlip {
    0% { transform: rotateY(0deg); }
    25% { transform: rotateY(720deg) scale(1.2); }
    50% { transform: rotateY(1440deg); }
    75% { transform: rotateY(2160deg) scale(1.2); }
    100% { transform: rotateY(2880deg); }
}

/* Dice Roll */
.dice-3d {
    transition: transform 0.3s;
}

.dice-rolling {
    animation: diceRoll 2s ease-in-out;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.2); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Side Buttons */
.side-btn {
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.side-btn.active {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.5);
}

.side-btn:hover {
    transform: scale(1.02);
}

/* Dice Type Buttons */
.dice-type-btn {
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.dice-type-btn.active {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
}

/* Lobby Cards */
.lobby-card {
    transition: all 0.2s;
}

.lobby-card:hover {
    background: rgba(255,255,255,0.08);
}

/* Gradient Text */
.text-gradient-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============== ENHANCED GAME ANIMATIONS ============== */

/* Roulette Wheel V2 - Realistic spinning with numbers */
.roulette-wheel-v2 {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(
        from 0deg,
        #16a34a 0deg 9.73deg,
        #dc2626 9.73deg 19.46deg,
        #1f2937 19.46deg 29.19deg,
        #dc2626 29.19deg 38.92deg,
        #1f2937 38.92deg 48.65deg,
        #dc2626 48.65deg 58.38deg,
        #1f2937 58.38deg 68.11deg,
        #dc2626 68.11deg 77.84deg,
        #1f2937 77.84deg 87.57deg,
        #dc2626 87.57deg 97.3deg,
        #1f2937 97.3deg 107.03deg,
        #dc2626 107.03deg 116.76deg,
        #1f2937 116.76deg 126.49deg,
        #dc2626 126.49deg 136.22deg,
        #1f2937 136.22deg 145.95deg,
        #dc2626 145.95deg 155.68deg,
        #1f2937 155.68deg 165.41deg,
        #dc2626 165.41deg 175.14deg,
        #1f2937 175.14deg 184.87deg,
        #dc2626 184.87deg 194.6deg,
        #1f2937 194.6deg 204.33deg,
        #dc2626 204.33deg 214.06deg,
        #1f2937 214.06deg 223.79deg,
        #dc2626 223.79deg 233.52deg,
        #1f2937 233.52deg 243.25deg,
        #dc2626 243.25deg 252.98deg,
        #1f2937 252.98deg 262.71deg,
        #dc2626 262.71deg 272.44deg,
        #1f2937 272.44deg 282.17deg,
        #dc2626 282.17deg 291.9deg,
        #1f2937 291.9deg 301.63deg,
        #dc2626 301.63deg 311.36deg,
        #1f2937 311.36deg 321.09deg,
        #dc2626 321.09deg 330.82deg,
        #1f2937 330.82deg 340.55deg,
        #dc2626 340.55deg 350.28deg,
        #1f2937 350.28deg 360deg
    );
    box-shadow: 
        0 0 0 12px rgba(255,215,0,0.3),
        0 0 0 14px rgba(255,255,255,0.1),
        0 0 60px rgba(220,38,38,0.3),
        inset 0 0 40px rgba(0,0,0,0.4);
    transform-origin: center center;
}

.roulette-wheel-v2::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.2);
}

.wheel-center {
    position: absolute;
    inset: 25%;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.6),
        0 0 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.wheel-result-number {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 0 0 20px currentColor;
}

.wheel-pointer-v2 {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    transform-origin: top center;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.wheel-pointer-v2::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 36px solid #fbbf24;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wheel-pointer-v2::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #d97706;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tick-anim {
    animation: pointerTick 0.15s ease-out;
}

@keyframes pointerTick {
    0% { transform: translateX(-50%) rotate(0deg); }
    40% { transform: translateX(-50%) rotate(-25deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* Remove CSS spin animation classes since we use JS now, but keep transform property */
.roulette-wheel-v2, .wheel-wheel {
    will-change: transform;
    transition: transform 0s; /* Handled by JS */
}

/* Add a nice gloss overlay to the wheels */
.roulette-wheel-v2::after, .wheel-wheel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 40%);
    pointer-events: none;
    z-index: 15;
}

/* Case Carousel Animation */
.case-carousel {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(0,0,0,0.3), transparent, rgba(0,0,0,0.3));
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.case-carousel::before,
.case-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 10;
    pointer-events: none;
}

.case-carousel::before {
    left: 0;
    background: linear-gradient(to right, rgba(15,23,42,1), transparent);
}

.case-carousel::after {
    right: 0;
    background: linear-gradient(to left, rgba(15,23,42,1), transparent);
}

.carousel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    z-index: 20;
    box-shadow: 0 0 20px rgba(251,191,36,0.5);
}

.carousel-pointer::before,
.carousel-pointer::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.carousel-pointer::before {
    top: 0;
    border-top: 12px solid #fbbf24;
}

.carousel-pointer::after {
    bottom: 0;
    border-bottom: 12px solid #fbbf24;
}

.carousel-track {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    will-change: transform;
}

.carousel-track.spinning {
    animation: carouselSpin var(--spin-duration, 5s) cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes carouselSpin {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--spin-distance, -3000px)); }
}

.carousel-item {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.carousel-item.rarity-common { border-color: rgba(156,163,175,0.3); background: rgba(156,163,175,0.1); }
.carousel-item.rarity-uncommon { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.1); }
.carousel-item.rarity-rare { border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.1); }
.carousel-item.rarity-epic { border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.1); }
.carousel-item.rarity-legendary { 
    border-color: rgba(251,191,36,0.5); 
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.1));
    box-shadow: 0 0 20px rgba(251,191,36,0.2);
}

.carousel-item.winner {
    transform: scale(1.1);
    box-shadow: 0 0 30px currentColor;
    animation: winnerPulse 0.5s ease-in-out 3;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
}

/* Case Box 3D Effect */
.case-box-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.case-lid {
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.case-box-3d.opening .case-lid {
    transform: rotateX(-120deg);
}

/* Currency Selector */
.currency-selector {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.currency-pill {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: none;
}

.currency-pill:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
}

.currency-pill.active {
    background: rgba(255,255,255,0.1);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.currency-pill img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}


.toast {
    pointer-events: auto;
    max-width: 520px;
    width: min(520px, calc(100vw - 32px));
    background: rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

 .toast__icon {
     width: 26px;
     height: 26px;
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: rgba(255, 255, 255, 0.06);
     border: 1px solid rgba(255, 255, 255, 0.10);
     flex: none;
 }

 .toast__message {
     flex: 1;
     min-width: 0;
     overflow: hidden;
     text-overflow: ellipsis;
 }

 .toast__close {
     flex: none;
     width: 28px;
     height: 28px;
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     color: rgba(255, 255, 255, 0.55);
     background: transparent;
     border: 1px solid rgba(255, 255, 255, 0.06);
     transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
 }

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

 .toast__close:hover {
     color: rgba(255, 255, 255, 0.85);
     background: rgba(255, 255, 255, 0.06);
 }

.toast--show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

 .toast--success { border-color: rgba(34, 197, 94, 0.35); }
 .toast--success .toast__icon { color: rgba(34, 197, 94, 0.95); border-color: rgba(34, 197, 94, 0.22); background: rgba(34, 197, 94, 0.10); }

 .toast--error { border-color: rgba(239, 68, 68, 0.35); }
 .toast--error .toast__icon { color: rgba(239, 68, 68, 0.95); border-color: rgba(239, 68, 68, 0.22); background: rgba(239, 68, 68, 0.10); }

 .toast--warning { border-color: rgba(245, 158, 11, 0.35); }
 .toast--warning .toast__icon { color: rgba(245, 158, 11, 0.95); border-color: rgba(245, 158, 11, 0.22); background: rgba(245, 158, 11, 0.10); }

 .toast--info { border-color: rgba(59, 130, 246, 0.35); }
 .toast--info .toast__icon { color: rgba(59, 130, 246, 0.95); border-color: rgba(59, 130, 246, 0.22); background: rgba(59, 130, 246, 0.10); }

/* ==================================================================
   POLISH 2026-10: переходы, поверхности, скелетоны, понятность
   ================================================================== */

/* --- Переходы между экранами: мягче и "дороже" --- */
@keyframes slideLeftEnter {
    from { transform: translateX(100%); opacity: 0.6; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideLeftExit {
    from { transform: translateX(0) scale(1);    opacity: 1; }
    to   { transform: translateX(-28%) scale(0.96); opacity: 0; }
}
@keyframes slideRightEnter {
    from { transform: translateX(-28%) scale(0.96); opacity: 0.6; }
    to   { transform: translateX(0) scale(1);    opacity: 1; }
}
@keyframes slideRightExit {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to   { transform: translateX(100%) scale(0.96); opacity: 0.6; }
}

.slide-left-enter,
.slide-right-enter,
.slide-left-exit,
.slide-right-exit,
.view-enter {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.slide-left-enter { animation: slideLeftEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.slide-left-exit  { animation: slideLeftExit  0.32s cubic-bezier(0.4, 0, 1, 1) forwards; }
.slide-right-enter { animation: slideRightEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.slide-right-exit  { animation: slideRightExit  0.32s cubic-bezier(0.4, 0, 1, 1) forwards; }
.view-enter { animation: viewSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* --- Stagger-появление списков (каскад карточек) --- */
@keyframes staggerIn {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.stagger > * {
    animation: staggerIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--stagger-i, 0) * 50ms);
}
.stagger > *:nth-child(1)  { --stagger-i: 0; }
.stagger > *:nth-child(2)  { --stagger-i: 1; }
.stagger > *:nth-child(3)  { --stagger-i: 2; }
.stagger > *:nth-child(4)  { --stagger-i: 3; }
.stagger > *:nth-child(5)  { --stagger-i: 4; }
.stagger > *:nth-child(6)  { --stagger-i: 5; }
.stagger > *:nth-child(7)  { --stagger-i: 6; }
.stagger > *:nth-child(8)  { --stagger-i: 7; }
.stagger > *:nth-child(9)  { --stagger-i: 8; }
.stagger > *:nth-child(n+10) { --stagger-i: 9; }

/* --- Плотная поверхность для строк списков (без дорогого blur) --- */
.surface-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.surface-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.09);
}
.surface-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* --- Скелетоны (загрузка без прыжков макета) --- */
@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    border-radius: 12px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.11) 50%,
        rgba(255, 255, 255, 0.05) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.skeleton-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: none;
}
.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.skeleton-line { height: 11px; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }

/* Плавная замена скелетона на контент */
@keyframes contentIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.content-enter { animation: contentIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* --- Баланс: табличные цифры, чтобы не дёргались при обновлении --- */
.balance-value,
.font-tabular {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Нижняя навигация: подписи на активном пункте --- */
.floating-nav {
    padding: 5px 7px;
    gap: 4px;
    border-radius: 22px;
    background: rgba(16, 24, 34, 0.92);
}

.nav-item {
    width: auto;
    min-width: 42px;
    height: 40px;
    padding: 0 11px;
    border-radius: 15px;
    gap: 7px;
}

.nav-item span {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transform: translateY(0.5px);
    transition: max-width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.22s ease 0.05s;
}

.nav-item.active span {
    max-width: 92px;
    opacity: 1;
}

.nav-item i { font-size: 15px; }

/* --- Баннер офлайн-режима --- */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, #b45309, #dc2626);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
#offline-banner.show {
    transform: translateY(0);
}

/* --- Кнопка "Повторить" --- */
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 20px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: transform 0.15s ease, background 0.15s ease;
}
.btn-retry:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.16);
}

/* --- Чипы-фильтры (История) --- */
.chip {
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.chip:active { transform: scale(0.94); }
.chip:hover { color: rgba(255, 255, 255, 0.8); }
.chip.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.theme-forest .chip.active { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.35); color: #a7f3d0; }
.theme-ocean  .chip.active { background: rgba(6, 182, 212, 0.18); border-color: rgba(6, 182, 212, 0.35); color: #a5f3fc; }
.theme-canyon .chip.active { background: rgba(249, 115, 22, 0.18); border-color: rgba(249, 115, 22, 0.35); color: #fed7aa; }
.theme-aurora .chip.active { background: rgba(217, 70, 239, 0.18); border-color: rgba(217, 70, 239, 0.35); color: #f5d0fe; }

/* --- Пустое состояние --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}
.empty-state i {
    font-size: 30px;
    opacity: 0.35;
    margin-bottom: 4px;
}
.empty-state__hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

/* --- Заголовок секции --- */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    opacity: 0.92;
}
.section-title i { font-size: 12px; opacity: 0.65; }

/* --- Карточка общего баланса --- */
.balance-hero {
    border-radius: 26px;
}
.balance-hero__glow {
    position: absolute;
    inset: -40% -20% auto auto;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.10), transparent 65%);
    pointer-events: none;
}

/* --- Уважение к reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .stagger > *,
    .content-enter {
        animation: none !important;
    }
    .skeleton {
        animation: none !important;
        background: rgba(255, 255, 255, 0.07);
    }
    .nav-item span {
        transition: none !important;
    }
    #offline-banner {
        transition: none !important;
    }
}

