* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 40%, #e8ecf4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
}

.loading-text {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 24px;
    min-height: 1.4em;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(124, 77, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7C4DFF, #5C6BC0);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Tab duplicate blocker */
.tab-blocked-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.tab-blocked-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tab-blocked-box h2 {
    margin: 16px 0 8px;
    font-size: 1.2rem;
    color: #333;
}

.tab-blocked-box p {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.tab-blocked-btn {
    background: #7C4DFF;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.tab-blocked-btn:hover {
    background: #651FFF;
}

:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8eaf0;
    --accent-pink: #5C6BC0;
    --accent-purple: #7C4DFF;
    --accent-blue: #00BCD4;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 40%, #e8ecf4 100%);
    min-height: 100vh;
    color: var(--text-primary);

}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 0;
    overflow: hidden;
}

/* ===== Верхняя секция ===== */
.top-section {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ===== Панель чата ===== */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--glass-border);
}

.chat-title {
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chat Tabs */
.chat-tabs {
    display: flex;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.chat-tabs::-webkit-scrollbar {
    display: none;
}

.chat-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 14px;
    opacity: 0.5;
    color: var(--text-secondary);
    border-right: 1px solid #0000000f;
}

.chat-tab:last-child {
    border: none;
}

.chat-tab:hover {
    color: var(--text-primary);
    opacity: 1;
}

.chat-tab.active {
    color: var(--text-primary);
    opacity: 1;

}

.chat-tab.has-unread {
    background: rgba(255, 107, 157, 0.15);
    border-color: rgba(255, 107, 157, 0.3);
}

.chat-tab.has-unread::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-pink);
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-tab-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.chat-tab-close:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease-out;
    max-width: 80%;
}

.message.own {
    align-self: flex-start;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message-content {
    position: relative;
    display: flex;
    gap: 4px;
    align-items: center;
}

.message.own .message-content {
    background: none;
}

.message-author {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.8;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mention-me .message-author::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #7C4DFF;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: left;
}

/* Системные сообщения */
.system-message {
    font-size: 14px;
    color: var(--text-secondary);
    animation: fadeInScale;
}

.system-message-name {
    color: #7c4dff;
    font-weight: 700;
    cursor: pointer;
}

.system-message-name:hover {
    text-decoration: underline;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Ввод сообщения ===== */
.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    position: relative;
}

.emotion-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 280px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.2s ease-out;
}

.emotion-picker.active {
    display: flex;
}

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

.emotion-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--glass-bg);
    border-radius: 12px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emotion-btn img {
    width: 30px;
    height: 24px;
    pointer-events: none;
    -webkit-user-drag: none;
}

.emotion-btn:hover {
    background: var(--glass-border);
    transform: scale(1.15);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.emoji-toggle {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--glass-bg);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.emoji-toggle:hover {
    background: var(--glass-border);
    transform: scale(1.1);
}

.message-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

#message-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 44px 14px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    min-height: 48px;
    max-height: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    white-space: nowrap;
    outline: none;
    line-height: 1.25;
}

#message-input:empty::before {
    content: attr(aria-placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

#message-input img {
    display: inline-block;
    width: 22px;
    height: 18px;
    vertical-align: middle;
    margin: 0 1px;
    pointer-events: none;
}

.sticker-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
}

.sticker-toggle:hover {
    color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.08);
}

.sticker-toggle.active {
    color: var(--accent-purple);
}

.sticker-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.2s ease-out;
    z-index: 100;
}

.sticker-picker.active {
    display: block;
}

.sticker-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 240px;
}

.sticker-btn {
    width: 46px;
    height: 46px;
    border: none;
    background: var(--glass-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.sticker-btn img {
    width: 32px;
    height: 26px;
    pointer-events: none;
    -webkit-user-drag: none;
}

.sticker-btn:hover {
    background: var(--glass-border);
    transform: scale(1.15);
}

.msg-sticker {
    display: inline-block;
    width: 24px;
    height: 20px;
    vertical-align: middle;
    margin: 0 1px;
}

#message-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12);
}


.send-btn {
    height: 48px;
    padding: 0 16px;
    border: none;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.25);
}

.send-btn svg {
    width: 18px;
    height: 18px;
    color: white;
    flex-shrink: 0;
}

.send-btn span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
}

.send-btn:active {
    transform: scale(0.95);
}

.shop-btn {
    height: 48px;
    padding: 0 16px;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.shop-btn svg {
    width: 18px;
    height: 18px;
    color: white;
    flex-shrink: 0;
}

.shop-btn span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.shop-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.shop-btn:active {
    transform: scale(0.95);
}

/* ===== Панель участников ===== */
.participants-panel {
    width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-left: none;
    overflow: hidden;

}

.participants-header {
    padding: 8px 20px;
    height: 44px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-bottom: 1px solid var(--glass-border);
}

.b-user-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 991px) {
    .participants-header {
        justify-content: space-between;

    }

    .--d-mobile-none {
        display: none;
    }

    .chat-header {
        padding: 10px 24px;
    }

}

.participants-header svg {
    flex-shrink: 0;
}

.participants-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: calc(100% - 65px);
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--glass-bg);
    border-radius: 14px;
    transition: all 0.2s ease;
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.edit-status-btn {
    margin-left: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 5px 7px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.edit-status-btn:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.status-editor {
    padding: 10px 15px;
    border-bottom: 1px solid var(--glass-border);
}

#status-edit-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

#status-edit-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

#status-edit-input::placeholder {
    color: var(--text-secondary);
}

.status-editor-actions {
    display: flex;
    gap: 8px;
}

.status-save-btn,
.status-cancel-btn {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-save-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
}

.status-save-btn:hover {
    filter: brightness(1.1);
}

.status-cancel-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.status-cancel-btn:hover {
    background: var(--glass-border);
}

.participant-status-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

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

.participant-item {
    cursor: pointer;
}


.participant-item.dm-active {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1), rgba(124, 77, 255, 0.1));
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.participant-dm-icon {
    margin-left: auto;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.participant-item:hover .participant-dm-icon {
    opacity: 1;
}

.chat-panel.dm-mode .chat-header {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.08), rgba(124, 77, 255, 0.08));
}


.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.participant-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-status {
    margin-left: auto;
    font-size: 0.7rem;
}

.owner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;

}

.owner-icon svg {
    stroke: #DAA520;
    stroke-width: 0.5px;
}

/* ===== Комната ===== */
.room-section {
    height: 220px;
    position: relative;
}

.offscreen-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    color: var(--accent-purple);
    transition: all 0.2s ease;
    animation: offscreenPulse 2s ease-in-out infinite;
}

.offscreen-indicator:hover {
    background: rgba(124, 77, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.offscreen-indicator.left {
    left: 24px;
}

.offscreen-indicator.right {
    right: 24px;
}

@keyframes offscreenPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.room-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #00000000 65%, #ffffff 66%, #ffffff 100%), repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(92, 107, 192, 0.09) 59px, rgba(92, 107, 192, 0.09) 60px), repeating-linear-gradient(180deg, transparent, transparent 39px, rgba(92, 107, 192, 0.09) 38px, rgba(92, 107, 192, 0.09) 40px), linear-gradient(180deg, #fefefe 0%, #ffffff 55%, #ffffff 65%);
    box-shadow: inset 0px -65px 40px 32px rgb(0 0 0 / 3%);
}

.room-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translate(0, 0);
    }
    5% {
        opacity: var(--p-opacity);
    }
    95% {
        opacity: var(--p-opacity);
    }
    100% {
        opacity: 0;
        transform: translate(var(--p-dx), var(--p-dy));
    }
}

.window {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 100px;
    background: linear-gradient(180deg, #9ecde8 0%, #bfddf5 60%, #d0e8fa 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 188, 212, 0.3);
    overflow: hidden;
    box-shadow: 0 0 12px rgba(0, 188, 212, 0.15), 0 0 4px rgba(0, 188, 212, 0.1), inset 0 0 8px rgba(255, 255, 255, 0.3);
}

.window-frame {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 4px rgba(0, 188, 212, 0.3);
}

.window-frame::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    width: 1px;
    height: 102px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 4px rgba(0, 188, 212, 0.3);
    transform: translateX(-50%);
}

.window::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(180deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
    z-index: 2;
}

.window::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(0, 188, 212, 0.12);
    border-radius: 8px;
    pointer-events: none;
    z-index: 2;
}

.stars {
    position: absolute;
    inset: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 3px rgba(0, 188, 212, 0.4);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
        box-shadow: 0 0 6px rgba(0, 188, 212, 0.6);
    }
}

.plant {
    position: absolute;
    bottom: 60px;
    right: 40px;
}

