html {
    --room-chat-width: clamp(500px, 38vw, 640px);
}

@media (max-width: 1100px) {
    html {
        --room-chat-width: clamp(380px, 42vw, 500px);
    }
}

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

body {
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top, rgba(95, 99, 255, 0.25), transparent 35%),
        linear-gradient(135deg, #0b0d1f 0%, #11152f 100%);
    color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    gap: 20px;
    flex-wrap: wrap;
}

header h1 {
    font-size: 2.7rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #63cdda, #7d7fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #a9b2d0;
    font-size: 1rem;
}

.card {
    background: rgba(22, 23, 48, 0.9);
    border: 1px solid rgba(99, 205, 218, 0.12);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 28px;
    backdrop-filter: blur(12px);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(95, 99, 255, 0.08);
    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 205, 218, 0.3);
}

.card h2 {
    margin-bottom: 22px;
    font-size: 1.7rem;
    color: #ffffff;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    margin-bottom: 10px;
    color: #9fb0d6;
    font-size: 0.95rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="file"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #2a2d4a;
    background: #0f1226;
    color: #ffffff;
    font-size: 1rem;
    transition: 0.2s;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field input[type="url"]:focus,
.field input[type="file"]:focus {
    outline: none;
    border-color: #63cdda;
    box-shadow: 0 0 0 4px rgba(99, 205, 218, 0.12);
}

.room-identity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 18px;
    margin-bottom: 8px;
}

.active-room-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin: -4px 0 18px;
    border: 1px solid rgba(99, 205, 218, 0.16);
    border-radius: 16px;
    background: rgba(15, 18, 38, 0.7);
}

.active-room-heading img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    background: #0f1226;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.active-room-heading strong,
.active-room-heading span {
    display: block;
}

.active-room-heading strong {
    font-size: 1.12rem;
    margin-bottom: 4px;
}

.active-room-heading span {
    color: #a9b2d0;
    font-size: 0.9rem;
}

.button {
    background: linear-gradient(135deg, #5f63ff, #6b8cff);
    border: none;
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: 0.25s ease;
    box-shadow: 0 8px 18px rgba(95, 99, 255, 0.25);
}

.button:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

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

.button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.button.secondary {
    background: #232743;
    box-shadow: none;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.auth-grid h3 {
    margin-bottom: 16px;
}

.auth-hint {
    color: #a9b2d0;
    margin-bottom: 18px;
}

.register-email-hint {
    margin-top: -8px;
    font-size: 0.9rem;
}

.email-verification {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(99, 205, 218, 0.2);
    border-radius: 14px;
    background: rgba(15, 18, 38, 0.7);
}

.email-verification .field {
    margin-bottom: 14px;
}

.email-verification input {
    text-align: center;
    letter-spacing: 6px;
    font-weight: 700;
}

.profile-editor {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    margin: 0 0 22px;
}

.profile-editor-fields {
    display: grid;
    gap: 16px;
}

.profile-avatar-preview,
.chat-avatar,
.participant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #5f63ff, #63cdda);
    border: 2px solid rgba(255,255,255,0.18);
}

.profile-avatar-preview {
    width: 118px;
    height: 118px;
    cursor: zoom-in;
    align-self: center;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.profile-avatar-wrap,
.presence-avatar-wrap,
.friend-profile-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.profile-avatar-wrap {
    align-self: center;
}

.presence-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    background: #7b8196;
    box-shadow: 0 0 0 3px #15172a;
}

.profile-avatar-wrap .presence-dot,
.friend-profile-avatar-wrap .presence-dot {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 4px #15172a;
}

.profile-orb .presence-dot,
.presence-avatar-wrap .presence-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
}

.presence-available { background: #32d074; }
.presence-idle { background: #f2c94c; }
.presence-dnd { background: #ff4d62; }
.presence-invisible,
.presence-offline { background: #7b8196; }

.presence-panel {
    position: relative;
    margin: 14px 0 20px;
}

.presence-current {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(125, 127, 255, 0.26);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: #eef2ff;
    padding: 0 14px;
    cursor: pointer;
    text-align: left;
}

.presence-current .presence-arrow {
    margin-left: auto;
    font-size: 1.4rem;
    color: #a9b2d0;
}

.presence-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(125, 127, 255, 0.32);
    border-radius: 8px;
    background: #202234;
    box-shadow: 0 18px 40px rgba(0,0,0,0.38);
}

.presence-menu button {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #eef2ff;
    cursor: pointer;
    padding: 0 10px;
    text-align: left;
}

.presence-menu button:hover,
.presence-menu button.active {
    background: rgba(255,255,255,0.08);
}

.custom-file-field {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
}

.custom-file-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.custom-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 158px;
    padding: 0 20px;
    border-radius: 999px;
    background: rgba(95, 99, 255, 0.18);
    border: 1px solid rgba(125, 127, 255, 0.42);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    line-height: 42px;
    white-space: nowrap;
    transition: 0.2s ease;
}

.custom-file-button:hover {
    background: rgba(95, 99, 255, 0.28);
}

.custom-file-name {
    color: #a9b2d0;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-editor-fields .field {
    margin-bottom: 0;
}

.profile-editor-fields small {
    display: block;
    margin-top: 10px;
}

.profile-orb {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    overflow: visible;
    cursor: pointer;
    background: transparent;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(99,205,218,0.2);
}

.profile-orb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.profile-orb.vip-profile-orb {
    box-shadow: 0 0 0 2px rgba(255, 215, 106, 0.72), 0 0 18px rgba(255, 199, 46, 0.5);
}

.floating-profile-orb {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 1040;
}

.notification-bell {
    position: fixed;
    top: 25px;
    right: 78px;
    z-index: 1040;
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(22, 23, 48, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.floating-profile-orb,
.notification-bell {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-control-hidden {
    opacity: 0;
    transform: translateY(-18px);
    pointer-events: none;
}

.notification-bell img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff4d67;
    color: #fff;
    font-size: 0.72rem;
    font-weight: bold;
    display: grid;
    place-items: center;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 7, 18, 0.72);
    backdrop-filter: blur(8px);
}

.profile-card {
    position: relative;
    width: min(560px, 100%);
    background: rgba(22, 23, 48, 0.98);
    border: 1px solid rgba(99, 205, 218, 0.18);
    border-radius: 26px;
    padding: 28px 28px 24px;
    box-shadow: 0 22px 70px rgba(0,0,0,0.5);
    max-height: min(84vh, 780px);
    overflow-y: auto;
}

.profile-card.vip-profile-card,
.friend-profile-card.vip-profile-card {
    border-color: rgba(255, 215, 106, 0.62);
    box-shadow: 0 22px 70px rgba(0,0,0,0.5), 0 0 32px rgba(255, 199, 46, 0.18);
}

.profile-card h2 {
    margin-bottom: 18px;
}

.profile-close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.profile-card .info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.profile-card .info-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 68px;
    padding: 14px 16px;
    overflow: hidden;
}

.profile-card .info-box span {
    min-width: 0;
    max-width: 100%;
}

.profile-card .info-box .vip-badge {
    flex: 0 0 auto;
}

.vip-store-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 215, 106, 0.28);
    background:
        radial-gradient(circle at 16% 0%, rgba(99,205,218,0.22), transparent 34%),
        linear-gradient(135deg, rgba(255,215,106,0.14), rgba(95,99,255,0.13));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

.vip-store-kicker {
    display: inline-flex;
    margin-bottom: 4px;
    color: #ffd76a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vip-store-copy h3 {
    margin: 0 0 6px;
}

.vip-store-copy p {
    margin: 0;
    color: #c9d3f4;
    line-height: 1.4;
}

.vip-store-buy {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.vip-store-buy strong {
    color: #fff;
    font-size: 1.35rem;
}

.vip-store-buy .button {
    white-space: nowrap;
}

#profileEmail,
#globalProfileEmail {
    display: inline-block;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.avatar-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0,0,0,0.82);
}

