/* =========================================================
   NELUDODROP — CS2 PIXEL & GLITCH SERVICE ENGINE
   Pure Pixel Aesthetic ('Press Start 2P') + CRT & RGB Glitch
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --cs-gold: #d4a373;
    --cs-gold-bright: #e9c46a;
    --cs-gold-dark: #a8794c;
    --cs-orange: #e76f51;
    --cs-blue: #4b69ff;
    --cs-red: #eb4b4b;
    --cs-green: #2ecc71;
    
    --cs-bg-main: #0a0b0e;
    --cs-bg-card: #12141a;
    --cs-bg-elevated: #181b22;
    --cs-bg-input: #0b0c10;
    
    --cs-border: #292d38;
    --cs-border-glow: rgba(212, 163, 115, 0.4);
    
    --text-pure: #ffffff;
    --text-primary: #e6e8ee;
    --text-secondary: #8f95a5;
    --text-muted: #585d6e;
    
    /* CS2 Item Rarities */
    --rarity-consumer: #b0c3d9;
    --rarity-industrial: #5e98d9;
    --rarity-milspec: #4b69ff;
    --rarity-restricted: #8847ff;
    --rarity-classified: #d32ce6;
    --rarity-covert: #eb4b4b;
    
    /* Pixel Typography */
    --font-pixel: 'Press Start 2P', monospace;
    --font-sub: 'VT323', monospace;
    
    --radius-sm: 2px;
    --radius-md: 4px;
}

body.light-theme {
    --cs-bg-main: #dfdacd;
    --cs-bg-card: #ede8dc;
    --cs-bg-elevated: #d6cfbf;
    --cs-bg-input: #e2ddd0;
    --cs-border: #b8b09d;
    
    --cs-gold: #96673a;
    --cs-gold-bright: #ad7743;
    --cs-gold-dark: #6e4620;
    
    --text-pure: #0f1013;
    --text-primary: #1c1e24;
    --text-secondary: #525666;
    --text-muted: #797e8f;
}

/* --- RESET & GLOBAL --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-pixel);
    image-rendering: pixelated;
}

body {
    background-color: var(--cs-bg-main);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

/* =========================================================
   CRT SCANLINES & VIGNETTE (NON-BLOCKING)
   ========================================================= */
.crt-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 6px 100%;
    pointer-events: none !important;
    z-index: 9990;
    opacity: 0.85;
}

/* =========================================================
   APP LAYOUT & PIXEL CS2 HEADER
   ========================================================= */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: env(safe-area-inset-top);
    position: relative;
    z-index: 1;
}

.cs2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(14, 16, 21, 0.95);
    border-bottom: 2px solid var(--cs-border);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    cursor: default;
    position: relative;
}

.brand-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-pure);
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8), -1px -1px 0 var(--cs-gold);
}

/* Glitch effect on title */
.brand-title::before, .brand-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip: rect(0, 0, 0, 0);
}

.brand-title:hover::before {
    left: -2px;
    text-shadow: 2px 0 var(--cs-red);
    animation: glitch-anim-1 0.4s infinite linear alternate-reverse;
}

.brand-title:hover::after {
    left: 2px;
    text-shadow: -2px 0 var(--cs-blue);
    animation: glitch-anim-2 0.4s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(2px, 9999px, 8px, 0); }
    50% { clip: rect(10px, 9999px, 14px, 0); }
    100% { clip: rect(4px, 9999px, 12px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(6px, 9999px, 12px, 0); }
    50% { clip: rect(1px, 9999px, 6px, 0); }
    100% { clip: rect(8px, 9999px, 15px, 0); }
}

.header-balance-box {
    display: flex;
    align-items: center;
}

.balance-card {
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    border-left: 3px solid var(--cs-gold);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    text-align: right;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.6);
}

.balance-tag {
    font-size: 7px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.balance-amount-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
}

.balance-val {
    font-size: 11px;
    color: var(--cs-gold-bright);
    text-shadow: 1px 1px 0px rgba(0,0,0,0.8);
}

