@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

/* ═══════════════════════════════════════════
   ПЕРЕМЕННЫЕ
═══════════════════════════════════════════ */
:root {
    --bg:          #080810;
    --bg2:         #0d0d18;
    --card:        #111120;
    --card2:       #16162a;
    --input:       #1a1a2e;
    --accent:      #00f2ff;
    --accent2:     #7c3aed;
    --accent-dim:  rgba(0, 242, 255, 0.08);
    --accent-glow: rgba(0, 242, 255, 0.25);
    --text:        #e2e2f0;
    --text2:       #a0a0c0;
    --muted:       #5a5a7a;
    --border:      rgba(255,255,255,0.07);
    --border2:     rgba(255,255,255,0.12);
    --danger:      #ff4b6e;
    --danger-dim:  rgba(255, 75, 110, 0.12);
    --success:     #00ff88;
    --gold:        #f5c518;
    --radius:      14px;
    --radius-lg:   20px;
    --shadow:      0 8px 32px rgba(0,0,0,0.5);
    --shadow-accent: 0 0 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════
   БАЗОВЫЕ СТИЛИ
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background 0.6s ease;
    -webkit-font-smoothing: antialiased;
}

/* Фоновая сетка */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(0,242,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,242,255,0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════
   СКРОЛЛБАР
═══════════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { opacity: 1; }

/* ═══════════════════════════════════════════
   ИКОНКИ
═══════════════════════════════════════════ */
.icon       { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; transition: 0.2s; vertical-align: middle; }
.icon-lg    { width: 24px; height: 24px; }
.icon-xl    { width: 36px; height: 36px; }
.badge-icon { width: 14px; height: 14px; fill: var(--accent); filter: drop-shadow(0 0 3px var(--accent-dim)); cursor: pointer; }

/* ═══════════════════════════════════════════
   КНОПКИ
═══════════════════════════════════════════ */
.btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px var(--accent-glow);
    flex-shrink: 0;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
    pointer-events: none;
}
.btn:hover   { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 25px var(--accent-glow); filter: brightness(1.1); }
.btn:active  { transform: translateY(0) scale(0.98); }

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
    padding: 9px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn-danger {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
    padding: 9px 18px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
    text-transform: uppercase;
}
.btn-danger:hover { background: var(--danger); color: #fff; box-shadow: 0 0 20px var(--danger-dim); }

/* ═══════════════════════════════════════════
   ПОЛЯ ВВОДА
═══════════════════════════════════════════ */
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    background: var(--input);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    outline: none;
    transition: 0.2s;
    font-size: 14px;
    font-family: inherit;
    resize: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════
   ЭКРАН ЛОГИНА
═══════════════════════════════════════════ */
#auth-screen {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(0,242,255,0.04) 0%, var(--bg) 70%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    width: 420px;
    text-align: center;
    padding: 48px 40px;
    position: relative;
    animation: loginIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 0 15px var(--accent), 0 0 40px rgba(0,242,255,0.3);
    margin-bottom: 4px;
    position: relative;
}
.login-logo::after {
    content: attr(data-text);
    position: absolute; inset: 0;
    color: var(--accent);
    animation: glitch 4s infinite;
    clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
    opacity: 0.4;
}
@keyframes glitch {
    0%, 90%, 100% { transform: none; opacity: 0; }
    92%  { transform: translateX(-3px); opacity: 0.4; }
    94%  { transform: translateX(3px); opacity: 0.4; }
    96%  { transform: translateX(-1px); opacity: 0.4; }
}

.login-ver {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 6px;
    font-weight: 700;
    margin-bottom: 36px;
    opacity: 0.6;
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════
   КАРТОЧКИ
═══════════════════════════════════════════ */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 22px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.card:hover::before { opacity: 1; }
.card-glow { box-shadow: var(--shadow-accent); border-color: rgba(0,242,255,0.2); }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
#app-screen {
    display: none;
    height: 100vh;
    flex-direction: column;
    position: relative;
    z-index: 5;
}

/* HEADER */
header {
    height: 64px;
    background: rgba(8,8,16,0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    z-index: 200;
    flex-shrink: 0;
    position: relative;
}
header::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.3;
}