.pot {
    width: 40px;
    height: 35px;
    background: linear-gradient(180deg, #c4956a 0%, #a67c52 100%);
    border-radius: 5px 5px 10px 10px;
    position: relative;
}

.pot::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    right: -3px;
    height: 8px;
    background: #d4a574;
    border-radius: 3px;
}

.leaves {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.leaf {
    position: absolute;
    width: 20px;
    height: 35px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: bottom center;
}

.leaf:nth-child(1) {
    transform: rotate(-30deg);
    left: -15px;
}

.leaf:nth-child(2) {
    transform: rotate(0deg);
    left: -10px;
    height: 45px;
}

.leaf:nth-child(3) {
    transform: rotate(30deg);
    left: -5px;
}

.characters-container {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 0;
    height: 150px;
    transition: transform 0.15s ease-out;
    z-index: 1;
}


/* ===== Роботы (EVE-style) ===== */
.character {
    position: absolute;
    bottom: 20px;
    cursor: grab;
    transition: left 0.15s ease-out, transform 0.15s ease-out;
    z-index: 10;
    transform: translateX(-50%) translateY(0px);
    perspective: 400px;
}

.character.dragging {
    cursor: grabbing;
    z-index: 100;
}

.character.me {
    z-index: 50;
}

/* Тело персонажа — яйцеобразная форма */
.robot-body {
    width: 60px;
    height: 90px;
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    background: linear-gradient(180deg, #ffffff 0%, #e8eaee 100%);
    position: relative;
    animation: float 3s ease-in-out infinite, sway 4s ease-in-out infinite;
    transform-style: preserve-3d;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18),
    0 8px 4px -4px rgba(0, 0, 0, 0.10),
    inset 0 -8px 12px -4px rgba(0, 0, 0, 0.10),
    inset 0 4px 8px -2px rgba(255, 255, 255, 0.50);
}

/* Блик сверху-слева */
.robot-body::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 32px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

/* Затемнение снизу */
.robot-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    pointer-events: none;
    z-index: 1;
}

.character:nth-child(even) .robot-body {
    animation-delay: -1.5s, -2s;
}

.character:nth-child(even) .robot-arm.left {
    animation-delay: -1.8s;
}

.character:nth-child(even) .robot-arm.right {
    animation-delay: -2.5s;
}

.character:nth-child(even) .robot-eye {
    animation-delay: 0s;
}

.character:nth-child(even) .robot-eyes {
    animation-delay: -3s;
}

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

@keyframes sway {
    0%, 100% {
        translate: 0 0;
    }
    50% {
        translate: 2px 0;
    }
}

.character.airborne .robot-body {
    animation: none;
}

.character.airborne .character-shadow {
    animation: none;
    transform: translateX(-50%) scale(0.5);
    opacity: 0.1;
}

.character.dragging .robot-body {
    animation: none;
    transform: scale(1.15);
    filter: brightness(1.1) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.25));
    transition: transform 0.15s ease, filter 0.15s ease;
}

.character.dragging .character-shadow {
    animation: none;
    transform: translateX(-50%) scale(1.5);
    opacity: 0.15;
    transition: all 0.15s ease;
}

.character.dragging .character-name {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.character.me.dragging .character-name {
    opacity: 1;
}

.robot-visor {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 22px;
    background: linear-gradient(180deg, #101424 0%, #1a1e2e 40%, #222840 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15),
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* Стеклянный блик на визоре */
.robot-visor::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 20px;
    height: 7px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Глаза персонажа */
.robot-eyes {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: -3px;
    animation: robotLook 7s ease-in-out infinite;
}

.robot-eyes.surprised {
    gap: 6px;
}

.robot-eye {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    position: relative;
    animation: robotBlink 4s ease-in-out infinite;
    box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
}

@keyframes robotBlink {
    0%, 42%, 48%, 100% {
        transform: scaleY(1);
    }
    45% {
        transform: scaleY(0.1);
    }
}

@keyframes robotLook {
    0%, 30% { translate: 0 0; }
    35%, 55% { translate: 2px 0; }
    60%, 80% { translate: -1.5px 0.5px; }
    85%, 100% { translate: 0 0; }
}

@keyframes armSwingLeft {
    0%, 100% { transform: rotate(6deg) skewX(-6deg); }
    25% { transform: rotate(14deg) skewX(-4deg); }
    50% { transform: rotate(2deg) skewX(-8deg); }
    75% { transform: rotate(10deg) skewX(-3deg); }
}

@keyframes armSwingRight {
    0%, 100% { transform: rotate(-6deg) skewX(6deg); }
    30% { transform: rotate(-14deg) skewX(4deg); }
    55% { transform: rotate(-2deg) skewX(8deg); }
    80% { transform: rotate(-10deg) skewX(3deg); }
}

/* Ручки персонажа */
.robot-arm {
    position: absolute;
    width: 8px;
    height: 28px;
    background: linear-gradient(180deg, #ffffff 0%, #ccd0d6 100%);
    top: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08),
    inset -2px 0 3px rgba(0, 0, 0, 0.10),
    inset 2px 0 3px rgba(255, 255, 255, 0.40);
}

.robot-arm.left {
    left: -12px;
    border-radius: 12px 4px 4px 8px;
    transform-origin: top center;
    animation: armSwingLeft 3.5s ease-in-out infinite;
}

.robot-arm.left::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 2px;
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 1px;
    pointer-events: none;
}

.robot-arm.right {
    right: -12px;
    border-radius: 4px 12px 8px 4px;
    transform-origin: top center;
    animation: armSwingRight 4s ease-in-out infinite;
}

.robot-arm.right::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 2px;
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 1px;
    pointer-events: none;
}


/* ===== Эмоции — формы глаз ===== */

/* happy — дуги вверх (^_^) */
.robot-eyes.happy {
    animation: robotLookHappy 10s ease-in-out infinite;
}

.robot-eyes.happy .robot-eye {
    height: 5px;
    width: 12px;
    border-radius: 12px 12px 0 0;
}

@keyframes robotLookHappy {
    0%, 25% { translate: 0 0; }
    30%, 45% { translate: 2px 0; }
    50%, 70% { translate: -1.5px 0.5px; }
    75% { translate: 0 0; }
    /* убегают вправо за визор */
    82% { translate: 50px 0; }
    /* мгновенный прыжок за левый край */
    82.01% { translate: -50px 0; }
    /* выезжают из-за левого края обратно в центр */
    90%, 100% { translate: 0 0; }
}

/* love — сердечки SVG */
.robot-eyes.love {
    gap: 14px;
    animation: none;
}

.robot-eyes.love .robot-eye {
    opacity: 0;
    width: 0;
    height: 0;
}

.love-heart-svg {
    position: absolute;
    top: 5px;
    animation: heartBlink 4s ease-in-out infinite;
}

.love-heart-svg.love-heart-left {
    left: 6px;
}

.love-heart-svg.love-heart-right {
    right: 6px;
}

.love-heart-svg svg {
    display: block;
    filter: drop-shadow(0 0 4px rgba(229, 57, 53, 0.6));
    animation: heartBeat 2s ease-in-out infinite;
}

@keyframes heartBlink {
    0%, 42%, 48%, 100% {
        transform: scaleY(1);
    }
    45% {
        transform: scaleY(0.1);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* laugh — прищуренные глаза и улыбка с зубами */
.robot-eyes.laugh {
    position: relative;
    margin-top: -8px;
}

.robot-eyes.laugh .robot-eye {
    height: 2px;
    width: 7px;
    border-radius: 2px;
}

.laugh-smile-svg {
    position: absolute;
    left: 50%;
    top: 0px;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 0 4px currentColor);
}

.laugh-smile-svg svg {
    animation: gentleSmile 1.5s ease-in-out infinite;
}

@keyframes gentleSmile {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* cool — горизонтальные полоски (козырёк) */
.robot-eyes.cool .robot-eye {
    height: 6px;
    width: 10px;
    border-radius: 12px;
    animation: none;
}

/* sad — опущенные вниз */
.robot-eyes.sad .robot-eye {
    height: 4px;
    width: 8px;
    border-radius: 50%;
    opacity: 0.5;
}

.robot-eyes.sad .robot-eye.right {
    border-radius: 50% 50% 0 50%;
}

/* sad tears on robot body */
.robot-tear {
    position: absolute;
    width: 4px;
    height: 8px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(180deg, rgba(105, 192, 224, 0.9) 0%, rgba(105, 192, 224, 0.3) 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    animation: tearFall 1.8s ease-in infinite;
}

.robot-tear.left-1 {
    left: 17px;
    top: 34px;
    animation-delay: 0s;
}

.robot-tear.left-2 {
    left: 20px;
    top: 34px;
    animation-delay: 0.7s;
    width: 3px;
    height: 6px;
}

.robot-tear.right-1 {
    right: 17px;
    top: 34px;
    animation-delay: 0.3s;
}

.robot-tear.right-2 {
    right: 20px;
    top: 34px;
    animation-delay: 1.0s;
    width: 3px;
    height: 6px;
}

@keyframes tearFall {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    10% {
        opacity: 0.9;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 0.6;
        transform: translateY(45px) scale(0.8);
    }
    85% {
        opacity: 0;
        transform: translateY(55px) scale(0.4);
    }
    100% {
        opacity: 0;
        transform: translateY(55px) scale(0);
    }
}

/* love — floating hearts from robot head */
.robot-heart {
    position: absolute;
    top: 0;
    color: #e53935;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 4px rgba(229, 57, 53, 0.5);
    animation: heartFloat 3s ease-out infinite;
}

@keyframes heartFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.3) rotate(0deg);
    }
    10% {
        opacity: 1;
        transform: translateY(-5px) scale(1) rotate(-5deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-40px) scale(0.9) rotate(10deg);
    }
    80% {
        opacity: 0.3;
        transform: translateY(-70px) scale(0.6) rotate(-8deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-90px) scale(0.3) rotate(12deg);
    }
}

.robot-zzz {
    position: absolute;
    top: -2px;
    font-family: 'Comic Sans MS', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-style: italic;
    color: #a0b4ff;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 6px rgba(160, 180, 255, 0.6), 0 0 12px rgba(160, 180, 255, 0.3);
    animation: zzzFloat 3.3s ease-out infinite;
}

@keyframes zzzFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.3) rotate(0deg);
    }
    8% {
        opacity: 0.9;
        transform: translateY(-5px) scale(1) rotate(5deg);
    }
    30% {
        opacity: 0.85;
        transform: translateY(-25px) scale(1.1) rotate(-8deg);
    }
    60% {
        opacity: 0.5;
        transform: translateY(-55px) scale(0.9) rotate(10deg);
    }
    85% {
        opacity: 0.2;
        transform: translateY(-80px) scale(0.7) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-95px) scale(0.4) rotate(8deg);
    }
}