.balance-curr {
    font-size: 8px;
    color: var(--cs-gold);
}

/* =========================================================
   CONTENT VIEWPORT & TABS (GLITCH TRANSITIONS)
   ========================================================= */
.content-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    padding-bottom: 90px;
    position: relative;
    z-index: 5;
    -webkit-overflow-scrolling: touch;
}

.tab-wrapper {
    min-height: 100%;
}

.tab-content {
    display: none;
}

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

/* Authentic CRT / RGB Glitch on Tab Switch */
@keyframes glitch-tab-switch {
    0% {
        opacity: 0.7;
        transform: translate(0) scale(1);
        filter: drop-shadow(-3px 0 var(--cs-red)) drop-shadow(3px 0 var(--cs-blue));
    }
    25% {
        opacity: 0.9;
        transform: translate(-3px, 2px) skewX(-2deg);
        filter: drop-shadow(3px -1px var(--cs-red)) drop-shadow(-3px 1px var(--cs-blue));
    }
    50% {
        opacity: 0.85;
        transform: translate(3px, -1px) skewX(2deg);
        filter: drop-shadow(-2px 1px var(--cs-red)) drop-shadow(2px -1px var(--cs-blue));
    }
    75% {
        opacity: 0.95;
        transform: translate(-1px, 1px);
        filter: drop-shadow(1px 0 var(--cs-red));
    }
    100% {
        opacity: 1;
        transform: translate(0) scale(1) skewX(0);
        filter: none;
    }
}

.tab-content.glitching {
    animation: glitch-tab-switch 0.26s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--cs-border);
    padding-bottom: 8px;
}

.page-heading {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-pure);
}

/* =========================================================
   CASE ITEM CARD (PIXEL RETRO CRATE)
   ========================================================= */
.case-grid {
    display: flex;
    justify-content: center;
    padding: 6px 0;
}

.case-item-card {
    width: 100%;
    max-width: 320px;
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.15s ease;
    pointer-events: auto;
}

.case-item-card:hover {
    border-color: var(--cs-gold);
    box-shadow: 4px 4px 0px rgba(212, 163, 115, 0.4);
    transform: translateY(-2px);
}

.case-item-card:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.7);
}

.case-card-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--cs-bg-elevated);
    border-bottom: 2px solid var(--cs-border);
    font-size: 8px;
}

.case-type-badge {
    color: var(--cs-gold);
}

.case-odds-badge {
    color: var(--text-secondary);
}

.case-media-box {
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #1a1d26 0%, #0d0f14 85%);
    position: relative;
}

.case-crate-visual {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crate-graphic {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.8));
    animation: crateHover 3s ease-in-out infinite alternate;
}

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

.crate-ambient-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.case-card-footer {
    padding: 14px 12px;
    text-align: center;
    background: var(--cs-bg-card);
    border-top: 2px solid var(--cs-border);
}

.case-name {
    font-size: 10px;
    color: var(--text-pure);
    margin-bottom: 6px;
    line-height: 1.4;
}

.case-pricing {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.price-nd {
    font-size: 11px;
    color: var(--cs-gold-bright);
}

.btn-primary-action {
    width: 100%;
    padding: 12px 8px;
    background: var(--cs-gold);
    color: #0a0b0e;
    font-size: 9px;
    letter-spacing: 0.5px;
    border: 2px solid var(--cs-gold-bright);
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.8);
    cursor: pointer;
    transition: filter 0.1s ease, transform 0.1s ease;
    pointer-events: auto;
}

.btn-primary-action:hover {
    filter: brightness(1.15);
}

.btn-primary-action:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0px rgba(0,0,0,0.8);
}

/* =========================================================
   TASKS LIST
   ========================================================= */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--cs-bg-elevated);
    border-bottom: 2px solid var(--cs-border);
}

.task-category {
    font-size: 7px;
    color: var(--text-secondary);
}

.task-reward-pill {
    font-size: 8px;
    color: var(--cs-gold-bright);
}