.header-wrap {
    width: 1240px;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.header-logo {
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    user-select: none;
}
.header-logo-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

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

.header-user {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-pill {
    background: var(--accent-dim);
    border: 1px solid rgba(0,242,255,0.2);
    color: var(--accent);
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: 0.2s;
}
.balance-pill:hover { box-shadow: 0 0 12px var(--accent-glow); }

/* Кнопка уведомлений */
.notif-btn {
    position: relative;
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}
.notif-btn:hover { border-color: var(--accent); color: var(--accent); }
.notif-dot {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg);
    padding: 0 3px;
    animation: notif-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes notif-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Дропдаун уведомлений */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), 0 0 30px rgba(0,0,0,0.5);
    z-index: 9999;
    overflow: hidden;
    animation: dropIn 0.2s ease;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--accent-dim); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-empty { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════════
   НАВИГАЦИЯ
═══════════════════════════════════════════ */
.main-grid {
    width: 1240px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 24px;
    flex: 1;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    overflow: hidden;
    min-height: 0;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding-right: 4px;
}
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 6px 14px;
    margin-top: 8px;
}
.nav-item {
    padding: 11px 14px;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    user-select: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item .icon { width: 17px; height: 17px; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
}

.view-container {
    overflow-y: auto;
    padding-right: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ═══════════════════════════════════════════
   ПОСТЫ В ЛЕНТЕ
═══════════════════════════════════════════ */
.post-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    flex-shrink: 0;
    transition: border-color 0.25s, box-shadow 0.25s;
    animation: fadeUp 0.3s ease both;
}
.post-card:hover { border-color: var(--border2); }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.post-header { display: flex; align-items: center; gap: 12px; }
.post-ava    {
    width: 44px; height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}
.post-ava:hover { border-color: var(--accent); }
.post-name   { font-weight: 800; font-size: 15px; cursor: pointer; }
.post-name:hover { color: var(--accent); }
.post-time   { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.post-body   { margin-top: 14px; font-size: 14px; line-height: 1.65; }
.post-img    { width: 100%; border-radius: var(--radius); margin-top: 12px; max-height: 480px; object-fit: cover; background: var(--input); display: block; }
.post-actions {
    display: flex;
    gap: 4px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.post-action-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.15s;
    font-family: inherit;
}
.post-action-btn:hover  { background: var(--accent-dim); color: var(--accent); }
.post-action-btn.liked  { color: var(--danger); }
.post-action-btn.liked:hover { background: var(--danger-dim); }

/* ═══════════════════════════════════════════
   COMPOSE BOX
═══════════════════════════════════════════ */
.compose-box {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
}
.compose-box textarea {
    background: var(--bg2);
    border-color: var(--border);
    font-size: 14px;
    min-height: 80px;
}
.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 10px;
}
.attach-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text2);
    background: var(--input);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
    font-family: inherit;
}
.attach-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════
   КОММЕНТАРИИ
