:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --accent: #ec4899;
    --dark-bg: #020617;
    --dark-card: #0f172a;
    --dark-overlay: rgba(15, 23, 42, 0.85);
    --border-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --radius-main: 1.5rem;
    --radius-button: 1rem;
    --glass-border: rgba(255, 255, 255, 0.08);
}

html, body, #app {
    height: 100%;
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%), 
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 25%);
    color: var(--text-primary);
    overflow: hidden;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#screen-container {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
    padding-bottom: 0;
}

.screen-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    background-color: transparent;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3.5rem;
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.screen-enter-start {
    transform: translateX(100%);
}
.screen-enter-end {
    transform: translateX(0);
}
.screen-leave-end {
    transform: translateX(-100%);
}

.primary-button {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 14px !important;
    padding: 10px 20px !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    background-image: none !important;
}

.primary-button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.primary-button:active {
    transform: scale(0.97) !important;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 8px 16px;
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(129, 140, 248, 0.3);
}

.secondary-button {
    background-color: var(--dark-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-button);
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.secondary-button:hover {
    background-color: var(--border-color);
}
.secondary-button:active {
    transform: scale(0.98);
}

.active-tab {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-button);
}

.loading-circle {
    display: inline-block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 2px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: spin 1.2s linear infinite;
}

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

.messages-container {
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px !important;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

#chats_list_view, 
#profile_view, 
#shop_view, 
#notifications_view, 
#channels_groups_view, 
#search_users_view, 
#add_chat_view,
#edit_profile_view,
.messages-container {
    padding-bottom: 3.5rem !important;
}

#chats-list-container {
    padding-bottom: 2rem;
}

.message-bubble {
    max-width: 85%;
    padding: 0.15rem 0.5rem !important;
    border-radius: var(--radius-main);
    margin-bottom: 0.1rem;
    line-height: 1.15 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: inline-block;
    width: fit-content;
    height: auto !important;
    min-height: 0 !important;
}

.message-bubble.media-content {
    padding: 0.25rem !important;
    line-height: 0 !important;
    overflow: hidden;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
}

.message-bubble.media-content video,
.message-bubble.media-content img {
    display: block;
    margin: 0;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: calc(var(--radius-main) - 0.25rem);
}

.message-bubble:not(.no-reply) {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}

.message-bubble p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.15 !important;
}

.message-incoming {
    background-color: var(--dark-card);
    align-self: flex-start;
    border-bottom-left-radius: 0.4rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--text-primary);
}

.message-outgoing {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.4rem;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.message-system {
    background-color: var(--dark-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: var(--radius-button);
    padding: 0.5rem 1rem;
    max-width: 100%;
    margin: 0.5rem auto;
    text-align: center;
}

.date-separator {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.date-separator-line {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 1rem;
    box-sizing: border-box;
}

#custom-modal {
    z-index: 2100 !important;
}

.modal-content {
    background-color: var(--dark-card);
    padding: 1.5rem;
    border-radius: var(--radius-main);
    width: 100%;
    max-width: 350px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.message-with-avatar {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}
.message-with-avatar .avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid var(--dark-card);
}
.message-with-avatar .bubble {
    max-width: calc(85% - 3.25rem);
}

.input-field {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-button);
    width: 100%;
    transition: all 0.3s ease;
    font-size: 16px;
    min-height: 44px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}
.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 15px rgba(99, 102, 241, 0.1);
    background-color: rgba(15, 23, 42, 0.8);
}
.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.card {
    background-color: var(--dark-card);
    background-image: linear-gradient(to bottom right, rgba(255,255,255,0.03), rgba(255,255,255,0));
    border-radius: var(--radius-main);
    padding: 1.25rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.avatar-preview {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--dark-card);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-bar {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) !important;
    width: 92%;
    max-width: 520px;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-radius: 2rem;
    overflow: hidden;
    margin: 0 auto;
    height: 68px;
    padding: 0 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 0 0 1px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.tab-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        rgba(99, 102, 241, 0.3),
        rgba(255, 255, 255, 0.4), 
        transparent);
    z-index: 2;
}