.task-card-body {
    padding: 12px;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.task-icon-box {
    width: 36px;
    height: 36px;
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cs-gold);
    flex-shrink: 0;
}

.task-svg {
    width: 18px;
    height: 18px;
}

.task-text-group h3 {
    font-size: 8px;
    color: var(--text-pure);
    margin-bottom: 4px;
    line-height: 1.4;
}

.task-text-group p {
    font-size: 7px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn-task-action {
    width: 100%;
    padding: 10px;
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-sm);
    color: var(--cs-gold);
    font-size: 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
    pointer-events: auto;
}

.btn-task-action:hover {
    border-color: var(--cs-gold);
    background: rgba(212, 163, 115, 0.15);
}

.btn-task-action:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0px rgba(0,0,0,0.5);
}

/* =========================================================
   PROFILE & INVENTORY
   ========================================================= */
.profile-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-account-card {
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
}

.user-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 2px solid var(--cs-border);
}

.user-avatar-frame {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid var(--cs-gold);
    background: var(--cs-bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

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

.default-avatar-icon {
    font-size: 10px;
    color: var(--cs-gold);
}

.user-info-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-display-name {
    font-size: 10px;
    color: var(--text-pure);
}

.user-handle {
    font-size: 8px;
    color: var(--text-secondary);
}

.user-stats-strip {
    display: flex;
    background: var(--cs-bg-elevated);
}

.stat-cell {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-lbl {
    font-size: 7px;
    color: var(--text-muted);
}

.stat-val {
    font-size: 10px;
    color: var(--cs-gold-bright);
}

/* Inventory */
.inventory-block {
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--cs-border);
    padding-bottom: 6px;
}

.block-title {
    font-size: 9px;
    color: var(--text-pure);
}

.inventory-count-tag {
    font-size: 7px;
    color: var(--cs-gold);
}

.inventory-grid {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 4px 2px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--cs-gold) transparent;
}

.inv-card {
    flex: 0 0 135px;
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    border-bottom: 4px solid var(--card-rarity, var(--rarity-consumer));
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.6);
    transition: transform 0.1s ease;
    pointer-events: auto;
}

.inv-card:hover {
    transform: translateY(-2px);
}

.inv-card.rare {
    border-color: rgba(136, 71, 255, 0.6);
    box-shadow: 0 0 10px rgba(136, 71, 255, 0.3);
}

.inv-img-wrap {
    width: 90px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.inv-img-wrap img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.6));
}

.weapon-fallback-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    border: 1px dashed var(--card-rarity, var(--cs-gold));
    border-radius: 2px;
    padding: 2px;
}

.wf-icon {
    font-size: 10px;
    color: var(--card-rarity, var(--cs-gold));
    margin-bottom: 2px;
}

.wf-tag {
    font-size: 7px;
    color: #fff;
    text-align: center;
}

.inv-name-text {
    font-size: 7px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}

.inv-price-tag {
    font-size: 8px;
    color: var(--cs-gold-bright);
    margin-bottom: 8px;
}

.inv-action-btn {
    width: 100%;
    padding: 6px 4px;
    font-size: 7px;
    background: transparent;
    border: 1px solid var(--cs-gold);
    color: var(--cs-gold);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 1px 1px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
    pointer-events: auto;
}

.inv-action-btn:hover {
    background: var(--cs-gold);
    color: #0a0b0e;
}

.inv-action-btn.withdraw {
    border-color: var(--rarity-covert);
    color: var(--rarity-covert);
}

.inv-action-btn.withdraw:hover {
    background: var(--rarity-covert);
    color: #fff;
}