═══════════════════════════════════════════ */
.comments-box {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.comment-ava  { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
.comment-bubble {
    background: var(--input);
    border-radius: 0 10px 10px 10px;
    padding: 8px 12px;
    flex: 1;
    word-break: break-word;
}
.comment-input-wrap { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ═══════════════════════════════════════════
   ПРОФИЛЬ
═══════════════════════════════════════════ */
.profile-container {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
}
.profile-banner {
    height: 200px;
    background: linear-gradient(135deg, #0d0d18 0%, #1a0a2e 50%, #0a1a2e 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}
.profile-banner::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--card), transparent);
}
.profile-body { display: flex; gap: 24px; padding: 0 28px 28px; }
.profile-avatar {
    width: 130px; height: 130px;
    border-radius: 24px;
    border: 5px solid var(--card);
    background: var(--input);
    object-fit: cover;
    margin-top: -50px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.profile-info { padding-top: 10px; flex: 1; min-width: 0; }
.profile-name { font-size: 24px; font-weight: 900; margin-bottom: 4px; }
.profile-status { color: var(--text2); font-size: 14px; margin-bottom: 14px; }
.profile-stats { display: flex; gap: 20px; margin-bottom: 16px; }
.profile-stat { text-align: center; }
.profile-stat-num { font-weight: 800; font-size: 18px; color: var(--accent); display: block; }
.profile-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   ОНЛАЙН СТАТУС
═══════════════════════════════════════════ */
.avatar-wrap { position: relative; flex-shrink: 0; }
.online-dot {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--card);
    box-shadow: 0 0 6px var(--success);
}
.online-dot.offline { background: var(--muted); box-shadow: none; }

/* ═══════════════════════════════════════════
   ЧАТ
═══════════════════════════════════════════ */
.im-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--card);
}
.im-sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.im-sidebar-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.im-list { overflow-y: auto; flex: 1; }
.im-user {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    position: relative;
}
.im-user:hover  { background: rgba(255,255,255,0.04); }
.im-user.active { background: var(--accent-dim); }
.im-user.active::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.im-user-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.im-chat    { display: flex; flex-direction: column; height: 100%; position: relative; min-height: 0; }
.im-chathead {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
}
.im-history { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.im-footer  {
    padding: 12px 16px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

/* Пузыри сообщений */
.bubble-wrap { display: flex; flex-direction: column; max-width: 75%; }
.bubble-wrap.out { align-self: flex-end; align-items: flex-end; }
.bubble-wrap.in  { align-self: flex-start; align-items: flex-start; }
.bubble-name { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

.bubble {
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.bubble.in  {
    background: var(--input);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}
.bubble.out {
    background: linear-gradient(135deg, var(--accent) 0%, #00b8cc 100%);
    color: #000;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}
.bubble-time { font-size: 10px; color: var(--muted); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }
.bubble audio { height: 36px; border-radius: 18px; margin-top: 6px; display: block; width: 100%; }

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--input);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    border: 1px solid var(--border);
}
.typing-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); background: var(--muted); }
    30%            { transform: translateY(-6px); background: var(--accent); }
}

/* Кнопка микрофона */
.record-btn {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text2);
    cursor: pointer;
    padding: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.record-btn:hover { border-color: var(--accent); color: var(--accent); }
.record-btn.recording {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,75,110,0.5); }
    50%       { box-shadow: 0 0 0 10px transparent; }
}