/* angry — сужены + скошены */
.robot-eyes.angry .robot-eye {
    height: 5px;
    width: 7px;
    border-radius: 2px;
    animation: none;
}

.robot-eyes.angry .robot-eye.left {
    transform: rotate(-15deg);
}

.robot-eyes.angry .robot-eye.right {
    transform: rotate(15deg);
}

/* surprised — большие круглые */
.robot-eyes.surprised .robot-eye {
    width: 13px;
    height: 13px;
    animation: none;
}

/* sleepy — полузакрытые */
.robot-eyes.sleepy .robot-eye {
    height: 3px;
    width: 10px;
    border-radius: 3px;
    opacity: 0;
    animation: none;
}

.visor-terminal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 4px;
    line-height: 1.4;
    color: #00ff41;
    white-space: pre;
    pointer-events: none;
    z-index: 3;
    text-shadow: 0 0 3px rgba(0, 255, 65, 0.7), 0 0 6px rgba(0, 255, 65, 0.3);
    animation: terminalScroll 8s linear infinite;
    opacity: 0.9;
}

@keyframes terminalScroll {
    0% {
        transform: translateY(22px);
    }
    100% {
        transform: translateY(-100%);
    }
}

/* Тень под роботом */
.character-shadow {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.30) 0%, transparent 50%),
    radial-gradient(ellipse, rgba(0, 0, 0, 0.12) 0%, transparent 70%);
    filter: blur(1px);
    animation: shadowPulse 3s ease-in-out infinite;
}

.character:nth-child(even) .character-shadow {
    animation-delay: -1.5s;
}

@keyframes shadowPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translateX(-50%) scale(0.7);
        opacity: 0.2;
    }
}

/* Анимация приземления */
.character.landing .robot-body {
    animation: landingBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.character.landing .character-shadow {
    animation: shadowLand 0.6s ease-out;
}

.character.landing .character-name {
    animation: nameFadeIn 0.4s ease-out 0.2s both;
}

.character.me.landing .character-name {
    animation: none;
}

@keyframes landingBounce {
    0% {
        transform: scale(1.15);
        filter: brightness(1.1);
    }
    50% {
        transform: scale(0.97, 1.03);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes shadowLand {
    0% {
        transform: translateX(-50%) scale(1.5);
        opacity: 0.1;
    }
    30% {
        transform: translateX(-50%) scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.4;
    }
}

@keyframes nameFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.character-name {
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    color: #1a1a2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);

    opacity: 0;
    transition: opacity 0.2s ease;
}

.character:hover .character-name,
.character.me .character-name {
    opacity: 1;
}

/* Эффект эмоции над головой */
.emotion-bubble {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    animation: emotionPop 2s ease-out forwards;
    pointer-events: none;
}

.emotion-bubble img {
    width: 30px;
    height: 24px;
    pointer-events: none;
    -webkit-user-drag: none;
}

@keyframes emotionPop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.2);
    }
    30% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
}

.typing-bubble {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);

    border-radius: 12px;
    padding: 4px 10px;
    display: flex;
    gap: 3px;
    align-items: center;
    pointer-events: none;
    animation: typingFadeIn 0.2s ease-out;
}

.typing-bubble span {
    width: 6px;
    height: 7px;
    border-radius: 50%;
    background: #00000099;
    animation: typingDot 1.2s infinite ease-in-out;
    box-shadow: #0000009e 0px 0px 2px 0px;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@keyframes typingFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* ===== Модальное окно ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

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

.modal {
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

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

.modal-character {
    transform: scale(0.6);
    overflow: visible;
    perspective: 400px;
}

.modal-character .preview-robot {
    overflow: visible;
}

.preview-robot {
    width: 60px;
    height: 90px;
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    background: linear-gradient(180deg, #ffffff 0%, #e8eaee 100%);
    margin: 0 auto;
    position: relative;
    animation: float 3s ease-in-out infinite, sway 4s ease-in-out infinite;
    transform-style: preserve-3d;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18),
    0 8px 4px -4px rgba(0, 0, 0, 0.10),
    inset 0 -8px 12px -4px rgba(0, 0, 0, 0.10),
    inset 0 4px 8px -2px rgba(255, 255, 255, 0.50);
}

/* Блик сверху-слева (превью) */
.preview-robot::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 32px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

/* Затемнение снизу (превью) */
.preview-robot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    pointer-events: none;
    z-index: 1;
}

.preview-visor {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 22px;
    background: linear-gradient(180deg, #101424 0%, #1a1e2e 40%, #222840 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: visible;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15),
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

/* Стеклянный блик на визоре (превью) */
.preview-visor::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 20px;
    height: 7px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.preview-eye {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7C4DFF;
    box-shadow: 0 0 6px #7C4DFF, 0 0 12px #7C4DFF;
    animation: robotBlink 4s ease-in-out infinite;
}


.preview-arm {
    position: absolute;
    width: 8px;
    height: 30px;
    background: linear-gradient(180deg, #e0e2e6 0%, #ccd0d6 100%);
    border-radius: 4px;
    top: 35px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08),
    inset -2px 0 3px rgba(0, 0, 0, 0.10),
    inset 2px 0 3px rgba(255, 255, 255, 0.40);
}

.preview-arm.left {
    left: -12px;
    transform: rotate(8deg);
}

.preview-arm.left::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 2px;
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 1px;
    pointer-events: none;
}

.preview-arm.right {
    right: -12px;
    transform: rotate(-8deg);
}

.preview-arm.right::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 2px;
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 1px;
    pointer-events: none;
}

.modal h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.color-target-toggle {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.color-target-btn {
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 8px 20px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.color-target-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    box-shadow: 0 2px 8px rgba(124, 77, 255, 0.3);
}

.color-target-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 25px;
}

.color-option {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    padding: 0;
}

.color-option-light {
    border: 2px solid var(--glass-border);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: #1a1a2e;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

#name-input,
#status-input {
    width: 100%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: inherit;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#status-input {
    font-size: 0.95rem;
    padding: 12px 16px;
    margin-bottom: 16px;
}

#name-input:focus,
#status-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.2);
}

#name-input::placeholder,
#status-input::placeholder {
    color: var(--text-secondary);
}

.join-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.25);
}

.join-btn.--guest {
    background: none;
    color: #6365cd;
    box-shadow: none;
    font-size: 14px;
}

.join-btn.--guest:hover {
    transform: none;
    box-shadow: none;
    color: #535353;
}

.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(124, 77, 255, 0.5);
}

.join-btn:active {
    transform: translateY(0);
}

/* ===== Room select button ===== */
.room-select-btn {
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--glass-border);
    background: #ffffff;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.room-select-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.room-select-btn span {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.room-select-btn:hover {
    background: var(--bg-secondary);
}

.room-select-btn:active {
    transform: scale(0.95);
}