.empty-inv-state {
    width: 100%;
    text-align: center;
    padding: 20px 8px;
    font-size: 8px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* =========================================================
   SETTINGS (LANGUAGE & HAPTICS TOGGLES)
   ========================================================= */
.settings-block {
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.setting-item.full-width {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-title {
    font-size: 8px;
    color: var(--text-pure);
    line-height: 1.3;
}

.setting-desc {
    font-size: 7px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Language Switcher (RU / UA) */
.lang-switch-container {
    width: 80px;
    height: 28px;
    background: var(--cs-bg-input);
    border: 2px solid var(--cs-border);
    border-radius: 2px;
    display: flex;
    position: relative;
    padding: 2px;
    cursor: pointer;
    pointer-events: auto;
}

.lang-switch-slider {
    position: absolute;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: var(--cs-gold);
    border-radius: 1px;
    top: 2px;
    left: 2px;
    transition: transform 0.15s ease;
    pointer-events: none;
}

.lang-switch-container.ua .lang-switch-slider {
    transform: translateX(100%);
}

.lang-opt {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 8px;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
    cursor: pointer;
    pointer-events: auto;
}

.lang-switch-container:not(.ua) .lang-opt[data-lang="ru"],
.lang-switch-container.ua .lang-opt[data-lang="ua"] {
    color: #0a0b0e;
}

/* Modern Haptics Toggle */
.modern-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
    pointer-events: auto;
}

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

.toggle-track {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--cs-bg-input);
    border: 2px solid var(--cs-border);
    border-radius: 2px;
    transition: background-color 0.15s ease;
}

.toggle-track::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    border-radius: 1px;
    transition: transform 0.15s ease;
}

.modern-toggle input:checked + .toggle-track {
    background-color: var(--cs-gold);
    border-color: var(--cs-gold);
}

.modern-toggle input:checked + .toggle-track::before {
    transform: translateX(18px);
    background-color: #0a0b0e;
}

/* Modern Input */
.modern-input {
    width: 100%;
    background: var(--cs-bg-input);
    color: var(--text-primary);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 7px;
    outline: none;
    pointer-events: auto;
}

.modern-input:focus {
    border-color: var(--cs-gold);
}

.btn-save-settings {
    width: 100%;
    padding: 10px;
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    color: var(--cs-gold);
    font-size: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
    pointer-events: auto;
}

.btn-save-settings:hover {
    background: var(--cs-gold);
    color: #0a0b0e;
}

/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(14, 16, 21, 0.98);
    border-top: 2px solid var(--cs-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 33.3%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.1s ease;
    pointer-events: auto;
}

.nav-btn.active {
    color: var(--cs-gold);
    text-shadow: 0 0 8px rgba(212, 163, 115, 0.4);
}

.nav-icon-wrap {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.nav-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nav-label {
    font-size: 7px;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* =========================================================
   MODAL DIALOGS & CS2 ROULETTE
   ========================================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 14px;
    backdrop-filter: blur(6px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box-cs2 {
    width: 100%;
    max-width: 380px;
    background: var(--cs-bg-card);
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.9), 0 0 16px rgba(212, 163, 115, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
}

.modal-close-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--cs-bg-elevated);
    border: 2px solid var(--cs-border);
    color: var(--text-secondary);
    font-size: 8px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    pointer-events: auto;
}

.modal-close-btn:hover {
    color: #fff;
    border-color: var(--cs-gold);
}

.modal-header-strip {
    text-align: center;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 11px;
    color: var(--text-pure);
    margin-bottom: 4px;
}

.modal-price-tag {
    font-size: 8px;
    color: var(--cs-gold);
}

/* Roulette Viewport */
.roulette-viewport {
    width: 100%;
    height: 115px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    background: #08090c;
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-sm);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.roulette-center-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--cs-gold-bright);
    z-index: 10;
    box-shadow: 0 0 8px var(--cs-gold-bright), 0 0 14px var(--cs-orange);
    pointer-events: none;
}

.roulette-strip {
    display: flex;
    position: absolute;
    left: 0; top: 0; height: 100%;
}

.roulette-slot {
    width: 110px;
    height: 100%;
    flex-shrink: 0;
    border-right: 2px solid #161922;
    border-bottom: 3px solid var(--slot-rarity, var(--rarity-consumer));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #0f1218;
    position: relative;
}