.avatar-lightbox img {
    width: min(420px, 82vw);
    height: min(420px, 82vw);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 80px rgba(0,0,0,0.55);
}

.avatar-lightbox button {
    position: absolute;
    top: 20px;
    right: 28px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
}

.friend-search-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.friends-list-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.friends-list-block h3 {
    margin-bottom: 12px;
}

.friends-list {
    display: grid;
    gap: 10px;
}

.friend-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    text-decoration: none;
}

.friend-link:hover {
    background: rgba(99,205,218,0.1);
}

.friend-link.vip-profile-preview,
.friend-result.vip-profile-preview {
    border: 1px solid rgba(255, 215, 106, 0.34);
    background: linear-gradient(135deg, rgba(255, 215, 106, 0.12), rgba(255,255,255,0.04));
    box-shadow: 0 0 20px rgba(255, 199, 46, 0.1);
}

.friend-link img,
.friend-link .presence-avatar-wrap {
    width: 42px;
    height: 42px;
}

.friend-link img {
    border-radius: 50%;
    object-fit: cover;
}

.friend-link div {
    display: grid;
    gap: 3px;
}

.friend-link strong,
.friend-result > span,
.participant-list-name {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.friend-link div span {
    color: #a9b2d0;
    font-size: 0.9rem;
}

.friend-search-block h3 {
    margin-bottom: 12px;
}

.friend-search-row {
    display: flex;
    gap: 10px;
}

.friend-search-row input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #2a2d4a;
    background: #0f1226;
    color: #fff;
}

.friend-search-results {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.friend-result,
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.friend-result img,
.friend-result .presence-avatar-wrap,
.notification-item img {
    width: 38px;
    height: 38px;
}

.friend-result img,
.notification-item img {
    border-radius: 50%;
    object-fit: cover;
}

.friend-result > .presence-avatar-wrap + span {
    color: #eef2ff;
}

.friend-result button {
    margin-left: auto;
}

.notifications-panel {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 7, 18, 0.72);
    backdrop-filter: blur(8px);
}

.notifications-card {
    position: relative;
    width: min(560px, 100%);
    max-height: 80vh;
    overflow: auto;
    border-radius: 26px;
    background: rgba(22,23,48,0.98);
    border: 1px solid rgba(99,205,218,0.18);
    padding: 28px;
}

.terms-card {
    width: min(720px, 100%);
}

.terms-body {
    display: grid;
    gap: 14px;
    color: #d8def6;
    line-height: 1.55;
}

.terms-body h3 {
    margin-top: 8px;
    color: #ffffff;
    font-size: 1rem;
}

.terms-body ul {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    color: #edf2ff;
}

.terms-check input {
    margin-top: 3px;
}

