* {
    box-sizing: border-box;
}

body {
    background: #ffffff;
    color: #333;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Стрелка возврата на главную */
.video-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-arrow {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
}

.back-arrow:hover {
    opacity: 1;
    transform: translateX(-3px);
    color: #fff;
    text-decoration: none;
}

.stream-page-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
    background: #f8f9fa;
    align-items: flex-start;
}

.stream-left-column {
    flex: 7;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.stream-right-column {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

/* Видеотрансляция (левая верхняя) */
.video-section {
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    position: relative;
    border: 1px solid rgba(102, 126, 234, 0.1);
    min-height: 400px;
    height: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.video-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.video-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.video-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 360px;
    overflow: hidden;
    border-radius: 0;
    z-index: 1;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.video-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    font-size: 0.9rem;
    color: #fff;
    backdrop-filter: blur(10px);
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status.success {
    color: #4caf50;
}
.status.error {
    color: #f44336;
}
.status.loading {
    color: #ff9800;
}

/* Чат (левая нижняя) */
.chat-section {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.1);
    min-height: 300px;
    flex: 1;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    position: relative;
}


.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
    min-height: 200px;
    order: 2;
}

.chat-message {
    padding: 12px 15px;
    background: #fff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    min-width: fit-content;
    max-width: 70%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    align-self: flex-start;
}

.chat-message.own-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-left: none;
    border-right: 4px solid #5568d3;
}

.chat-message.own-message .username,
.chat-message.own-message .text {
    color: #fff;
}

.chat-message:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(2px);
}

.chat-message.donation {
    border-left-color: #ff9800;
    border-left-width: 5px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 152, 0, 0.2) 100%);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.chat-message .username {
    font-weight: bold;
    color: #667eea;
    margin-right: 5px;
}

.chat-message.donation .username {
    color: #e65100;
    font-weight: 700;
}

.chat-message .text {
    color: #333;
}

.chat-message.donation .text {
    color: #1a1a1a;
    font-weight: 500;
}

.chat-message .message-time {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
    font-weight: normal;
}

.chat-message.own-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input-area {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    display: flex;
    gap: 10px;
    order: 1;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.chat-send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.dev-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #ff9800;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 12px;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

/* Условия донатов (правая верхняя) */
.donation-info-section {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 15px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.1);
    max-height: fit-content;
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: 0;
}

.donation-info-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
}

.donation-info-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.donation-info-content {
    flex: 1;
    overflow-y: visible;
    padding: 15px 20px;
    padding-bottom: 0;
    color: #333;
    line-height: 1.6;
    background: #f8f9fa;
    font-size: 0.9rem;
}

.donation-info-content h4 {
    color: #667eea;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.donation-info-content h4:first-child {
    margin-top: 0;
}

.donation-info-content p {
    color: #555;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.donation-info-content ul {
    margin: 8px 0;
    padding-left: 20px;
    color: #555;
}

.donation-info-content li {
    margin: 6px 0;
    line-height: 1.5;
    font-size: 0.85rem;
}

/* Кнопки донатов (правая нижняя) */
.donation-buttons-section {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 15px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.1);
    overflow: visible;
    align-items: stretch;
    min-height: auto;
    position: relative;
    z-index: 1;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    margin-top: 0;
}

.donation-button {
    flex: 1;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.donation-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.donation-button:hover:not(:disabled)::before {
    left: 100%;
}

.donation-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.donation-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #ccc 0%, #bbb 100%);
    box-shadow: none;
}

.donation-button.game {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.donation-button.game:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.donation-button-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.donation-button-title {
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.donation-button-description {
    font-size: 0.85rem;
    opacity: 0.95;
}

/* Скрываем время и прогресс-бар для live трансляции */
video::-webkit-media-controls-timeline {
    display: none !important;
}
video::-webkit-media-controls-current-time-display {
    display: none !important;
}
video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}
video::-webkit-media-controls-duration {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .stream-page-container {
        flex-direction: column;
    }
    
    .stream-left-column,
    .stream-right-column {
        flex: 1;
        width: 100%;
    }
    
    .game-design-variant-2 {
        width: 100%;
        display: flex !important;
        justify-content: center;
    }
    
    .game-card-gradient {
        max-width: 100%;
        width: 100%;
    }
    
    .video-section {
        min-height: 400px;
    }
    
    .chat-section {
        min-height: 300px;
    }
    
    .donation-info-section {
        min-height: 200px;
    }
}

/* Скроллбар стилизация */
.chat-messages::-webkit-scrollbar,
.donation-info-content::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.donation-info-content::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb,
.donation-info-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.donation-info-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #654a92 100%);
}