.roulette-slot.rare {
    background: radial-gradient(circle at 50% 50%, rgba(136, 71, 255, 0.22) 0%, #0f1218 80%);
}

.roulette-slot.winner {
    background: radial-gradient(circle at 50% 50%, rgba(233, 196, 106, 0.3) 0%, #0f1218 80%);
    border-color: var(--cs-gold-bright);
}

.slot-img-box {
    width: 75px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.slot-img-box img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.slot-name-txt {
    font-size: 7px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

/* Loot terminal drop list */
.loot-terminal {
    margin: 12px 0;
    border: 2px solid var(--cs-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.loot-header {
    padding: 6px 10px;
    background: var(--cs-bg-elevated);
    border-bottom: 2px solid var(--cs-border);
    font-size: 7px;
    color: var(--cs-gold);
    text-align: center;
}

.case-contents-scroll {
    max-height: 150px;
    overflow-y: auto;
    background: var(--cs-bg-input);
    padding: 4px;
}

.content-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--cs-border);
}

.content-row.rare {
    background: rgba(136, 71, 255, 0.1);
    border-left: 2px solid var(--rarity-restricted);
}

.content-thumb {
    width: 38px;
    height: 28px;
    background: var(--cs-bg-elevated);
    border: 1px solid var(--cs-border);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.content-thumb img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.content-meta {
    flex: 1;
    min-width: 0;
}

.content-skin-name {
    font-size: 7px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.content-skin-price {
    font-size: 7px;
    color: var(--cs-gold);
    margin-top: 2px;
}

.btn-spin-action {
    width: 100%;
    padding: 12px 8px;
    background: var(--cs-gold);
    color: #0a0b0e;
    font-size: 9px;
    border: 2px solid var(--cs-gold-bright);
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.8);
    transition: filter 0.1s ease;
    pointer-events: auto;
}

.btn-spin-action:hover {
    filter: brightness(1.15);
}

.btn-spin-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#case-modal .case-opening-modal {
    max-width: 420px;
    padding: 14px;
    background:
        radial-gradient(circle at top, rgba(243, 156, 18, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(26, 30, 38, 0.98) 0%, rgba(10, 12, 16, 0.98) 100%);
    border-color: rgba(212, 163, 115, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 214, 102, 0.08) inset,
        0 22px 50px rgba(0, 0, 0, 0.68),
        0 0 24px rgba(243, 156, 18, 0.14);
    overflow: hidden;
}

#case-modal .modal-close-btn {
    top: 12px;
    right: 12px;
    z-index: 5;
}

#case-modal .case-opening-shell {
    position: relative;
    border: 1px solid rgba(212, 163, 115, 0.18);
    border-radius: 12px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(17, 20, 28, 0.95) 0%, rgba(8, 9, 12, 0.96) 100%);
    overflow: hidden;
}

#case-modal .case-opening-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.025) 0,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px,
            transparent 4px
        );
    opacity: 0.42;
    mix-blend-mode: screen;
    pointer-events: none;
}

#case-modal .case-opening-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.38) 100%);
    pointer-events: none;
}

#case-modal .case-opening-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

#case-modal .case-title-stack,
#case-modal .case-header-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#case-modal .case-header-meta {
    align-items: flex-end;
}

#case-modal .case-kicker,
#case-modal .roulette-stage-label,
#case-modal .case-result-header {
    font-size: 7px;
    letter-spacing: 0.14em;
    color: rgba(255, 214, 102, 0.82);
}

#case-modal .modal-title {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.08em;
}

#case-modal .modal-price-tag {
    font-size: 9px;
    padding: 4px 8px;
    border: 1px solid rgba(243, 156, 18, 0.28);
    border-radius: 999px;
    background: rgba(243, 156, 18, 0.08);
}

#case-modal .case-status-text {
    font-size: 7px;
    color: rgba(208, 216, 230, 0.74);
    text-align: right;
}

#case-modal .roulette-stage {
    position: relative;
    z-index: 1;
}

#case-modal .roulette-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