.admin-grid {
    display: grid;
    gap: 16px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.admin-stat {
    border: 1px solid rgba(99, 205, 218, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: rgba(16, 20, 42, 0.85);
}

.admin-stat strong {
    display: block;
    color: #a9b2d0;
    font-size: 0.86rem;
    margin-bottom: 4px;
}

.admin-meter {
    width: 100%;
    height: 7px;
    margin-top: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.admin-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #63cdda, #ffcc5c);
    transition: width 0.25s ease;
}

.admin-live-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(99, 205, 218, 0.35);
    border-radius: 999px;
    color: #9fe5ff;
    background: rgba(99, 205, 218, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
}

.admin-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.admin-setting-wide {
    grid-column: 1 / -1;
}

.admin-config-summary {
    display: grid;
    gap: 6px;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(99, 205, 218, 0.2);
    border-radius: 12px;
    background: rgba(16, 20, 42, 0.85);
    color: #a9b2d0;
    font-size: 0.88rem;
    line-height: 1.45;
}

.admin-path {
    font-size: 0.9rem;
    color: #9fb0d6;
}

.admin-list {
    display: grid;
    gap: 8px;
}

.admin-item {
    border: 1px solid rgba(99, 205, 218, 0.2);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(16, 20, 42, 0.85);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.admin-item-meta {
    color: #a9b2d0;
    font-size: 0.86rem;
}

.admin-item-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-log-box {
    width: 100%;
    min-height: 240px;
    max-height: 420px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(99, 205, 218, 0.22);
    padding: 12px;
    background: #090d24;
    color: #ced8ff;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(99, 205, 218, 0.35);
    color: #9fe5ff;
    font-size: 0.7rem;
}

.notifications-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.notification-item {
    cursor: pointer;
}

.notification-item.unread {
    border: 1px solid rgba(99,205,218,0.32);
}

.notification-copy {
    flex: 1;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.mini-button {
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    background: rgba(95,99,255,0.25);
}

.private-chat-page {
    width: min(920px, 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

.private-back-btn {
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 11px 18px;
    border: 1px solid rgba(255,255,255,0.08);
    width: auto;
}

.private-chat-card {
    position: relative;
    overflow: hidden;
    height: min(760px, calc(100vh - 96px));
    min-height: 560px;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(30, 34, 72, 0.96), rgba(17, 20, 43, 0.96)),
        rgba(22, 23, 48, 0.94);
}

.private-chat-card:hover {
    transform: none;
}

.private-chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background:
        linear-gradient(90deg, rgba(95, 99, 255, 0.22), rgba(99, 205, 218, 0.08)),
        rgba(10, 13, 29, 0.32);
}

.private-chat-header img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(99, 205, 218, 0.42);
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.private-presence-avatar,
.private-presence-avatar img {
    width: 58px;
    height: 58px;
}

.private-presence-avatar .presence-dot {
    right: 2px;
    bottom: 2px;
    width: 15px;
    height: 15px;
    box-shadow: 0 0 0 3px #20254a;
}

.private-chat-title {
    min-width: 0;
}

.private-chat-header h1 {
    font-size: 1.45rem;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.private-chat-header p {
    margin-top: 4px;
    color: #a9b2d0;
    font-size: 0.92rem;
}

.private-messages {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border-radius: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(99, 205, 218, 0.10), transparent 24%),
        radial-gradient(circle at 86% 18%, rgba(95, 99, 255, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(10,13,29,0.86), rgba(8,10,24,0.94));
}

.private-empty-state {
    margin: auto;
    display: grid;
    gap: 6px;
    text-align: center;
    color: #d8e2ff;
    padding: 26px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
}

.private-empty-state span {
    color: #a9b2d0;
    font-size: 0.94rem;
}

.private-message-row {
    display: flex;
    justify-content: flex-start;
    animation: messageFade 0.2s ease;
}

.private-message-row.mine {
    justify-content: flex-end;
}

.private-message {
    position: relative;
    max-width: min(68%, 560px);
    min-width: 86px;
    padding: 12px 14px 9px;
    border-radius: 6px 18px 18px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.private-message.mine {
    border-radius: 18px 6px 18px 18px;
    background: linear-gradient(135deg, #5963f4, #4f92ff);
    border-color: rgba(255,255,255,0.16);
}

.private-message-text {
    display: block;
    color: #f7f9ff;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.private-message-media {
    display: block;
    width: auto;
    max-width: min(280px, 100%);
    max-height: 280px;
    margin: 4px 0;
    border-radius: 14px;
    object-fit: contain;
    background: rgba(0,0,0,0.22);
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.private-message-link {
    color: #aeeaff;
    text-decoration: none;
    word-break: break-all;
}

.private-message-link:hover {
    text-decoration: underline;
}

.private-message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: rgba(224, 232, 255, 0.62);
    font-size: 0.72rem;
    line-height: 1;
}

.private-message-meta .reply-btn {
    color: rgba(224, 232, 255, 0.78);
    font-size: 0.78rem;
    padding: 2px 5px;
}

.message-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-action-btn,
.message-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: rgba(238, 244, 255, 0.86);
    cursor: pointer;
    font-size: 0.78rem;
}

.message-action-btn:hover,
.message-reaction-btn:hover,
.message-reaction-btn.active {
    background: rgba(99, 205, 218, 0.18);
    color: #ffffff;
}

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.message-reaction-btn {
    gap: 4px;
    width: auto;
    padding: 0 7px;
}

.message-reaction-btn strong {
    font-size: 0.68rem;
}

.message-deleted {
    opacity: 0.72;
}

.message-deleted .private-reply-btn,
.message-deleted .reply-btn,
.message-deleted .message-reactions {
    display: none;
}

.message-pinned {
    border-color: rgba(255, 205, 78, 0.45);
}

.message-edited-label {
    margin-top: 5px;
    color: rgba(224, 232, 255, 0.56);
    font-size: 0.72rem;
}

.private-pinned-messages,
.room-pinned-message {
    display: grid;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 205, 78, 0.24);
    background: rgba(255, 205, 78, 0.08);
    color: #fff3c2;
}

.private-pinned-message {
    display: grid;
    gap: 3px;
}

.private-pinned-message strong,
.room-pinned-message strong {
    font-size: 0.78rem;
}

.private-pinned-message span,
.room-pinned-message span {
    color: #f8f1d2;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.private-reply-banner {
    margin: 10px 20px 0;
}

.private-attachment-preview {
    padding: 10px 20px 0;
    background: rgba(11, 14, 32, 0.84);
}

.private-attachment-preview .chat-attachment-card {
    width: min(180px, 72%);
}

.message-read-status {
    color: rgba(255,255,255,0.76);
    font-size: 0.78rem;
    line-height: 1;
}

.message-read-status.read {
    color: #9fe7ff;
}

.private-compose {
    display: flex;
    gap: 12px;
    padding: 18px 20px;
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(11, 14, 32, 0.84);
}

.private-compose input {
    flex: 1;
    min-width: 0;
    padding: 15px 18px;
    border-radius: 999px;
    border: 1px solid rgba(99, 205, 218, 0.18);
    background: rgba(15, 18, 38, 0.96);
    color: #fff;
    font-size: 0.98rem;
}

.private-file-input {
    display: none;
}

.private-compose input:focus {
    outline: none;
    border-color: rgba(99, 205, 218, 0.72);
    box-shadow: 0 0 0 4px rgba(99, 205, 218, 0.12);
}

.private-compose .button {
    border-radius: 999px;
    min-width: 104px;
    width: auto;
    flex: 0 0 auto;
}

.private-compose .private-attach-btn {
    min-width: 48px;
    width: 48px;
    padding: 0;
    display: grid;
    place-items: center;
}

.private-compose .private-gif-btn {
    min-width: 58px;
    padding: 0 14px;
}

.gif-picker {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(100% + 10px);
    z-index: 70;
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(99, 205, 218, 0.18);
    background: rgba(9, 12, 28, 0.98);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.gif-picker.hidden {
    display: none;
}

.private-gif-picker {
    position: static;
    margin: 0 20px 14px;
}

.gif-picker input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(99, 205, 218, 0.18);
    background: #0f1226;
    color: #fff;
    font-size: 0.94rem;
}

.gif-picker input:focus {
    outline: none;
    border-color: rgba(99, 205, 218, 0.7);
    box-shadow: 0 0 0 4px rgba(99, 205, 218, 0.12);
}

.gif-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.gif-result-btn {
    position: relative;
    width: min(260px, 100%);
    justify-self: center;
    height: 150px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    cursor: pointer;
}

.chat-container .gif-results {
    grid-template-columns: 1fr;
    max-height: 320px;
}

.chat-container .gif-result-btn {
    width: min(240px, 100%);
    height: 132px;
}

.gif-result-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: rgba(0,0,0,0.22);
}

.gif-result-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 205, 218, 0.52);
}

.gif-status {
    min-height: 18px;
    color: #a9b2d0;
    font-size: 0.86rem;
}

.friend-profile-page {
    max-width: 680px;
}

.friend-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.friend-profile-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

.friend-profile-avatar-wrap {
    margin-bottom: 16px;
}

.friend-profile-avatar-wrap .friend-profile-avatar {
    margin-bottom: 0;
}

.friend-profile-presence {
    margin-top: -4px;
    color: #c9d3f4;
    font-weight: 700;
}

.friend-profile-card h1 {
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-profile-card p {
    color: #a9b2d0;
    margin-bottom: 20px;
}

.social-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 7, 18, 0.72);
    backdrop-filter: blur(10px);
}

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

.social-modal-card {
    position: relative;
    width: min(760px, 96vw);
    max-height: min(820px, 92vh);
    border: 1px solid rgba(99, 205, 218, 0.24);
    border-radius: 14px;
    background: rgba(14, 18, 42, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.social-profile-card {
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.social-chat-frame {
    width: 100%;
    height: min(760px, 88vh);
    display: block;
    border: 0;
    background: #090d24;
}

.social-modal-loading,
.social-modal-error {
    padding: 44px 24px;
    color: #d6defc;
    text-align: center;
}

body.social-modal-open {
    overflow: hidden;
}

body.private-chat-embedded {
    overflow: hidden;
}

body.private-chat-embedded .profile-orb,
body.private-chat-embedded .notification-bell,
body.private-chat-embedded .private-back-btn {
    display: none !important;
}

body.private-chat-embedded .private-chat-page {
    min-height: 100vh;
    padding: 0;
}

body.private-chat-embedded .private-chat-card {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.hidden {
    display: none;
}

.upload-progress-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    width: min(360px, calc(100vw - 44px));
    margin: 0;
    padding: 14px;
    border-radius: 14px;
    background: rgba(20, 22, 42, 0.96);
    border: 1px solid rgba(99, 205, 218, 0.28);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(12px);
    animation: uploadProgressFloatIn 0.22s ease;
}

.upload-progress-container.processing {
    border-color: rgba(255, 204, 92, 0.55);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 204, 92, 0.12);
}

.upload-progress-text {
    color: #d7e6ff;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.upload-progress-bar-wrapper {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    background: #63cdda;
    transition: width 0.2s ease;
}

.upload-progress-container.processing .upload-progress-bar {
    background: #ffcc5c;
}

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

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.info-box {
    background: #0f1226;
    border: 1px solid #2a2d4a;
    border-radius: 16px;
    padding: 14px 18px;
    color: #d5ddff;
    flex: 1;
    min-width: 220px;
}

.room-cover-update {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.room-cover-update .button {
    width: fit-content;
}

.room-name-update-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.room-name-update-row input {
    flex: 1;
    min-width: min(260px, 100%);
}

.link {
    color: #63cdda;
    text-decoration: none;
    word-break: break-all;
    cursor: pointer;
}

.link:hover {
    color: #8ee8f0;
}

.room-opening,
.room-title-opening {
    color: #ff6b6b;
    font-weight: 700;
}

.room-closed {
    background: #6a1b1b;
    color: #ffe5e5;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.video-item {
    width: 100%;
    background: #000;
    border-radius: 22px;
    overflow: hidden;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a2d4a;
    position: relative;
}

.video-item::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 22px;
    box-shadow: inset 0 0 40px rgba(255,255,255,0.04);
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#videoPlaceholder {
    color: #aeb8db;
    font-size: 1.1rem;
}

.list {
    list-style: none;
    margin-top: 25px;
}

.list li {
    padding: 14px 0;
    border-bottom: 1px solid #20243f;
    color: #d6defc;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list li:last-child {
    border-bottom: none;
}

.context-menu {
    position: absolute;
    z-index: 9999;
    min-width: 180px;
    background: #11152b;
    border: 1px solid #2a2d4a;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.context-menu.hidden {
    display: none;
}

.context-menu button {
    width: 100%;
    border: none;
    background: transparent;
    color: #eef2ff;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
}

.context-menu button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.context-menu button.danger {
    color: #ff7b7b;
}

.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 35, 63, 0.95);
    border: 1px solid rgba(99, 205, 218, 0.25);
    padding: 16px 22px;
    border-radius: 16px;
    display: none;
    z-index: 9999;
    color: white;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0b0d1f;
}

::-webkit-scrollbar-thumb {
    background: #2f3566;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d58a6;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(10, 13, 29, 0.9);
    border: 1px solid rgba(99, 205, 218, 0.16);
    border-radius: 18px;
    padding: 16px;
}

.chat-message {
    position: relative;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-message:last-child {
    margin-bottom: 0;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.chat-user {
    font-weight: 700;
    color: #d6e2ff;
}

.chat-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: #edf2ff;
    line-height: 1.5;
}

.reply-btn {
    border: none;
    background: transparent;
    color: #8caaff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 6px;
    border-radius: 12px;
}

.reply-btn:hover {
    background: rgba(140, 170, 255, 0.12);
}

.reply-preview {
    border-left: 3px solid #63cdda;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: rgba(99, 205, 218, 0.1);
    border-radius: 14px;
    color: #e6f4ff;
}

.reply-preview strong {
    display: block;
    margin-bottom: 4px;
    color: #b6e0ff;
}

.own-message {
    background: rgba(99, 205, 218, 0.14);
}

.mentioned {
    border-color: #63cdda;
    background: rgba(99, 205, 218, 0.15);
}

.system-message {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    color: #d8e4ff;
}

.system-message.donation-message {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    color: #fffacd;
    font-weight: bold;
}

.typing-indicator {
    color: #caceff;
    font-size: 0.92rem;
    min-height: 20px;
    padding-left: 4px;
}

.chat-reply-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(17, 24, 55, 0.98);
    border: 1px solid rgba(99, 205, 218, 0.14);
    color: #d8e4ff;
    margin: 10px 12px 0;
    font-size: 0.9rem;
}

.chat-reply-banner > div {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-banner strong {
    color: #ffffff;
}

.chat-reply-banner button {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #ff8a8a;
    cursor: pointer;
    font-size: 1rem;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {

    .container {
        padding: 18px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 22px;
    }

    .room-identity-grid {
        grid-template-columns: 1fr;
    }

    .upload-progress-container {
        right: 14px;
        bottom: 14px;
        width: calc(100vw - 28px);
    }

    .custom-controls {
        gap: 8px;
        padding: 12px 10px 14px 58px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .volume-control {
        width: 34px;
        height: 34px;
        padding: 0 7px;
        gap: 6px;
    }

    .volume-control:hover,
    .volume-control:focus-within {
        width: 102px;
        padding: 0 9px 0 8px;
    }

    .volume-slider {
        width: 60px;
        min-width: 60px;
    }

    .time-display {
        min-width: 82px;
        font-size: 0.78rem;
    }

    .video-item {
        height: 260px;
    }

    .button {
        width: 100%;
    }

    .private-chat-page {
        justify-content: flex-start;
        padding: 14px;
    }

    .private-back-btn {
        width: auto;
        margin-bottom: 10px;
    }

    .private-chat-card {
        min-height: calc(100vh - 84px);
        height: calc(100vh - 84px);
        border-radius: 18px;
    }

    .private-chat-header {
        padding: 16px;
    }

    .private-chat-header img {
        width: 48px;
        height: 48px;
    }

    .private-messages {
        padding: 16px 12px;
        gap: 10px;
    }

    .private-message {
        max-width: 84%;
    }

    .private-compose {
        padding: 12px;
        gap: 8px;
    }

    .private-compose input {
        padding: 13px 14px;
    }

    .private-compose .button {
        width: auto;
        min-width: 82px;
        padding: 13px 15px;
    }

    .private-compose .private-attach-btn {
        min-width: 44px;
        width: 44px;
        padding: 0;
    }

    .private-compose .private-gif-btn {
        min-width: 48px;
        padding: 0 10px;
    }

    .private-gif-picker {
        margin: 0 12px 10px;
    }

    .gif-results {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .gif-result-btn,
    .chat-container .gif-result-btn {
        width: min(220px, 100%);
        height: 124px;
    }

    .private-message-media {
        max-width: min(230px, 100%);
        max-height: 230px;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .profile-editor {
        align-items: stretch;
    }

    .profile-actions {
        flex-direction: column;
    }

    .vip-store-card {
        grid-template-columns: 1fr;
    }

    .vip-store-buy {
        justify-items: stretch;
    }

    .profile-card .info-row {
        grid-template-columns: 1fr;
    }

    .info-box {
        min-width: 100%;
    }
}

.video-source-selector {
    margin-bottom: 20px;
}

.source-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.source-tab {
    flex: 1;
    min-width: 130px;
    padding: 12px 16px;
    border: 2px solid rgba(99, 205, 218, 0.2);
    background: rgba(22, 23, 48, 0.5);
    color: #a9b2d0;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.source-tab:hover {
    border-color: rgba(99, 205, 218, 0.4);
    background: rgba(99, 205, 218, 0.1);
}

.source-tab.active {
    background: linear-gradient(135deg, #5f63ff, #6b8cff);
    border-color: #5f63ff;
    color: white;
}

.source-tab.vip-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.source-content {
    animation: fadeInContent 0.3s ease;
}

.drive-picker-btn {
    margin-top: 10px;
    width: fit-content;
}

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

.youtube-player {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 22px;
}

.youtube-click-shield {
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 0;
    background: transparent;
    cursor: pointer;
}

/* PLAYER CUSTOMIZADO */

.custom-player {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: black;
}

.custom-controls {
    position: absolute;
    z-index: 7;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 16px 20px 20px 86px;
    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.85),
            rgba(0,0,0,0)
        );

    display: flex;
    align-items: center;
    gap: 14px;

    opacity: 0;
    transition: 0.25s;
}

.custom-player:hover .custom-controls {
    opacity: 1;
}

.player-controls-idle .custom-controls,
.player-controls-idle .video-search-btn,
.player-controls-idle .video-search-input-container,
.player-controls-idle .player-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.player-controls-idle {
    cursor: none;
}

.control-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255,255,255,0.16);
    transform: scale(1.05);
}

.progress-area {
    flex: 1;
    height: 7px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow: visible;
    cursor: pointer;
    position: relative;
}

.buffer-bar,
.progress-bar {
    width: 0%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    border-radius: 999px;
}

.buffer-bar {
    z-index: 1;
    background: rgba(255,255,255,0.32);
}

.progress-bar {
    z-index: 2;
    background:
        linear-gradient(
            90deg,
            #63cdda,
            #6b8cff
        );
}

.progress-hover-marker {
    position: absolute;
    top: -4px;
    z-index: 3;
    width: 2px;
    height: 15px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    pointer-events: none;
    transform: translateX(-50%);
}

.progress-hover-marker.hidden {
    display: none;
}

.timeline-preview {
    position: absolute;
    left: 0;
    bottom: 20px;
    z-index: 12;
    width: min(190px, 42vw);
    aspect-ratio: 16 / 9;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 8px;
    overflow: hidden;
    background: #05060d;
    box-shadow: 0 14px 34px rgba(0,0,0,0.5);
    pointer-events: none;
    transform: translateX(-50%);
}

.timeline-preview.hidden {
    display: none;
}

.timeline-preview-video,
.timeline-preview-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.timeline-preview-time {
    position: absolute;
    left: 50%;
    bottom: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0,0,0,0.76);
    font-size: 0.78rem;
    font-weight: 700;
    transform: translateX(-50%);
}

.buffer-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 9;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.2);
    border-top-color: #ffffff;
    transform: translate(-50%, -50%);
    animation: playerSpin 0.85s linear infinite;
    pointer-events: none;
}