.tab-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2rem;
    padding: 0.5px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
    z-index: 2;
}

.tab-bar.intro-animating {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.tab-bar.intro-expanded {
    width: 95%;
    opacity: 1;
    animation: tabBarGlow 0.8s ease-out;
}

@keyframes tabBarGlow {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.3);
        border-color: rgba(99, 102, 241, 0.3);
    }
}

#tab-intro-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 20;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.tab-bar-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s;
}

.tab-bar-content-visible {
    opacity: 1;
}

.tab-scroll-wrapper {
    flex: 1;
    overflow-x: auto;
    display: flex;
    align-items: center;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    height: 100%;
}

.tab-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-button {
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    min-width: 80px;
    padding: 0.5rem 0.25rem;
}

.tab-button span {
    font-size: 0.6rem;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

.tab-indicator {
    position: absolute;
    height: calc(100% - 0.75rem);
    top: 0.375rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 1.5rem;
    transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 1;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
}

.tab-nav-btn {
    background: rgba(14, 165, 233, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 2px;
    flex-shrink: 0;
    border: 1px solid rgba(14, 165, 233, 0.2);
    opacity: 1;
}

.tab-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.tab-nav-btn:hover {
    background: rgba(14, 165, 233, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.tab-nav-btn svg {
    width: 20px;
    height: 20px;
}

.active-tab {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.tab-button.active-tab .tab-icon {
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.6));
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.tab-button:not(.active-tab) {
    color: var(--text-secondary);
}

.tab-button:active {
    transform: scale(0.9);
}

.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--dark-card);
    border-radius: var(--radius-button);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 60px;
}
.chat-item:hover {
    background-color: var(--border-color);
    border-color: var(--primary);
    transform: translateY(-1px);
}

@keyframes highlight-flash {
    0% { background-color: rgba(14, 165, 233, 0.4); }
    100% { background-color: transparent; }
}
.highlight-message {
    animation: highlight-flash 2s ease-out;
}

.gift-item {
    background: linear-gradient(135deg, var(--dark-card), #1a2b4b);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.gift-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--dark-card);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
}

.stars-badge {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #EF4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}

.channel-item, .group-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--dark-card), #1a2b4b);
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.channel-item:hover, .group-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--dark-card);
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-badge {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #233554;
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .toggle-slider {
    background-color: var(--primary);
}

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

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--dark-card);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.security-message {
    background: linear-gradient(135deg, #1E40AF, #3730A3);
    border-left: 4px solid #EF4444;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--dark-card);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.current-session {
    border-left: 4px solid #10B981;
}

.device-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.message-context-menu {
    position: fixed;
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 150px;
    animation: fadeIn 0.2s ease-out;
}

.message-context-menu button {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.message-context-menu button:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.message-context-menu button.delete-btn {
    color: #ef4444;
}

.message-context-menu button.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

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

.edit-mode-active {
    border: 2px solid var(--primary);
    border-radius: 0.75rem;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: var(--primary); }
    50% { border-color: var(--primary-light); box-shadow: 0 0 10px rgba(99, 102, 241, 0.3); }
    100% { border-color: var(--primary); }
}

.reaction-picker {
    display: flex;
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.25rem;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.reaction-picker button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.reaction-picker button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(100, 116, 139, 0.2);
    color: var(--text-secondary);
    user-select: none;
}

.reaction-pill.user-reaction {
    background-color: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
    color: var(--primary-light);
}

.reaction-pill:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.2);
}

.reaction-count {
    margin-left: 0.3rem;
    font-weight: 600;
}

.flying-reaction {
    position: fixed;
    font-size: 2.5rem;
    pointer-events: none;
    z-index: 9999;
    animation: flyDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes flyDown {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, 60px) scale(0.8);
        opacity: 0;
    }
}

/* ===== НОВЫЕ СТИЛИ ДЛЯ ОКНА УВЕДОМЛЕНИЙ ===== */
#notifications-dropdown {
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease-out;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.1);
    border-radius: 1.5rem;
    overflow: hidden;
}

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

