:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --accent: #22d3ee;
    --bg: #0d1224;
    --card: #111830;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --border: #1f2937;
    --success: #10b981;
    --header-height: 88px;
    --nav-height: 86px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Vazirmatn', 'IRANSans', sans-serif;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body.mobile {
    margin: 0;
    font-family: 'Vazir', 'Vazirmatn', 'IRANSans', sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.12), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.15), transparent 35%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell { min-height: 100vh; max-width: 100vw; overflow-x: hidden; }

.app-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-height);
    z-index: 30;
    backdrop-filter: blur(10px);
    background: rgba(13, 18, 36, 0.9);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-main.chat-header { gap: 0.95rem; flex: 1; }
.chat-header__identity { display: flex; align-items: center; gap: 0.75rem; }
.avatar.badge.small { width: 52px; height: 52px; border-radius: 50%; }
.chat-header__identity .header-sub { color: var(--muted); font-size: 0.9rem; }

.header-title {
    font-weight: 800;
    font-size: 1.15rem;
}

.header-sub {
    color: var(--muted);
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.version-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--muted);
    font-size: 0.9rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.notif {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border);
}

.notif:active { transform: scale(0.96); }

.notif .icon.bell-icon {
    width: 22px;
    height: 22px;
    display: block;
    background: linear-gradient(120deg, #fff, #c4b5fd);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg>') center / contain no-repeat;
}

.notif.has-unread { border-color: rgba(124,58,237,0.6); box-shadow: 0 12px 28px rgba(124,58,237,0.22); }
.notif.has-unread::after { content: ""; position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 8px rgba(239,68,68,0.18); }

.notif .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #1f2937;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.08);
}

.app-main {
    padding: calc(var(--header-height) + 0.6rem) 1.2rem calc(var(--nav-height) + 1.5rem);
    max-width: 100vw;
    overflow-x: hidden;
}

.auth-shell-page .app-main {
    min-height: calc(100vh - var(--header-height));
    padding: calc(var(--header-height) + 1rem) 1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.screen {
    display: grid;
    gap: 1rem;
}

.card {
    background: var(--card);
    border-radius: 28px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.card.mini { padding: 1rem; }
.profile-card { position: relative; display: grid; gap: 0.9rem; }
.profile-toolbar { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; align-items: center; z-index: 2; }
.logout-form { margin: 0; }
.logout-cta { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.55rem 0.85rem; border-radius: 14px; font-weight: 800; }
.logout-cta span { font-size: 0.95rem; }
.profile-identity { align-items: start; gap: 0.85rem; }
.profile-identity.rich { align-items: center; grid-template-columns: auto 1fr; }
.profile-meta .muted { margin-top: 0.1rem; }
.profile-meta .subtitle { color: var(--muted); font-weight: 700; }
.pill-row { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.status-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.65rem; border-radius: 999px; font-weight: 800; border: 1px solid rgba(255,255,255,0.1); }
.status-pill.online { background: rgba(34,197,94,0.14); color: #34d399; border-color: rgba(34,197,94,0.35); }
.status-pill.offline { background: rgba(248,113,113,0.14); color: #fca5a5; border-color: rgba(248,113,113,0.35); }
.status-pill.playing { background: rgba(234,179,8,0.16); color: #facc15; border-color: rgba(234,179,8,0.45); box-shadow: 0 10px 22px rgba(234,179,8,0.18); }
.chip.subtle { background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.12); padding: 0.3rem 0.65rem; border-radius: 999px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
.stat-block { padding: 0.75rem 0.9rem; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); display: grid; gap: 0.2rem; box-shadow: 0 10px 20px rgba(0,0,0,0.16); }
.stat-block .stat-value { font-size: 1.4rem; font-weight: 900; }
.stat-block .stat-label { color: var(--muted); }
.profile-form { gap: 0.85rem; }
.form-section { border: 1px dashed rgba(255,255,255,0.18); padding: 0.9rem; border-radius: 16px; background: rgba(255,255,255,0.02); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); display: grid; gap: 0.5rem; }
.section-title { font-weight: 800; color: #e5e7eb; }
.form-actions { display: flex; justify-content: flex-end; }

.hero {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.12));
    border-radius: 28px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    display: grid;
    gap: 0.6rem;
}

.hero.profile-hero { padding: 1.1rem; }
.hero.profile-hero.slim { padding: 0.85rem 1rem; }

.profile-hero {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    text-align: center;
    gap: 0.8rem;
}

.profile-hero.compact { gap: 0.2rem; }
.hero-avatar-wrapper { position: relative; display: inline-block; }
.hero-avatar-wrapper .hero-avatar { position: relative; z-index: 1; }
.hero-avatar-wrapper .avatar-status { bottom: 2px; left: 4px; }

.hero-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.08);
}

.hero-avatar.clickable { cursor: pointer; }

.hero-avatar.large { width: 104px; height: 104px; border-radius: 50%; }

.hero-meta { display: grid; gap: 0.2rem; }

.callout { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; border: 1px dashed var(--border); padding: 0.85rem 1rem; border-radius: 16px; background: rgba(124,58,237,0.08); box-shadow: 0 12px 28px rgba(124,58,237,0.16); }
.callout__content { display: flex; align-items: center; gap: 0.65rem; }
.callout .emoji { font-size: 1.4rem; }
.callout__actions { display: flex; align-items: center; gap: 0.35rem; }
.callout.danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); box-shadow: 0 12px 28px rgba(239,68,68,0.22); }

.counts { display: grid; grid-auto-flow: column; gap: 0.8rem; align-items: center; }
.counts .stat { display: grid; gap: 0.1rem; color: var(--text); text-decoration: none; background: rgba(255,255,255,0.05); border-radius: 14px; padding: 0.4rem 0.9rem; border: 1px solid var(--border); min-width: 110px; text-align: center; }
.counts .count { font-weight: 800; font-size: 1.2rem; }
.counts .label { color: var(--muted); font-size: 0.9rem; }
.profile-counts { justify-content: flex-start; gap: 0.5rem; }
.profile-counts .stat.clickable { cursor: pointer; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 20px rgba(0,0,0,0.18); }
.profile-counts .stat.clickable:active { transform: translateY(1px); }
.inline-counts { justify-content: flex-start; }
.inline-counts .stat { min-width: 0; padding: 0.55rem 0.85rem; display: inline-flex; align-items: center; gap: 0.55rem; box-shadow: none; border-color: rgba(124,58,237,0.35); transition: none; }
.inline-counts .stat .stat-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: rgba(124,58,237,0.18); border: 1px solid rgba(124,58,237,0.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }
.inline-counts .stat .stat-body { display: grid; gap: 0.05rem; text-align: left; }
.inline-counts .stat .count { font-size: 1.05rem; }
.inline-counts .stat .label { font-size: 0.85rem; }
.inline-counts.text-links { gap: 1.2rem; align-items: flex-start; }
.stat-link { display: inline-flex; align-items: center; gap: 0.45rem; color: #fff; cursor: pointer; position: relative; padding: 0.35rem 0.55rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); }
.stat-link::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 4px; height: 1px; background: linear-gradient(90deg, transparent, rgba(124,58,237,0.6), transparent); opacity: 0; transition: opacity 0.2s ease; }
.stat-link:hover::after, .stat-link:focus-visible::after { opacity: 1; }
.stat-link .stat-body { display: grid; gap: 0.15rem; align-items: center; }