/* ===== Image upload button ===== */
.image-upload-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--glass-border);
    background: #ffffff;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.image-upload-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

.image-upload-btn:hover {
    background: var(--bg-secondary);
}

.image-upload-btn:active {
    transform: scale(0.95);
}

/* ===== Rooms overlay ===== */
.rooms-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.2s ease-out;
}

.rooms-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 0;
    max-width: 540px;
    width: 94%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0 0 1px rgba(124, 77, 255, 0.04),
        0 8px 40px rgba(0, 0, 0, 0.08),
        0 24px 80px rgba(124, 77, 255, 0.06);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.rooms-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
    border-radius: 20px 20px 0 0;
}

@media (min-width: 769px) {
    .rooms-overlay {
        background: none;
        backdrop-filter: none;
        pointer-events: none;
    }

    .rooms-overlay > .rooms-panel {
        pointer-events: auto;
        position: absolute;
    }

    .rooms-panel-header {
        cursor: grab;
        user-select: none;
    }

    .rooms-panel-header.dragging {
        cursor: grabbing;
    }
}

.rooms-close-btn {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 12px;
    padding: 7px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: all 0.18s ease;
}

.rooms-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.rooms-list {
    padding: 10px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.room-item:hover {
    background: rgba(124, 77, 255, 0.04);
    border-color: rgba(124, 77, 255, 0.08);
}

.room-item.active {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.08) 0%, rgba(92, 107, 192, 0.06) 100%);
    border-color: rgba(124, 77, 255, 0.22);
    box-shadow: 0 2px 12px rgba(124, 77, 255, 0.08);
}

.room-item.active .room-icon {
    box-shadow: 0 0 0 2.5px rgba(124, 77, 255, 0.25);
}

.room-item.active .room-name {
    color: var(--accent-purple);
}

.room-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.room-item:hover .room-icon {
    transform: scale(1.05);
}

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

.room-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: color 0.18s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.room-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    padding: 3px 9px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.3;
}

.room-item.active .room-count {
    background: rgba(124, 77, 255, 0.12);
    color: var(--accent-purple);
}

.room-settings-btn {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
}

.room-item:hover .room-settings-btn {
    opacity: 1;
}

.room-settings-btn:hover {
    background: rgba(124, 77, 255, 0.1);
    color: var(--accent-purple);
}

.room-capacity-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin: 0;
}

.room-capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.room-item.active .room-capacity-fill {
    background: linear-gradient(90deg, #7C4DFF, #9C7CFF);
}

.rooms-create {
    display: flex;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}

#new-room-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.03);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

#new-room-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12);
}

#new-room-input::placeholder {
    color: var(--text-secondary);
}

.rooms-create-btn {
    background: var(--accent-purple);
    border: none;
    border-radius: 14px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rooms-create-btn:hover {
    background: #6a3de8;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.3);
}

.room-settings-body {
    padding: 20px;
}

.room-settings-body .profile-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.room-settings-danger {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.room-settings-danger .profile-label {
    color: #e74c3c;
}

.room-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    color: #e74c3c;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.room-delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}

/* Room avatar upload */
.room-avatar-upload-area {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--glass-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.room-avatar-upload-area:hover {
    border-color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.04);
}

.room-avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.room-avatar-placeholder svg {
    opacity: 0.5;
}

/* Room description snippet in list */
.room-desc-snippet {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Room welcome card */
.room-welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    margin: 8px auto 12px;
    max-width: 320px;
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-align: center;
}

.room-welcome-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.room-welcome-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.room-welcome-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Modal room selector ===== */
.modal-room-select {
    margin-bottom: 20px;
}

.modal-room-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-rooms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.modal-room-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-room-btn:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.modal-room-btn.selected {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.3), rgba(92, 107, 192, 0.3));
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

/* ===== Name editor ===== */
.name-editor {
    padding: 10px 15px;
    border-bottom: 1px solid var(--glass-border);
}

#name-edit-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

#name-edit-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

#name-edit-input::placeholder {
    color: var(--text-secondary);
}

/* ===== Auth screens ===== */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.auth-back-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: var(--text-primary);
}

.auth-input {
    width: 100%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    text-align: center;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.2);
}

.auth-input::placeholder {
    color: var(--text-secondary);
}

.auth-error {
    color: #e53935;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 0;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

.auth-error:not(:empty) {
    min-height: 1.2em;
    margin-bottom: 12px;
}

.auth-success {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 0;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

.auth-success:not(:empty) {
    min-height: 1.2em;
    margin-bottom: 12px;
}

.auth-forgot-link {
    display: block;
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: var(--accent-pink);
    text-decoration: underline;
}

.auth-email-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.auth-code-input {
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-weight: 700;
}

.join-btn.--secondary {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow: none;
    margin-top: 8px;
}

.join-btn.--secondary:hover {
    background: var(--glass-border);
    transform: scale(1.02);
}

/* ===== Аксессуары на персонажах ===== */
.accessory {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.accessory.hidden-by-preview {
    display: none;
}

.accessory img {
    display: block;
    width: 100%;
    height: 100%;
}

.accessory-halo {
    top: -18px;
    left: 50%;
    transform: translateX(-50%) rotateX(55deg);
    width: 56px;
    height: 20px;
    z-index: 10;
    animation: haloGlow 2s ease-in-out infinite;
}

.accessory-angel_wings {
    top: 19px;
    width: 126px;
    left: -33px;
}

@keyframes haloGlow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9));
    }
}

.accessory-crown {
    top: -17px;
    left: 10px;
    width: 39px;
    height: 24px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}

.accessory-red_horns {
    top: -10px;
    left: 11px;
    width: 38px;
}


.accessory-dragon_tattoo {
    position: absolute;
    bottom: 5px;
    left: 25px;
    transform: rotate(7deg);
    width: 30px;
    height: 40px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.9;
}

.accessory-dragon_tattoo img {
    width: 100%;
    height: 100%;
}

.accessory-hockey_mask {
    top: -2px;
    left: 2px;
    width: 56px;
    z-index: 10;
}

.accessory-hockey_mask img {
    width: 100%;
    height: 100%;
}

.accessory-drone_iex {
    position: absolute;
    top: -10px;
    right: -28px;
    width: 32px;
    height: 36px;
    z-index: 15 !important;
    animation: droneOrbit 6s ease-in-out infinite;
}

.accessory-drone_iex img {
    width: 100%;
    height: 100%;
}

.accessory-snake_tattoo {
    bottom: 0;
    right: -0.7px;
    width: 34px;
    transform: rotate(0.9deg);
    z-index: 1;
}

.accessory-girl_cap1 {
    top: -28px;
    left: -2px;
    width: 64px;
    z-index: 9;
}
.accessory-man_cap_winter {
    top: -28px;
    left: -3px;
    width: 66px;
    z-index: 9;
}

.accessory-red_jacket {
    top: 32px;
    left: -9px;
    width: 79px;
}

.robot-body:has(.accessory-red_jacket) .robot-arm {
    display: none;
}

.preview-robot:has(.accessory-red_jacket) .preview-arm {
    display: none;
}

/* Lightsaber position when red jacket is equipped */
.robot-body:has(.accessory-red_jacket) .accessory-lightsaber,
.robot-body:has(.accessory-red_jacket) .accessory-lightsaber_red {
    top: -15px;
    left: -13px;
}

.robot-body:has(.accessory-red_jacket) .accessory-babubu_pink {
    bottom: 11px;
    right: -22px;
}

.robot-body:has(.accessory-red_jacket) .accessory-sparkler {
    top: 23px;
    left: -17px;
}

/* Lightsaber position when sweateer is equipped */
.robot-body:has(.accessory-sweateer) .accessory-lightsaber,
.robot-body:has(.accessory-sweateer) .accessory-lightsaber_red {
    top: -8px;
    left: -10px;
}

.robot-body:has(.accessory-sweateer) .accessory-babubu_pink {
    bottom: 1px;
    right: -17px;
}

.robot-body:has(.accessory-sweateer) .accessory-sparkler {
    top: 30px;
    left: -16px;
}

/* Lightsaber position when sport_sweater is equipped */
.robot-body:has(.accessory-sport_sweater) .accessory-lightsaber,
.robot-body:has(.accessory-sport_sweater) .accessory-lightsaber_red {
    top: -17px;
    left: -13px;
}

.robot-body:has(.accessory-sport_sweater) .accessory-babubu_pink {
    bottom: 12px;
    right: -20px;
}

.robot-body:has(.accessory-sport_sweater) .accessory-sparkler {
    top: 23px;
    left: -19px;
}

/* Shop preview: red_jacket */
.preview-robot:has(.accessory-red_jacket) .accessory-lightsaber,
.preview-robot:has(.accessory-red_jacket) .accessory-lightsaber_red {
    top: -15px;
    left: -13px;
}