#notifications-dropdown-list {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--dark-card);
    padding: 0.5rem;
}

#notifications-dropdown-list::-webkit-scrollbar {
    width: 4px;
}

#notifications-dropdown-list::-webkit-scrollbar-track {
    background: var(--dark-card);
    border-radius: 10px;
}

#notifications-dropdown-list::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

.notification-item {
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    border-left-color: var(--primary);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.notification-title {
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.notification-time {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#clear-all-notifications {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

#clear-all-notifications:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ===== ПРОЧИЕ СТИЛИ ===== */
.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.better-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.ios-fixed-fix {
    transform: translateZ(0);
}

/* Эффекты подарков */
.casino-effect-bg {
    background: linear-gradient(135deg, #a3e635 0%, #4ade80 100%) !important; 
    box-shadow: 0 0 30px rgba(163, 230, 53, 0.6) !important;
    border: 2px solid #bef264 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.casino-effect-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.lolpol-effect-bg {
    background: linear-gradient(135deg, #EF4444, #F56565) !important;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.9), 0 0 20px rgba(239, 68, 68, 0.5) !important;
    border: 3px solid #FCA5A5 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.tulip-effect-bg {
    background: linear-gradient(135deg, #ec4899, #be185d) !important;
    box-shadow: 0 0 50px rgba(236, 72, 153, 0.9), 0 0 20px rgba(236, 72, 153, 0.5) !important;
    border: 3px solid #fbcfe8 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.snowflake-effect-bg {
    background: linear-gradient(135deg, #3b82f6, #93c5fd) !important;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.9), 0 0 20px rgba(147, 197, 253, 0.5) !important;
    border: 3px solid #bfdbfe !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.eggplant-effect-bg {
    background: linear-gradient(45deg, #4c1d95, #7c3aed, #d8b4fe) !important;
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.9), 0 0 20px rgba(124, 58, 237, 0.5) !important;
    border: 3px solid #ddd6fe !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.vanka-coin-effect-bg {
    background: linear-gradient(135deg, #000000, #1a1a1a, #333333) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(50, 50, 50, 0.5) !important;
    border: 3px solid #444444 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.shop-tabs {
    display: flex;
    background-color: #1a2b4b;
    border-radius: 0.75rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.shop-tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0.5rem;
    color: var(--text-secondary);
}

.shop-tab-button.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auction-button {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border-radius: 1rem;
    padding: 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #FCA5A5;
    transition: all 0.2s;
    cursor: pointer;
    width: 140px;
    height: auto;
    min-height: 170px;
    overflow: visible;
    margin: 1rem auto;
}

.auction-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.auction-item {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border-radius: 1rem;
    padding: 1rem 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #FCA5A5;
    width: 140px;
    height: auto;
    min-height: 170px;
    overflow: visible;
    margin: 0 auto;
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

.break-anywhere { 
    overflow-wrap: anywhere; 
    word-break: break-word; 
}

.discovery-section {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.discovery-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

html, body, #app {
    font-family: 'Manrope', sans-serif;
}

.tab-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.auth-step {
    animation: fadeIn 0.5s ease-out;
}

.lock-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: block;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.input-anim {
    transition: all 0.3s ease;
}
.input-anim:focus {
    transform: scale(1.02);
}

audio::-webkit-media-controls-panel {
    background-color: #f1f5f9;
}

/* Графические настройки */
html.gfx-medium .primary-button,
html.gfx-medium .tab-indicator,
html.gfx-medium .card { 
    box-shadow: none !important; 
}
html.gfx-medium .card { 
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important; 
}
html.gfx-medium .gradient-text, 
html.gfx-medium .active-tab { 
    text-shadow: none !important; 
}
html.gfx-medium * { 
    animation-duration: 0.4s !important; 
}

html.gfx-low .screen-content { 
    transition: none !important; 
}
html.gfx-low .primary-button,
html.gfx-low .tab-indicator,
html.gfx-low .card { 
    box-shadow: none !important; 
}
html.gfx-low .card { 
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important; 
}
html.gfx-low .gradient-text, 
html.gfx-low .active-tab { 
    text-shadow: none !important; 
}
html.gfx-low * { 
    animation: none !important; 
    transition: none !important; 
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
        margin-bottom: 0.75rem;
    }

    .tab-bar {
        padding: 0.25rem;
    }

    .tab-button {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        min-height: auto;
    }

    .chat-item {
        padding: 0.5rem;
        min-height: 50px;
    }

    .chat-item .w-12 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .message-bubble {
        max-width: 90%;
        padding: 0.4rem 0.6rem;
    }

    .message-with-avatar .bubble {
        max-width: calc(90% - 3.25rem);
    }

    .avatar-preview {
        width: 4rem;
        height: 4rem;
    }

    .gift-item {
        padding: 1rem;
    }

    #gift-shop-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .channel-item, .group-item {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .channel-item > div:last-child,
    .group-item > div:last-child {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .primary-button, .secondary-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 40px;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.25rem;
        max-width: none;
    }

    .input-field {
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }

    .card {
        padding: 1rem;
    }

    .member-item {
        padding: 0.5rem;
    }

    #message-form {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    #message-input {
        flex: 1;
        min-width: 0;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.125rem;
        padding: 0.5rem;
    }

    .tab-button {
        font-size: 0.65rem;
        padding: 0.375rem 0.125rem;
    }

    .chat-item {
        padding: 0.375rem;
    }

    .chat-item .w-12 {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .message-bubble {
        max-width: 95%;
        padding: 0.3rem 0.5rem;
        font-size: 0.875rem;
    }

    .primary-button, .secondary-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
        min-height: 36px;
    }

    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
    }

    .avatar-preview {
        width: 3rem;
        height: 3rem;
    }

    .truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .p-4 {
        padding: 0.75rem;
    }

    .p-6 {
        padding: 1rem;
    }

    .mb-4 {
        margin-bottom: 0.75rem;
    }

    .mb-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    .tab-button {
        font-size: 0.6rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .primary-button, .secondary-button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}
/* Поднимаем панель ввода в чате */
#chat_view .messages-container {
    padding-bottom: 110px !important;
}

#chat_view #message-form {
    margin-bottom: 25px !important;
    position: relative !important;
    bottom: 15px !important;
}
.message-bubble {
    white-space: pre-wrap !important;  /* Сохраняет пробелы и переносы */
    word-wrap: break-word !important;  /* Переносит длинные слова */
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.message-bubble p {
    margin: 0 0 8px 0 !important;
}

.message-bubble p:last-child {
    margin-bottom: 0 !important;
}

.message-bubble br {
    display: block !important;
    content: "" !important;
    margin: 4px 0 !important;
}
.premium-emoji-inline {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
}

#chats-list-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.screen-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
/* Исправление для чат-листа */
.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden !important;
}

.chat-item > div:first-child {
    flex-shrink: 0;
}

.chat-item .flex-grow,
.chat-item > div:nth-child(2) {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
}

.chat-item h3 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chat-item p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Контейнер чатов */
#chats-list-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Экранный контейнер */
.screen-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Основной контейнер приложения */
#screen-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Флекс контейнер внутри чат-элемента */
.chat-item .flex {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.chat-item .justify-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.chat-item .justify-between h3 {
    flex: 1;
    min-width: 0;
}

.chat-item .justify-between span:last-child {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Фикс для тела страницы */
body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

#app {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Фикс для мобильных устройств */
@media (max-width: 640px) {
    .chat-item {
        padding: 10px 8px !important;
    }
    
    .chat-item h3 {
        font-size: 0.9rem !important;
    }
    
    .chat-item p {
        font-size: 0.75rem !important;
    }
}
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --accent: #ec4899;
    --dark-bg: #020617;
    --dark-card: #0f172a;
    --dark-overlay: rgba(15, 23, 42, 0.85);
    --border-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --radius-main: 1.5rem;
    --radius-button: 1rem;
    --glass-border: rgba(255, 255, 255, 0.08);
}

html, body, #app {
    height: 100%;
    background-color: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%), 
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08) 0%, transparent 25%);
    color: var(--text-primary);
    overflow: hidden;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

#screen-container {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
    padding-bottom: 0;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.screen-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    background-color: transparent;
    overflow-y: auto;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3.5rem;
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
    max-width: 100vw !important;
}

/* ===== ИСПРАВЛЕНИЕ: КОНТЕЙНЕР ЧАТОВ — СТРОГО ВЕРТИКАЛЬНО ===== */
#chats-list-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: 2rem;
    gap: 8px !important;
}

/* ===== ИСПРАВЛЕНИЕ: ЭЛЕМЕНТ ЧАТА — НЕ РАСТЯГИВАЕТСЯ ПО ГОРИЗОНТАЛИ ===== */
.chat-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    padding: 12px !important;
    margin-bottom: 0 !important;
    background-color: var(--dark-card);
    border-radius: var(--radius-button);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
    box-sizing: border-box;
    overflow: hidden !important;
}