#case-modal .roulette-stage-live {
    font-size: 7px;
    color: #e7ebf3;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.06);
}

#case-modal .roulette-viewport {
    height: 154px;
    margin: 0;
    border: 1px solid rgba(212, 163, 115, 0.3);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(12, 14, 19, 0.98) 0%, rgba(5, 6, 10, 0.98) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 214, 102, 0.06),
        inset 0 18px 30px rgba(255, 255, 255, 0.02),
        0 12px 28px rgba(0, 0, 0, 0.45);
    -webkit-mask-image: none;
    mask-image: none;
}

#case-modal .roulette-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 6, 10, 0.95) 0%, transparent 12%, transparent 88%, rgba(5, 6, 10, 0.95) 100%);
    z-index: 2;
    pointer-events: none;
}

#case-modal .roulette-scanlines {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 5px
        );
    opacity: 0.28;
    z-index: 4;
    pointer-events: none;
}

#case-modal .case-glitch-flash {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 18%, rgba(255, 214, 102, 0.32) 50%, transparent 82%);
    opacity: 0;
    transform: translateX(-120%);
    z-index: 5;
    pointer-events: none;
}

#case-modal.flash-win .case-glitch-flash {
    animation: case-glitch-flash 520ms ease-out forwards;
}

#case-modal .roulette-center-line {
    width: 3px;
    background: linear-gradient(180deg, rgba(255, 214, 102, 0.35) 0%, rgba(255, 214, 102, 1) 50%, rgba(255, 214, 102, 0.35) 100%);
    box-shadow:
        0 0 10px rgba(255, 214, 102, 0.9),
        0 0 24px rgba(243, 156, 18, 0.55);
    z-index: 6;
}

#case-modal .roulette-strip {
    top: 12px;
    bottom: 12px;
    height: auto;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 0 14px;
    will-change: transform;
}

#case-modal .roulette-slot {
    width: 132px;
    height: 130px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 3px solid var(--slot-rarity, var(--rarity-consumer));
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    justify-content: space-between;
    align-items: stretch;
    padding: 10px 10px 12px;
    background:
        linear-gradient(180deg, rgba(24, 28, 36, 0.98) 0%, rgba(11, 13, 18, 0.98) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.025),
        0 6px 18px rgba(0, 0, 0, 0.28);
}

#case-modal .roulette-slot.rare {
    background:
        radial-gradient(circle at top, rgba(136, 71, 255, 0.24) 0%, transparent 48%),
        linear-gradient(180deg, rgba(27, 24, 41, 0.98) 0%, rgba(12, 13, 19, 0.98) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 18px rgba(136, 71, 255, 0.18);
}

#case-modal .roulette-slot.winner {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 214, 102, 0.48);
    background:
        radial-gradient(circle at center, rgba(255, 214, 102, 0.22) 0%, transparent 46%),
        linear-gradient(180deg, rgba(26, 28, 34, 0.98) 0%, rgba(11, 13, 18, 0.98) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 214, 102, 0.12),
        0 0 22px rgba(255, 214, 102, 0.22),
        0 10px 24px rgba(0, 0, 0, 0.32);
}

#case-modal .slot-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 7px;
    color: rgba(208, 216, 230, 0.7);
    text-transform: uppercase;
}

#case-modal .slot-tag {
    color: rgba(255, 214, 102, 0.84);
}

#case-modal .slot-rarity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--slot-rarity, var(--rarity-consumer));
    box-shadow: 0 0 10px var(--slot-rarity, var(--rarity-consumer));
}

#case-modal .slot-img-box {
    width: 100%;
    height: 62px;
    margin: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%);
}

#case-modal .slot-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.35));
}

#case-modal .slot-bottomline {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#case-modal .slot-name-txt {
    width: 100%;
    text-align: left;
    font-size: 7px;
    line-height: 1.35;
    color: var(--text-pure);
}

#case-modal .slot-price-txt {
    font-size: 7px;
    color: rgba(255, 214, 102, 0.84);
}