.buffer-loader.hidden {
    display: none;
}

.player-error {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;
    width: min(520px, calc(100% - 36px));
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    background: rgba(8, 10, 22, 0.92);
    color: #fff;
    line-height: 1.45;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 18px 44px rgba(0,0,0,0.42);
}

.player-error.hidden {
    display: none;
}

@keyframes playerSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.time-display {
    font-size: 0.9rem;
    color: #d6defc;
    min-width: 110px;
    text-align: center;
}

.quality-selector {
    position: relative;
    flex: 0 0 auto;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 38px;
    width: 38px;
    padding: 0 8px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
        rgba(8, 10, 22, 0.78);
    border: 1px solid rgba(99, 205, 218, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        0 8px 22px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    overflow: hidden;
    transition: width 0.22s ease, padding 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.volume-control:hover,
.volume-control:focus-within {
    width: 128px;
    padding: 0 12px 0 10px;
    border-color: rgba(99, 205, 218, 0.45);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.07)),
        rgba(8, 10, 22, 0.9);
}

.volume-icon-btn {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.volume-slider {
    --volume-percent: 100%;
    width: 78px;
    min-width: 78px;
    height: 18px;
    appearance: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s ease;
}

.volume-control:hover .volume-slider,
.volume-control:focus-within .volume-slider {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.volume-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, #63cdda 0 var(--volume-percent), rgba(255,255,255,0.32) var(--volume-percent) 100%);
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(99, 205, 218, 0.8);
    box-shadow: 0 0 12px rgba(99, 205, 218, 0.55);
}

.volume-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.32);
}

