/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    height: 100dvh; /* ⭐ حل مشكلة ارتفاع الشاشة في الهواتف */
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ---------- LOGIN / REGISTER SCREENS ---------- */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
    padding: 20px 0;
}

.login-box {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 32px 28px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    margin: auto;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box .info {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.login-box input,
.login-box select {
    width: 100%;
    padding: 14px 18px;
    margin: 8px 0;
    border: 1px solid #e5e7eb;
    border-radius: 60px;
    font-size: 15px;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.login-box input:focus,
.login-box select:focus {
    outline: none;
    border-color: #4f46e5;
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: transform 0.2s;
}

.login-box button:hover {
    transform: scale(1.02);
}

.toggle-form {
    margin-top: 20px;
    color: #4f46e5;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-right: 12px;
}

.toggle-form:hover {
    text-decoration: underline;
}

.lang-select {
    margin-top: 15px;
    background: #f3f4f6;
    border-radius: 40px;
    padding: 8px 16px;
    width: 100%;
    border: 1px solid #e5e7eb;
}

/* ---------- MAIN APP LAYOUT ---------- */
.main-container {
    display: none;
    height: 100vh;
    height: 100dvh; /* ⭐ حل مشكلة ارتفاع الشاشة */
    background: #f8fafc;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

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

.profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s;
}

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

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

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-details h4 {
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.coins {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    width: fit-content;
}

.header-vip-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    font-size: 10px;
    border-radius: 40px;
    padding: 2px 8px;
    font-weight: bold;
    display: inline-block;
    width: fit-content;
    animation: vip-glow 2s ease-in-out infinite;
}

@keyframes vip-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.9); }
}

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

.connection-status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 40px;
    white-space: nowrap;
    color: #4ade80;
}

.connection-status-indicator.disconnected {
    color: #f87171;
}

.connection-status-indicator .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 4px;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.bell-icon {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.bell-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    border-radius: 40px;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin: 8px 0;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px;
    margin: 0;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

html[dir="rtl"] .toggle-password {
    right: auto;
    left: 15px;
}

html[dir="rtl"] .password-wrapper input {
    padding-right: 12px;
    padding-left: 45px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header.hidden,
.bottom-nav.hidden {
    display: none;
}

/* ---------- GIFT TICKER ---------- */
.ticker-container {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 999;
    overflow: hidden;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: none;
    pointer-events: none;
}

.ticker-container.active {
    display: block;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 8s linear forwards;
}

.ticker-text {
    display: inline-block;
    padding-right: 40px;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(100%); opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* ============================================
   ROOMS VIEW
   ============================================ */
.rooms-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 18px;
    gap: 16px;
    overflow: hidden;
}

.rooms-view .search-container {
    flex-shrink: 0;
}

#roomsList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 10px;
}

.create-room-btn {
    flex-shrink: 0;
    margin-top: auto;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 60px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.create-room-btn:hover {
    transform: scale(1.02);
}

/* ============================================
   FRIENDS VIEW
   ============================================ */
.friends-view {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 18px;
    gap: 16px;
    overflow: hidden;
}

.friends-view.active {
    display: flex;
}

.friends-view .search-container {
    flex-shrink: 0;
}

#searchResults {
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.friends-view h3 {
    flex-shrink: 0;
    font-size: 18px;
    color: #1f2937;
    padding: 8px 0;
    margin: 0;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 5;
}

#friendsList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-top: 8px;
}

/* ============================================
   GIFTS VIEW
   ============================================ */
.gifts-view {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 18px;
    gap: 16px;
    overflow: hidden;
}

.gifts-view.active {
    display: flex;
}

.gifts-view .send-gift-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 60px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.gifts-view .send-gift-btn:hover {
    transform: scale(1.02);
}

.gifts-view .target-card {
    flex-shrink: 0;
    margin-bottom: 0;
}

.gifts-scroll-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.gifts-scroll-area h3 {
    font-size: 18px;
    color: #1f2937;
    padding: 8px 0;
    margin: 0;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}

.gifts-scroll-area h3:not(:first-child) {
    margin-top: 16px;
}

.gifts-scroll-area #payoutHistoryList,
.gifts-scroll-area #giftHistoryList {
    padding-top: 8px;
}

/* ============================================
   SEARCH CONTAINER
   ============================================ */