.tag-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }

.pill.subtle { background: rgba(255,255,255,0.08); color: var(--muted); }

.hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

.title { font-weight: 800; font-size: 1.1rem; }
.caption { color: var(--muted); font-size: 0.95rem; }
.muted { color: var(--muted); }

.pill {
    padding: 0.55rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 700;
}

.pill.ghost { background: transparent; }
.pill.danger { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.4); box-shadow: 0 10px 20px rgba(239,68,68,0.16); }
.pill.glossy { background: linear-gradient(135deg, rgba(124,58,237,0.28), rgba(34,211,238,0.18)); border-color: rgba(124,58,237,0.45); box-shadow: 0 12px 28px rgba(124,58,237,0.24); color: #fff; }

.grid.two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.8rem;
}

.grid.three {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.action-card {
    display: flex;
    gap: 0.9rem;
    background: linear-gradient(120deg, rgba(124, 58, 237, 0.25), rgba(34, 211, 238, 0.15));
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid var(--border);
    align-items: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.action-card:active { transform: translateY(2px); }

.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.card.list-card { padding: 0; }
.list-header { padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.list-header .badge { background: rgba(124,58,237,0.2); color: #fff; padding: 0.25rem 0.6rem; border-radius: 12px; font-weight: 800; }
.list { display: grid; }
.list-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border);
    transition: background 0.2s ease;
}

.list-item .meta { min-width: 0; }
.list-item .title, .list-item .subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-item:hover { background: rgba(255, 255, 255, 0.03); }

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.avatar.shadow { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25); }

.meta .subtitle { color: var(--muted); font-size: 0.9rem; }

.chip {
    padding: 0.35rem 0.7rem;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.chip.success { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.25); }
.chip.subtle { background: rgba(255, 255, 255, 0.04); color: var(--muted); }

.profile-card .profile-identity { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.avatar-picker { position: relative; width: 120px; height: 120px; cursor: pointer; }
.avatar-picker img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.avatar-picker input { display: none; }
.avatar-picker .share-fab { position: absolute; bottom: 10px; right: 10px; background: linear-gradient(140deg, rgba(124,58,237,0.9), rgba(34,211,238,0.75)); color: #fff; padding: 0.25rem 0.3rem; border-radius: 12px; font-weight: 800; cursor: pointer; border: 1px solid rgba(255,255,255,0.28); box-shadow: 0 12px 26px rgba(124,58,237,0.25); width: 34px; height: 34px; display: grid; place-items: center; }
.avatar-picker .share-fab.corner-left { left: 6px; right: auto; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }
.share-icon { width: 16px; height: 16px; background: #fff; mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18 8a3 3 0 1 0-2.82-4H15a3 3 0 1 0 .18 4.12l-7.2 4.13a3 3 0 1 0 .01 3.5l7.2 4.13A3 3 0 1 0 16 18a2.98 2.98 0 0 0-.18-.99l-7.2-4.13A3 3 0 0 0 8.63 12c0-.31.05-.6.13-.88l7.2-4.13c.64.63 1.51 1.01 2.47 1.01Z"/></svg>'); mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.avatar-picker .avatar-status { left: 0; bottom: 0; border-width: 2px; }
.profile-meta { display: grid; gap: 0.25rem; align-content: center; }
.profile-actions-inline { display: flex; gap: 0.35rem; align-items: center; }

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,58,237,0.45); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(124,58,237,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}

.profile-summary { display: grid; gap: 0.15rem; align-content: center; }
.profile-summary .tag { color: var(--muted); margin-top: 0.15rem; }
.share-row { margin-top: 0.6rem; }

.stack { display: grid; gap: 0.8rem; }

.field { display: grid; gap: 0.35rem; }
.field label { color: var(--muted); font-weight: 700; }
.field input, .field textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.85rem 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2); }
.field.read-only input { opacity: 0.7; }

.btn-primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
    border-radius: 16px;
    padding: 1rem;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}
.btn-primary.full { width: 100%; }
.btn-primary .btn-icon { font-size: 1rem; display: inline-flex; }

.btn-primary:active { transform: scale(0.98); box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35); }
.actions-row { margin-top: 0.4rem; display: flex; }
.actions-row .btn-primary.search { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem; font-size: 0.98rem; border-radius: 16px; }
.actions-row .btn-primary.search .icon { font-size: 1.2rem; }

.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
}
.ghost.full { width: 100%; text-align: center; }

.text-button {
    border: none;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.error-message { color: #f87171; font-size: 0.9rem; }

.quick-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.quick-links a { padding: 0.5rem 0.8rem; border-radius: 10px; background: rgba(255,255,255,0.05); }

.list-item, .action-card, .bottom-nav { animation: fadeUp 0.3s ease; }

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

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0c1327;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    gap: 0.35rem;
    z-index: 20;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
    min-height: var(--nav-height);
}

.nav-item {
    position: relative;
    display: grid;
    place-items: center;
    gap: 0.15rem;
    color: var(--muted);
    padding: 0.65rem 0.4rem;
    border-radius: 14px;
    transition: color 0.2s ease, transform 0.12s ease;
    overflow: hidden;
}

.nav-item--primary {
    transform: translateY(-6px);
    padding: 0.75rem 0.6rem;
    background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(34,211,238,0.18));
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 32px rgba(0,0,0,0.35);
}
.nav-item--primary .icon { font-size: 1.3rem; }
.nav-item--primary small { font-size: 0.95rem; }
.nav-item--primary::after { display: none; }

.nav-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item:hover { color: var(--text); }
.nav-item:hover::after { opacity: 0.35; }
.nav-item .icon { font-size: 1.1rem; position: relative; z-index: 1; }
.nav-item small { position: relative; z-index: 1; font-weight: 700; letter-spacing: -0.01em; }

.bottom-nav .nav-item.active { color: #fff; }
.bottom-nav .nav-item.active::after { opacity: 1; background: rgba(124,58,237,0.25); box-shadow: 0 10px 26px rgba(124,58,237,0.35); transform: scale(1.02); }

.user-list-shell { display: grid; gap: 0.6rem; }
.list-loading { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); padding: 0.4rem 0.2rem; }