.volume-slider::-moz-range-progress {
    height: 4px;
    border-radius: 999px;
    background: #63cdda;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(99, 205, 218, 0.8);
    box-shadow: 0 0 12px rgba(99, 205, 218, 0.55);
}

.quality-btn {
    font-size: 1.05rem;
}

.live-edge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 78px;
    padding: 0 13px;
    color: #edf2ff;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05)),
        rgba(18, 21, 34, 0.72);
    border-color: rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        0 8px 22px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
}

.live-edge-btn:hover {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)),
        rgba(24, 28, 44, 0.82);
    border-color: rgba(255, 255, 255, 0.24);
}

.live-edge-btn.hidden {
    display: none;
}

.live-edge-btn::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #ff4d6d;
    box-shadow: 0 0 12px rgba(255, 77, 109, 0.85);
}

.quality-menu {
    position: absolute;
    right: 0;
    bottom: 52px;
    z-index: 8;
    min-width: 116px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(8, 10, 22, 0.96);
    box-shadow: 0 14px 34px rgba(0,0,0,0.42);
    display: grid;
    gap: 6px;
    backdrop-filter: blur(12px);
}

.quality-menu.hidden {
    display: none;
}

.quality-option {
    border: 0;
    border-radius: 9px;
    padding: 9px 10px;
    background: transparent;
    color: #d6defc;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
}