.chat-item:hover {
    background-color: var(--border-color);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Контент внутри чата */
.chat-item > div:first-child {
    flex-shrink: 0;
}

.chat-item .flex-grow,
.chat-item > div:nth-child(2) {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
}

.chat-item h3 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chat-item p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chat-item .justify-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.chat-item .justify-between h3 {
    flex: 1;
    min-width: 0;
}

.chat-item .justify-between span:last-child {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== ТАБ-БАР ===== */
.tab-bar {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) !important;
    width: 92%;
    max-width: 520px;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-radius: 2rem;
    overflow: hidden;
    margin: 0 auto;
    height: 68px;
    padding: 0 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s;
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 0 0 1px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.tab-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        rgba(99, 102, 241, 0.3),
        rgba(255, 255, 255, 0.4), 
        transparent);
    z-index: 2;
}

.tab-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2rem;
    padding: 0.5px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
    z-index: 2;
}

.tab-bar.intro-animating {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.tab-bar.intro-expanded {
    width: 95%;
    opacity: 1;
    animation: tabBarGlow 0.8s ease-out;
}

@keyframes tabBarGlow {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.3);
        border-color: rgba(99, 102, 241, 0.3);
    }
}

#tab-intro-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 20;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.tab-bar-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s;
}

.tab-bar-content-visible {
    opacity: 1;
}