.public-card .public-header { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; }
.public-body { display: grid; gap: 0.7rem; }
.info-row span { color: var(--muted); font-size: 0.9rem; }
.info-row p { margin: 0.2rem 0 0; }
.action-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.action-row.stretch { width: 100%; justify-content: space-between; }
.textual-counts { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.35rem; justify-content: space-between; align-items: stretch; }
.textual-counts .stat { background: rgba(255,255,255,0.03); border: 1px dashed var(--border); padding: 0.55rem 0.85rem; border-radius: 12px; min-width: 140px; box-shadow: 0 10px 20px rgba(0,0,0,0.18); flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; }
.textual-counts .label { color: var(--muted); font-weight: 700; }
.textual-counts .count { font-weight: 900; font-size: 1.15rem; }

.bottom-nav .nav-item.active { background: rgba(124,58,237,0.2); color: #fff; }

#toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    color: #fff;
    min-width: 220px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 50;
}

#toast.visible { opacity: 1; transform: translate(-50%, -6px); }

#loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(124,58,237,0.12), transparent 40%), radial-gradient(circle at 70% 20%, rgba(34,211,238,0.12), transparent 40%), rgba(4,6,15,0.75);
    display: grid;
    place-items: center;
    gap: 0.8rem;
    z-index: 40;
    backdrop-filter: blur(8px);
}

.loader-orbs { display: inline-flex; gap: 0.5rem; align-items: center; }
.loader-orbs .orb { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, #22d3ee); box-shadow: 0 0 0 0 rgba(124,58,237,0.35); animation: pulse-orb 1.1s ease-in-out infinite; }
.loader-orbs .orb.delay { animation-delay: 0.15s; }
.loader-orbs .orb.delay-more { animation-delay: 0.3s; }

.loader-text { color: #fff; font-weight: 800; text-shadow: 0 6px 18px rgba(0,0,0,0.35); letter-spacing: 0.5px; }

@keyframes pulse-orb {
    0% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(124,58,237,0.35); }
    50% { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(34,211,238,0.22); }
    100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(124,58,237,0.0); }
}

.notif-panel {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    right: 12px;
    width: min(380px, 92vw);
    background: transparent;
    max-height: 64vh;
    overflow-y: auto;
    z-index: 30;
    padding: 0.2rem;
}

.notif-card {  
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

.notif-card__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notif-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(124,58,237,0.2);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(124,58,237,0.35);
}

.notif-card__list { display: grid; }

.notif-card__actions { padding: 0.6rem 1rem 1rem; border-top: 1px solid var(--border); }
.notif-card__actions .pill { width: 100%; justify-content: center; }

.notif-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.notif-item.read { opacity: 0.6; }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 18px rgba(0,0,0,0.28);
}

.notif-item .body { display: grid; gap: 0.25rem; }
.notif-item .title { font-size: 0.96rem; }
.notif-item .from { color: var(--muted); font-size: 0.88rem; }

.notif-empty { text-align: center; padding: 1rem; color: var(--muted); display: grid; gap: 0.25rem; }
.notif-empty .emoji { font-size: 1.4rem; }