.quality-option:hover,
.quality-option.active {
    background: rgba(99,205,218,0.18);
    color: #ffffff;
}

.quality-option:disabled {
    color: rgba(214, 222, 252, 0.42);
    cursor: not-allowed;
}

.quality-option:disabled:hover {
    background: transparent;
    color: rgba(214, 222, 252, 0.42);
}

.quality-status {
    padding: 6px 8px;
    color: #a9b2d0;
    font-size: 0.78rem;
    white-space: nowrap;
}

.player-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 94px;
    height: 94px;
    margin: auto;
    border-radius: 24px;
    background: rgba(0,0,0,0.32);
    box-shadow: 0 0 34px rgba(99, 205, 218, 0.18);

    opacity: 0;

    transition: opacity 0.2s ease;
    pointer-events: none;
}

.overlay-play-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: pulse 1.8s infinite ease-in-out;
    filter: drop-shadow(0 0 18px rgba(115, 173, 255, 0.55));
}

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

.custom-player:hover .player-overlay {
    pointer-events: all;
}

.play-toggle-btn {
    position: absolute;
    left: 18px;
    bottom: 18px;
    background: rgba(0,0,0,0.72);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.control-btn .control-icon,
.play-toggle-btn .control-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.play-toggle-btn.playing .control-icon {
    opacity: 0;
}

.play-toggle-btn.playing::before,
.play-toggle-btn.playing::after {
    content: '';
    position: absolute;
    top: 12px;
    width: 4px;
    height: 16px;
    background: white;
    border-radius: 2px;
}

.play-toggle-btn.playing::before {
    left: 14px;
}

.play-toggle-btn.playing::after {
    right: 14px;
}

.control-btn:hover {
    background: rgba(255,255,255,0.16);
    transform: scale(1.05);
}

.video-search-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.video-search-btn:hover {
    transform: scale(1.05);
    background: rgba(99,205,218,0.22);
}

.video-search-input-container {
    position: absolute;
    top: 14px;
    right: 74px;
    width: min(700px, calc(100% - 120px));
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 6;
}

.video-search-input-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0);
    pointer-events: auto;
}

.video-search-input-container input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.55);
    color: #f5f8ff;
    outline: none;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.video-search-input-container input::placeholder {
    color: rgba(255,255,255,0.75);
}

.video-search-input-container button {
    min-width: 90px;
    padding: 12px 16px;
    border-radius: 999px;
    border: none;
    background: rgba(99,205,218,0.18);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.video-search-input-container button:hover {
    background: rgba(99,205,218,0.32);
}

.video-search-input-container .video-search-gif-btn {
    min-width: 58px;
    padding: 12px 14px;
}

.video-search-gif-picker {
    position: absolute;
    top: 56px;
    right: 0;
    bottom: auto;
    left: auto;
    width: min(360px, 100%);
    max-height: min(420px, calc(100vh - 120px));
    overflow: hidden;
    z-index: 8;
}

.video-search-gif-picker input {
    width: 100%;
    flex: none;
    margin-bottom: 10px;
}

.video-search-gif-picker .gif-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 280px;
}

.video-search-input-container .video-search-gif-picker .gif-result-btn {
    min-width: 0;
    width: 100%;
    height: 82px;
    padding: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
}

.video-search-input-container .video-search-gif-picker .gif-result-btn:hover {
    background: rgba(99,205,218,0.20);
}

.room-queue-panel {
    margin-top: 22px;
    border: 1px solid rgba(99, 205, 218, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 18, 38, 0.92), rgba(12, 15, 32, 0.88));
    overflow: hidden;
    box-shadow: inset 0 0 24px rgba(255,255,255,0.03);
}

.room-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(99, 205, 218, 0.12);
}

.room-queue-header h3 {
    margin: 0 0 4px;
    font-size: 1.08rem;
}

.room-queue-header p {
    margin: 0;
    color: #a9b2d0;
    font-size: 0.92rem;
}

.room-queue-count {
    min-width: 42px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #dffaff;
    background: rgba(99, 205, 218, 0.12);
    border: 1px solid rgba(99, 205, 218, 0.24);
    font-weight: 800;
}

.room-queue-list {
    display: grid;
    gap: 10px;
    padding: 14px;
    max-height: 330px;
    overflow-y: auto;
}

.room-queue-empty {
    padding: 18px;
    color: #a9b2d0;
    text-align: center;
    border: 1px dashed rgba(169, 178, 208, 0.22);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
}

.room-queue-item {
    display: grid;
    grid-template-columns: 38px 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(99, 205, 218, 0.14);
    border-radius: 14px;
    background: rgba(19, 23, 48, 0.92);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.room-queue-item.dragging {
    opacity: 0.62;
    transform: scale(0.99);
}

.room-queue-item.drag-over {
    border-color: rgba(99, 205, 218, 0.65);
    background: rgba(99, 205, 218, 0.08);
}

.room-queue-grip,
.room-queue-play,
.room-queue-remove {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #f4f7ff;
    cursor: pointer;
}

.room-queue-grip {
    cursor: grab;
    color: #a9b2d0;
}

.room-queue-grip:active {
    cursor: grabbing;
}

.room-queue-position {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(95, 99, 255, 0.18);
    color: #dce1ff;
    font-weight: 800;
}

.room-queue-main {
    min-width: 0;
}

.room-queue-main strong,
.room-queue-main span {
    display: block;
}

.room-queue-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.98rem;
}

.room-queue-main span {
    margin-top: 3px;
    color: #9fb0d6;
    font-size: 0.84rem;
}

.room-queue-status.queue-processing {
    color: #ffd166;
}

.room-queue-status.queue-ready {
    color: #4ee28a;
    font-weight: 700;
}

.room-queue-status.queue-failed {
    color: #ff7b7b;
    font-weight: 700;
}

