:root {
    --bg-main: #0b0b0b;
    --bg-panel: #151515;
    --bg-panel-light: #202020;
    --border: #2d2d2d;
    --martell-gold: #d4af37;
    --martell-orange: #f97316;
    --text-main: #e5e5e5;
    --text-muted: #9ca3af;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

.app-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    background: radial-gradient(circle at center, #111 0%, #050505 100%);
}

.sidebar,
.members-sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.members-sidebar {
    max-height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.sidebar h1,
.members-sidebar h1 {
    margin: 0;
    padding: 24px 22px;
    font-size: 24px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.channel-list {
    padding: 12px;
    flex: 1;
}

.channel-item {
    padding: 14px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
}

.channel-item:hover,
.channel-item:first-child {
    background: var(--bg-panel-light);
    color: var(--text-main);
}

.channel-item.voice {
    color: var(--martell-gold);
}

.user-panel {
    border-top: 1px solid var(--border);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.user-panel small {
    display: block;
    color: var(--text-muted);
    margin-top: 4px;
}

.settings-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
}

.main-content {
    min-width: 0;
    min-height: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.channel-header {
    height: 80px;
    border-bottom: 1px solid var(--border);
    padding: 18px 26px;
}

.channel-header h2 {
    margin: 0;
    color: var(--martell-gold);
}

.channel-header span {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 1px;
}

.chat-area {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 26px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    color: var(--text-muted);
}

.message-box {
    height: 76px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
}

.message-box input {
    flex: 1;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 16px;
    border-radius: 8px;
    outline: none;
}

.message-box input:focus {
    border-color: var(--martell-gold);
}

.message-box button {
    background: transparent;
    color: var(--martell-gold);
    border: 2px solid var(--martell-gold);
    border-radius: 8px;
    padding: 14px 24px;
    font-weight: 800;
    cursor: pointer;
}

.member {
    padding: 12px 0;
    font-weight: 700;
}

.channel-item {
    width: 100%;
    border: none;
    text-align: left;
    background: transparent;
    font-size: 16px;
}

.channel-item.active {
    background: var(--bg-panel-light);
    color: var(--text-main);
}

.chat-message {
    display: flex;
    width: 100%;
    margin-bottom: 10px;
}

.chat-message:not(.own) {
    justify-content: flex-start;
}

.chat-message.own {
    justify-content: flex-end;
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
    object-fit: cover;
    font-size: 16px;
}

.message-bubble {
    background: rgba(22, 22, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 12px 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.chat-message.own .message-bubble {
    border-color: rgba(212, 175, 55, 0.28);
    background: linear-gradient(180deg, rgba(50, 38, 12, 0.95), rgba(31, 24, 10, 0.96));
    border-bottom-right-radius: 6px;
}

.chat-message:not(.own) .message-bubble {
    background: linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(16, 16, 16, 0.96));
    border-bottom-left-radius: 6px;
}

.message-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.message-author {
    color: var(--martell-gold);
    font-weight: 800;
    font-size: 15px;
}

.message-time {
    color: #93a0ad;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 2px;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: 15px;
    margin-top: 2px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    display: inline-block;
    border-radius: 50%;
    margin-right: 8px;
}

.voice-controls {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    gap: 10px;
}

.voice-controls button {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--bg-panel-light);
    color: var(--text-main);
    border-radius: 50%;
    cursor: pointer;
}

.voice-controls button.danger {
    background: var(--danger);
    color: white;
}

.hidden {
    display: none !important;
}

.voice-stage {
    flex: 1;
    align-items: center;
    justify-content: center;
}

.voice-card {
    width: 530px;
    height: 300px;
    border: 1px solid var(--border);
    background: rgba(25, 25, 25, 0.95);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.55);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 900;
}

.voice-card span {
    position: absolute;
    left: 14px;
    bottom: 12px;
    background: #050505;
    padding: 4px 10px;
    border-radius: 4px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal {
    width: 500px;
    background: var(--bg-panel);
    border: 1px solid var(--martell-gold);
    border-radius: 12px;
    padding: 30px;
    position: relative;
}

.settings-modal h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.settings-modal label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--martell-gold);
    font-weight: 800;
}

.settings-modal select,
.settings-modal input[type="file"] {
    width: 100%;
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
}

.upload-row {
    display: flex;
    gap: 10px;
}

.upload-row input {
    flex: 1;
}

.upload-row button,
.modal-confirm {
    background: transparent;
    color: var(--martell-gold);
    border: 1px solid var(--martell-gold);
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
}

.modal-confirm {
    width: 100%;
    margin-top: 24px;
}

.modal-close {
    position: absolute;
    right: 24px;
    top: 20px;
    background: transparent;
    border: none;
    color: var(--martell-gold);
    font-size: 32px;
    cursor: pointer;
}

.logout-btn {
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    margin-left: 4px;
}

.logout-btn:hover {
    color: #fecaca;
}

.avatar,
.message-avatar {
    object-fit: cover;
}

img.avatar,
img.message-avatar {
    display: block;
}

.settings-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
}

.channel-admin-bar {
    padding: 0 12px 10px;
}

.channel-admin-bar button {
    width: 100%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--martell-gold);
    padding: 10px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
}

