body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    margin: 0;
    padding: 0;
    color: #fff;
}

.stream, .chat {
    box-sizing: border-box;
    padding: 2rem;
    border-radius: 16px;
    background: rgba(34, 34, 34, 0.85);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    margin: 2rem;
}

.stream img {
    width: 100%;
    max-width: 1920px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    display: block;
    margin-top: 1rem;
}

h2 {
    margin-top: 0;
    font-weight: 600;
    letter-spacing: 1px;
}

.main-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.stream {
    flex: 1 1 0;
    min-width: 0;
    max-width: 900px;
}

.chat {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin: 0 0 2rem 0;
    display: flex;
    flex-direction: column;
}

.side-panel {
    flex: 0 1 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    max-width: 420px;
    box-sizing: border-box;
}

#chat-box {
    flex: 1;
    background: rgba(44, 44, 44, 0.7);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    overflow-y: auto;
    min-height: 200px;
    max-height: 600px;
}

.messagebox {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(54, 54, 54, 0.7);
    border-radius: 8px;
    padding: 1rem;
}

.messagebox label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.messagebox input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
    border: none;
    margin-left: 0.5rem;
    background: #222;
    color: #fff;
}

input[type="text"]::placeholder {
    color: #888;
}

input[type="text"] {
    box-sizing: border-box;
}

#send-button {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: none;
    background: #00b894;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

#send-button:hover {
    background: #00916e;
}

#load-older {
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    border: none;
    background: #414345;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
    width: 100%;
}
#load-older:hover{
    background-color: #313335;
}

.message {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.system-message {
    
    color: #ffd700;
    background: rgba(60, 60, 20, 0.3);
    font-style: italic;
}

.admin-message {
    color: #ff5252;
    background: rgba(60, 20, 20, 0.3);
    font-weight: bold;
}

.user-message {
    color: #fff;
    background: rgba(34, 34, 34, 0.5);
}

.user-message strong {
    font-weight: 600;
}

.progress {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin: 2rem 0 2rem 0;
    padding: 2rem;
    border-radius: 16px;
    background: rgba(34, 34, 34, 0.85);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.progress-bar {
    background: linear-gradient(90deg, #00b894 0%, #00916e 100%);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-bar 20s infinite;
}

@keyframes pulse-bar {
    0% {
        box-shadow: 0 0 12px 0 #00b894, 0 2px 8px rgba(0,0,0,0.15);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 32px 8px #00b894, 0 2px 8px rgba(0,0,0,0.15);
        filter: brightness(1.15);
    }
    100% {
        box-shadow: 0 0 12px 0 #00b894, 0 2px 8px rgba(0,0,0,0.15);
        filter: brightness(1);
    }
}

.progress-percent {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    pointer-events: none;
}

.progress-info {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #00b894;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

#eta-label {
    font-weight: 500;
    color: #fff;
}

#eta-display {
    font-weight: bold;
    color: #ffd700;
}

@media (max-width: 1100px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .stream, .side-panel {
        width: 90vw;
        max-width: 100%;
    }
    .chat, .progress {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .stream, .chat {
        margin: 1rem 0;
        width: 90vw;
        max-width: 100%;
    }
}