.room-queue-actions {
    display: flex;
    gap: 8px;
}

.room-queue-play:hover {
    border-color: rgba(99, 205, 218, 0.55);
    background: rgba(99, 205, 218, 0.16);
}

.room-queue-remove:hover {
    border-color: rgba(255, 107, 107, 0.55);
    background: rgba(255, 107, 107, 0.14);
}

/* CHAT */
.room-layout {
    margin-top: 25px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--room-chat-width);
    align-items: stretch;
    gap: 20px;
}

.room-layout.chat-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.room-layout.chat-hidden .chat-container {
    display: none;
}

.room-layout.chat-hidden .video-item {
    height: min(78vh, 820px);
}

.room-layout .video-item {
    height: clamp(560px, 70vh, 760px);
    min-height: 560px;
}

.chat-container {
    position: relative;
    margin-top: 0;
    background: rgba(13, 16, 36, 0.97);
    border: 1px solid rgba(99, 205, 218, 0.16);
    border-radius: 18px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: clamp(560px, 70vh, 760px);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.35),
        inset 0 0 30px rgba(255,255,255,0.03);
}

.chat-resize-handle {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: -10px;
    width: 14px;
    cursor: ew-resize;
    z-index: 6;
}

.chat-resize-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 4px;
    height: 72px;
    border-radius: 999px;
    background: rgba(99, 205, 218, 0.22);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease;
}

.chat-container:hover .chat-resize-handle::before,
.chat-resize-handle:hover::before {
    opacity: 1;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(90deg, rgba(28,33,69,0.98), rgba(37,43,88,0.9));
    border-bottom: 1px solid rgba(99, 205, 218, 0.12);
    color: #ffffff;
    border-radius: 18px 18px 0 0;
}

.chat-popout-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.chat-popout-btn:hover {
    background: rgba(99, 205, 218, 0.16);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.show-chat-btn {
    margin-top: 12px;
    width: auto;
    align-self: flex-end;
    padding: 10px 16px;
}

.show-chat-btn.hidden {
    display: none;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        radial-gradient(circle at top right, rgba(99, 205, 218, 0.06), transparent 34%),
        rgba(8, 11, 26, 0.72);
}

.chat-message {
    max-width: 92%;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(99, 205, 218, 0.08);
    border-radius: 16px;
    padding: 12px 14px;
    animation: messageFade 0.2s ease;
}

.chat-message.own-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #5f63ff, #6b8cff);
}

.chat-message.vip-emoji-message {
    width: auto;
    min-width: 0;
    max-width: 148px;
    padding: 8px 10px 12px;
    background: rgba(12, 17, 38, 0.72);
    border-color: rgba(99, 205, 218, 0.22);
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
    overflow: visible;
}

.chat-message.own-message.vip-emoji-message {
    background: rgba(12, 17, 38, 0.72);
    border-color: rgba(99, 205, 218, 0.32);
}

.chat-message.vip-emoji-message .chat-message-header {
    margin-bottom: 2px;
}

.chat-message.vip-emoji-message .chat-user {
    gap: 6px;
}

.chat-message.vip-emoji-message .chat-avatar {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

.chat-message.vip-emoji-message .reply-btn {
    display: none;
}

.chat-message.vip-emoji-message .chat-text {
    display: flex;
    align-items: center;
    justify-content: center;
    place-items: center;
    min-height: 92px;
    line-height: 0;
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: bold;
    color: #63cdda;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
}

.participant-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}

.chat-message.own-message .chat-user {
    color: white;
}

.chat-text {
    color: #ffffff;
    line-height: 1.5;
    word-break: break-word;
    font-size: 0.98rem;
}

.chat-input-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(99, 205, 218, 0.12);
    background: rgba(8, 10, 22, 0.96);
    position: relative;
    border-radius: 0 0 18px 18px;
}

.chat-actions-row {
    display: grid;
    grid-template-columns: 42px 46px 64px minmax(86px, auto);
    justify-content: end;
    gap: 8px;
}

.mention-suggestions {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(11, 16, 34, 0.98);
    border: 1px solid rgba(99, 205, 218, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
}

.mention-suggestions button {
    width: 100%;
    border: none;
    background: transparent;
    color: #e8f1ff;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
}

.mention-suggestions button:hover {
    background: rgba(99, 205, 218, 0.12);
}

.chat-input-area input {
    width: 100%;
    flex: 1;
    min-width: 0;
    background: rgba(15, 18, 38, 0.96);
    border: 1px solid rgba(99, 205, 218, 0.18);
    color: white;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 0.94rem;
    transition: 0.2s;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #63cdda;
    box-shadow: 0 0 0 4px rgba(99,205,218,0.12);
}

.chat-attachment-preview {
    width: 100%;
    padding: 0 0 10px;
}

.chat-attachment-card {
    position: relative;
    width: min(180px, 72%);
    min-height: 82px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(99, 205, 218, 0.18);
    background: rgba(15, 18, 38, 0.92);
}

.chat-attachment-card img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
}

.chat-attachment-card button {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(8, 10, 22, 0.78);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}

.chat-actions-row > button {
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 999px;
}

.chat-actions-row > button:first-child,
.chat-actions-row .open-emoji-btn {
    width: 46px;
    padding: 0;
}

.chat-actions-row > .gif-button {
    width: auto;
}

.chat-container .emoji-wrapper {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: 7;
    margin: 0;
}

.chat-container .open-emoji-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
}

.chat-container .emoji-popup {
    right: 0;
    left: auto;
    bottom: 52px;
}