.search-container {
    background: white;
    border-radius: 80px;
    padding: 6px 6px 6px 20px;
    display: flex;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.search-container input {
    flex: 1;
    padding: 12px 0;
    border: none;
    font-size: 15px;
    background: transparent;
    min-width: 0;
}

.search-container input:focus {
    outline: none;
}

.search-container button {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-container button:hover {
    background: #4338ca;
}

/* ============================================
   ROOM CARDS
   ============================================ */
.room-card,
.search-result-item,
.gift-history-item,
.friend-request-item {
    background: white;
    border-radius: 18px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.room-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.room-card.boosted {
    border-left: 5px solid #f59e0b;
    background: #fffbeb;
}

.room-card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding-right: 8px;
}

html[dir="rtl"] .room-card-info {
    padding-right: 0;
    padding-left: 8px;
}

.room-card-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card-info p {
    font-size: 11px;
    color: #6b7280;
}

.vip-room-name {
    color: #b45309 !important;
}

.join-btn,
.send-req-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.join-btn:hover,
.send-req-btn:hover {
    background: #4338ca;
}

.delete-friend-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: background 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.delete-friend-btn:hover {
    background: #dc2626;
}

.friend-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.search-result-item .send-req-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.search-result-item .send-req-btn:hover {
    background: #4338ca;
}

.friend-request-item button {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    flex-shrink: 0;
}

.friend-request-item button:hover {
    background: #059669;
}

/* ============================================
   FRIEND CARD
   ============================================ */
.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 18px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.friend-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    overflow: hidden;
}

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

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-info p {
    font-size: 11px;
    color: #6b7280;
}

.friend-actions-inline {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.friend-actions-inline button {
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}

.friend-actions-inline .btn-chat {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.friend-actions-inline .btn-chat:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.friend-actions-inline .btn-remove {
    background: #fef2f2;
    color: #ef4444;
}

.friend-actions-inline .btn-remove:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

/* ============================================
   RTL SUPPORT
   ============================================ */
html[dir="rtl"] .room-card.boosted {
    border-left: none;
    border-right: 5px solid #f59e0b;
}

html[dir="rtl"] .search-container {
    padding: 6px 20px 6px 6px;
}

html[dir="rtl"] .search-container input {
    direction: rtl;
}

html[dir="rtl"] .side-panel,
html[dir="rtl"] .users-panel {
    left: -320px;
    right: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
}

html[dir="rtl"] .side-panel.open,
html[dir="rtl"] .users-panel.open {
    left: 0;
    right: auto;
}

html[dir="rtl"] .room-dropdown {
    right: auto;
    left: 16px;
}

html[dir="rtl"] .notification-dropdown {
    right: auto;
    left: 16px;
}

html[dir="rtl"] .close-lightbox {
    right: auto;
    left: 35px;
}

/* ============================================
   CHAT VIEWS
   ============================================ */
.chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f8fafc;
}

.chat-view.active {
    display: flex;
}

.chat-header {
    background: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.back-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #4f46e5;
    padding: 0;
    width: 40px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.back-btn:hover {
    transform: scale(1.1);
}

.chat-header-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-header-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
    direction: rtl;
    text-align: right;
}

.chat-header-info p {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boost-icon,
.call-icon,
.youtube-toggle-btn,
.room-menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.boost-icon:hover,
.call-icon:hover,
.youtube-toggle-btn:hover,
.room-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.gift-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gift-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.15);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.message-wrapper {
    display: flex;
    gap: 10px;
    max-width: 80%;
    animation: messageSlide 0.25s ease-out;
}

@keyframes messageSlide {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================
   ROOM MESSAGES — التصميم التقليدي (يمين ويسار)
   ============================================ */

/* ⭐ الروم: المرسلة على اليمين */
#roomMessages .message-wrapper.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

#roomMessages .message-wrapper.sent .message-bubble {
    background: #4f46e5;
    color: white;
}

#roomMessages .message-wrapper.sent .message-time {
    text-align: right;
}

/* ⭐ الروم: المستقبلة على اليسار */
#roomMessages .message-wrapper.received {
    align-self: flex-start;
    flex-direction: row;
}

#roomMessages .message-wrapper.received .message-time {
    text-align: right;
}

/* ⭐ RTL: عكس الجهات للعربية */
html[dir="rtl"] #roomMessages .message-wrapper.sent {
    align-self: flex-start;
    flex-direction: row;
}

html[dir="rtl"] #roomMessages .message-wrapper.sent .message-time {
    text-align: left;
}

html[dir="rtl"] #roomMessages .message-wrapper.received {
    align-self: flex-end;
    flex-direction: row-reverse;
}

html[dir="rtl"] #roomMessages .message-wrapper.received .message-time {
    text-align: left;
}

/* ============================================
   PRIVATE MESSAGES — التصميم التقليدي (يمين ويسار)
   ============================================ */