.preview-robot:has(.accessory-red_jacket) .accessory-babubu_pink {
    bottom: 11px;
    right: -22px;
}

.preview-robot:has(.accessory-red_jacket) .accessory-sparkler {
    top: 23px;
    left: -17px;
}

/* Shop preview: sweateer */
.preview-robot:has(.accessory-sweateer) .accessory-lightsaber,
.preview-robot:has(.accessory-sweateer) .accessory-lightsaber_red {
    top: -8px;
    left: -10px;
}

.preview-robot:has(.accessory-sweateer) .accessory-babubu_pink {
    bottom: 1px;
    right: -17px;
}

.preview-robot:has(.accessory-sweateer) .accessory-sparkler {
    top: 30px;
    left: -16px;
}

/* Shop preview: sport_sweater */
.preview-robot:has(.accessory-sport_sweater) .accessory-lightsaber,
.preview-robot:has(.accessory-sport_sweater) .accessory-lightsaber_red {
    top: -17px;
    left: -13px;
}

.preview-robot:has(.accessory-sport_sweater) .accessory-babubu_pink {
    bottom: 12px;
    right: -20px;
}

.preview-robot:has(.accessory-sport_sweater) .accessory-sparkler {
    top: 23px;
    left: -19px;
}


.accessory-sweateer {
    top: 33px;
    left: -8px;
    width: 76px;
}

.robot-body:has(.accessory-sweateer) .robot-arm {
    display: none;
}

.preview-robot:has(.accessory-sweateer) .preview-arm {
    display: none;
}
.accessory-sport_sweater{
    top: 26px;
    left: -12px;
    width: 83px;
}

.robot-body:has(.accessory-sport_sweater) .robot-arm {
    display: none;
}

.preview-robot:has(.accessory-sport_sweater) .preview-arm {
    display: none;
}


.accessory-bag {
    top: -2px;
    left: -4px;
    width: 71px;
    z-index: 9;
}

.accessory-robo_bag {
    bottom: 0;
    left: -25px;
    width: 35px;
}

.accessory-jacket_lui {
    top: 27px;
    left: -6px;
    width: 74px;
    z-index: 6;
}

.robot-body:has(.accessory-jacket_lui) .robot-arm {
    display: none;
}

.preview-robot:has(.accessory-jacket_lui) .preview-arm {
    display: none;
}

/* Accessory positions when jacket_lui is equipped */
.robot-body:has(.accessory-jacket_lui) .accessory-lightsaber,
.robot-body:has(.accessory-jacket_lui) .accessory-lightsaber_red {
    top: -15px;
    left: -13px;
}

.robot-body:has(.accessory-jacket_lui) .accessory-babubu_pink {
    bottom: 11px;
    right: -22px;
}

.robot-body:has(.accessory-jacket_lui) .accessory-sparkler {
    top: 23px;
    left: -17px;
}

/* Shop preview: jacket_lui */
.preview-robot:has(.accessory-jacket_lui) .accessory-lightsaber,
.preview-robot:has(.accessory-jacket_lui) .accessory-lightsaber_red {
    top: -15px;
    left: -13px;
}

.preview-robot:has(.accessory-jacket_lui) .accessory-babubu_pink {
    bottom: 11px;
    right: -22px;
}

.preview-robot:has(.accessory-jacket_lui) .accessory-sparkler {
    top: 23px;
    left: -17px;
}

.accessory-female_jacket_pink {
    top: 18px;
    left: -8px;
    width: 77px;
}

.robot-body:has(.accessory-female_jacket_pink) .robot-arm {
    display: none;
}

.preview-robot:has(.accessory-female_jacket_pink) .preview-arm {
    display: none;
}

@keyframes droneOrbit {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(-10px, -8px);
    }
    50% {
        transform: translate(-25px, 0);
    }
    75% {
        transform: translate(-10px, 8px);
    }
}

.accessory-sparkles {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 80px;
    overflow: visible;
}

.accessory-sparkles img {
    width: 60px;
    height: 80px;
}

/* Hairstyles - behind headwear */


.accessory-skirt_pink {
    bottom: -2px;
    left: -10px;
    width: 81px;
    z-index: 6;
}


/* Female hair - above all clothing */
.accessory-hair_female_2,
.accessory-hair_female_3,
.accessory-hair_female_4 {
    z-index: 8;
}

/* Headwear + other category - above hairstyles */
.accessory-crown,
.accessory-beanie,
.accessory-black-cap,
.accessory-red_horns,
.accessory-halo,
.accessory-sparkles,
.accessory-lightsaber,
.accessory-lightsaber_red,
.accessory-red_roses,
.accessory-drone_iex,
.accessory-sparkler,
.accessory-babubu_pink {
    z-index: 9;
}

.accessory-gold_chain,
.accessory-silver_chain {
    top: 30px;
    left: 0;
    width: 60px;
    z-index: 4;
    overflow: visible;
}


.accessory-beanie {
    top: -17px;
    left: 1px;
    width: 58px;
}

.accessory-lightsaber {
    top: -26px;
    left: -23px;
    width: 18px;
    height: 95px;
    transform: rotate(-10deg);
    transform-origin: bottom center;
    overflow: visible;
}

.accessory-lightsaber img,
.accessory-lightsaber_red img {
    overflow: visible;
    width: 18px;
    height: 95px;
}

.accessory-exp_dress {
    width: 132px;
    bottom: -70px;
    left: -37px;
}

.accessory-exp_dress img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.accessory-sweater_ny {
    top: 32px;
    width: 62px;
    left: -1px;
}

.accessory-black-t-shit {
    top: 33px;
    left: -1px;
    width: 62px;
}

.accessory-black-cap {
    top: -6px;
    width: 55px;
    left: 3px;
}

.robot-body:has(.accessory-hair_female_3) .accessory-black-cap {
    left: 5px;
}

.accessory-red_roses {
    top: 35px;
    width: 50px;
    left: -30px;
    transform: rotate(-10deg);
}

.accessory-jeans {
    bottom: -2px;
    width: 60px;
    left: 0;
}

.accessory-hair_female_2 {
    top: -2px;
    width: 84px;
    left: -13px;
}

.accessory-hair_female_3 {
    top: -2px;
    width: 85px;
    left: -13px;
}

.accessory-hair_female_4 {
    top: -1px;
    left: -1px;
    width: 62px;
}

/* Сдвигаем тень ниже для платья */
.robot-body:has(.accessory-exp_dress) ~ .character-shadow {
    bottom: -118px;
}

/* Анимированные блестки для платья - первый слой */
.accessory-exp_dress::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.9) 1.5px, transparent 1.5px),
    radial-gradient(circle at 60% 20%, rgba(255, 215, 255, 0.8) 1px, transparent 1px),
    radial-gradient(circle at 80% 50%, rgba(200, 230, 255, 0.9) 1.8px, transparent 1.8px),
    radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.7) 0.8px, transparent 0.8px),
    radial-gradient(circle at 70% 80%, rgba(255, 240, 255, 0.8) 1.2px, transparent 1.2px);
    background-size: 100% 100%;
    animation: dressSparkle1 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
    clip-path: inset(0);
}

/* Второй слой блесток */
.accessory-exp_dress::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background-image: radial-gradient(circle at 40% 15%, rgba(255, 255, 255, 1) 1.2px, transparent 1.2px),
    radial-gradient(circle at 15% 50%, rgba(220, 200, 255, 0.9) 1.5px, transparent 1.5px),
    radial-gradient(circle at 85% 35%, rgba(255, 255, 255, 0.8) 0.8px, transparent 0.8px),
    radial-gradient(circle at 50% 85%, rgba(200, 255, 255, 0.9) 1.8px, transparent 1.8px),
    radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 100% 100%;
    animation: dressSparkle2 3s ease-in-out infinite;
    animation-delay: -1.2s;
    pointer-events: none;
    z-index: 11;
    clip-path: inset(0);
}

@keyframes dressSparkle1 {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    40% {
        opacity: 0.6;
    }
    60% {
        opacity: 0.9;
    }
    80% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
    }
}

@keyframes dressSparkle2 {
    0% {
        opacity: 0;
    }
    25% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    75% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
    }
}

/* Hide left arm when lightsaber is equipped */
.robot-body:has(.accessory-lightsaber) .robot-arm.left {
    left: -13px;
    transform: rotate(45deg);
    height: 20px;
    top: 40px;
}

.accessory-lightsaber_red {
    top: -26px;
    left: -23px;
    width: 18px;
    height: 95px;
    transform: rotate(-10deg);
    transform-origin: bottom center;
    overflow: visible;
}

/* Hide left arm when lightsaber is equipped */
.robot-body:has(.accessory-lightsaber_red) .robot-arm.left {
    left: -13px;
    transform: rotate(45deg);
    height: 20px;
    top: 40px;
}