#case-modal .case-result-panel {
    position: relative;
    z-index: 1;
    margin: 12px 0;
    padding: 10px;
    border: 1px solid rgba(212, 163, 115, 0.22);
    border-radius: 12px;
    background: rgba(10, 12, 16, 0.88);
    opacity: 0.62;
    transform: translateY(6px);
    transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

#case-modal .case-result-panel.active {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(255, 214, 102, 0.3);
    box-shadow: 0 0 18px rgba(255, 214, 102, 0.1);
}

#case-modal .case-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    min-height: 82px;
    border-radius: 12px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(21, 24, 32, 0.96) 0%, rgba(11, 13, 18, 0.96) 100%);
}

#case-modal .case-result-card.is-empty {
    opacity: 0.68;
}

#case-modal .case-result-card.is-win {
    box-shadow:
        inset 0 0 0 1px rgba(255, 214, 102, 0.12),
        0 0 20px rgba(255, 214, 102, 0.12);
}

#case-modal .case-result-image {
    width: 88px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
}

#case-modal .case-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.42));
}

#case-modal .case-result-meta {
    min-width: 0;
    flex: 1;
}

#case-modal .case-result-name {
    font-size: 9px;
    color: var(--text-pure);
    line-height: 1.35;
}

#case-modal .case-result-subline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

#case-modal .case-result-rarity,
#case-modal .case-result-price {
    font-size: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
}

#case-modal .case-result-rarity {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#case-modal .case-result-price {
    color: rgba(255, 214, 102, 0.88);
}

#case-modal .loot-terminal {
    position: relative;
    z-index: 1;
    margin: 12px 0 14px;
    border-color: rgba(212, 163, 115, 0.22);
    border-radius: 12px;
    background: rgba(8, 10, 14, 0.84);
}

#case-modal .loot-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: rgba(212, 163, 115, 0.18);
}

#case-modal .case-contents-scroll {
    background: rgba(9, 10, 14, 0.92);
}

#case-modal .content-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

#case-modal .btn-spin-action {
    position: relative;
    z-index: 1;
    padding: 13px 10px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 214, 102, 0.98) 0%, rgba(243, 156, 18, 0.96) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 10px 18px rgba(243, 156, 18, 0.18),
        3px 3px 0 rgba(0, 0, 0, 0.68);
}

#case-modal .btn-spin-action:disabled {
    opacity: 0.6;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

#case-modal.spinning .roulette-stage-live {
    color: #111318;
    background: rgba(255, 214, 102, 0.95);
    border-color: rgba(255, 214, 102, 0.95);
    box-shadow: 0 0 18px rgba(255, 214, 102, 0.28);
}

#case-modal.spinning .case-status-text {
    color: rgba(255, 214, 102, 0.9);
}

@keyframes case-glitch-flash {
    0% {
        opacity: 0;
        transform: translateX(-120%) skewX(-16deg);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(120%) skewX(-16deg);
    }
}

/* Withdraw Modal */
.withdraw-body {
    margin: 14px 0;
}

.withdraw-desc {
    font-size: 8px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.trade-preview-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-label {
    font-size: 7px;
    color: var(--cs-gold);
}

.trade-input-readonly {
    width: 100%;
    background: var(--cs-bg-input);
    border: 2px solid var(--cs-border);
    color: var(--text-secondary);
    padding: 6px 8px;
    font-size: 7px;
    border-radius: var(--radius-sm);
}

/* =========================================================
   NOTIFICATION TOASTS (PIXEL & GLITCH)
   ========================================================= */
#notification-container {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: 90%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.tactical-toast {
    background: #141720;
    border: 2px solid var(--cs-gold);
    padding: 8px 12px;
    color: var(--cs-gold-bright);
    font-size: 8px;
    text-align: center;
    border-radius: var(--radius-sm);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.9);
    animation: toastIn 0.2s ease;
    line-height: 1.3;
    pointer-events: auto;
}

.tactical-toast.hide {
    animation: toastOut 0.2s ease forwards;
}

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

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