/* Live Tournament — Premium Desktop */

.live-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    border: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.league-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.online-count {
    font-size: 11px;
    color: #34d399;
    font-weight: 700;
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

.tournament-info {
    font-size: 12px;
    color: #71717a;
    margin-left: auto;
}

.players-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

/* --- ВИДЕО ПЛЕЕР --- */
.video-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 60vh;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #71717a;
    font-size: 14px;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(30,30,40,1) 0%, rgba(10,10,15,1) 100%);
}

.fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

/* --- ЧАТ (Telegram Style Desktop) --- */
.chat-title {
    font-size: 14px;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    background: #0a0a0f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 0;
    box-sizing: border-box;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Паттерн на фоне чата */
.chat-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
    border-radius: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-messages > .chat-message:first-child {
    margin-top: auto;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

/* ПУЗЫРИ */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    background: #1c1c26;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    position: relative;
    animation: msgFadeIn 0.2s ease forwards;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Хвостик для чужих */
.chat-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #1c1c26;
    clip-path: path('M 12 12 C 12 5.373 7.627 0 1 0 L 0 12 Z');
    z-index: -1;
}

.chat-message.is-mine {
    align-self: flex-end;
    background: #4f46e5;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 16px;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}

/* Хвостик для своих */
.chat-message.is-mine::after {
    left: auto;
    right: -6px;
    background: #4f46e5;
    clip-path: path('M 0 12 C 0 5.373 4.373 0 11 0 L 12 12 Z');
}

.chat-sender {
    font-size: 11px;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 4px;
}
.chat-message.is-mine .chat-sender {
    display: none;
}

.chat-text {
    font-size: 14px;
    color: #e4e4e7;
    line-height: 1.4;
    word-break: break-word;
}
.chat-message.is-mine .chat-text {
    color: #ffffff;
}

.chat-time {
    font-size: 10px;
    color: #71717a;
    align-self: flex-end;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.chat-message.is-mine .chat-time {
    color: rgba(255,255,255,0.6);
}

/* Блок .chat-dots полностью удален */

/* Reply block внутри пузыря */
.chat-reply {
    background: rgba(0,0,0,0.2);
    border-left: 3px solid #818cf8;
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}
.chat-reply-sender {
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 2px;
}
.chat-reply-text {
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Reply Bar (когда отвечаешь на сообщение) */
.reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #12121a;
    padding: 8px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 2;
}

.reply-bar-info {
    display: flex;
    flex-direction: column;
    border-left: 3px solid #4f46e5;
    padding-left: 10px;
}

.reply-bar-sender {
    font-size: 11px;
    font-weight: 700;
    color: #818cf8;
}

.reply-bar-text {
    font-size: 12px;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.reply-bar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: #71717a;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.reply-bar-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Input Row */
.chat-input-row {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #0a0a0f;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 2;
}

.chat-input {
    flex: 1;
    min-width: 0;
    background: #1c1c26;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus {
    border-color: #4f46e5;
}
.chat-input::placeholder {
    color: #52525b;
}

.send-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.send-btn:hover {
    background: #6366f1;
    transform: scale(1.05);
}
.send-btn:active {
    transform: scale(0.95);
}
.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-block {
    text-align: center;
    padding: 60px 0;
}