.accessory-clown_mask {
    width: 80px;
    left: -9px;
    top: 8px;
}

.accessory-babubu_pink {
    width: 24px;
    bottom: 20px;
    right: -25px;
    transform: rotate(10deg);
    z-index: 7;
}

.accessory-man_hair_2 {
    top: -10px;
    width: 52px;
    left: 6px;
}

.robot-body:has(.accessory-beanie) .accessory-man_hair_2,
.robot-body:has(.accessory-black-cap) .accessory-man_hair_2 {
    display: none;
}

.accessory-man_hair_3 {
    top: -8px;
    width: 65px;
    left: -6px;
}

.robot-body:has(.accessory-beanie) .accessory-man_hair_3,
.robot-body:has(.accessory-black-cap) .accessory-man_hair_3 {
    display: none;
}

.accessory-sparkler {
    position: absolute;
    top: 5px;
    left: -23px;
    width: 25px;
    height: 48px;
    transform: rotate(-20deg);
    transform-origin: bottom center;
    overflow: visible;
    z-index: 10;
}

.accessory-sparkler img {
    width: 25px;
    height: 48px;
    overflow: visible;
}

.robot-body:has(.accessory-sparkler) .robot-arm.left {
    left: -12px;
    transform: rotate(55deg);
    height: 24px;
    top: 34px;
}

.accessory-blazer_male {
    top: 34px;
    width: 63px;
    left: -2px;
}


@keyframes previewPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* ===== Магазин ===== */
.shop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.2s ease-out;
}

.shop-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    max-width: 820px;
    width: 94%;
    min-height: 520px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: modalSlideIn 0.3s ease-out;
}

.shop-panel-sm {
    max-width: 360px;
    min-height: auto;
    max-height: none;
}

.shop-panel-md {
    max-width: 440px;
    min-height: auto;
    max-height: none;
}

.shop-panel-body {
    padding: 20px 24px;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 24px;
    font-weight: 800;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    background: #FFFFFF;
    border-radius: 8px 8px 0 0;
}

@media (min-width: 769px) {
    .shop-overlay {
        background: none;
        backdrop-filter: none;
        pointer-events: none;
    }

    .shop-overlay > .shop-panel {
        pointer-events: auto;
        position: absolute;
    }

    .shop-header {
        cursor: grab;
        user-select: none;
    }

    .shop-header.dragging {
        cursor: grabbing;
    }
}

.shop-coins {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #F57F17;
}

.coin-icon {
    flex-shrink: 0;
}

.salary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.15s ease;
}

.salary-btn:hover:not(:disabled) {
    background: var(--glass-hover);
    color: var(--text-primary);
}

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

.salary-btn.ready {
    background: #f8f4e8;
    border: 1px solid #d4c9a8;
    color: #8b7355;
}

.salary-btn.ready:hover {
    background: #f2ebda;
    border-color: #c4b898;
}

.promo-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 4px;
}

.promo-input:focus {
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.promo-message {
    font-size: 13px;
    text-align: center;
    min-height: 20px;
    line-height: 20px;
    margin-bottom: 4px;
}

.promo-message.success {
    color: #2e7d32;
}

.promo-message.error {
    color: #c62828;
}

.shop-preview-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-left: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(255, 248, 225, 0.15) 0%, transparent 100%);
    position: relative;
    min-width: 215px;
}

.shop-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    flex: 1;
}

.shop-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 200px;
}

.shop-loading-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.shop-loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(124, 77, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.shop-loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7C4DFF, #5C6BC0);
    border-radius: 2px;
    transition: width 0.15s ease;
}

.shop-preview-robot {
    position: relative;
    perspective: 400px;
}

.shop-guest-block {
    padding: 30px 24px;
    text-align: center;
    margin: auto;
}

.shop-guest-block p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.shop-guest-block .join-btn {
    max-width: 260px;
    margin: 0 auto;
}

.shop-main {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
}

.shop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
    border-right: 1px solid var(--glass-border);
    min-width: 150px;
    overflow-y: auto;
}

.shop-sidebar-btn {
    border: none;
    background: none;
    text-align: left;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.shop-sidebar-btn:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.shop-sidebar-btn.active {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.12), rgba(92, 107, 192, 0.12));
    color: var(--accent-purple);
    font-weight: 700;
}

.shop-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-width: 0;
}

.compare-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px 20px;
}

.compare-card {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.compare-card-character {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.compare-card-character .character {
    position: static;
    transform: none;
    transition: none;
    cursor: default;
    pointer-events: none;
}

.compare-card-character .robot-body {
    animation: none;
}

.compare-card-character .character-shadow,
.compare-card-character .character-name {
    display: none;
}


.compare-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    word-break: break-word;
}

.compare-card-rating {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    transition: transform 0.2s;
}

.compare-rating-settle {
    animation: comparePopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.compare-card-rank {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    min-height: 1.4em;
}

.compare-rank-flip {
    animation: compareRankFlip 0.08s ease-out;
}

.compare-rank-settle {
    animation: compareRankSettle 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes compareRankFlip {
    0% {
        opacity: 0.4;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes compareRankSettle {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.15);
        color: var(--primary);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes comparePopIn {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

.shop-catalog {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.shop-owned-card {
    position: relative;
}

.shop-sell-btn-small {
    position: absolute;
    right: 4px;
    bottom: 4px;
    border: none;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shop-owned-card:hover .shop-sell-btn-small {
    opacity: 1;
}

.shop-sell-btn-small:hover {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.shop-sell-btn-small svg {
    width: 10px;
    height: 10px;
}

.shop-owned-label {
    position: absolute;
    right: 4px;
    bottom: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #4CAF50;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shop-card:hover .shop-owned-label {
    opacity: 1;
}

.shop-buy-btn-small {
    position: absolute;
    right: 4px;
    bottom: 4px;
    border: none;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shop-card:hover .shop-buy-btn-small {
    opacity: 1;
}

.shop-buy-btn-small:hover {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.shop-buy-btn-small svg {
    width: 10px;
    height: 10px;
}

@media (hover: none) {
    .shop-sell-btn-small,
    .shop-buy-btn-small,
    .shop-owned-label {
        opacity: 1;
    }
}

.shop-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: inset 0px 0 13px 0px #00000021;
}

.shop-card:hover {
    box-shadow: inset 0px 0 13px 0px #b8cecf59;
    transform: translateY(-2px);

}

.shop-card.previewing {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.08), rgba(92, 107, 192, 0.08));
}


.shop-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-card-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.shop-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.shop-card-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #F57F17;
    font-weight: 700;
}

.shop-card-owned-label {
    font-size: 0.75rem;
    color: #4CAF50;
    font-weight: 700;
}

.shop-card.equipped {
    border-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1), rgba(92, 107, 192, 0.1));
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.15);
}

.shop-action-bar {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.shop-preview-btn,
.shop-buy-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-preview-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.shop-preview-btn:hover {
    background: var(--glass-border);
}

.shop-buy-btn {
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.shop-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

/* Мои аксессуары */
.shop-owned {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-owned-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 0.95rem;
}

.shop-owned-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-owned-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-owned-icon img {
    width: 100%;
}

.shop-owned-icon svg {
    width: 36px;
    height: 36px;
}

.shop-owned-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
}

.shop-owned-item.equipped {
    border-color: var(--accent-purple);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1), rgba(92, 107, 192, 0.1));
}

.shop-owned-item:hover {
    border-color: rgba(124, 77, 255, 0.3);
}

.shop-sell-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-family: inherit;
    min-width: 90px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.shop-sell-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Диалог подтверждения */
.shop-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.2s ease-out;
}

.shop-confirm-box {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: modalSlideIn 0.3s ease-out;
}

.shop-confirm-box p {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.5;
}

.shop-confirm-actions {
    display: flex;
    gap: 10px;
}

.shop-confirm-yes {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.25);
}

.shop-confirm-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.shop-confirm-actions .shop-confirm-yes {
    flex: 1;
    width: auto;
}

.shop-confirm-no {
    flex: 1;
    border: none;
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--glass-bg);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.shop-confirm-no:hover {
    background: var(--glass-border);
}

/* ===== Top-up (coin purchase) ===== */
.topup-btn {
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: white;
    border: none;
    font-weight: 700;
}

.topup-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFD54F, #FFA726);
    color: white;
}

.topup-panel .shop-panel-body {
    padding: 0 24px 24px;
}

.topup-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 16px;
}

.topup-hero-img {
    width: 120px;
    height: auto;
    margin-bottom: 8px;
}