/* ⭐ الخاص: المرسلة على اليمين */
#privateMessages .message-wrapper.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

#privateMessages .message-wrapper.sent .message-bubble {
    background: #4f46e5;
    color: white;
}

#privateMessages .message-wrapper.sent .message-time {
    text-align: right;
}

/* ⭐ الخاص: المستقبلة على اليسار */
#privateMessages .message-wrapper.received {
    align-self: flex-start;
    flex-direction: row;
}

#privateMessages .message-wrapper.received .message-time {
    text-align: right;
}

/* ⭐ RTL: عكس الجهات للعربية */
html[dir="rtl"] #privateMessages .message-wrapper.sent {
    align-self: flex-start;
    flex-direction: row;
}

html[dir="rtl"] #privateMessages .message-wrapper.sent .message-time {
    text-align: left;
}

html[dir="rtl"] #privateMessages .message-wrapper.received {
    align-self: flex-end;
    flex-direction: row-reverse;
}

html[dir="rtl"] #privateMessages .message-wrapper.received .message-time {
    text-align: left;
}

/* ============================================
   MESSAGE BASE
   ============================================ */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

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

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

.message-bubble {
    background: white;
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    word-wrap: break-word;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.message-sender.owner {
    color: #ef4444;
}

.message-sender.moderator {
    color: #f97316;
}

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

html[dir="rtl"] .message-text {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .message-text br + span {
    direction: ltr !important;
    text-align: left !important;
    display: inline-block;
}

.message-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 16px;
    cursor: pointer;
    margin-top: 4px;
}

.message-audio audio {
    height: 36px;
    width: 200px;
    margin-top: 4px;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* ============================================
   SYSTEM MESSAGES
   ============================================ */
.system-message {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0;
    font-style: italic;
}

.system-message.system-join {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-style: normal;
    font-size: 13px;
    display: inline-block;
    margin: 10px auto;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
    animation: joinPop 0.4s ease;
    align-self: center;
    max-width: 90%;
}

.system-message.system-leave {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-style: normal;
    font-size: 12px;
    display: inline-block;
    margin: 8px auto;
    opacity: 0.85;
    align-self: center;
}

.system-message.system-boost {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-style: normal;
    font-size: 13px;
    display: inline-block;
    margin: 10px auto;
    box-shadow: 0 3px 10px rgba(251, 191, 36, 0.4);
    align-self: center;
}

@keyframes joinPop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

#roomMessages .system-message,
#privateMessages .system-message {
    align-self: center;
    width: fit-content;
}

.typing-indicator {
    font-size: 12px;
    color: #6b7280;
    padding: 4px 16px;
    font-style: italic;
    min-height: 20px;
    flex-shrink: 0;
}

/* ⭐⭐⭐ تعديل شريط الكتابة السفلي (حل مشكلة الاختفاء في الهواتف) ⭐⭐⭐ */
.chat-input-area {
    background: white;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px)) !important;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
}

.chat-input-area input {
    flex: 1;
    min-width: 80px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 60px;
    font-size: 14px;
    unicode-bidi: plaintext;
    text-transform: none;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    direction: inherit;
    text-align: start;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #4f46e5;
    cursor: text;
}

html[dir="rtl"] .chat-input-area input {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] .chat-input-area input {
    direction: ltr;
    text-align: left;
}

.media-btn,
.send-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 60px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.media-btn {
    background: #f3f4f6;
    color: #1f2937;
}

.media-btn:hover {
    background: #e5e7eb;
}

.send-btn {
    background: #4f46e5;
    color: white;
    padding: 10px 24px;
}

.send-btn:hover {
    background: #4338ca;
}

.recording {
    animation: pulse 1s infinite;
    background: #ef4444 !important;
    color: white !important;
}

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

/* ============================================
   VIP ROOM
   ============================================ */
.vip-room-chat {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.6), rgba(20, 40, 70, 0.6)),
                url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1200&q=80') no-repeat center center;
    background-size: cover;
}

.vip-room-messages .message-bubble {
    background: rgba(255, 255, 255, 0.88);
    color: #1a1a2e;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vip-room-messages .message-wrapper.sent .message-bubble {
    background: rgba(79, 70, 229, 0.9);
    color: white;
}

.vip-room-header {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.vip-room-title {
    color: #1f2937;
    font-size: 15px !important;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    direction: rtl;
    text-align: right;
    line-height: 1.3;
}

.vip-room-stats {
    color: #4b5563;
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vip-room-header .youtube-toggle-btn,
.vip-room-header .gift-icon,
.vip-room-header .boost-icon,
.vip-room-header .room-menu-btn {
    font-size: 20px;
    padding: 6px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
}

/* ============================================
   BOTTOM NAVIGATION (⭐ تعديل لعدم القطع في الهواتف)
   ============================================ */
.bottom-nav {
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px)) !important;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
}