.search-card { display: grid; gap: 0.35rem; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 14px 30px rgba(0,0,0,0.22); }
.search-card.unified { gap: 1rem; padding: 1.1rem; }
.search-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 14px; padding: 0.55rem 0.7rem; }
.search-row .icon { font-size: 1.2rem; color: var(--muted); }
.search-row input { background: transparent; border: none; outline: none; border-radius: 12px; padding: 0.65rem 0.2rem; color: #fff; width: 100%; }
.search-row.compact { grid-template-columns: auto 1fr; padding: 0.45rem 0.65rem; }
.search-row.compact .icon { font-size: 1rem; }
.search-row.compact input { padding: 0.55rem 0.2rem; }
.hint { color: var(--muted); font-size: 0.9rem; }
.list-header.inset { margin-top: 0.25rem; padding: 0.6rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.6rem; padding: 0.8rem; }
.user-grid.compact { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.user-chip { display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: center; padding: 0.7rem 0.95rem; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease; min-width: 0; }
.user-chip:hover { border-color: rgba(124,58,237,0.45); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,0.25); }
.user-chip .meta { min-width: 0; }
.user-chip .meta .title, .user-chip .meta .subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .status { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; justify-self: end; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.online { background: linear-gradient(120deg, #22c55e, #38bdf8); box-shadow: 0 0 0 6px rgba(56,189,248,0.18); }
.dot.offline { background: linear-gradient(120deg, #ef4444, #9ca3af); box-shadow: 0 0 0 4px rgba(239,68,68,0.08); }
.dot.playing { background: linear-gradient(120deg, #f59e0b, #facc15); box-shadow: 0 0 0 6px rgba(250,204,21,0.18); }
.avatar-status { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--card); background: #22c55e; left: 2px; bottom: 2px; box-shadow: 0 10px 16px rgba(0,0,0,0.25); }
.avatar-status.online { background: linear-gradient(120deg, #22c55e, #38bdf8); }
.avatar-status.offline { background: linear-gradient(120deg, #ef4444, #9ca3af); }


.followers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.followers .count { font-size: 1.4rem; font-weight: 800; }
.followers .count.link { text-decoration: none; color: var(--text); }
.avatar-row { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.mini-avatar { width: 42px; height: 42px; border-radius: 50%; background-size: cover; background-position: center; border: 2px solid rgba(255,255,255,0.08); box-shadow: 0 8px 18px rgba(0,0,0,0.3); }

.user-strip { display: flex; gap: 0.5rem; padding: 0.2rem 0; overflow-x: auto; }
.user-strip .avatar-chip { position: relative; width: 60px; height: 60px; border-radius: 18px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.user-strip .avatar { width: 48px; height: 48px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 12px 24px rgba(0,0,0,0.25); }
.user-strip .dot { position: absolute; top: 6px; right: 6px; box-shadow: 0 0 0 6px rgba(0,0,0,0.2); }
.user-strip::-webkit-scrollbar { display: none; }

.icon-button.back { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: #fff; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }

.message-card .message-hero { display: flex; align-items: center; gap: 0.8rem; }
.message-card .bubble { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); font-size: 1.3rem; }
.chat-shell { display: grid; grid-template-columns: minmax(220px, 0.9fr) 2fr; gap: 0.9rem; align-items: start; }
.chat-list { min-height: 420px; overflow: hidden; }
.chat-list-body { display: grid; gap: 0.15rem; max-height: 500px; overflow-y: auto; padding: 0.2rem 0.15rem 0.8rem; }
.chat-list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.65rem; align-items: center; padding: 0.6rem 0.35rem; border-radius: 10px; border: none; background: transparent; border-bottom: 1px solid var(--border); }
.chat-list-item .avatar { width: 46px; height: 46px; border-radius: 50%; background-size: cover; background-position: center; }
.chat-list-item .dot { box-shadow: 0 0 0 6px rgba(0,0,0,0.25); }
.chat-list-item.active { border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.05); }
.chat-panel { display: grid; gap: 0.75rem; min-height: 420px; position: relative; overflow: hidden; grid-template-rows: auto 1fr auto; }
.chat-toolbar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.4rem; background: linear-gradient(180deg, rgba(13,18,36,0.9), rgba(13,18,36,0.35)); z-index: 1; border-bottom: 1px solid var(--border); }
.chat-peer { display: flex; align-items: center; gap: 0.65rem; }
.chat-peer .avatar { width: 56px; height: 56px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 12px 24px rgba(0,0,0,0.28); position: relative; }
.chat-peer .avatar .avatar-status { left: -6px; bottom: -6px; border-color: var(--bg); }
.status-row { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.chat-thread { display: grid; gap: 0.75rem; max-height: none; overflow-y: auto; padding-right: 0.2rem; min-height: 240px; padding: 0.5rem 0.2rem 0.75rem; align-content: start; background: radial-gradient(circle at 10% 20%, rgba(124,58,237,0.08), transparent 35%), radial-gradient(circle at 90% 10%, rgba(34,211,238,0.08), transparent 30%); border-radius: 18px; }
.chat-bubble { padding: 0.75rem 0.85rem; border-radius: 16px; max-width: 90%; box-shadow: 0 12px 22px rgba(0,0,0,0.18); word-break: break-word; }
.chat-bubble .sender { font-weight: 700; margin-bottom: 0.15rem; }
.chat-bubble.inbound { background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.chat-bubble.outbound { background: linear-gradient(120deg, rgba(124,58,237,0.25), rgba(34,211,238,0.25)); border: 1px solid rgba(124,58,237,0.35); justify-self: end; }
.chat-input { display: flex; align-items: flex-end; gap: 0.6rem; padding-bottom: env(safe-area-inset-bottom); }
.chat-input__box { position: relative; flex: 1; display: flex; align-items: center; gap: 0.6rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; box-shadow: 0 12px 24px rgba(0,0,0,0.3); padding: 0.35rem 0.45rem; }
.chat-input textarea { width: 100%; min-height: 54px; max-height: 160px; padding: 0.7rem 0.8rem; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; color: #fff; line-height: 1.5; overflow-y: auto; resize: none; }
.chat-input textarea:focus { outline: none; }
.chat-input button.send-btn { width: 44px; height: 44px; border-radius: 14px; padding: 0; box-shadow: 0 10px 24px rgba(124,58,237,0.35); display: grid; place-items: center; background: linear-gradient(135deg, rgba(124,58,237,0.85), rgba(34,211,238,0.75)); border: 1px solid rgba(255,255,255,0.25); color: #fff; flex-shrink: 0; cursor: pointer; }
.send-icon { width: 16px; height: 16px; background: #fff; mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3.4 10.2 19 3.3a1 1 0 0 1 1.3 1.3l-6.9 15.6a1 1 0 0 1-1.8.02l-2.6-5.4-5.4-2.6a1 1 0 0 1 .2-1.9Z"/></svg>'); mask-size: contain; mask-repeat: no-repeat; mask-position: center; display: block; }
.chat-thread::-webkit-scrollbar { width: 6px; }
.chat-thread::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

.chat-list-page { display: grid; gap: 0.4rem; }
.chat-directory { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; }
.chat-directory__item { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: center; padding: 0.65rem 0.35rem; border-radius: 10px; border: none; background: transparent; transition: color 0.2s ease; width: 100%; border-bottom: 1px solid var(--border); }
.chat-directory__item:last-child { border-bottom: none; }
.chat-directory__item:active { transform: none; background: rgba(255,255,255,0.02); }
.chat-directory__avatar { width: 50px; height: 50px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 10px 18px rgba(0,0,0,0.25); border: 2px solid rgba(255,255,255,0.08); }
.chat-directory__avatar.badge { position: relative; }
.chat-directory__avatar.badge .avatar-status { left: -6px; bottom: -6px; border-color: var(--bg); }
.chat-directory__meta { display: grid; gap: 0.2rem; }
.chat-directory__top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.chat-directory__last { color: var(--muted); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pill { border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; border: 1px solid var(--border); font-size: 0.9rem; }
.status-pill.online { background: rgba(16,185,129,0.14); color: #34d399; border-color: rgba(16,185,129,0.3); }
.status-pill.offline { background: rgba(148,163,184,0.12); color: #cbd5e1; }

.chat-room { display: flex; flex-direction: column; gap: 0.75rem; position: relative; min-height: calc(var(--app-viewport-height, 100vh) - var(--header-height) - var(--nav-height)); overflow: hidden; width: 100%; }
.chat-room .chat-thread { flex: 1; padding-bottom: calc(var(--nav-height) + 120px); height: auto; max-height: none; min-height: 0; }
.chat-room .chat-input { position: fixed; left: 1.2rem; right: 1.2rem; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 0.75rem); background: linear-gradient(180deg, rgba(13,18,36,0.6), rgba(13,18,36,0.92)); padding: 0.7rem 0.75rem; margin: 0; border-radius: 16px; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 -8px 28px rgba(0,0,0,0.32); z-index: 35; max-width: 960px; width: calc(100% - 2.4rem); margin-inline: auto; }

.chat-screen { min-height: calc(var(--app-viewport-height, 100vh) - var(--header-height) - var(--nav-height) - 10px); display: flex; }
.empty-state { text-align: center; display: grid; gap: 0.35rem; padding: 1.2rem; background: rgba(255,255,255,0.03); border-radius: 18px; border: 1px dashed var(--border); }
.empty-state .emoji { font-size: 2rem; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(6, 10, 20, 0.75); backdrop-filter: blur(6px); z-index: 15; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__content { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 20px; max-width: 720px; width: min(720px, 100%); box-shadow: 0 22px 44px rgba(0,0,0,0.35); max-height: 80vh; display: grid; grid-template-rows: auto 1fr; }
.modal__content.compact { max-width: 520px; }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal__body { padding: 1rem; overflow-y: auto; }
.modal__backdrop { position: absolute; inset: 0; }
.icon-button { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.35rem 0.65rem; cursor: pointer; }
.icon-button.icon-only { width: 44px; height: 44px; display: grid; place-items: center; padding: 0.35rem; border-radius: 14px; }
.game-request-body { display: grid; gap: 0.75rem; }
.requester-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.65rem; align-items: center; }
.game-request-summary { background: rgba(255,255,255,0.03); border: 1px dashed var(--border); padding: 0.65rem 0.75rem; border-radius: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.game-request-body .chip-row { margin: 0; }
.game-request-question { font-weight: 800; margin-top: 0.1rem; }
.hero-actions.compact { gap: 0.4rem; justify-content: flex-end; }
.icon-button.danger { border-color: rgba(239,68,68,0.4); color: #fca5a5; background: rgba(239,68,68,0.08); box-shadow: 0 10px 20px rgba(239,68,68,0.16); }
.logout-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; }

.profile-actions { justify-content: space-between; align-items: center; gap: 0.6rem; }
.profile-actions .action-row { gap: 0.5rem; }
.profile-actions .inline-form { margin: 0; }
.profile-actions .pill, .profile-actions .ghost { height: fit-content; }
.public-actions { gap: 0.4rem; align-items: stretch; }
.public-actions .inline-form { flex: 1; }
.public-actions .action-row { width: 100%; }
.public-actions .pill.glossy { flex: 1; text-align: center; }
.subtle-row { justify-content: flex-end; }

.link-row { display: flex; gap: 0.35rem; justify-content: center; color: var(--muted); margin-top: 0.4rem; }
.auth-screen { display: grid; grid-template-columns: 1fr; gap: 1rem; width: min(560px, 100%); margin: 0 auto; background: var(--card); border-radius: 24px; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 24px 48px rgba(0,0,0,0.32); padding: 1.2rem; position: relative; }
.auth-screen.single-pane { grid-template-columns: 1fr; }
.auth-pane { position: relative; z-index: 1; display: grid; gap: 1rem; align-content: start; background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(34,211,238,0.08)); border: 1px solid var(--border); border-radius: 18px; padding: 1.1rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03); }
.auth-form { gap: 0.85rem; }
.auth-form .btn-primary.full { margin-top: 0.35rem; }
.form-head { display: grid; gap: 0.25rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.chip { padding: 0.45rem 0.75rem; background: rgba(255,255,255,0.07); border: 1px solid var(--border); border-radius: 12px; font-weight: 700; color: var(--text); box-shadow: 0 10px 24px rgba(0,0,0,0.2); backdrop-filter: blur(5px); }
.chip.accent { background: rgba(124,58,237,0.22); border-color: rgba(124,58,237,0.55); box-shadow: 0 12px 28px rgba(124,58,237,0.28); }
.pill.glass { background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.alert { padding: 0.65rem 0.85rem; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); font-weight: 800; text-align: center; }
.alert.danger { border-color: rgba(248,113,113,0.35); color: #fecdd3; background: rgba(127,29,29,0.25); }
.input-field { display: grid; gap: 0.35rem; }
.input-field label { color: var(--muted); font-weight: 700; }
.input-field input, .input-field textarea { background: rgba(255,255,255,0.06); border: 1px solid color-mix(in srgb, var(--border) 70%, rgba(124,58,237,0.4)); padding: 1rem; border-radius: 16px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease; resize: none; }
.input-field input:focus, .input-field textarea:focus { border-color: rgba(124,58,237,0.8); box-shadow: 0 0 0 4px rgba(124,58,237,0.2); transform: translateY(-1px); }
.auth-screen.otp-screen .auth-pane { max-width: 520px; }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.timer-pill { display: inline-flex; align-items: center; justify-content: center; padding: 0.4rem 0.9rem; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); font-weight: 800; letter-spacing: 0.08em; }
.resend-form { margin-top: -0.3rem; }
.resend-form .ghost.full[disabled] { opacity: 0.6; cursor: not-allowed; }

.chat-directory.plain .chat-directory__item { background: transparent; border-style: solid; }
.chat-full { padding-bottom: 0; }
.empty-state.stand-alone { background: transparent; border-style: dashed; }

.online-following { display: grid; gap: 0.4rem; margin: 0.6rem 0 1rem; }
.online-following__label { color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.online-following__list { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.online-following__avatar { width: 42px; height: 42px; border-radius: 50%; background-size: cover; background-position: center; position: relative; border: 2px solid rgba(124,58,237,0.35); box-shadow: 0 10px 18px rgba(0,0,0,0.26); transition: transform 0.15s ease, border-color 0.2s ease; }
.online-following__avatar .avatar-status { left: -5px; bottom: -5px; border-color: var(--bg); }
.online-following__avatar:active { transform: translateY(2px); border-color: rgba(124,58,237,0.65); }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.65rem; grid-auto-rows: 1fr; max-width: 920px; margin: 0 auto; }
.category-card { position: relative; border: 1px solid var(--border); background: rgba(255,255,255,0.03); padding: 0.5rem; border-radius: 14px; display: grid; gap: 0.3rem; cursor: pointer; transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.2s ease, background 0.2s ease; min-height: 86px; align-content: start; }
.category-card:hover { transform: translateY(-2px); border-color: var(--accent, rgba(124,58,237,0.4)); box-shadow: 0 12px 28px rgba(0,0,0,0.2); }
.category-card.active { border-color: var(--accent, #7c3aed); background: linear-gradient(145deg, rgba(124,58,237,0.16), rgba(34,211,238,0.16)); box-shadow: 0 18px 32px rgba(124,58,237,0.24); transform: translateY(-3px); outline: 2px solid color-mix(in srgb, var(--accent, #7c3aed) 60%, transparent); }
.category-card input { display: none; }
.category-card .category-check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(16,185,129,0.18); color: #34d399; display: grid; place-items: center; font-weight: 800; opacity: 0; transform: translateY(-6px); transition: opacity 0.2s ease, transform 0.2s ease; }
.category-card .icon-bubble { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, #7c3aed) 28%, rgba(255,255,255,0.08)); font-size: 0.92rem; }
.category-card .title { font-weight: 800; font-size: 0.9rem; }
.category-card[style*="--accent"] { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.category-card.active .category-check { opacity: 1; transform: translateY(0); }
.categories-grid .actions-row { grid-column: 1 / -1; margin-top: 0.4rem; }
.actions-row .btn-primary.search { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem; font-size: 0.98rem; border-radius: 16px; }

.matchmaking { display: grid; gap: 1rem; text-align: center; padding: 1.2rem; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, rgba(124,58,237,0.1), rgba(14,165,233,0.08)); }
.match-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.player-card { display: grid; gap: 0.5rem; justify-items: center; padding: 0.6rem; border-radius: 14px; border: 1px dashed var(--border); background: rgba(255,255,255,0.03); }
.player-card .avatar { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: rgba(255,255,255,0.08); font-size: 2rem; }
.player-card .avatar.image { background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); color: transparent; }
.player-card .avatar.pulse { animation: pulse 1.4s infinite; }
.player-card .avatar.carousel { animation: wiggle 1.8s infinite; }
.match-stage .vs { font-weight: 800; font-size: 1.4rem; }
.search-loader { display: flex; gap: 0.35rem; justify-content: center; }
.search-loader .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: bounce 1s infinite; }
.search-loader .dot:nth-child(2) { animation-delay: 0.15s; }
.search-loader .dot:nth-child(3) { animation-delay: 0.3s; }
.search-loader.large .dot { width: 14px; height: 14px; }
.request-await { gap: 1.1rem; }
.request-summary { border: 1px dashed var(--border); border-radius: 14px; padding: 0.75rem; background: rgba(255,255,255,0.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.request-summary .title { font-weight: 800; margin-bottom: 0.15rem; }

.game-shell { display: grid; gap: 0.8rem; grid-template-rows: auto 1fr; min-height: calc(var(--app-viewport-height, 100vh) - 80px); max-height: calc(var(--app-viewport-height, 100vh) - 40px); width: min(1100px, 100%); margin: 0 auto; padding: 0 0.5rem 1rem; overflow: hidden; }
.game-shell.minimal { gap: 1.2rem; align-content: start; }
.game-top { display: none; }
.game-top--versus .player-card.modern { height: 100%; }
.game-top--versus { grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.85fr) minmax(240px, 1fr); }
.player-card.modern { display: grid; grid-template-columns: auto 1fr; gap: 0.65rem; align-items: center; padding: 0.85rem 1rem; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(14,165,233,0.04)); box-shadow: 0 18px 30px rgba(0,0,0,0.24); position: relative; overflow: hidden; }
.player-card.modern[data-player="opponent"] { direction: rtl; }
.player-card.modern::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(124,58,237,0.2), transparent 45%), radial-gradient(circle at 80% 20%, rgba(14,165,233,0.16), transparent 45%); opacity: 0.6; pointer-events: none; }
.player-card.modern .player-card__avatar { width: 68px; height: 68px; border-radius: 18px; background-size: cover; background-position: center; box-shadow: 0 16px 28px rgba(0,0,0,0.28); position: relative; border: 1px solid rgba(255,255,255,0.14); }
.player-card.modern .player-card__meta { display: grid; gap: 0.2rem; z-index: 1; }
.player-card.modern .title { font-weight: 900; font-size: 1rem; word-break: break-word; }
.player-card.modern .player-card__username { color: var(--muted); font-weight: 700; font-size: 0.92rem; direction: ltr; text-align: left; }
.player-card.modern .status-row { color: var(--muted); display: inline-flex; gap: 0.35rem; align-items: center; font-weight: 700; }
.player-card.modern .dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 6px rgba(255,255,255,0.04); }
.player-card.modern .dot.online { background: #34d399; box-shadow: 0 0 0 6px rgba(52,211,153,0.16); }
.player-card.modern .dot.offline { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,0.16); }
.player-card.modern.is-active { border-color: rgba(124,58,237,0.5); box-shadow: 0 20px 36px rgba(124,58,237,0.28); transform: translateY(-2px); }
.player-card.modern.is-turn { animation: turnGlow 1.5s ease-in-out infinite; border-color: rgba(34,197,94,0.65); box-shadow: 0 22px 40px rgba(34,197,94,0.25); }
.avatar-badge { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: rgba(13,18,36,0.92); border: 1px solid rgba(255,255,255,0.22); font-size: 0.92rem; box-shadow: 0 10px 20px rgba(0,0,0,0.35); }
.score-tile { display: grid; gap: 0.5rem; justify-items: center; padding: 1rem; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(14,165,233,0.12)); box-shadow: 0 20px 38px rgba(0,0,0,0.25); text-align: center; min-height: 100%; }
.score-title { font-weight: 800; color: var(--muted); }
.score-value { font-size: 2.2rem; font-weight: 900; text-shadow: 0 8px 22px rgba(0,0,0,0.35); }
.versus-stack.expanded { padding: 0.9rem; border-radius: 18px; border: 1px solid var(--border); background: radial-gradient(circle at 20% 10%, rgba(124,58,237,0.18), transparent 40%), linear-gradient(160deg, rgba(14,165,233,0.12), rgba(255,255,255,0.02)); box-shadow: 0 14px 30px rgba(0,0,0,0.24); display: grid; gap: 0.35rem; justify-items: center; }
.shared-timer { display: grid; place-items: center; gap: 0.1rem; padding: 0.45rem 0.65rem; border-radius: 14px; width: 100%; max-width: 200px; background: rgba(15,23,42,0.6); box-shadow: 0 10px 20px rgba(0,0,0,0.3); border: none; }
.shared-timer[data-owner="self"] { box-shadow: 0 18px 28px rgba(34,197,94,0.18); }
.shared-timer[data-owner="opponent"] { box-shadow: 0 18px 28px rgba(249,115,22,0.18); }
.shared-timer .timer-value { font-size: 1.6rem; font-weight: 900; letter-spacing: 0.08em; }
.shared-timer .timer-label { font-weight: 800; color: var(--muted); font-size: 0.9rem; }
.game-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.game-meta .pill { border-radius: 12px; padding: 0.35rem 0.75rem; border: 1px solid var(--border); background: rgba(255,255,255,0.04); font-weight: 800; }
.game-meta .pill.muted { color: var(--muted); }
.mode-switch { display: flex; gap: 0.5rem; justify-content: center; align-items: center; margin-top: -0.25rem; margin-bottom: 0.25rem; }
.mode-selector { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.65rem; margin-bottom: 0.65rem; }
.mode-card { display: flex; gap: 0.65rem; align-items: center; padding: 0.9rem 1rem; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease; box-shadow: 0 14px 24px rgba(0,0,0,0.22); }
.mode-card .mode-body { display: grid; gap: 0.2rem; text-align: right; }
.mode-card .mode-body p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.mode-card .mode-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(124,58,237,0.16); border: 1px solid rgba(124,58,237,0.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); font-size: 1.2rem; }
.mode-card .mode-badge { margin-right: auto; padding: 0.35rem 0.75rem; border-radius: 999px; background: rgba(34,197,94,0.14); color: #bbf7d0; border: 1px solid rgba(34,197,94,0.35); font-weight: 800; }
.mode-card .mode-badge.ghost { background: rgba(14,165,233,0.16); border-color: rgba(14,165,233,0.35); color: #bfdbfe; }
.mode-card.is-active { border-color: rgba(124,58,237,0.55); box-shadow: 0 16px 30px rgba(124,58,237,0.25); background: linear-gradient(135deg, rgba(124,58,237,0.14), rgba(14,165,233,0.12)); transform: translateY(-1px); }
.mode-highlight { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-top: -0.1rem; margin-bottom: 0.35rem; }
.mode-chip { padding: 0.45rem 0.8rem; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); font-weight: 800; box-shadow: 0 10px 20px rgba(0,0,0,0.16); }
.mode-chip.is-active { border-color: rgba(124,58,237,0.5); background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(34,211,238,0.12)); box-shadow: 0 12px 18px rgba(124,58,237,0.25); }
.mode-chip.disabled { opacity: 0.6; }
.mode-chip.glass { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.versus-stack { display: grid; justify-items: center; gap: 0.25rem; text-align: center; padding: 0.35rem 0.6rem; border-radius: 14px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); }
.timer-bubble { min-width: 140px; padding: 0.35rem 0.5rem; border-radius: 16px; background: transparent; font-weight: 900; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 0.2rem; justify-content: center; flex-direction: column; box-shadow: none; }
.timer-values { display: grid; gap: 0.25rem; width: 100%; }
.timer-line { display: flex; justify-content: center; gap: 0.35rem; border: none; background: transparent; font-weight: 800; color: var(--muted); }
.timer-line.active { color: #fff; text-shadow: 0 6px 18px rgba(124,58,237,0.35); }
.timer-icon { width: 32px; height: 32px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25)); margin-bottom: 0.15rem; }
.timer-value { font-weight: 900; }
.timer-bubble.is-counting { animation-play-state: running; }
.timer-label { color: var(--muted); font-weight: 700; }
.timer-label .clock-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-block; position: relative; border: 3px solid rgba(255,255,255,0.76); box-shadow: 0 6px 16px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.24); animation: clockPulse 2.2s ease-in-out infinite; }
.timer-label .clock-icon::before { content: ""; position: absolute; width: 2px; height: 12px; background: #fff; top: 50%; left: 50%; transform-origin: bottom center; transform: translate(-50%, -100%) rotate(0deg); border-radius: 4px; animation: clockMinute 6s linear infinite; }
.timer-label .clock-icon::after { content: ""; position: absolute; width: 2px; height: 8px; background: #cbd5e1; top: 50%; left: 50%; transform-origin: bottom center; transform: translate(-50%, -100%) rotate(90deg); border-radius: 4px; animation: clockHour 12s linear infinite; }
.game-mode-card { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: center; padding: 0.5rem 0.8rem; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(34,211,238,0.08)); box-shadow: 0 14px 28px rgba(0,0,0,0.24); }
.game-mode-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.game-mode-meta .title { font-weight: 900; }
.categories-badge { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); padding: 0.35rem 0.6rem; border-radius: 12px; }

.question-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; justify-items: center; width: min(980px, 100%); margin: 0 auto; gap: 0.85rem; padding: 0.5rem 0.25rem 0; }
.question-area { display: grid; align-items: start; width: min(980px, 100%); margin: 0 auto; gap: 0.5rem; }
.question-area.minimal { gap: 0.75rem; }
.turn-chip { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; align-items: center; gap: 0.45rem; padding: 0.5rem 0.75rem; border-radius: 16px; border: 1px solid var(--border); background: rgba(15,23,42,0.6); width: 100%; max-width: 280px; box-shadow: 0 10px 18px rgba(0,0,0,0.18); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.turn-chip.is-active { border-color: rgba(124,58,237,0.45); box-shadow: 0 18px 30px rgba(124,58,237,0.25); background: linear-gradient(145deg, rgba(124,58,237,0.15), rgba(15,23,42,0.65)); }
.turn-chip.is-turn { animation: stagePulse 1.3s ease-in-out infinite; border-color: rgba(34,197,94,0.6); box-shadow: 0 18px 34px rgba(34,197,94,0.28); }
.turn-chip .turn-avatar { width: 70px; height: 70px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 12px 20px rgba(0,0,0,0.24); border: none; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.turn-chip.is-turn .turn-avatar { box-shadow: 0 14px 26px rgba(34,197,94,0.32); transform: translateY(-2px); }
.turn-meta { display: grid; gap: 0.1rem; align-items: center; min-width: 0; justify-items: center; }
.turn-username { font-weight: 900; direction: ltr; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.turn-name { font-weight: 700; color: var(--muted); direction: rtl; text-align: center; }
.stage-timer { display: grid; gap: 0.35rem; justify-items: center; text-align: center; padding: 0.5rem 0.75rem; border-radius: 16px; background: linear-gradient(145deg, rgba(124,58,237,0.14), rgba(14,165,233,0.18)); box-shadow: 0 18px 32px rgba(0,0,0,0.2); width: 100%; max-width: 240px; border: none; }
.stage-timer.compact { padding: 0.45rem 0.65rem; gap: 0.2rem; box-shadow: none; background: rgba(15,23,42,0.5); }
.question-card { border: 1px solid var(--border); border-radius: 18px; padding: 0.9rem; background: rgba(255,255,255,0.02); box-shadow: 0 18px 34px rgba(0,0,0,0.25); transition: border-color 0.2s ease, transform 0.2s ease; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; min-height: 0; }
.question-card.simple { background: rgba(15,23,42,0.6); box-shadow: none; border-style: dashed; gap: 0.4rem; }
.question-card.is-entering { animation: cardEnter 0.45s ease; }
.question-card.is-leaving { animation: cardExit 0.26s ease; }
.question-card.is-resolving.is-correct { animation: cardResolveCorrect 0.9s ease; }
.question-card.is-resolving.is-wrong { animation: cardResolveWrong 0.9s ease; }
.question-card.is-resolving.is-skipped { animation: cardResolveSkip 0.9s ease; }
.question-card .question-head { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.question-head__primary { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.question-visual { position: relative; padding: 1rem; border-radius: 14px; background: radial-gradient(circle at 15% 30%, rgba(124,58,237,0.08), transparent 45%), linear-gradient(135deg, rgba(255,255,255,0.03), rgba(14,165,233,0.08)); border: 1px dashed rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.question-visual.minimal { background: transparent; border: 1px dashed rgba(255,255,255,0.12); box-shadow: none; padding: 0.6rem; }
.question-category { position: absolute; top: 12px; left: 12px; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(15,23,42,0.6); border: 1px solid rgba(255,255,255,0.12); color: #e0f2fe; font-weight: 800; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.question-card .question-text { font-size: 1.05rem; font-weight: 800; line-height: 1.6; margin-bottom: 0.5rem; word-break: break-word; }
.question-card .options { display: grid; gap: 0.45rem; overflow-y: auto; padding-right: 0.1rem; }
.question-card .options::-webkit-scrollbar { width: 6px; }
.question-card .options::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }
.question-card .option { padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: #fff; text-align: right; white-space: normal; line-height: 1.6; transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.question-card .option { word-break: break-word; }
.question-card .option:active { transform: translateY(1px); }
.question-card .option.is-locked { opacity: 0.55; pointer-events: none; }
.question-card .option.is-correct { border-color: rgba(34,197,94,0.6); background: rgba(34,197,94,0.12); animation: optionGlow 0.5s ease; box-shadow: 0 14px 26px rgba(34,197,94,0.22); }
.question-card .option.is-wrong { border-color: rgba(248,113,113,0.55); background: rgba(248,113,113,0.08); animation: optionGlow 0.5s ease; box-shadow: 0 14px 26px rgba(248,113,113,0.2); }
.question-card .option.is-selected { outline: 2px solid rgba(124,58,237,0.4); transform: translateY(-1px); }
.question-card .option.is-animating { animation: pulsePick 0.35s ease; }
.question-card .option:hover:not(.is-locked) { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(0,0,0,0.18); }
.question-card .answer-feedback { margin-top: 0.4rem; font-weight: 700; }
.question-card.is-correct { border-color: rgba(34,197,94,0.6); box-shadow: 0 20px 36px rgba(34,197,94,0.2); }
.question-card.is-wrong { border-color: rgba(248,113,113,0.6); box-shadow: 0 20px 36px rgba(248,113,113,0.2); }
.question-card.is-skipped { border-color: rgba(234,179,8,0.6); box-shadow: 0 20px 36px rgba(234,179,8,0.2); }
.answer-feedback.correct { color: #4ade80; }
.answer-feedback.wrong { color: #f87171; }
.game-actions { margin-top: 0.6rem; display: flex; justify-content: flex-end; }

@keyframes optionGlow { from { transform: scale(0.98); } to { transform: scale(1); } }
@keyframes pulsePick { 0% { transform: scale(0.98); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes turnGlow { 0% { box-shadow: 0 14px 26px rgba(34,197,94,0.18); } 50% { box-shadow: 0 22px 42px rgba(34,197,94,0.32); } 100% { box-shadow: 0 14px 26px rgba(34,197,94,0.18); } }

@keyframes timerBounce {
    0% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(8px); }
    100% { transform: translateY(0); }
}

@keyframes stagePulse {
    0% { box-shadow: 0 14px 26px rgba(34,197,94,0.16); }
    50% { box-shadow: 0 24px 38px rgba(34,197,94,0.3); }
    100% { box-shadow: 0 14px 26px rgba(34,197,94,0.16); }
}

@keyframes clockPulse {
    0% { transform: scale(1); box-shadow: 0 6px 16px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.24); }
    50% { transform: scale(1.05); box-shadow: 0 10px 22px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.32); }
    100% { transform: scale(1); box-shadow: 0 6px 16px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.24); }
}

@keyframes clockMinute {
    from { transform: translate(-50%, -100%) rotate(0deg); }
    to { transform: translate(-50%, -100%) rotate(360deg); }
}

@keyframes clockHour {
    from { transform: translate(-50%, -100%) rotate(90deg); }
    to { transform: translate(-50%, -100%) rotate(450deg); }
}

@keyframes cardEnter { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cardExit { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-10px) scale(0.98); } }
@keyframes cardResolveCorrect { 0% { transform: scale(1); } 40% { transform: scale(1.02); box-shadow: 0 24px 40px rgba(34,197,94,0.26); } 100% { transform: scale(1); } }
@keyframes cardResolveWrong { 0% { transform: scale(1); } 40% { transform: scale(0.98); box-shadow: 0 22px 34px rgba(248,113,113,0.26); } 100% { transform: scale(1); } }
@keyframes cardResolveSkip { 0% { transform: scale(1); } 40% { transform: scale(1.01); box-shadow: 0 20px 32px rgba(234,179,8,0.24); } 100% { transform: scale(1); } }

.result-card { border: 1px solid var(--border); padding: 1.2rem; border-radius: 18px; background: rgba(255,255,255,0.02); display: grid; gap: 0.8rem; }
.result-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 0.8rem; }
.result-player { display: grid; gap: 0.4rem; justify-items: center; padding: 0.6rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.03); }
.result-player .avatar { width: 78px; height: 78px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 14px 28px rgba(0,0,0,0.22); }
.result-player .name { font-weight: 800; }
.result-card .stat { font-size: 1.6rem; font-weight: 900; }
.result-player .avatar .avatar-badge { bottom: -10px; font-size: 1.05rem; }
.result-meta { display: grid; gap: 0.15rem; font-size: 0.92rem; color: var(--muted); text-align: center; }
.result-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.result-item { padding: 0.8rem; border-radius: 12px; border: 1px solid var(--border); }
.result-item.success { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.4); }
.result-item.danger { background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.4); }
.result-item.warning { background: rgba(234,179,8,0.14); border-color: rgba(234,179,8,0.4); }

.challenge-panel { border: 1px dashed var(--border); border-radius: 14px; padding: 0.9rem 1rem; background: rgba(255,255,255,0.02); box-shadow: 0 12px 22px rgba(0,0,0,0.22); display: grid; gap: 0.65rem; }
.user-suggestions { display: grid; gap: 0.4rem; }
.user-suggestion { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); color: #fff; text-align: right; width: 100%; }
.user-suggestion .avatar { width: 42px; height: 42px; border-radius: 12px; background-size: cover; background-position: center; box-shadow: 0 10px 18px rgba(0,0,0,0.2); }
.user-suggestion .user-body { display: grid; gap: 0.1rem; text-align: right; }
.selected-user { display: flex; align-items: center; gap: 0.65rem; justify-content: space-between; flex-wrap: wrap; }
.selected-user .user-chip { box-shadow: none; background: rgba(255,255,255,0.03); padding: 0.35rem 0.6rem; gap: 0.5rem; min-width: 0; }
.selected-user .user-chip .avatar { width: 36px; height: 36px; border-radius: 12px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 6px rgba(255,255,255,0.04); }
.status-dot.online { background: #34d399; box-shadow: 0 0 0 6px rgba(52,211,153,0.18); }
.status-dot.playing { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,0.2); }
.empty-hint { padding: 0.65rem 0.8rem; border-radius: 10px; background: rgba(255,255,255,0.03); color: var(--muted); text-align: right; border: 1px dashed var(--border); }
.muted.small { font-size: 0.85rem; }

.share-fab img { width: 20px; height: 20px; }
.share-icon { display: inline-block; width: 18px; height: 18px; mask: url('../images/icon-share.svg') center/contain no-repeat; -webkit-mask: url('../images/icon-share.svg') center/contain no-repeat; background: currentColor; }

@media (max-width: 900px) {
    .chat-shell { grid-template-columns: 1fr; }
    .chat-list { min-height: 220px; }
    .chat-panel { min-height: 380px; }
}

@media (max-width: 820px) {
    .game-header.dual { grid-template-columns: 1fr; text-align: center; gap: 0.35rem; }
    .game-header.dual .versus-stack { order: -1; width: 100%; }
    .player-chip { justify-content: center; }
    .question-card { padding: 1.1rem; }
    .question-card .question-head { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .mode-highlight { flex-direction: column; align-items: stretch; }
    .mode-highlight .mode-chip { width: 100%; text-align: center; }
    .game-mode-card { width: 100%; justify-content: center; text-align: center; }
}

@media (max-width: 600px) {
    .app-main { padding-bottom: calc(var(--nav-height) + 12px); }
    .hero { padding: 1.2rem; }
    .profile-card .profile-identity, .public-card .public-header { grid-template-columns: 1fr; }
    .avatar-picker { justify-self: center; }
    .chat-shell { grid-template-columns: 1fr; }
    .chat-list-body { max-height: 260px; }
    .chat-panel { padding: 0.85rem; }
    .user-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 0; }
}

@media (max-width: 520px) {
    .bottom-nav { padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px)); gap: 0.25rem; }
    .nav-item { padding: 0.55rem 0.35rem; }
    .nav-item small { font-size: 0.85rem; }
    .categories-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .game-screen { gap: 0.65rem; }
    .question-card .question-text { word-break: break-word; overflow-wrap: anywhere; }
    .mode-selector { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
    .category-card { padding: 0.55rem; min-height: 92px; }
    .category-card .title { font-size: 0.9rem; }
    .player-chip .avatar, .player-chip .avatar-wrapper { width: 48px; height: 48px; }
    .question-card .question-text { font-size: 1rem; }
}