.topup-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topup-hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.topup-packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.topup-card {
    position: relative;
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topup-card:hover {
    border-color: #FFD54F;
    background: linear-gradient(165deg, #fffde7, #fff8e1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.18);
}

.topup-card:active {
    transform: translateY(0);
}

.topup-discount {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #FF5722, #F44336);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
}

.topup-coins {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.topup-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F57F17;
}

.topup-old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-weight: 400;
    margin-right: 4px;
}

/* ===== Universal Confirm Dialog ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease-out;
}

.confirm-box {
    background: white;
    border-radius: 20px;
    padding: 28px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease-out;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon.danger {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.confirm-icon.warning {
    background: rgba(241, 196, 15, 0.15);
    color: #f39c12;
}

.confirm-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-btn-cancel {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.confirm-btn-cancel:hover {
    background: var(--glass-border);
}

.confirm-btn-ok {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
}

.confirm-btn-ok:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.confirm-btn-ok.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* ===== Force Login Overlay ===== */
.force-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease-out;
}

.force-login-box {
    background: white;
    border-radius: 20px;
    padding: 28px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease-out;
}

.force-login-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 77, 255, 0.1);
}

.force-login-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.force-login-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.force-login-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 8px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.force-login-input:focus {
    border-color: var(--accent-purple);
}

.force-login-error {
    color: #e74c3c;
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 16px;
}

.force-login-actions {
    display: flex;
    gap: 12px;
}

/* ===== Бургер-меню ===== */
.burger-wrapper {
    position: relative;
    margin-left: auto;
}

.burger-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 200;
    animation: contextMenuIn 0.15s ease-out;
}

.burger-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.burger-menu-item:hover {
    background: var(--glass-border);
}

.burger-menu-item.burger-menu-danger {
    color: #e53935;
}

.burger-menu-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 8px;
}

/* ===== Контекстное меню персонажа ===== */
.character-context-menu {
    position: fixed;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: contextMenuIn 0.15s ease-out;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 4px;
}

.context-menu-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--glass-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.context-menu-avatar:hover {
    transform: scale(1.1);
}

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

.context-menu-avatar .avatar-letter {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.context-menu-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.context-menu-item:hover {
    background: var(--glass-border);
}

.context-menu-admin {
    color: #FF9800;
}

.context-menu-danger {
    color: #E53935;
}

.context-menu-danger:hover {
    background: rgba(229, 57, 53, 0.1);
}

/* ===== Avatar viewer ===== */
.avatar-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.2s ease-out;
    cursor: pointer;
}

.avatar-viewer-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.avatar-viewer-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.avatar-viewer-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.avatar-viewer-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ===== Profile avatar section ===== */
.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-preview {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    background: var(--glass-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}

.profile-avatar-preview:hover {
    transform: scale(1.05);
}

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

.profile-avatar-placeholder {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.profile-avatar-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.avatar-context-menu {
    position: fixed;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: contextMenuIn 0.15s ease-out;
}

/* ===== Профиль оверлей ===== */
.profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.2s ease-out;
}

.profile-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0;
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: modalSlideIn 0.3s ease-out;
}

.profile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    font-weight: 800;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    background: #ffffff;
    border-radius: 8px 8px 0 0;
}

@media (min-width: 769px) {
    .profile-overlay {
        background: none;
        backdrop-filter: none;
        pointer-events: none;
    }

    .profile-overlay > .profile-panel {
        pointer-events: auto;
        position: absolute;
    }

    .profile-panel-header {
        cursor: grab;
        user-select: none;
    }

    .profile-panel-header.dragging {
        cursor: grabbing;
    }
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.profile-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.profile-tab:hover {
    color: var(--text-primary);
    background: rgba(124, 77, 255, 0.05);
}

.profile-tab.active {
    color: var(--accent-purple);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-purple);
}

.profile-tab-content {
    display: none;
}

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

.security-form {
    text-align: left;
}

.security-form .auth-input {
    width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.profile-panel-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.profile-section {
    margin-bottom: 20px;
}

.profile-section:last-of-type {
    margin-bottom: 0;
}

.profile-section-title {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.profile-section .profile-field:last-child {
    margin-bottom: 0;
}

/* Character tab layout */
.profile-character-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.profile-robot-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    perspective: 400px;
}

.profile-robot-container .preview-robot {
    transform: scale(1.1);
}

.profile-settings {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-field {
    text-align: left;
    margin-bottom: 8px;
}

.profile-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-input {
    width: 100%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.profile-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.profile-input::placeholder {
    color: var(--text-secondary);
}

/* Profile rating */
.profile-rating-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.profile-rating-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-rating-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-rating-rank {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-left: auto;
}

.profile-rating-bar {
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.profile-rating-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.profile-rating-next {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: right;
}

/* Profile checkbox */
.profile-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
    padding: 6px 0;
}

.profile-checkbox-label input[type="checkbox"] {
    display: none;
}

.profile-checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    background: var(--glass-bg);
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.profile-checkbox-label input[type="checkbox"]:checked + .profile-checkbox-mark {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.profile-checkbox-label input[type="checkbox"]:checked + .profile-checkbox-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Color slider */
.color-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(to right,
    #FF6B6B 0%,
    #FF9F43 14%,
    #FECA57 28%,
    #48C774 42%,
    #00BCD4 56%,
    #7C4DFF 70%,
    #E91E63 84%,
    #FF6B6B 100%
    );
    cursor: pointer;
    border: 2px solid var(--glass-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent-purple);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.color-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent-purple);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab;
}

.color-slider-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid var(--glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* Security form */
.security-form {
    text-align: left;
}

.security-form .profile-label {
    margin-bottom: 16px;
}

.security-form .profile-input {
    margin-bottom: 12px;
}

.security-message {
    font-size: 0.85rem;
    min-height: 20px;
    margin-top: 4px;
}

.security-message:not(:empty) {
    color: #E53935;
}

.security-message.security-success:not(:empty) {
    color: #4CAF50;
}

.profile-panel-body .preview-robot {
    margin-bottom: 0;
}

.profile-panel-body .color-target-toggle {
    margin-bottom: 16px;
}

.profile-panel-body .color-picker {
    margin-bottom: 20px;
}

/* Referral section */
.referral-section {
    text-align: left;
}

.referral-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.referral-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.referral-link-input {
    flex: 1;
    font-size: 0.82rem !important;
    user-select: all;
}

.referral-copy-btn {
    background: #7C4DFF;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.referral-copy-btn:hover {
    background: #6930c3;
}

.referral-stats {
    display: flex;
    gap: 12px;
    justify-content: space-around;
}

.referral-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.referral-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #7C4DFF;
}

.referral-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Referral banner on register page */
.referral-banner {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(124, 77, 255, 0.05));
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #7C4DFF;
    font-weight: 600;
    text-align: center;
}

/* Profile responsive */
@media (max-width: 500px) {
    .profile-character-row {
        flex-direction: column;
        align-items: center;
    }

    .profile-robot-container {
        justify-content: center;
    }

    .profile-settings {
        width: 100%;
    }
}

.profile-save-btn {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.25);
}

.profile-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

/* ===== Модальное окно уведомлений ===== */
/* ===== Help modal ===== */
.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    animation: fadeIn 0.2s ease-out;
}

.help-panel {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12);
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    font-weight: 800;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--glass-border);
}

@media (min-width: 769px) {
    .help-overlay {
        background: none;
        backdrop-filter: none;
        pointer-events: none;
    }

    .help-overlay > .help-panel {
        pointer-events: auto;
        position: absolute;
    }

    .help-header {
        cursor: grab;
        user-select: none;
    }

    .help-header.dragging {
        cursor: grabbing;
    }
}

.help-body {
    padding: 20px;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.help-section {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.2s;
}

.help-section:hover {
    border-color: var(--accent-purple);
}

.help-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 77, 255, 0.1);
    border-radius: 10px;
}

.help-text {
    flex: 1;
}

.help-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.help-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.help-body a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}

.help-body a:hover {
    text-decoration: underline;
}

/* Tutorial Modal */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tutorial-panel {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.tutorial-header {
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-purple);
    border-bottom: 1px solid var(--border-color);
}

.tutorial-body {
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tutorial-body p {
    margin: 0 0 8px;
}

.tutorial-body p:last-child {
    margin-bottom: 0;
}

.tutorial-body strong {
    color: var(--text-primary);
}

.tutorial-footer {
    padding: 12px 20px 16px;
    text-align: center;
}

.tutorial-btn {
    background: var(--accent-purple);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

.tutorial-btn:hover {
    background: #6a3de8;
}

.tutorial-btn:active {
    transform: scale(0.98);
}

/* System Message Modal */
.system-msg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.system-msg-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.system-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a1a2e;
}

.system-msg-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.system-msg-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f5f7fa;
    color: #1a1a2e;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}

.system-msg-body textarea:focus {
    outline: none;
    border-color: #7C4DFF;
}

.system-msg-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.system-msg-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    transition: border-color 0.2s;
}