@media (max-width: 640px) {
    .room-layout {
        grid-template-columns: 1fr;
    }

    .room-queue-header {
        align-items: flex-start;
    }

    .room-queue-item {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .room-queue-position {
        display: none;
    }

    .room-queue-actions {
        gap: 6px;
    }

    .room-queue-grip,
    .room-queue-play,
    .room-queue-remove {
        width: 34px;
        height: 34px;
    }

    .room-layout .video-item {
        height: auto;
        min-height: 300px;
        aspect-ratio: 16 / 9;
    }

    .chat-container {
        height: 560px;
    }

    .chat-resize-handle {
        display: none;
    }
}

@keyframes messageFade {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    .chat-container {
        min-height: 420px;
        height: 560px;
        overflow: visible;
    }

    .chat-messages {
        gap: 12px;
        padding: 14px;
    }

    .chat-input-area {
        gap: 8px;
        padding: 10px;
    }

    .chat-input-area input {
        width: 100%;
    }

    .chat-actions-row {
        grid-template-columns: 42px 42px 54px minmax(72px, auto);
    }

    .chat-actions-row > button:first-child,
    .chat-actions-row .open-emoji-btn {
        width: 42px;
    }

    .chat-message {
        max-width: 94%;
        font-size: 0.95rem;
    }

    .chat-message.own-message {
        align-self: flex-end;
    }
}
.video-chat-overlay {
    position: absolute;
    left: 20px;
    bottom: 90px;
    width: 380px;
    max-height: 60%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    z-index: 20;
}

.video-chat-message {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    color: white;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: videoMessageEnter 0.25s ease;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 4px 15px rgba(0,0,0,0.35);
    word-break: break-word;
}

.video-chat-message img {
    max-width: 100%;
    max-height: 200px;
    display: block;
    margin-top: 8px;
    border-radius: 12px;
}

.video-chat-user {
    font-weight: bold;
    color: #63cdda;
}

@keyframes videoMessageEnter {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    .video-chat-overlay {
        width: calc(100% - 30px);
        left: 15px;
        bottom: 75px;
    }

    .video-chat-message {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}
.emoji-wrapper{
  position:relative;
  margin-top:12px;
}

.open-emoji-btn{
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  cursor:pointer;
  font-size:22px;
  background:rgba(255,255,255,0.08);
  transition:0.2s;
}

.open-emoji-btn:hover{
  transform:scale(1.08);
  background:rgba(255,255,255,0.15);
}

.emoji-popup{
  position:absolute;
  bottom:55px;
  left:0;

  width: min(360px, calc(100vw - 28px));
  max-height: 420px;

  overflow-y:auto;

  display:flex;
  flex-wrap:wrap;
  gap:10px;

  padding:12px;

  border-radius:18px;

  background:
    linear-gradient(180deg, rgba(21, 25, 57, 0.98), rgba(9, 12, 28, 0.98));
  border: 1px solid rgba(99, 205, 218, 0.18);

  backdrop-filter:blur(14px);

  box-shadow:
    0 18px 50px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.05);

  z-index:999;
}

.emoji-popup.hidden{
  display:none;
}

.emoji-btn{
  border:none;
  background:rgba(255,255,255,0.07);
  border-radius:12px;
  width: 42px;
  height: 42px;
  padding:0;
  cursor:pointer;
  font-size:22px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  border: 1px solid rgba(255,255,255,0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.emoji-btn:hover{
  transform:translateY(-2px) scale(1.06);
  background:rgba(99,205,218,0.15);
  border-color: rgba(99,205,218,0.28);
}

.emoji-vip-section {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 0%, rgba(99,205,218,0.26), transparent 36%),
    linear-gradient(135deg, rgba(255,215,106,0.16), rgba(95,99,255,0.16));
  border: 1px solid rgba(255, 215, 106, 0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.emoji-vip-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.emoji-vip-heading span {
  color: #ffd76a;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.emoji-vip-heading small {
  color: rgba(255,255,255,0.72);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: right;
}

.emoji-vip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.emoji-normal-heading {
  width: 100%;
  margin-top: 2px;
  color: rgba(255,255,255,0.68);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vip-emoji-btn {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 82px;
  display: inline-grid;
  place-items: center;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 106, 0.34);
  background:
    radial-gradient(circle at 50% 20%, rgba(99,205,218,0.20), transparent 46%),
    rgba(255, 215, 106, 0.08);
}

.vip-emoji-btn:hover {
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 50% 20%, rgba(99,205,218,0.28), transparent 50%),
    rgba(255, 215, 106, 0.14);
  border-color: rgba(255, 215, 106, 0.52);
}

.vip-emoji-btn.vip-locked {
  opacity: 0.72;
  filter: grayscale(0.15);
}

.vip-emoji-btn.vip-locked:hover {
  transform: translateY(-1px);
  background:
    radial-gradient(circle at 50% 20%, rgba(99,205,218,0.18), transparent 46%),
    rgba(255, 215, 106, 0.08);
}

.vip-emoji-lock {
  position: absolute;
  right: 7px;
  top: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe28a, #d6a319);
  color: #211601;
  font-size: 0.58rem;
  font-weight: 900;
}

.vip-animated-emoji-wrap,
.vip-emoji-preview,
.vip-animated-emoji {
  width: 74px;
  height: 74px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 0 10px rgba(99, 205, 218, 0.34));
}

.vip-animated-emoji-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.vip-animated-emoji {
  display: block;
  margin: 0;
}

.video-chat-message{
  font-size:18px;
  line-height:1.4;
  animation:fadeIn 0.3s ease;
}

.video-chat-message.vip-emoji-floating-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.video-chat-message.vip-emoji-floating-message .vip-animated-emoji-wrap,
.video-chat-message.vip-emoji-floating-message .vip-animated-emoji {
  width: 64px;
  height: 64px;
}

.video-chat-user{
  font-weight:bold;
  color:#00e5ff;
}

.chat-username.vip-user,
.video-chat-message.vip-message .video-chat-user {
  color: #ffd76a;
  text-shadow: 0 0 10px rgba(255, 199, 46, 0.45);
}

.vip-name {
  color: #ffd76a;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 199, 46, 0.45);
}

.vip-avatar {
  border-color: rgba(255, 215, 106, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 215, 106, 0.16), 0 0 20px rgba(255, 199, 46, 0.35);
}

#participantsList li.vip-participant {
  border-color: rgba(255, 215, 106, 0.4);
  background: rgba(255, 215, 106, 0.08);
}

#participantsList li.vip-participant > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe28a, #d6a319);
  color: #211601;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@keyframes fadeIn{

  from{
    opacity:0;
    transform:translateY(10px);
  }

  to{
    opacity:1;
    transform:translateY(0);
  }

}
.system-message{

  display:flex;
  align-items:center;
  gap:8px;

  background:rgba(255,255,255,0.06);

  border-left:4px solid #00e5ff;

  padding:10px 12px;

  border-radius:10px;

  margin-bottom:10px;

  color:#d9f7ff;

  font-size:14px;

  animation:fadeIn 0.3s ease;
}

.system-message img {
  max-width: 150px;
  max-height: 150px;
  display: block;
  margin-top: 5px;
  border-radius: 8px;
}

.system-icon{
  font-size:18px;
}

.video-system-message{

  background:rgba(0,0,0,0.45);

  color:white;

  padding:8px 14px;

  border-radius:14px;

  margin-bottom:8px;

  width:fit-content;

  backdrop-filter:blur(6px);

  font-size:15px;

  animation:fadeIn 0.3s ease;

  transition:0.4s;
}

.video-system-message.donation-message {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
  border: 1px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  color: #fffacd;
  font-weight: bold;
}

.video-system-message img {
  max-width: 100px;
  max-height: 100px;
  display: block;
  margin-top: 5px;
  border-radius: 6px;
}