/* ============================================
   ВАРИАНТЫ ДИЗАЙНА АКТИВНОЙ ИГРЫ (ТЕСТИРОВАНИЕ)
   ============================================ */

/* Вариант 1: Минималистичный */
.game-design-variant-1 {
    grid-column: 1 / -1;
    margin: 0 20px 20px 20px;
}

.game-minimal {
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #667eea;
}

.game-minimal i {
    font-size: 1.5rem;
    color: #667eea;
}

.game-minimal .game-text {
    flex: 1;
    color: #333;
    font-size: 1rem;
}

.game-minimal .game-timer {
    font-weight: bold;
    font-size: 1.2rem;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

/* Вариант 2: Карточка с градиентом (над трансляцией) */
.game-design-variant-2 {
    width: 100%;
    margin: 0;
    margin-bottom: 0;
    padding: 0;
    pointer-events: none;
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
}

/* Скрываем тестовый блок выбора дизайна */
.game-design-test-buttons {
    display: none !important;
}

.game-card-gradient {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    color: #fff;
    pointer-events: auto;
    animation: slideDown 0.5s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.game-card-header i {
    font-size: 2rem;
}

.game-card-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.game-card-body {
    text-align: center;
}

.game-card-body .game-player {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.95;
}

.game-timer-large {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.game-card-body .game-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* Вариант 3: Баннер с анимацией */
.game-design-variant-3 {
    grid-column: 1 / -1;
    margin: 0 20px 20px 20px;
}

.game-banner-animated {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    animation: pulse-banner 2s ease-in-out infinite;
    color: #fff;
}

@keyframes pulse-banner {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    }
}

.game-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.game-banner-icon {
    font-size: 3rem;
    animation: rotate-icon 3s linear infinite;
}

@keyframes rotate-icon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-banner-text {
    flex: 1;
}

.game-banner-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.game-banner-text p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

.game-banner-timer {
    text-align: center;
    background: rgba(255,255,255,0.2);
    padding: 15px 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.game-banner-timer .timer-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.game-banner-timer .timer-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Вариант 4: Боковая панель */
.game-design-variant-4 {
    grid-column: 2;
    grid-row: 1 / -1;
    position: relative;
}

.game-sidebar {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    border: 2px solid #667eea;
    overflow: hidden;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 116px);
}

.game-sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.game-sidebar-content {
    padding: 20px;
}

.game-sidebar-player,
.game-sidebar-amount,
.game-sidebar-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.game-sidebar-player:last-child,
.game-sidebar-amount:last-child,
.game-sidebar-timer:last-child {
    margin-bottom: 0;
}

.game-sidebar-timer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left-color: #764ba2;
    font-weight: bold;
}

.game-sidebar-player i,
.game-sidebar-amount i,
.game-sidebar-timer i {
    color: #667eea;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.game-sidebar-timer i {
    color: #764ba2;
}

.game-sidebar-player span,
.game-sidebar-amount span,
.game-sidebar-timer span {
    flex: 1;
    color: #333;
}

.game-sidebar-timer span {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #764ba2;
}

/* Вариант 5: Всплывающий блок */
.game-design-variant-5 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.game-popup {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    z-index: 2001;
    animation: popup-appear 0.3s ease-out;
}

@keyframes popup-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
}

.game-popup-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-popup-body {
    padding: 30px 25px;
}

.game-popup-info {
    text-align: center;
}

.game-popup-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.game-popup-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.game-popup-item span {
    color: #333;
    font-size: 1.1rem;
}

.game-popup-timer {
    margin-top: 25px;
}

.timer-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    animation: pulse-circle 2s ease-in-out infinite;
}

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

.timer-time {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.timer-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
    margin-top: 5px;
}

/* Адаптивность для вариантов дизайна */
@media (max-width: 1200px) {
    .game-design-variant-4 {
        grid-column: 1;
        grid-row: 3;
        position: static;
    }
    
    .game-sidebar {
        position: static;
        max-height: none;
    }
    
    .game-banner-content {
        flex-direction: column;
        text-align: center;
    }
}