.system-msg-radio:hover {
    border-color: #7C4DFF;
}

.system-msg-radio input[type="radio"] {
    accent-color: #7C4DFF;
    width: 16px;
    height: 16px;
}

.system-msg-radio span {
    color: #1a1a2e;
    font-size: 0.9rem;
}

.system-msg-send {
    padding: 12px;
    background: #7C4DFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.system-msg-send:hover {
    background: #6930c3;
}

.notification-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.notification-box {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 32px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: modalSlideIn 0.3s ease-out;
}

.notification-icon {
    width: 56px;
    height: 64px;
    margin: 0 auto 20px;
    animation: iconBounce 0.5s ease-out;
}

.notification-icon svg,
.notification-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.notification-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.notification-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

.notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.notification-btn:active {
    transform: translateY(0);
}

/* Hide mobile-only menu items on desktop */
.burger-mobile-only {
    display: none !important;
}

/* Hide mobile burger on desktop */
.mobile-burger-wrapper {
    display: none;
    position: relative;
}

.mobile-burger-menu {
    position: fixed;
    bottom: 70px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 10000;
}

.mobile-burger-menu .burger-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mobile-burger-menu .burger-menu-item:hover {
    background: #f5f5f5;
}

.mobile-burger-menu .burger-menu-item.burger-menu-danger {
    color: #e53935;
}

.mobile-burger-menu .burger-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 8px;
}

/* Mobile participants overlay */
.participants-mobile-panel {
    max-height: 70vh;
}

.participants-mobile-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

.participants-mobile-list .participant-item {
    padding: 10px 12px;
}

/* ===== Адаптивность ===== */
@media (max-width: 991px) {
    .app-container {
        gap: 0;
        padding: 40px 0 0 0;
    }

    .send-btn,
    .shop-btn {
        height: 32px;
        padding: 0 10px;
    }

    .send-btn svg,
    .shop-btn svg {
        width: 14px;
        height: 14px;
    }

    .send-btn span,
    .shop-btn span {
        display: none;
    }

    .top-section {
        flex-direction: column;
        padding: 0;
    }

    .chat-panel {
        border-radius: 0;
    }

    /* Hide participants panel completely on mobile */
    .participants-panel {
        display: none !important;
    }

    /* Hide shop button on mobile (available in burger menu) */
    .shop-btn:not(.mobile-burger-btn) {
        display: none !important;
    }

    /* Show mobile burger */
    .mobile-burger-wrapper {
        display: block !important;
    }

    .mobile-burger-btn {
        height: 32px !important;
        padding: 0 10px !important;
    }

    .mobile-burger-menu {
        min-width: 200px;
    }

    /* Hide room select button on mobile */
    .room-select-btn {
        display: none !important;
    }

    /* Show mobile-only menu items */
    .burger-mobile-only {
        display: flex !important;
    }

    .room-section {
        height: 180px;
    }

    .character-ball {
        width: 55px;
        height: 55px;
    }

    .characters-container {
        width: 0;
    }


    .robot-eyes.love .robot-eye::before {
        font-size: 10px;
        top: -5px;
        left: -4px;
    }

    /* Shop mobile optimization */
    .shop-panel {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .shop-main {
        flex-direction: column;
    }

    .shop-sidebar {
        flex-direction: row;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        gap: 4px;
        flex-shrink: 0;
    }

    .shop-sidebar-btn {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .shop-catalog {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .compare-body {
        flex-direction: column;
        gap: 60px;
        padding: 20px 16px;
        margin: auto;
    }

    .compare-card {
        width: 100%;
    }

    .compare-card-rating {
        font-size: 1.5rem;
    }

    #compare-overlay > .shop-panel {
        max-width: 100% !important;
    }

    .shop-item {
        padding: 10px;
    }

    .shop-item-preview {
        width: 50px;
        height: 50px;
    }

    .shop-item-name {
        font-size: 0.75rem;
    }

    .shop-item-price {
        font-size: 0.7rem;
    }

    .shop-preview-area {
        display: none;
    }

    .shop-body {
        padding: 10px;
    }

    .shop-header {
        padding: 12px 16px;
    }

    #shop-overlay .shop-header {
        justify-content: flex-end;
    }

    #shop-overlay .shop-header > span:first-child {
        display: none;
    }

    .shop-coins {
        margin-left: 0;
    }

    .message-content {
        display: block;
    }
}

/* ===== Cookie Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #1a1a2e;
    color: #ccc;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-banner a {
    color: #7C4DFF;
    text-decoration: underline;
    cursor: pointer;
}

.cookie-banner a:hover {
    color: #a07dff;
}

.cookie-accept-btn {
    background: #7C4DFF;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cookie-accept-btn:hover {
    background: #651FFF;
}

/* ===== Cookie Policy Modal ===== */
.cookie-policy-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.cookie-policy-modal {
    background: #fff;
    border-radius: 14px;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.cookie-policy-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 1;
}

.cookie-policy-close:hover {
    color: #333;
}

.cookie-policy-content {
    padding: 32px 36px;
    overflow-y: auto;
    color: #333;
    font-size: 0.88rem;
    line-height: 1.65;
}

.cookie-policy-content h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: #1a1a2e;
}

.cookie-policy-date {
    color: #999;
    margin-bottom: 20px;
}

.cookie-policy-content h3 {
    font-size: 1.05rem;
    margin-top: 22px;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.cookie-policy-content h4 {
    font-size: 0.95rem;
    margin-top: 14px;
    margin-bottom: 6px;
    color: #444;
}

.cookie-policy-content p {
    margin-bottom: 10px;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px;
    font-size: 0.82rem;
}

.cookie-table th,
.cookie-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 10px;
    text-align: left;
}

.cookie-table th {
    background: #f5f5f5;
    font-weight: 700;
    color: #444;
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
        text-align: center;
    }

    .cookie-policy-content {
        padding: 24px 20px;
    }
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 40%, #e8ecf4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.1);
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.5;
}

.auth-info span {
    color: var(--accent-purple);
    font-weight: 600;
}

.auth-input-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 8px;
    font-weight: 700;
}

.auth-error,
.auth-success {
    font-size: 0.85rem;
    text-align: center;
    display: none;
    margin-top: 8px;
}

.auth-error:not(:empty),
.auth-success:not(:empty) {
    display: block;
}

.auth-error {
    color: #f44336;
}

.auth-success {
    color: #4CAF50;
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.25);
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.35);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-link {
    display: block;
    text-align: center;
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 12px;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.8;
}

.auth-link-btn {
    background: none;
    border: none;
    color: var(--accent-purple);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin: 14px auto 0;
    display: block;
    transition: opacity 0.2s;
}

.auth-link-btn:hover {
    opacity: 0.8;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-alt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-alt-btn {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 14px;
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: transparent;
}

.auth-alt-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.05);
}

.auth-guest-btn {
    padding: 12px;
    border-radius: 14px;
    border: 2px dashed var(--glass-border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-guest-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}


@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .auth-logo h1 {
        font-size: 1.75rem;
    }

    .logo-robot {
        width: 70px;
        height: 70px;
    }
}

/* Gender selection in registration form */
.gender-select {
    margin: 8px 0 4px;
}

.gender-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: center;
}

.gender-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gender-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 24px;
    border: 2px solid var(--glass-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--glass-bg);
    flex: 1;
    max-width: 140px;
}

.gender-option:hover {
    border-color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.05);
}

.gender-option input[type="radio"] {
    display: none;
}

.gender-option input[type="radio"]:checked + .gender-icon + .gender-text {
    font-weight: 700;
}

.gender-option:has(input[type="radio"]:checked) {
    border-color: var(--accent-purple);
    background: rgba(124, 77, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.gender-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.gender-icon.gender-male {
    color: #4a90d9;
    background: rgba(74, 144, 217, 0.15);
}

.gender-icon.gender-female {
    color: #e76f9a;
    background: rgba(231, 111, 154, 0.15);
}

.gender-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Gender icons in participants list */
.gender-icon-list {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-right: 2px;
}

.gender-male-icon {
    color: #4a90d9;
}

.gender-female-icon {
    color: #e76f9a;
}

/* ===== Message images ===== */
.message-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: opacity 0.2s;
    border: 1px solid #7157e957;
    border-radius: 4px;
}

.message-image:hover {
    opacity: 0.85;
}

/* ===== Image lightbox ===== */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.2s ease-out;
}

.image-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@media (max-width: 991px) {
    .image-upload-btn {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        position: absolute;
        right: 20px;
        top: -45px;
    }

    .image-upload-btn svg {
        width: 14px;
        height: 14px;
    }

    .message-image {
        max-width: 150px;
        max-height: 150px;
    }

    #message-input {
        border-radius: 6px;
    }
}