.channel-admin-bar button:hover {
    background: rgba(212, 175, 55, 0.18);
}

.channel-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.channel-row .channel-item {
    margin-bottom: 0;
    flex: 1;
}

.channel-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.channel-row:hover .channel-actions {
    opacity: 1;
}

.channel-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--bg-panel-light);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 900;
}

.channel-actions button:hover {
    color: var(--martell-gold);
}

.channel-actions .delete-channel-btn:hover {
    color: var(--danger);
}

.file-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: var(--martell-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}

.file-button input {
    display: none;
}

.selected-file-name {
    max-width: 180px;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-attachment {
    margin-top: 10px;
}

.chat-image {
    max-width: 360px;
    max-height: 280px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    object-fit: cover;
    display: block;
}

.chat-video {
    max-width: 420px;
    max-height: 280px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: block;
}

.file-attachment {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.file-attachment a {
    color: var(--martell-gold);
    text-decoration: none;
    font-weight: 700;
}

.file-attachment a:hover {
    text-decoration: underline;
}

.message-attachment audio {
    width: 280px;
}

.channel-header,
.message-box {
    flex-shrink: 0;
}

/* Discord-like dark scrollbar */
.chat-area {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.25);
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.45);
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

.message-bubble {
    position: relative;
}

.message-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    margin-left: 4px;
}

.chat-message.own .message-actions {
    justify-content: flex-end;
}

.chat-message:not(.own) .message-actions {
    justify-content: flex-start;
}

.message-bubble:hover .message-actions {
    opacity: 1;
    pointer-events: auto;
}