/* ═══════════════════════════════════════════
   MARKDOWN
═══════════════════════════════════════════ */
.markdown                  { word-wrap: break-word; overflow-wrap: break-word; }
.markdown p                { margin-bottom: 8px; }
.markdown p:last-child     { margin-bottom: 0; }
.markdown pre              { background: rgba(0,0,0,0.5); padding: 12px; border-radius: 8px; overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; margin: 6px 0; border: 1px solid var(--border); }
.markdown code             { background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); }
.markdown strong           { color: #fff; }
.bubble.out .markdown pre,
.bubble.out .markdown code { background: rgba(0,0,0,0.25); color: #001a1a; }

/* ═══════════════════════════════════════════
   МАГАЗИН
═══════════════════════════════════════════ */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shop-item {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    text-align: center;
    transition: 0.25s;
    cursor: default;
}
.shop-item:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-accent); }
.shop-preview { font-size: 28px; font-weight: 900; margin-bottom: 10px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.shop-name  { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.shop-price { color: var(--accent); font-weight: 900; font-family: 'JetBrains Mono', monospace; font-size: 15px; margin-bottom: 14px; }

/* ═══════════════════════════════════════════
   ДОСТИЖЕНИЯ
═══════════════════════════════════════════ */
.achieve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.achieve-card {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 16px;
    text-align: center;
    transition: 0.25s;
    position: relative;
    overflow: hidden;
}
.achieve-card.earned {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.achieve-card.earned::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}
.achieve-icon  { font-size: 40px; margin-bottom: 10px; }
.achieve-name  { font-weight: 800; font-size: 14px; margin-bottom: 5px; }
.achieve-desc  { font-size: 11px; color: var(--muted); line-height: 1.4; }
.achieve-badge { font-size: 11px; color: var(--success); font-weight: 700; margin-top: 8px; }

/* ═══════════════════════════════════════════
   ЛЮДИ (НОВАЯ ВКЛАДКА)
═══════════════════════════════════════════ */
.people-search { display: flex; gap: 10px; margin-bottom: 18px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.people-card {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    transition: 0.25s;
    cursor: default;
}
.people-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.people-ava {
    width: 70px; height: 70px;
    border-radius: 18px;
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
    border: 3px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}
.people-ava:hover { border-color: var(--accent); }
.people-name   { font-weight: 800; font-size: 14px; margin-bottom: 4px; cursor: pointer; }
.people-name:hover { color: var(--accent); }
.people-status { font-size: 12px; color: var(--muted); margin-bottom: 12px; min-height: 18px; }
.people-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.online-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; color: var(--success);
    margin-bottom: 8px;
}
.online-label-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 5px var(--success); }

/* ═══════════════════════════════════════════
   PIXEL CANVAS
═══════════════════════════════════════════ */
.canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.canvas-grid {
    display: grid;
    grid-template-columns: repeat(32, 14px);
    gap: 0;
    border: 2px solid var(--accent);
    padding: 0;
    width: max-content;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(0,242,255,0.12);
    overflow: hidden;
}
.canvas-px { width: 14px; height: 14px; cursor: crosshair; transition: filter 0.05s; background: var(--input); }
.canvas-px:hover { filter: brightness(1.5); z-index: 1; position: relative; outline: 1px solid rgba(255,255,255,0.2); }

.color-picker  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.color-swatch  { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: 0.2s; }
.color-swatch.active { border-color: #fff; transform: scale(1.25); box-shadow: 0 0 8px rgba(255,255,255,0.4); }
.eraser-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--input); border: 2px solid var(--border2);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text2); font-size: 16px; transition: 0.2s;
}
.eraser-btn:hover, .eraser-btn.active { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════
   ИГРЫ
═══════════════════════════════════════════ */
.games-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; justify-content: center; }
.game-btn  {
    background: var(--card2);
    color: var(--text2);
    border: 1px solid var(--border);
    padding: 10px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.2s;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.game-btn:hover, .game-btn.active { background: var(--accent); color: #000; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 5px 20px var(--accent-glow); }

/* Слот-машина */
.slot-machine {
    background: linear-gradient(180deg, #10102a 0%, #080818 100%);
    border: 3px solid var(--accent);
    border-radius: 24px;
    padding: 36px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 0 60px rgba(0,242,255,0.08), inset 0 0 40px rgba(0,0,0,0.8);
    margin: 0 auto;
}
.slot-title  { color: var(--accent); font-size: 26px; font-weight: 900; text-shadow: 0 0 12px var(--accent-glow); margin-bottom: 10px; letter-spacing: 2px; }
.slot-balance {
    background: #000;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #333;
    margin-bottom: 10px;
    color: #0f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
}
.slot-window {
    background: #fff;
    border: 8px solid #1a1a1a;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.7);
    padding: 14px 0;
    margin: 22px 0;
}
.slot-window::after {
    content: '';
    position: absolute; top: 50%; left: 0; width: 100%; height: 4px;
    background: rgba(255,0,0,0.5);
    z-index: 5; pointer-events: none;
    box-shadow: 0 0 8px red;
}
.slot-reel {
    width: 110px; height: 130px;
    display: flex; align-items: center; justify-content: center;
    border-right: 4px solid #ccc;
    background: linear-gradient(180deg, #aaa 0%, #fff 20%, #fff 80%, #aaa 100%);
}
.slot-reel:last-child { border-right: none; }
.slot-icon-svg   { width: 65px; height: 65px; fill: #111; transition: 0.1s; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.4)); }
.spin-btn-arcade {
    background: linear-gradient(180deg, #ff4b4b 0%, #880000 100%);
    border: 2px solid #ffaaaa;
    color: white;
    font-size: 20px;
    font-weight: 900;
    padding: 14px 36px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 0 #550000, 0 10px 20px rgba(0,0,0,0.5);
    transition: 0.1s;
    font-family: 'JetBrains Mono', monospace;
    width: 100%;
    margin-top: 8px;
    letter-spacing: 1px;
}
.spin-btn-arcade:active  { transform: translateY(6px); box-shadow: none; }
.spin-btn-arcade:disabled { filter: grayscale(0.8) brightness(0.6); cursor: not-allowed; transform: translateY(6px); box-shadow: none; }
.slot-blur .slot-icon-svg { animation: slotSpin 0.1s infinite linear; }
@keyframes slotSpin {
    0%   { transform: translateY(-55px); filter: blur(5px); opacity: 0.5; }
    100% { transform: translateY(55px);  filter: blur(5px); opacity: 0.5; }
}

/* Тетрис */
canvas#tetris {
    background: #04040e;
    border: 2px solid var(--accent);
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0,242,255,0.08);
    max-width: 100%;
}

/* Сапёр */
.ms-grid { display: grid; grid-template-columns: repeat(10, 32px); gap: 2px; margin: 0 auto; width: fit-content; }
.ms-cell {
    width: 32px; height: 32px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; cursor: pointer; user-select: none; font-size: 13px;
    transition: 0.1s;
}
.ms-cell:hover           { background: var(--card2); border-color: var(--accent); }
.ms-cell.revealed        { background: var(--card); border-color: var(--border); cursor: default; }
.ms-cell.mine            { background: var(--danger); border-color: var(--danger); }
.ms-cell[data-num="1"]   { color: #00f2ff; }
.ms-cell[data-num="2"]   { color: #00ff88; }
.ms-cell[data-num="3"]   { color: #ff8800; }
.ms-cell[data-num="4"]   { color: #ff4b4b; }

/* ═══════════════════════════════════════════
   G-TOK
═══════════════════════════════════════════ */
.gtok-container  { flex: 1; overflow-y: scroll; scroll-snap-type: y mandatory; background: #000; border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; padding-top: 16px; }
.gtok-video-wrap { width: 100%; max-width: 340px; height: 600px; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 24px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.9); background: #111; flex-shrink: 0; border: 1px solid #1a1a1a; }
.gtok-iframe { width: 100%; height: 100%; border: none; }

/* ═══════════════════════════════════════════
   НАСТРОЙКИ
═══════════════════════════════════════════ */
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; font-weight: 600; }
.settings-sublabel { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Toggle switch */
.toggle {
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    position: absolute; inset: 0;
    background: var(--input);
    border: 1.5px solid var(--border2);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* Checkbox */
.custom-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; margin-bottom: 12px; user-select: none; font-weight: 500; }
.custom-check input { display: none; }
.checkmark {
    width: 20px; height: 20px;
    background: var(--input); border: 1.5px solid var(--border2);
    border-radius: 5px; position: relative; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0;
}
.custom-check:hover .checkmark          { border-color: var(--accent); }
.custom-check input:checked + .checkmark { background: var(--accent); border-color: var(--accent); }
.checkmark::after { content: ''; position: absolute; display: none; width: 5px; height: 10px; border: solid #000; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); margin-top: -2px; }
.custom-check input:checked + .checkmark::after { display: block; }

/* ═══════════════════════════════════════════
   TOAST УВЕДОМЛЕНИЯ
═══════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: var(--card2);
    border: 1px solid var(--border2);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow);
    min-width: 260px;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
    animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
.toast.success  { border-left-color: var(--success); }
.toast.danger   { border-left-color: var(--danger); }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(30px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(40px) scale(0.9); } }

/* ═══════════════════════════════════════════
   FRUTIGER AERO ТЕМА
═══════════════════════════════════════════ */
.aero-bg-layer { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 3s ease; z-index: -10; pointer-events: none; }
body.frutiger .aero-bg-layer.active { opacity: 1; }

body.frutiger {
    font-family: 'Segoe UI', sans-serif;
    --bg:          rgba(200,230,255,0.1);
    --bg2:         rgba(200,230,255,0.15);
    --card:        rgba(255,255,255,0.5);
    --card2:       rgba(255,255,255,0.6);
    --input:       rgba(255,255,255,0.6);
    --border:      rgba(255,255,255,0.8);
    --border2:     rgba(255,255,255,0.9);
    --text:        #002244;
    --text2:       #004488;
    --muted:       #336699;
    --accent:      #0077cc;
    --accent-dim:  rgba(0,119,204,0.2);
    --accent-glow: rgba(0,119,204,0.3);
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}
body.frutiger::before { display: none; }
body.frutiger header {
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(200,230,255,0.7) 100%);
    backdrop-filter: blur(30px) saturate(200%);
    border-bottom: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 20px rgba(0,100,200,0.15);
}
body.frutiger .card, body.frutiger .post-card, body.frutiger .compose-box, body.frutiger .im-wrap, body.frutiger .profile-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(230,245,255,0.6) 50%, rgba(255,255,255,0.7) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 12px 40px rgba(0,50,150,0.12), inset 0 2px 4px rgba(255,255,255,1), inset 0 -1px 6px rgba(0,100,255,0.08);
    border-color: rgba(255,255,255,0.9);
}
body.frutiger .btn {
    background: linear-gradient(180deg, #88ccff 0%, #0088ee 49%, #0055bb 50%, #0077dd 100%);
    border: 1px solid #003388; color: #fff;
    text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.6), 0 4px 12px rgba(0,0,0,0.25);
    border-radius: 20px;
}
body.frutiger .bubble.in  { background: linear-gradient(180deg, #fff 0%, #e8f5ff 100%); border: 1px solid #bde; }
body.frutiger .bubble.out { background: linear-gradient(180deg, #66ccff 0%, #0088ee 100%); color: #fff; border: 1px solid #004488; }
body.frutiger .nav-item.active { background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(180,220,255,0.7) 100%); box-shadow: inset 3px 0 0 #0088ff, 0 2px 8px rgba(0,0,0,0.08), inset 0 1px 3px #fff; border: 1px solid rgba(255,255,255,0.9); color: #004488; }

/* ═══════════════════════════════════════════
   SWEETALERT2 ТЕМА
═══════════════════════════════════════════ */
.swal2-popup.dark-swal {
    background: var(--card2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border2);
    border-radius: 20px !important;
    box-shadow: var(--shadow) !important;
}
.swal2-title       { color: var(--accent) !important; font-weight: 800 !important; }
.swal2-html-container { color: var(--text2) !important; }
.swal2-confirm     { background: var(--accent) !important; color: #000 !important; font-weight: 800 !important; border-radius: var(--radius) !important; text-transform: uppercase; padding: 11px 24px !important; font-size: 13px !important; }
.swal2-cancel      { background: transparent !important; color: var(--danger) !important; border: 2px solid var(--danger) !important; border-radius: var(--radius) !important; font-weight: 700 !important; text-transform: uppercase; }
.swal2-input       { background: var(--input) !important; color: var(--text) !important; border: 1.5px solid var(--border2) !important; border-radius: var(--radius) !important; font-family: inherit !important; }

/* ═══════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО
═══════════════════════════════════════════ */
#modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 9998; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
#modal-box     { width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: dropIn 0.25s ease; }

/* ═══════════════════════════════════════════
   ПУСТЫЕ СОСТОЯНИЯ
═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state-sub  { font-size: 13px; opacity: 0.7; }

/* ═══════════════════════════════════════════
   ПРОЧЕЕ
═══════════════════════════════════════════ */
.text-rainbow {
    background-image: linear-gradient(to right, #ff0080, #ff8c00, #ffe000, #00ff88, #00f2ff, #8000ff, #ff0080);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: rainbow-anim 4s linear infinite;
    background-size: 200% auto; font-weight: 900;
}
@keyframes rainbow-anim { to { background-position: 200% center; } }

.divider { height: 1px; background: var(--border); margin: 8px 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,242,255,0.2); }
.tag.danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255,75,110,0.2); }

/* ═══════════════════════════════════════════
   G-TOK — TikTok стиль
═══════════════════════════════════════════ */
.gtok-wrap {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    border-radius: var(--radius-lg);
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.gtok-wrap::-webkit-scrollbar { display: none; }

.gtok-slide {
    width: 100%;
    max-width: 400px;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gtok-player-box {
    width: 100%;
    height: 100%;
    position: relative;
    background: #111;
    overflow: hidden;
}
/* YouTube iframe fills the box */
.gtok-player-box iframe,
.gtok-player-box > div:first-child {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0; left: 0;
    pointer-events: none; /* touch-through for our controls */
}
/* Allow touch on player itself for play/pause area */
.gtok-slide.gtok-active .gtok-player-box > div:first-child {
    pointer-events: auto;
}

/* Overlays */
.gtok-overlay-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}
.gtok-overlay-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 16px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}
.gtok-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.gtok-ava {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}
.gtok-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Progress bar */
.gtok-progress-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    overflow: hidden;
}
.gtok-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
}
@keyframes gtok-progress { from { width: 0%; } to { width: 100%; } }

/* Side action buttons */
.gtok-side-actions {
    position: absolute;
    right: 12px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 20;
}
.gtok-action-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 52px; height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    transition: 0.2s;
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.15);
}
.gtok-action-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.gtok-action-btn.liked { color: var(--danger); }
.gtok-action-btn.liked svg { fill: var(--danger); }
.gtok-action-btn.muted  { color: var(--muted); }

@keyframes gtok-like-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Toast icon fix */
.toast-icon { flex-shrink: 0; }

/* Canvas continuous draw fix */
.canvas-grid { user-select: none; }

/* Achievements icon size in card */
.achieve-icon svg { width: 48px; height: 48px; }
.achieve-icon .icon-xl { width: 48px; height: 48px; }

/* ═══════════════════════════════════════════
   ГОЛОСОВОЙ ЧАТ
═══════════════════════════════════════════ */
.voice-idle {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.voice-idle svg { width: 64px; height: 64px; opacity: 0.25; }

.voice-room-ui {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.voice-room-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.voice-participants {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.voice-participant {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--card2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: 0.2s;
}
.voice-participant:hover { border-color: var(--border2); }

/* Индикатор говорит */
.voice-speaking-dot {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--muted);
    border: 2px solid var(--card);
    transition: 0.15s;
}
.voice-speaking-dot.speaking {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: speaking-pulse 0.5s ease infinite alternate;
}
@keyframes speaking-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.3); box-shadow: 0 0 14px var(--success); }
}

.voice-controls {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    justify-content: center;
}
.voice-ctrl-btn {
    background: var(--input);
    border: 1.5px solid var(--border2);
    color: var(--text2);
    border-radius: var(--radius);
    padding: 12px 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    transition: 0.2s;
    flex: 1;
    justify-content: center;
}
.voice-ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
.voice-ctrl-btn.danger { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }
.voice-ctrl-btn.danger:hover { background: var(--danger); color: #fff; }

.voice-room-item { justify-content: space-between; }
.voice-room-badge {
    font-size: 11px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}
.voice-room-preview {
    display: flex;
    justify-content: space-between;
    padding: 4px 14px;
    font-size: 11px;
    color: var(--muted);
}

/* ═══════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ
═══════════════════════════════════════════ */

/* Планшет (≤900px) */
@media (max-width: 900px) {
    .main-grid {
        width: 100%;
        grid-template-columns: 60px 1fr;
        gap: 12px;
        padding: 12px;
    }
    .nav-item span,
    .nav-section-label { display: none; }
    .nav-item {
        padding: 12px;
        justify-content: center;
        border-radius: 12px;
    }
    .nav-item .icon { width: 22px; height: 22px; margin: 0; }
    .nav-item.active { box-shadow: none; background: var(--accent-dim); }
    .header-logo span:not(.header-logo-dot) { display: none; }
    .balance-pill span:first-child { display: none; }
    .im-wrap { grid-template-columns: 200px 1fr; }
}

/* Мобильный (≤600px) */
@media (max-width: 600px) {
    html { font-size: 14px; }

    header { height: 56px; }
    .header-wrap { padding: 0 12px; gap: 8px; }
    .header-logo { font-size: 14px; letter-spacing: 1px; }

    /* Навигация снизу как в мобильных приложениях */
    .main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        padding: 0;
        gap: 0;
        margin: 0;
        width: 100%;
    }

    nav {
        order: 2;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
        height: 60px;
        flex-shrink: 0;
        background: rgba(8,8,16,0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 100;
        gap: 0;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .nav-section-label { display: none; }
    .nav-item {
        flex-direction: column;
        gap: 2px;
        padding: 6px 10px;
        border-radius: 8px;
        margin: 0;
        min-width: 48px;
        font-size: 9px;
        color: var(--muted);
        align-items: center;
        justify-content: center;
    }
    .nav-item span { display: block !important; font-size: 9px; }
    .nav-item .icon { width: 20px; height: 20px; }
    .nav-item.active { background: var(--accent-dim); color: var(--accent); box-shadow: none; }

    /* Контент */
    #main-view, #voice-view {
        order: 1;
        padding-bottom: 72px; /* место для нижнего бара */
        height: calc(100vh - 56px - 60px);
        overflow-y: auto;
    }
    #main-view { padding: 10px 10px 72px; }

    .view-container { gap: 10px; padding-right: 0; }

    /* Карточки */
    .card { padding: 14px; border-radius: 12px; }
    .post-card { padding: 14px; border-radius: 12px; }
    .compose-box { padding: 12px; }

    /* Профиль */
    .profile-banner { height: 130px; }
    .profile-body { flex-direction: column; align-items: center; text-align: center; padding: 0 16px 20px; gap: 12px; }
    .profile-avatar { width: 90px; height: 90px; border-radius: 20px; margin-top: -40px; }
    .profile-stats { justify-content: center; }
    .profile-actions { justify-content: center; }

    /* IM чат */
    .im-wrap { grid-template-columns: 1fr; grid-template-rows: 1fr; }
    .im-sidebar {
        position: fixed;
        bottom: 60px; left: 0; right: 0;
        height: auto;
        max-height: 50vh;
        background: var(--bg2);
        border-top: 1px solid var(--border);
        border-radius: 20px 20px 0 0;
        z-index: 90;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    .im-sidebar.open { transform: translateY(0); }
    .im-chat { grid-column: 1; }
    .im-chathead { padding: 10px 14px; }
    .show-contacts-btn {
        display: flex !important;
        align-items: center;
        gap: 8px;
        background: var(--input);
        border: 1.5px solid var(--border2);
        color: var(--text2);
        padding: 8px 14px;
        border-radius: var(--radius);
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        font-family: inherit;
        transition: 0.2s;
    }
    .show-contacts-btn:hover { border-color: var(--accent); color: var(--accent); }

    /* Модальные */
    #modal-box { width: 95%; padding: 18px; }

    /* Люди */
    .people-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Магазин */
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Игры */
    .games-nav { gap: 6px; }
    .game-btn  { padding: 8px 14px; font-size: 12px; }
    .slot-machine { padding: 20px; }
    .slot-reel { width: 80px; }
    .slot-icon-svg { width: 50px; height: 50px; }

    /* G-Tok */
    .gtok-wrap { border-radius: 0; }
    .gtok-slide { max-width: 100%; }

    /* Pixel Canvas */
    .canvas-grid { grid-template-columns: repeat(32, 10px) !important; }
    .canvas-px { width: 10px !important; height: 10px !important; }

    /* Достижения */
    .achieve-grid { grid-template-columns: repeat(2, 1fr); }

    /* Toast */
    #toast-container { bottom: 72px; right: 12px; left: 12px; }
    .toast { min-width: unset; max-width: 100%; }

    /* Header slim */
    .balance-pill { font-size: 12px; padding: 4px 10px; }
    .notif-btn { width: 34px; height: 34px; }
    .btn-danger.logout-btn { display: none; }
}

/* Очень маленький (≤380px) */
@media (max-width: 380px) {
    .nav-item span { display: none !important; }
    .nav-item { min-width: 40px; }
    .people-grid { grid-template-columns: 1fr 1fr; }
    .achieve-grid { grid-template-columns: 1fr 1fr; }
}

/* Скрываем кнопку контактов на десктопе */
.show-contacts-btn { display: none; }