.tab-scroll-wrapper {
    flex: 1;
    overflow-x: auto;
    display: flex;
    align-items: center;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    height: 100%;
}

.tab-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-button {
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    min-width: 80px;
    padding: 0.5rem 0.25rem;
}

.tab-button span {
    font-size: 0.6rem;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

.tab-indicator {
    position: absolute;
    height: calc(100% - 0.75rem);
    top: 0.375rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 1.5rem;
    transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 1;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
}

.tab-nav-btn {
    background: rgba(14, 165, 233, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 2px;
    flex-shrink: 0;
    border: 1px solid rgba(14, 165, 233, 0.2);
    opacity: 1;
}

.tab-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.tab-nav-btn:hover {
    background: rgba(14, 165, 233, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.tab-nav-btn svg {
    width: 20px;
    height: 20px;
}

.active-tab {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

.tab-button.active-tab .tab-icon {
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.6));
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.tab-button:not(.active-tab) {
    color: var(--text-secondary);
}

.tab-button:active {
    transform: scale(0.9);
}

/* ===== ОСТАЛЬНЫЕ СТИЛИ ===== */
.primary-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-button);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(99, 102, 241, 0.5);
}

.primary-button:active {
    transform: scale(0.98);
}

.primary-button:disabled {
    background: #233554;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(129, 140, 248, 0.3);
}

.secondary-button {
    background-color: var(--dark-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-button);
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.secondary-button:hover {
    background-color: var(--border-color);
}

.secondary-button:active {
    transform: scale(0.98);
}

.loading-circle {
    display: inline-block;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 2px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: spin 1.2s linear infinite;
}

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

.messages-container {
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px !important;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

.message-bubble {
    max-width: 85%;
    padding: 0.15rem 0.5rem !important;
    border-radius: var(--radius-main);
    margin-bottom: 0.1rem;
    line-height: 1.15 !important;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: inline-block;
    width: fit-content;
    height: auto !important;
    min-height: 0 !important;
}

.message-bubble p {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    line-height: 1.15 !important;
}

.message-bubble p:last-child {
    margin-bottom: 0 !important;
}

.message-bubble br {
    display: block !important;
    content: "" !important;
    margin: 4px 0 !important;
}

.message-bubble.media-content {
    padding: 0.25rem !important;
    line-height: 0 !important;
    overflow: hidden;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
}

.message-bubble.media-content video,
.message-bubble.media-content img {
    display: block;
    margin: 0;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: calc(var(--radius-main) - 0.25rem);
}

.message-incoming {
    background-color: var(--dark-card);
    align-self: flex-start;
    border-bottom-left-radius: 0.4rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--text-primary);
}

.message-outgoing {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.4rem;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.message-system {
    background-color: var(--dark-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: var(--radius-button);
    padding: 0.5rem 1rem;
    max-width: 100%;
    margin: 0.5rem auto;
    text-align: center;
}

.date-separator {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.date-separator-line {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--dark-card);
    padding: 1.5rem;
    border-radius: var(--radius-main);
    width: 100%;
    max-width: 350px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.input-field {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-button);
    width: 100%;
    transition: all 0.3s ease;
    font-size: 16px;
    min-height: 44px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 15px rgba(99, 102, 241, 0.1);
    background-color: rgba(15, 23, 42, 0.8);
}

.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.card {
    background-color: var(--dark-card);
    background-image: linear-gradient(to bottom right, rgba(255,255,255,0.03), rgba(255,255,255,0));
    border-radius: var(--radius-main);
    padding: 1.25rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.avatar-preview {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--dark-card);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.message-with-avatar {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.message-with-avatar .avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid var(--dark-card);
}

.message-with-avatar .bubble {
    max-width: calc(85% - 3.25rem);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #EF4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}

.admin-badge {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.stars-badge {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
}

.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.premium-emoji-inline {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
}

/* ===== ПРОЧИЕ ЭФФЕКТЫ ===== */
.casino-effect-bg {
    background: linear-gradient(135deg, #a3e635 0%, #4ade80 100%) !important; 
    box-shadow: 0 0 30px rgba(163, 230, 53, 0.6) !important;
    border: 2px solid #bef264 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.lolpol-effect-bg {
    background: linear-gradient(135deg, #EF4444, #F56565) !important;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.9), 0 0 20px rgba(239, 68, 68, 0.5) !important;
    border: 3px solid #FCA5A5 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.tulip-effect-bg {
    background: linear-gradient(135deg, #ec4899, #be185d) !important;
    box-shadow: 0 0 50px rgba(236, 72, 153, 0.9), 0 0 20px rgba(236, 72, 153, 0.5) !important;
    border: 3px solid #fbcfe8 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.snowflake-effect-bg {
    background: linear-gradient(135deg, #3b82f6, #93c5fd) !important;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.9), 0 0 20px rgba(147, 197, 253, 0.5) !important;
    border: 3px solid #bfdbfe !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.eggplant-effect-bg {
    background: linear-gradient(45deg, #4c1d95, #7c3aed, #d8b4fe) !important;
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.9), 0 0 20px rgba(124, 58, 237, 0.5) !important;
    border: 3px solid #ddd6fe !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

.vanka-coin-effect-bg {
    background: linear-gradient(135deg, #000000, #1a1a1a, #333333) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(50, 50, 50, 0.5) !important;
    border: 3px solid #444444 !important;
    padding: 1.25rem !important;
    min-height: 100px !important;
    position: relative;
    overflow: hidden;
}

@keyframes highlight-flash {
    0% { background-color: rgba(14, 165, 233, 0.4); }
    100% { background-color: transparent; }
}

.highlight-message {
    animation: highlight-flash 2s ease-out;
}

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

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

/* ===== МЕДИА-ЗАПРОСЫ ===== */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
        margin-bottom: 0.75rem;
    }

    .tab-bar {
        padding: 0.25rem;
    }

    .tab-button {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        min-height: auto;
    }

    .chat-item {
        padding: 10px 8px !important;
        min-height: 50px;
    }
    
    .chat-item h3 {
        font-size: 0.9rem !important;
    }
    
    .chat-item p {
        font-size: 0.75rem !important;
    }

    .chat-item .w-12 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .message-bubble {
        max-width: 90%;
        padding: 0.4rem 0.6rem;
    }

    .message-with-avatar .bubble {
        max-width: calc(90% - 3.25rem);
    }

    .avatar-preview {
        width: 4rem;
        height: 4rem;
    }

    .primary-button, .secondary-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 40px;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.25rem;
        max-width: none;
    }

    .input-field {
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }

    .card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.125rem;
        padding: 0.5rem;
    }

    .tab-button {
        font-size: 0.65rem;
        padding: 0.375rem 0.125rem;
    }

    .chat-item {
        padding: 0.375rem !important;
    }

    .chat-item .w-12 {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .message-bubble {
        max-width: 95%;
        padding: 0.3rem 0.5rem;
        font-size: 0.875rem;
    }

    .primary-button, .secondary-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
        min-height: 36px;
    }

    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
    }

    .avatar-preview {
        width: 3rem;
        height: 3rem;
    }
}

/* Графические настройки */
html.gfx-medium .primary-button,
html.gfx-medium .tab-indicator,
html.gfx-medium .card { 
    box-shadow: none !important; 
}

html.gfx-medium .card { 
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important; 
}

html.gfx-medium .gradient-text, 
html.gfx-medium .active-tab { 
    text-shadow: none !important; 
}

html.gfx-medium * { 
    animation-duration: 0.4s !important; 
}

html.gfx-low .screen-content { 
    transition: none !important; 
}

html.gfx-low .primary-button,
html.gfx-low .tab-indicator,
html.gfx-low .card { 
    box-shadow: none !important; 
}

html.gfx-low .card { 
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important; 
}

html.gfx-low .gradient-text, 
html.gfx-low .active-tab { 
    text-shadow: none !important; 
}

html.gfx-low * { 
    animation: none !important; 
    transition: none !important; 
}
.admin-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.admin-user-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.admin-user-item.blocked {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-user-details {
    min-width: 0;
}

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

.admin-user-username {
    font-size: 12px;
    color: #94a3b8;
}

.admin-user-badges {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.admin-badge-sm {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.admin-unblock-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-unblock-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}
.profile-header-section {
    position: relative;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    overflow: hidden;
}

.profile-effect-overlay {
    position: absolute;
    inset: 0;
    background: inherit;
    z-index: 0;
}

.profile-default-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    z-index: 0;
}

.profile-header-content {
    position: relative;
    z-index: 1;
}

.avatar-container {
    position: relative;
    width: 96px;
    height: 96px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.online-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6b7280;
    border: 3px solid white;
}

.online-indicator.online {
    background: #10b981;
}

.profile-body-section {
    flex: 1;
    background: #0f172a;
    padding: 16px;
    min-height: 400px;
}

.steam-card {
    background: #171a21;
    border: 1px solid #2a475e;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.gifts-section {
    margin-top: 0;
}

.gifts-section-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gift-card-item {
    position: relative;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    transition: all 0.2s;
}

.gift-card-item:hover {
    border-color: #475569;
    transform: translateY(-2px);
}

.gift-card-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.gift-card-info {
    padding: 8px;
}

.gift-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gift-sell-btn {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.7rem;
    background: #334155;
    color: #fbbf24;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.gift-sell-btn:hover {
    background: #475569;
}

.gift-action-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gift-action-btn:hover {
    transform: scale(1.1);
}

.moderator-btn {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: #7f1d1d;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.moderator-btn:hover {
    background: #991b1b;
}
#tab-bar {
    transition: opacity 0.2s ease;
}

.tab-bar-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.tab-bar-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}