.nav-item {
    text-align: center;
    padding: 8px;
    cursor: pointer;
    flex: 1;
    border-radius: 60px;
    transition: background 0.2s;
}

.nav-item.active {
    background: #e0e7ff;
    color: #4f46e5;
}

.nav-item:hover {
    background: #f3f4f6;
}

.nav-icon {
    font-size: 26px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

/* ============================================
   PANELS
   ============================================ */
.side-panel,
.users-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 280px;
    background: white;
    z-index: 200;
    transition: right 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    overflow-y: auto;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
}

.side-panel {
    right: -320px;
}

.side-panel.open {
    right: 0;
}

.users-panel {
    right: -320px;
}

.users-panel.open {
    right: 0;
}

.panel-header,
.users-panel-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 24px 20px;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.panel-section {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.panel-section h4 {
    margin-bottom: 12px;
    color: #1f2937;
}

.coin-package {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

.coin-package span {
    font-weight: 600;
}

.coin-package div {
    display: flex;
    gap: 4px;
}

.card-btn, .crypto-btn {
    border: none;
    padding: 4px 12px;
    border-radius: 60px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: opacity 0.2s;
}

.card-btn:hover, .crypto-btn:hover {
    opacity: 0.8;
}

.card-btn { background: #3b82f6; }
.crypto-btn { background: #f7931a; }

.manual-request-btn,
.support-btn,
.logout-btn,
.history-btn,
.buy-vip-btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border-radius: 60px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.manual-request-btn:hover,
.support-btn:hover,
.logout-btn:hover,
.history-btn:hover,
.buy-vip-btn:hover {
    transform: scale(1.02);
}

.manual-request-btn { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.support-btn { background: #3b82f6; color: white; }
.history-btn { background: #10b981; color: white; }
.logout-btn { background: #ef4444; color: white; }
.buy-vip-btn { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1e293b; }

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
}

.admin-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    transition: opacity 0.2s;
}

.admin-btn:hover {
    opacity: 0.8;
}

.admin-btn.green { background: #10b981; }
.admin-btn.orange { background: #f59e0b; }
.admin-btn.pink { background: #ec4899; }
.admin-btn.purple { background: #8b5cf6; }
.admin-btn.blue { background: #3b82f6; }
.admin-btn.teal { background: #14b8a6; }
.admin-btn.violet { background: #8b5cf6; }
.admin-btn.indigo { background: #4f46e5; }
.admin-btn.gray { background: #6b7280; }

.admin-input {
    width: 100%;
    padding: 10px 14px;
    margin: 6px 0;
    border: 1px solid #e5e7eb;
    border-radius: 60px;
    font-size: 14px;
}

.admin-input:focus {
    outline: none;
    border-color: #4f46e5;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex !important;
}

#manualCoinRequestModal.active,
#coinHistoryModal.active {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 32px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: #1f2937;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    border-radius: 60px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #4f46e5;
}

.modal-content button {
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    border-radius: 60px;
    border: none;
    background: #4f46e5;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.modal-content button:hover {
    background: #4338ca;
}

.modal-close {
    background: #6b7280 !important;
}

.modal-close:hover {
    background: #4b5563 !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    display: none;
}

.overlay.active {
    display: block;
}

/* ============================================
   DROPDOWN
   ============================================ */
.room-dropdown {
    position: absolute;
    top: 70px;
    right: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 300;
    display: none;
    overflow: hidden;
}

.room-dropdown.show {
    display: block;
}

.room-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.room-dropdown-item:hover {
    background: #f8fafc;
}

.room-dropdown-item:last-child {
    border-bottom: none;
}

/* ============================================
   CALL
   ============================================ */
.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 400;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.call-modal.active {
    display: flex;
}

.call-video-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

.call-video {
    background: #1a1a2e;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.call-video:first-child {
    width: 200px;
    height: 150px;
    border: 2px solid #4f46e5;
}

.call-video:last-child {
    width: 400px;
    height: 300px;
    border: 2px solid #10b981;
}

.call-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-controls {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.call-controls button {
    background: #4f46e5;
    border: none;
    padding: 12px 24px;
    border-radius: 60px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.call-controls button:hover {
    background: #4338ca;
}

.end-call {
    background: #ef4444 !important;
}

.end-call:hover {
    background: #dc2626 !important;
}

#speakerBtn {
    background: #4f46e5;
    border: none;
    padding: 12px 24px;
    border-radius: 60px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 20px;
}
#speakerBtn:hover {
    background: #4338ca;
}

.incoming-call-bar {
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 14px 20px;
    border-radius: 80px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 500;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.incoming-call-bar.active {
    display: flex;
}

.incoming-call-bar div {
    display: flex;
    gap: 8px;
}

.call-answer {
    background: #10b981;
    border: none;
    padding: 8px 20px;
    border-radius: 60px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.call-answer:hover {
    background: #059669;
}

.call-decline {
    background: #ef4444;
    border: none;
    padding: 8px 20px;
    border-radius: 60px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.call-decline:hover {
    background: #dc2626;
}

/* ============================================
   YOUTUBE
   ============================================ */
.youtube-player-container {
    background: #000;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: none;
    flex-shrink: 0;
}

.youtube-player-container.active {
    display: block;
}

.youtube-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.youtube-search-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 40px;
    background: #333;
    color: white;
    min-width: 0;
}

.youtube-search-input::placeholder {
    color: #999;
}

.youtube-search-input:focus {
    outline: none;
}

.youtube-search-btn {
    background: #ff0000;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.youtube-search-btn:hover {
    background: #cc0000;
}

.youtube-iframe {
    width: 100%;
    height: 220px;
    border: none;
}

/* ============================================
   BOOST MODAL
   ============================================ */
.boost-modal {
    position: fixed;
    bottom: -320px;
    left: 0;
    right: 0;
    background: white;
    border-radius: 48px 48px 0 0;
    z-index: 250;
    transition: bottom 0.3s ease;
    padding: 28px;
}

.boost-modal.open {
    bottom: 0;
}

.boost-modal h3 {
    margin-bottom: 16px;
}

.boost-modal select,
.boost-modal button {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border-radius: 60px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.boost-modal select:focus {
    outline: none;
    border-color: #4f46e5;
}

.boost-modal button {
    background: #4f46e5;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.boost-modal button:hover {
    background: #4338ca;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-dropdown {
    position: absolute;
    top: 70px;
    right: 16px;
    width: 320px;
    background: pink;
    border-radius: 24px;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
    z-index: 250;
    display: none;
    max-height: 500px;
    overflow-y: auto;
}

.notification-dropdown.active {
    display: block;
}

.notification-header {
    padding: 16px;
    background: #4f46e5;
    color: white;
    display: flex;
    justify-content: space-between;
    border-radius: 24px 24px 0 0;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 5;
}

.clear-notif {
    background: #ef4444;
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.clear-notif:hover {
    background: #dc2626;
}

.notification-item {
    padding: 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item .time {
    font-size: 10px;
    color: #6b7280;
    margin-top: 4px;
}

/* ============================================
   TOAST
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 90px;
    left: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 80px;
    text-align: center;
    z-index: 600;
    animation: fadeOut 3s forwards;
    pointer-events: none;
    font-weight: 500;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(20px); visibility: hidden; }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s;
}

.image-lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 20px;
}

.close-lightbox {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 44px;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-lightbox:hover {
    transform: scale(1.2);
}

/* ============================================
   USER ITEMS
   ============================================ */
.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    overflow: hidden;
    font-size: 16px;
    flex-shrink: 0;
}

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

.kick-btn, .mod-btn, .unban-btn {
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 11px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.kick-btn:hover, .mod-btn:hover, .unban-btn:hover {
    opacity: 0.8;
}

.kick-btn { background: #ef4444; color: white; }
.mod-btn { background: #3b82f6; color: white; }
.unban-btn { background: #10b981; color: white; }

/* ============================================
   PROFILE CARD
   ============================================ */
.profile-card {
    text-align: center;
    padding: 16px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin: 0 auto 16px;
    overflow: hidden;
}

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

.profile-name {
    font-size: 20px;
    font-weight: bold;
}

.profile-status {
    font-size: 14px;
    color: #6b7280;
    margin: 8px 0;
}

.profile-info {
    margin: 12px 0;
}

.profile-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-buttons button {
    margin: 4px;
    padding: 8px 16px;
    border-radius: 60px;
    border: none;
    background: #4f46e5;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.profile-buttons button:hover {
    background: #4338ca;
}

/* ============================================
   VIP STATUS BOX
   ============================================ */
.vip-status-box {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 16px;
    margin: 8px 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    transition: background 0.3s;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}

/* ============================================
   TARGET CARD + STREAK SYSTEM
   ============================================ */
.target-card {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.target-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.streak-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
    transition: background 0.3s;
}

.month-countdown {
    background: rgba(120, 53, 15, 0.12);
    color: #78350f;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.streak-dots {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.streak-dot {
    flex: 1;
    height: 6px;
    background: rgba(120, 53, 15, 0.2);
    border-radius: 3px;
    transition: background 0.4s, transform 0.3s;
}

.streak-dot.filled {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.streak-dot.today {
    transform: scaleY(1.6);
    animation: pulse-dot 1.5s infinite;
}

.target-progress-bar {
    height: 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.target-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 10px;
    transition: width 0.6s ease;
    width: 0%;
}

.target-info {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #78350f;
    font-size: 14px;
}

.target-reward {
    margin-top: 8px;
    font-size: 13px;
    color: #92400e;
    font-weight: 700;
}

.target-milestones {
    margin-top: 6px;
    font-size: 11px;
    color: #78350f;
    opacity: 0.75;
    line-height: 1.6;
}

.payout-item {
    background: #f0fdf4;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    border-left: 4px solid #10b981;
}

.payout-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.payout-status.pending { background: #fef3c7; color: #92400e; }
.payout-status.paid { background: #d1fae5; color: #065f46; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .message-wrapper {
        max-width: 90%;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .side-panel,
    .users-panel {
        width: 260px;
    }
    
    .call-video:first-child {
        width: 120px;
        height: 90px;
    }
    
    .call-video:last-child {
        width: 280px;
        height: 200px;
    }
    
    .call-video-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .send-btn {
        padding: 8px 18px;
        font-size: 14px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .connection-status-indicator {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .user-details h4 {
        font-size: 14px;
    }
    
    .profile-pic {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .room-card {
        padding: 8px 12px;
        border-radius: 14px;
        margin-bottom: 6px;
    }
    
    .room-card-info h4 {
        font-size: 13px;
    }
    
    .room-card-info p {
        font-size: 10px;
    }
    
    .join-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .friend-card {
        padding: 10px 12px;
    }
    
    .friend-avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .friend-info h4 {
        font-size: 13px;
    }
    
    .friend-actions-inline button {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .system-message.system-join {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .system-message.system-leave {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .system-message.system-boost {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .friend-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .friend-actions button {
        width: 100%;
    }
    
    .coin-package {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .coin-package div {
        justify-content: center;
    }
    
    .notification-dropdown {
        width: 280px;
        right: 10px;
    }

    .target-card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .chat-header {
        padding: 8px 10px !important;
        gap: 6px !important;
    }
    
    .chat-header-info h4 {
        font-size: 14px !important;
    }
    
    .chat-header-info p {
        font-size: 10px !important;
    }
    
    .vip-room-title {
        font-size: 13px !important;
    }
    
    .vip-room-stats {
        font-size: 10px !important;
    }
    
    .vip-room-header .youtube-toggle-btn,
    .vip-room-header .gift-icon,
    .vip-room-header .boost-icon,
    .vip-room-header .room-menu-btn {
        font-size: 18px !important;
        padding: 4px !important;
        min-width: 32px;
        min-height: 32px;
    }
    
    .boost-icon,
    .call-icon,
    .youtube-toggle-btn,
    .room-menu-btn,
    .gift-icon {
        font-size: 18px;
        padding: 4px;
        min-width: 32px;
        min-height: 32px;
    }
}

@media (max-width: 360px) {
    .login-box {
        padding: 24px 16px;
    }
    
    .call-controls button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-header-info h4,
    .vip-room-title {
        font-size: 12px !important;
    }
}

/* ============================================
   LUCKY GAMES
   ============================================ */
.games-view {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 16px;
    gap: 12px;
    overflow-y: auto;
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 100%);
    color: #f8fafc;
}

.games-view.active {
    display: flex;
}

.games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
}

.games-header h2 {
    font-size: 22px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.games-balance {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 40px;
    font-weight: 700;
    color: #fbbf24;
}

.games-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.game-tab {
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.game-tab.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
    border-color: transparent;
}

.game-area {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 24px;
    padding: 20px 16px;
    min-height: 220px;
}

.game-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.game-panel.active {
    display: flex;
}

.coin-display, .dice-display, .wheel-display {
    font-size: 80px;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.5));
    transition: transform 0.4s;
}

.coin-display.flip {
    animation: coin-flip 0.8s ease;
}

@keyframes coin-flip {
    0%   { transform: rotateY(0) scale(1); }
    50%  { transform: rotateY(720deg) scale(1.3); }
    100% { transform: rotateY(1440deg) scale(1); }
}

.wheel-display.spin {
    animation: wheel-spin 0.9s ease;
}

@keyframes wheel-spin {
    0%   { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(1080deg) scale(1.2); }
}

.slot-display {
    display: flex;
    gap: 10px;
}

.reel {
    width: 70px;
    height: 90px;
    background: linear-gradient(180deg, #fef3c7, #fde68a);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 3px solid #f59e0b;
    box-shadow: inset 0 -6px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.reel.spinning {
    animation: reel-spin 0.4s linear infinite;
}

@keyframes reel-spin {
    0%   { transform: translateY(-4px); }
    50%  { transform: translateY(4px); }
    100% { transform: translateY(-4px); }
}

.game-info {
    font-size: 13px;
    color: #cbd5e1;
    text-align: center;
    margin: 0;
}

.game-choice-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-choice-row.dice-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 400px;
}

.choice-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 60px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 80px;
}

.dice-row .choice-btn {
    padding: 10px 4px;
    min-width: auto;
    font-size: 15px;
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

.choice-btn:disabled, .spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spin-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
    border: none;
    padding: 14px 40px;
    border-radius: 60px;
    font-weight: 800;
    font-size: 17px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.spin-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.6);
}

.bet-area {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    padding: 14px;
}

.bet-area label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    display: block;
    margin-bottom: 8px;
}

.bet-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.bet-input-row input {
    flex: 1;
    min-width: 80px;
    padding: 10px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.bet-input-row input:focus {
    outline: none;
    border-color: #fbbf24;
}

.bet-quick {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 14px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.bet-quick:hover {
    background: rgba(255,255,255,0.2);
}

.bet-limits {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
    text-align: center;
}

.game-result {
    flex-shrink: 0;
    min-height: 40px;
    text-align: center;
}

.game-win {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 18px;
    animation: pop-in 0.4s ease;
}

.game-lose {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 18px;
    animation: pop-in 0.4s ease;
}

.game-rolling {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    padding: 14px;
    border-radius: 20px;
    font-weight: 700;
    animation: pulse 1s infinite;
}

@keyframes pop-in {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.game-result-line {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
}

.game-history-title {
    font-size: 16px;
    color: #fbbf24;
    margin-top: 8px;
    flex-shrink: 0;
}

.game-history-list {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
}

.game-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid #64748b;
    gap: 8px;
}

.game-history-item.history-win {
    background: rgba(16, 185, 129, 0.12);
    border-left-color: #10b981;
}

.game-history-item.history-lose {
    background: rgba(239, 68, 68, 0.12);
    border-left-color: #ef4444;
}

.gh-game { font-size: 20px; }
.gh-bet { color: #cbd5e1; }
.gh-result { font-weight: 700; }
.gh-time { font-size: 10px; color: #94a3b8; margin-left: auto; }

html[dir="rtl"] .game-history-item {
    border-left: none;
    border-right: 3px solid #64748b;
}
html[dir="rtl"] .game-history-item.history-win { border-right-color: #10b981; }
html[dir="rtl"] .game-history-item.history-lose { border-right-color: #ef4444; }

@media (max-width: 480px) {
    .coin-display, .dice-display, .wheel-display { font-size: 64px; }
    .reel { width: 54px; height: 72px; font-size: 36px; }
    .game-choice-row.dice-row { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   ACTIVE ROOMS BAR
   ============================================ */
.active-rooms-bar {
    flex-shrink: 0;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    padding: 10px 12px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    max-height: 140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.active-rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.active-rooms-count {
    background: #10b981;
    color: white;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.active-rooms-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.active-rooms-scroll::-webkit-scrollbar {
    height: 4px;
}

.active-rooms-scroll::-webkit-scrollbar-thumb {
    background: #34d399;
    border-radius: 10px;
}

.active-room-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #6ee7b7;
    border-radius: 40px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    animation: chip-pop 0.3s ease;
}

.active-room-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.active-room-chip.vip-chip {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fbbf24;
    color: #78350f;
}

.active-room-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: pulse-dot 1.5s infinite;
    flex-shrink: 0;
}

.active-room-chip .chip-members {
    background: #d1fae5;
    color: #065f46;
    padding: 1px 6px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.active-room-chip.vip-chip .chip-members {
    background: rgba(120, 53, 15, 0.15);
    color: #78350f;
}

@keyframes chip-pop {
    0%   { transform: scale(0.6); opacity: 0; }
    70%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.active-rooms-empty {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    padding: 4px 0;
}

html[dir="rtl"] .active-rooms-scroll {
    direction: rtl;
}

@media (max-width: 480px) {
    .active-rooms-bar {
        max-height: 120px;
        padding: 8px 10px;
    }
    .active-room-chip {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* ============================================
   PRIVATE CODE BOX
   ============================================ */
.private-code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 8px 0;
    box-shadow: 0 4px 12px rgba(30, 27, 75, 0.25);
}

.private-code-text {
    flex: 1;
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fbbf24;
    word-break: break-all;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
    user-select: all;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.copy-code-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    transform: scale(1.05);
}

.private-code-hint {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 6px;
}

.admin-code-result {
    margin-top: 10px;
    font-size: 13px;
    padding: 10px;
    border-radius: 12px;
    background: #f9fafb;
    min-height: 20px;
    word-break: break-all;
}

.admin-code-result code {
    background: #1e1b4b;
    color: #fbbf24;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

html[dir="rtl"] .private-code-text {
    letter-spacing: 1px;
    direction: ltr;
    text-align: center;
}

/* ============================================
   IME / Arabic input support
   ============================================ */
.chat-input-area input,
.login-box input,
.modal-content input,
.admin-input,
input[type="text"],
input[type="password"],
input[type="search"],
textarea {
    unicode-bidi: plaintext;
    -webkit-user-modify: read-write-plaintext-only;
    text-transform: none;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
input[dir="rtl"],
textarea[dir="rtl"] {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', 'Helvetica', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    text-align: right;
    direction: rtl;
}

input[dir="ltr"],
textarea[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

input[type="number"],
#betAmount,
#adminGiveAmount,
#manualCoinAmount {
    direction: ltr !important;
    text-align: center;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: inherit;
    transition: background-color 5000s ease-in-out 0s;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #4f46e5;
}

/* ============================================
   BOT SYSTEM STYLES
   ============================================ */
.system-bots-list {
    margin-top: 8px;
}

.system-bot-card {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #7c3aed;
}

html[dir="rtl"] .system-bot-card {
    border-left: none;
    border-right: 4px solid #7c3aed;
}

.system-bot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.system-bot-avatar {
    font-size: 32px;
    line-height: 1;
}

.system-bot-name {
    font-size: 14px;
    font-weight: 700;
    color: #4c1d95;
}

.system-bot-type {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
}

.system-bot-code-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #4c1d95;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

.system-bot-label {
    font-size: 10px;
    color: #ddd6fe;
    font-weight: 600;
}

.system-bot-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    background: transparent;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    user-select: all;
    text-align: center;
}

.add-bot-btn {
    width: 100%;
    padding: 8px;
    border-radius: 40px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.add-bot-btn:hover {
    transform: scale(1.02);
}

.bot-icon, .bot-help-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bot-icon:hover {
    background: rgba(79, 70, 229, 0.1);
    transform: scale(1.15);
}

.bot-help-icon:hover {
    background: rgba(251, 191, 36, 0.15);
    transform: scale(1.15);
}

.bot-badge {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 9px;
    margin-left: 4px;
}

.bot-join-btn {
    transition: transform 0.2s, box-shadow 0.2s;
}

.bot-join-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* رسالة البوت */
#roomMessages .message-wrapper.received .message-sender.moderator {
    color: #7c3aed;
}

/* ============================================
   REFERRAL SYSTEM
   ============================================ */
.referral-box {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 14px;
    margin-top: 8px;
}

.referral-desc {
    font-size: 12px;
    color: #065f46;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
    line-height: 1.5;
}

.referral-code-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(135deg, #064e3b, #065f46);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.25);
}

.referral-label {
    font-size: 11px;
    color: #a7f3d0;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.referral-code-text {
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fbbf24;
    text-align: center;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    user-select: all;
    padding: 6px 0;
}

.copy-referral-btn {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    padding: 8px 12px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.copy-referral-btn:hover {
    background: rgba(251, 191, 36, 0.3);
    transform: scale(1.03);
}

.share-referral-btn,
.view-referrals-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 60px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.share-referral-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.share-referral-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.view-referrals-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.view-referrals-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.referral-stats {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.referral-stat {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.referral-stat .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #065f46;
    line-height: 1.2;
}

.referral-stat .stat-label {
    display: block;
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html[dir="rtl"] .referral-code-text {
    direction: ltr;
    letter-spacing: 4px;
}

/* حقل كود الإحالة في التسجيل */
#regReferralCode {
    font-family: 'Courier New', ui-monospace, monospace;
    letter-spacing: 3px !important;
    font-weight: 800 !important;
    color: #065f46 !important;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
    border: 2px dashed #10b981 !important;
    text-align: center !important;
    text-transform: uppercase;
}

#regReferralCode:focus {
    border-style: solid !important;
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

#regReferralCode::placeholder {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    color: #6b7280;
}