.message-actions button {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.message-actions button:hover {
    color: var(--martell-gold);
    border-color: rgba(212, 175, 55, 0.7);
}

.delete-message-btn:hover {
    color: var(--danger) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
}

.edited-label {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    white-space: nowrap;
}

.edit-message-input {
    width: 100%;
    min-width: 260px;
    min-height: 80px;
    background: #101010;
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.edit-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.edit-message-actions button {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: var(--martell-gold);
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 800;
    cursor: pointer;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.message-author {
    color: var(--martell-gold);
    font-weight: 800;
    font-size: 15px;
}

.chat-message.grouped {
    margin-top: -4px;
}



.message-mini-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 18px;
    margin-bottom: 4px;
    opacity: 0.75;
}

.chat-message.grouped .message-time {
    font-size: 11px;
}

.chat-message.grouped .message-bubble {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.message-actions button {
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 5px;
}

.message-mini-header .message-actions {
    margin-left: 2px;
}

.voice-controls button.active-danger {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

.voice-stage {
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.08), transparent 35%),
        #050505;
}

.voice-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow-y: auto;
}

.voice-grid {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.voice-user-card {
    min-height: 170px;
    background: rgba(22, 22, 22, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.voice-user-card.self {
    border-color: rgba(212, 175, 55, 0.5);
    background: linear-gradient(180deg, rgba(38, 29, 12, 0.96), rgba(17, 17, 17, 0.96));
}

.voice-user-avatar-wrap {
    width: 78px;
    height: 78px;
    position: relative;
    flex-shrink: 0;
}

.voice-user-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 900;
    object-fit: cover;
}

.voice-speaking-ring {
    position: absolute;
    inset: -5px;
    border: 2px solid rgba(34, 197, 94, 0.75);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.voice-user-info {
    min-width: 0;
}

.voice-user-info strong {
    display: block;
    color: var(--text-main);
    font-size: 18px;
    margin-bottom: 6px;
}

.voice-user-info span {
    color: var(--text-muted);
    font-size: 13px;
}

.voice-user-status {
    position: absolute;
    right: 18px;
    bottom: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 60px;
    border: 1px dashed rgba(212, 175, 55, 0.25);
    border-radius: 16px;
}

.voice-channel-users {
    margin: -4px 0 8px 34px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.voice-channel-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 0;
}

.voice-channel-user img,
.voice-channel-user span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.voice-channel-user img {
    object-fit: cover;
}

.voice-channel-user span {
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.voice-channel-user small {
    color: var(--text-muted);
    font-weight: 700;
}

.voice-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow-y: auto;
}

.voice-grid {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.voice-user-card {
    min-height: 260px;
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.voice-user-card.self {
    border-color: rgba(212, 175, 55, 0.55);
}

.voice-video-area {
    flex: 1;
    min-height: 200px;
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.12), transparent 35%),
        #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-user-avatar.large {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
    object-fit: cover;
}

.voice-card-footer {
    height: 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 15, 15, 0.98);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.voice-card-footer strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
    margin-bottom: 3px;
}

.voice-card-footer span {
    color: var(--text-muted);
    font-size: 12px;
}

.voice-user-status {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
}

.voice-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.voice-channel-users {
    width: 100%;
    margin: -2px 0 10px 44px;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.voice-channel-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 0;
    max-width: 190px;
}

.voice-channel-user img,
.voice-channel-user span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.voice-channel-user img {
    object-fit: cover;
}

.voice-channel-user span {
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.voice-channel-user small {
    color: var(--text-muted);
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.voice-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    overflow-y: auto;
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.06), transparent 36%),
        #050505;
}

.voice-grid {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.voice-user-card {
    height: 260px;
    background: #0c0c0c;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.voice-user-card.self {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.36),
        inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.voice-video-area {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at center, rgba(212, 175, 55, 0.12), transparent 38%),
        linear-gradient(180deg, #111, #070707);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-avatar-center {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-user-avatar.large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--martell-orange), var(--martell-gold));
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.voice-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #050505;
}

.voice-overlay {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    min-height: 48px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voice-overlay strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
    margin-bottom: 2px;
}

.voice-overlay span {
    color: var(--text-muted);
    font-size: 12px;
}

.voice-user-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    flex-shrink: 0;
}

.voice-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 60px;
    border: 1px dashed rgba(212, 175, 55, 0.25);
    border-radius: 16px;
}

.voice-grid {
    width: min(1180px, 100%);
    height: 100%;
    display: block;
}

.voice-focus-layout {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.voice-user-card.focused {
    flex: 1;
    min-height: 360px;
    max-height: calc(100vh - 260px);
}

.voice-thumbnails {
    height: 150px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.voice-user-card.compact {
    width: 230px;
    height: 140px;
    min-width: 230px;
    min-height: 140px;
    cursor: pointer;
}

.voice-user-card.compact .voice-user-avatar.large {
    width: 58px;
    height: 58px;
    font-size: 26px;
}

.voice-user-card.compact .voice-overlay {
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 9px;
}

.voice-user-card.compact .voice-overlay strong {
    font-size: 12px;
}

.voice-user-card.compact .voice-overlay span {
    font-size: 10px;
}

.voice-user-card.compact .voice-user-status {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.voice-user-card {
    cursor: pointer;
}

.voice-thumbnails::-webkit-scrollbar {
    height: 7px;
}

.voice-thumbnails::-webkit-scrollbar-track {
    background: #070707;
}

.voice-thumbnails::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 999px;
}

.voice-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

.voice-grid {
    width: min(1180px, 100%);
    height: 100%;
    display: block;
}

/* Default görünüm: herkes eşit kartlarla ortada */
.voice-equal-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-content: center;
    justify-content: center;
    gap: 18px;
}

.voice-user-card.grid {
    height: 260px;
    min-height: 220px;
    cursor: pointer;
}

/* Focus görünüm: bir kişi büyük, diğerleri altta */
.voice-focus-layout {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.voice-user-card.focused {
    flex: 1;
    min-height: 360px;
    max-height: calc(100vh - 260px);
    cursor: zoom-out;
}

.voice-thumbnails {
    height: 150px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.voice-user-card.compact {
    width: 230px;
    height: 140px;
    min-width: 230px;
    min-height: 140px;
    cursor: pointer;
}

.voice-user-card.compact .voice-user-avatar.large {
    width: 58px;
    height: 58px;
    font-size: 26px;
}

.voice-user-card.compact .voice-overlay {
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 9px;
}

.voice-user-card.compact .voice-overlay strong {
    font-size: 12px;
}

.voice-user-card.compact .voice-overlay span {
    font-size: 10px;
}

.voice-user-card.compact .voice-user-status {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.screen-video {
    object-fit: contain;
    background: #000;
}

.voice-controls button.active {
    background: rgba(212, 175, 55, 0.22);
    color: var(--martell-gold);
}

.screen-share-card {
    border-color: rgba(249, 115, 22, 0.45);
}

.screen-area {
    background:
        radial-gradient(circle at center, rgba(249, 115, 22, 0.12), transparent 35%),
        #050505;
}

.screen-join-panel {
    height: 100%;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-align: center;
    gap: 10px;
}

.screen-join-panel strong {
    color: var(--martell-gold);
    font-size: 18px;
}

.screen-join-panel span,
.screen-join-panel em {
    color: var(--text-muted);
    font-size: 13px;
}

.join-screen-btn,
.leave-screen-btn {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--martell-gold);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

.leave-screen-btn {
    padding: 6px 9px;
    font-size: 12px;
}

.join-screen-btn:hover,
.leave-screen-btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

.volume-popover {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 180px;
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 10px;
    padding: 8px 10px;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 5;
}

.voice-user-card:hover .volume-popover {
    opacity: 1;
    pointer-events: auto;
}

.volume-popover label {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 5px;
}

.volume-popover input {
    width: 100%;
}

.voice-user-card.compact .volume-popover {
    width: 130px;
    right: 8px;
    top: 8px;
}

.screen-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-dj-panel {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    flex-shrink: 0;
}

.music-dj-panel h3 {
    margin: 0 0 10px;
    color: var(--martell-gold);
    font-size: 13px;
    letter-spacing: 0.8px;
}

.youtube-player {
    width: 220px;
    height: 124px;
    background: #050505;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.music-now-playing {
    margin-bottom: 10px;
}

.music-now-playing strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.3;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-now-playing small {
    color: var(--text-muted);
    font-size: 11px;
}

.music-input-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.music-input-row input {
    min-width: 0;
    flex: 1;
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 9px;
    font-size: 12px;
    outline: none;
}

.music-input-row input:focus {
    border-color: var(--martell-gold);
}

.music-input-row button,
.music-controls button {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: var(--martell-gold);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.music-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.music-volume-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.music-volume-label input {
    width: 100%;
    margin-top: 4px;
}

.music-queue {
    max-height: 130px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.music-queue-item {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.music-queue-item strong {
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.members-header {
    margin-bottom: 14px;
}

.members-header h3 {
    margin: 0;
    color: var(--martell-gold);
    font-size: 14px;
    letter-spacing: 0.8px;
}

.members-section {
    margin-bottom: 18px;
}

.members-section-title {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 7px 8px;
    border-radius: 10px;
    position: relative;
    background: transparent;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.045);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background:
        radial-gradient(circle at top, rgba(212, 175, 55, 0.28), transparent 42%),
        #141414;
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--martell-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    overflow: hidden;
    flex: 0 0 auto;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info {
    min-width: 0;
    flex: 1;
}

.member-info strong {
    display: block;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-info span {
    color: var(--text-muted);
    font-size: 11px;
}

.member-presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.member-presence-dot.online {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}

.member-presence-dot.offline {
    background: #555;
}

.member-offline {
    opacity: 0.48;
}

.fixed-music-dj {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 260px;
    max-width: 260px;
    z-index: 999;
    background:
        radial-gradient(circle at top right, rgba(212, 175, 55, 0.13), transparent 38%),
        rgba(12, 12, 12, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 16px;
    padding: 12px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
}

.youtube-player-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.music-dj-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.music-dj-top h3 {
    margin: 0 0 6px;
    color: var(--martell-gold);
    font-size: 12px;
    letter-spacing: 1px;
}

.music-dj-top strong {
    display: block;
    max-width: 190px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-dj-top small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.music-collapse-button {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.08);
    color: var(--martell-gold);
    cursor: pointer;
    font-weight: 900;
}

.music-collapse-button:hover {
    background: rgba(212, 175, 55, 0.16);
}

.music-dj-body {
    margin-top: 12px;
}

.fixed-music-dj.collapsed {
    width: 260px;
}

.fixed-music-dj.collapsed .music-dj-body {
    display: none;
}

.fixed-music-dj.collapsed .music-collapse-button {
    transform: none;
}

.fixed-music-dj .music-input-row {
    display: flex;
    gap: 7px;
    margin-bottom: 9px;
}

.fixed-music-dj .music-input-row input {
    min-width: 0;
    flex: 1;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(212, 175, 55, 0.18);
    color: var(--text-main);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 12px;
    outline: none;
}

.fixed-music-dj .music-input-row input:focus {
    border-color: rgba(212, 175, 55, 0.65);
}

.fixed-music-dj .music-input-row button,
.fixed-music-dj .music-controls button {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: var(--martell-gold);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.fixed-music-dj .music-input-row button:hover,
.fixed-music-dj .music-controls button:hover {
    background: rgba(212, 175, 55, 0.18);
}

.fixed-music-dj .music-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.fixed-music-dj .music-volume-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.fixed-music-dj .music-volume-label input {
    width: 100%;
    margin-top: 5px;
}

.fixed-music-dj .music-queue {
    max-height: 145px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.fixed-music-dj .music-queue-item {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 10px;
    padding: 7px 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.fixed-music-dj .music-queue-item strong {
    display: block;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.members-sidebar::-webkit-scrollbar,
.fixed-music-dj .music-queue::-webkit-scrollbar {
    width: 8px;
}

.members-sidebar::-webkit-scrollbar-track,
.fixed-music-dj .music-queue::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
    border-radius: 999px;
}

.members-sidebar::-webkit-scrollbar-thumb,
.fixed-music-dj .music-queue::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(212, 175, 55, 0.55),
        rgba(142, 68, 173, 0.55)
    );
    border-radius: 999px;
    border: 2px solid rgba(10, 10, 10, 0.9);
}

.members-sidebar::-webkit-scrollbar-thumb:hover,
.fixed-music-dj .music-queue::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        rgba(212, 175, 55, 0.78),
        rgba(142, 68, 173, 0.78)
    );
}

/* Firefox */
.members-sidebar,
.fixed-music-dj .music-queue {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.6) rgba(255, 255, 255, 0.035);
}

.fixed-music-dj * {
    box-sizing: border-box;
}

.fixed-music-dj .music-input-row input {
    width: 100%;
}

.fixed-music-dj .music-input-row button {
    flex: 0 0 auto;
}

.fixed-music-dj .music-controls button {
    flex: 1;
}

.members-sidebar {
    padding-bottom: 120px;
}

@media (max-width: 1400px) {
    .fixed-music-dj {
        width: 230px;
        max-width: 230px;
        right: 10px;
        bottom: 10px;
    }

    .fixed-music-dj.collapsed {
        width: 230px;
    }

    .music-dj-top strong {
        max-width: 160px;
    }

    .fixed-music-dj .music-input-row {
        flex-direction: column;
    }

    .fixed-music-dj .music-input-row button {
        width: 100%;
    }
}

/* Sağ üyeler paneli daha ferah */
.members-sidebar {
    padding: 22px 18px 170px 22px;
    box-sizing: border-box;
}

/* Üyeler başlığı yukarı yapışmasın */
.members-header {
    margin-bottom: 22px;
}

.members-header h3 {
    margin: 0;
    color: var(--martell-gold);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.4px;
}

/* Online / offline blokları arasında boşluk */
.members-section {
    margin-bottom: 26px;
}

/* ÇEVRİMİÇİ / ÇEVRİMDIŞI başlıkları */
.members-section-title {
    margin-bottom: 12px;
    color: #b9c5d8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Üyeler birbirine yapışmasın */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Her üye satırı daha rahat */
.member-item {
    min-height: 50px;
    padding: 8px 10px;
    gap: 12px;
    border-radius: 12px;
}

/* Avatarlar biraz daha dengeli */
.member-avatar {
    width: 38px;
    height: 38px;
    font-size: 15px;
    flex: 0 0 38px;
}

/* İsim ve durum metni */
.member-info strong {
    font-size: 14px;
    line-height: 1.25;
}

.member-info span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.2;
}

/* Sağdaki online/offline dot biraz içeri gelsin */
.member-presence-dot {
    margin-left: 8px;
}

/* Offline üyeler okunabilir ama soluk kalsın */
.member-offline {
    opacity: 0.55;
}

.member-offline:hover {
    opacity: 0.78;
}

/* YouTube DJ daha kompakt */
.fixed-music-dj {
    width: 230px;
    max-width: 230px;
    right: 10px;
    bottom: 10px;
    padding: 10px;
    border-radius: 14px;
}

.fixed-music-dj.collapsed {
    width: 230px;
    max-width: 230px;
}

.music-dj-top {
    gap: 8px;
}

.music-dj-top h3 {
    font-size: 11px;
    margin-bottom: 5px;
}

.music-dj-top strong {
    max-width: 145px;
    font-size: 12px;
}

.music-dj-top small {
    font-size: 10px;
}

.music-collapse-button {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    flex: 0 0 28px;
}

.fixed-music-dj .music-dj-body {
    margin-top: 10px;
}

.fixed-music-dj .music-input-row {
    flex-direction: column;
    gap: 6px;
}

.fixed-music-dj .music-input-row input {
    padding: 8px 9px;
    font-size: 11px;
}

.fixed-music-dj .music-input-row button {
    width: 100%;
    padding: 7px 9px;
    font-size: 11px;
}

.fixed-music-dj .music-controls {
    gap: 6px;
}

.fixed-music-dj .music-controls button {
    padding: 7px 8px;
    font-size: 11px;
}

.fixed-music-dj .music-queue {
    max-height: 105px;
}

.channel-item {
    position: relative;
}

.channel-item.has-unread {
    background: rgba(212, 175, 55, 0.12);
    color: var(--text-main);
}

.channel-item.has-unread::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    width: 4px;
    height: 22px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--martell-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
}

.unread-dot {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--martell-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.65);
    flex: 0 0 auto;
}

.chat-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.chat-search-box input {
    width: 210px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    outline: none;
    font-size: 13px;
}

.chat-search-box input::placeholder {
    color: var(--text-muted);
}

.chat-search-box button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(212, 175, 55, 0.16);
    color: var(--martell-gold);
    font-weight: 900;
    cursor: pointer;
}

.chat-search-box button:hover {
    background: rgba(212, 175, 55, 0.26);
}

.chat-search-panel {
    position: absolute;
    top: 76px;
    right: 22px;
    width: 360px;
    max-height: 480px;
    z-index: 50;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(212, 175, 55, 0.12), transparent 36%),
        rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.chat-search-panel.hidden {
    display: none;
}

.chat-search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-search-panel-header strong {
    color: var(--text-main);
    font-size: 14px;
}

.chat-search-panel-header button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
}

.chat-search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}

.search-result-item {
    width: 100%;
    display: block;
    text-align: left;
    border: 0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 7px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.12);
}

.search-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.search-result-top strong {
    font-size: 13px;
    color: var(--martell-gold);
}

.search-result-top span {
    font-size: 11px;
    color: var(--text-muted);
}

.search-result-body {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
    word-break: break-word;
}

.search-result-body mark {
    background: rgba(212, 175, 55, 0.35);
    color: #fff7d6;
    border-radius: 4px;
    padding: 0 3px;
}

.search-empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.message-search-highlight {
    animation: messageSearchPulse 2.5s ease;
}

@keyframes messageSearchPulse {
    0% {
        outline: 2px solid rgba(212, 175, 55, 0.95);
        background: rgba(212, 175, 55, 0.16);
    }

    100% {
        outline: 2px solid transparent;
        background: transparent;
    }
}

.channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
}

.channel-header-left {
    min-width: 0;
}

.channel-header-left h2 {
    margin: 0;
}

.channel-header-left span {
    display: block;
    margin-top: 6px;
}

.channel-header-right {
    position: relative;
    flex: 0 0 auto;
}

.chat-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-search-box input {
    width: 230px;
    height: 36px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    outline: none;
    font-size: 13px;
}

.chat-search-box input::placeholder {
    color: var(--text-muted);
}

.chat-search-box button {
    height: 36px;
    border: 0;
    border-radius: 999px;
    padding: 0 15px;
    background: rgba(212, 175, 55, 0.16);
    color: var(--martell-gold);
    font-weight: 900;
    cursor: pointer;
}

.chat-search-box button:hover {
    background: rgba(212, 175, 55, 0.26);
}

.chat-search-panel {
    position: absolute;
    top: 46px;
    right: 0;
    width: 360px;
    max-height: 480px;
    z-index: 100;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(212, 175, 55, 0.12), transparent 36%),
        rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.chat-search-panel.hidden {
    display: none;
}

.message-box {
    position: relative;
}

.reply-preview {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: calc(100% + 8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.14), transparent 42%),
        rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    z-index: 20;
}

.reply-preview.hidden {
    display: none;
}

.reply-preview strong {
    display: block;
    color: var(--martell-gold);
    font-size: 12px;
    margin-bottom: 3px;
}

.reply-preview span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    max-width: 720px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview button {
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 18px;
}

.reply-preview button:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.message-reply-preview {
    width: 100%;
    display: block;
    text-align: left;
    margin: 0 0 7px;
    padding: 8px 10px;
    border: 0;
    border-left: 3px solid var(--martell-gold);
    border-radius: 9px;
    background: rgba(212, 175, 55, 0.08);
    color: var(--text-main);
    cursor: pointer;
}

.message-reply-preview:hover {
    background: rgba(212, 175, 55, 0.14);
}

.message-reply-preview span {
    display: block;
    color: var(--martell-gold);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 3px;
}

.message-reply-preview em {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-message-btn {
    color: #bfdbfe;
}

.typing-indicator {
    min-height: 22px;
    padding: 0 28px 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.typing-indicator.hidden {
    visibility: hidden;
}

.typing-indicator::after {
    content: '';
    display: inline-block;
    width: 16px;
}

.icon-button {
    border: 0;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-main);
    cursor: pointer;
    font-size: 15px;
}

.icon-button:hover {
    background: rgba(212, 175, 55, 0.16);
}

/* Android / Mobile real layout */
.mobile-topbar,
.mobile-backdrop {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    body {
        background: var(--bg-main);
    }

    .app-shell {
        display: block;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        padding-top: 54px;
        background: radial-gradient(circle at center, #111 0%, #050505 100%);
    }

    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 54px;
        z-index: 3000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 10px;
        padding-top: max(8px, env(safe-area-inset-top));
        background: rgba(15, 15, 15, 0.98);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(12px);
    }

    .mobile-topbar button {
        border: 1px solid rgba(212, 175, 55, 0.35);
        background: rgba(212, 175, 55, 0.08);
        color: var(--martell-gold);
        border-radius: 10px;
        height: 36px;
        padding: 0 12px;
        font-weight: 900;
        cursor: pointer;
    }

    .mobile-topbar strong {
        min-width: 0;
        color: var(--martell-gold);
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1990;
        display: block;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(3px);
    }

    .mobile-backdrop.hidden {
        display: none !important;
    }

    .main-content {
        width: 100vw;
        height: calc(100dvh - 54px);
        min-width: 0;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 54px;
        left: 0;
        bottom: 0;
        z-index: 2500;
        width: min(86vw, 340px);
        max-width: min(86vw, 340px);
        height: calc(100dvh - 54px);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        border-right: 1px solid var(--border);
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-channels-open .sidebar {
        transform: translateX(0);
    }

    .members-sidebar {
        position: fixed;
        top: 54px;
        right: 0;
        bottom: 0;
        z-index: 2500;
        width: min(82vw, 320px);
        max-width: min(82vw, 320px);
        height: calc(100dvh - 54px);
        transform: translateX(105%);
        transition: transform 0.2s ease;
        border-left: 1px solid var(--border);
        border-right: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 18px 14px 120px;
    }

    body.mobile-members-open .members-sidebar {
        transform: translateX(0);
    }

    .sidebar h1 {
        padding: 18px 16px;
        font-size: 22px;
    }

    .channel-list {
        padding: 10px;
        padding-bottom: 150px;
    }

    .channel-item {
        min-height: 52px;
        font-size: 16px;
        padding: 14px 12px;
    }

    .channel-actions {
        opacity: 1;
    }

    .voice-controls {
        position: sticky;
        bottom: 76px;
        background: rgba(15, 15, 15, 0.98);
        z-index: 20;
    }

    .user-panel {
        position: fixed;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        min-height: 76px;
        background: rgba(15, 15, 15, 0.98);
        z-index: 2600;
    }

    body:not(.mobile-channels-open) .user-panel {
        transform: translateX(-105%);
    }

    .channel-header {
        height: 66px;
        padding: 10px 12px;
        gap: 8px;
    }

    .channel-header-left {
        min-width: 0;
        flex: 1;
    }

    .channel-header-left h2 {
        font-size: 22px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .channel-header-left span {
        font-size: 11px;
        line-height: 1.2;
    }

    .channel-header-right {
        display: none;
    }

    .chat-area {
        padding: 12px;
        height: auto;
        flex: 1 1 auto;
    }

    .chat-message {
        justify-content: flex-start !important;
    }

    .message-bubble {
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .chat-image,
    .chat-video {
        max-width: 100%;
        height: auto;
    }

    .message-box {
        height: auto;
        min-height: 64px;
        padding: 9px 10px;
        gap: 8px;
    }

    .message-box input {
        min-width: 0;
        padding: 12px;
        font-size: 14px;
    }

    .message-box button {
        padding: 11px 12px;
        font-size: 12px;
    }

    .file-button {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }

    .selected-file-name {
        display: none !important;
    }

    .reply-preview {
        left: 8px;
        right: 8px;
    }

    .voice-stage {
        width: 100%;
        height: calc(100dvh - 120px);
        padding: 10px;
        align-items: stretch;
        justify-content: flex-start;
    }

    .voice-grid {
        width: 100%;
        height: 100%;
        display: block;
        overflow-y: auto;
    }

    .voice-equal-grid {
        display: flex;
        flex-direction: column;
        align-content: stretch;
        justify-content: flex-start;
        gap: 12px;
        height: auto;
        min-height: 100%;
    }

    .voice-user-card,
    .voice-user-card.grid,
    .screen-share-card {
        width: 100%;
        height: 220px;
        min-height: 220px;
        max-width: 100%;
    }

    .voice-user-card.focused {
        min-height: 300px;
        max-height: none;
    }

    .voice-thumbnails {
        height: 120px;
    }

    .voice-user-card.compact {
        width: 180px;
        min-width: 180px;
        height: 110px;
        min-height: 110px;
    }

    .voice-overlay {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

        .main-content {
        padding-bottom: 74px;
    }

    .message-box {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1700;
        background: rgba(10, 10, 10, 0.98);
        border-top: 1px solid var(--border);
    }

    .chat-area {
        padding-bottom: 96px;
    }

    .fixed-music-dj {
        left: 10px;
        right: 10px;
        bottom: 72px;
        width: auto;
        max-width: none;
        z-index: 1650;
        padding: 10px;
        border-radius: 16px;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .fixed-music-dj.collapsed {
        width: auto;
        max-width: none;
    }

    .fixed-music-dj.collapsed .music-dj-body {
        display: none;
    }

    .fixed-music-dj .music-dj-top {
        align-items: center;
    }

    .fixed-music-dj .music-dj-top h3 {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .fixed-music-dj .music-dj-top strong {
        max-width: calc(100vw - 120px);
        font-size: 13px;
    }

    .fixed-music-dj .music-dj-top small {
        font-size: 11px;
    }

    .fixed-music-dj .music-collapse-button {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        flex: 0 0 42px;
        font-size: 20px;
    }

    .fixed-music-dj .music-dj-body {
        max-height: 42vh;
        overflow-y: auto;
        padding-top: 8px;
    }

    .fixed-music-dj .music-input-row {
        flex-direction: row;
    }

    .fixed-music-dj .music-input-row input {
        min-width: 0;
        font-size: 13px;
    }

    .fixed-music-dj .music-input-row button {
        width: auto;
        flex: 0 0 auto;
    }

    .fixed-music-dj .music-queue {
        max-height: 110px;
    }

    body.mobile-channels-open .fixed-music-dj,
    body.mobile-members-open .fixed-music-dj {
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
    }

    .settings-modal {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        padding: 22px;
    }

    .chat-search-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 64px;
        width: auto;
        max-height: calc(100dvh - 90px);
    }
}
