* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#player {
    flex: 1;
    min-height: 0;
    background: #000;
    width: 100%;
    object-fit: contain;
}

#status-bar {
    background: #16213e;
    font-size: 13px;
    color: #a0a0a0;
}

#progress-bar {
    height: 8px;
    background: #333;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    transition: height 0.15s;
}

#progress-bar:hover {
    height: 10px;
}

#progress-fill {
    height: 100%;
    background: #e94560;
    width: 0%;
    transition: width 1s linear;
    border-radius: 4px;
}

#progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #e94560;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 1s linear;
    z-index: 5;
}

#thumb-preview {
    position: absolute;
    bottom: 8px;
    transform: translateX(-50%);
    background: #000;
    border: 1px solid #444;
    padding: 2px;
    pointer-events: none;
    z-index: 20;
}

#thumb-preview[hidden] {
    display: none;
}

#thumb-image {
    width: 160px;
    height: 90px;
    background-repeat: no-repeat;
}

#thumb-time {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #ccc;
    padding: 2px 0;
}

#status-text {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
}

#speed {
    color: #e94560;
    font-weight: bold;
}

#speed:empty {
    display: none;
}

#sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: #16213e;
    border-left: 1px solid #0f3460;
}

#user-panel {
    padding: 12px;
    border-bottom: 1px solid #0f3460;
}

#user-panel h3 {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 8px;
}

#users {
    list-style: none;
    font-size: 14px;
}

#users li {
    padding: 4px 0;
}

#chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-size: 14px;
}

.chat-msg {
    margin-bottom: 6px;
    word-wrap: break-word;
}

.chat-user {
    font-weight: bold;
    color: #e94560;
}

.chat-event {
    margin-bottom: 6px;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

#chat-input {
    padding: 10px 12px;
    background: #0f3460;
    border: none;
    border-top: 1px solid #1a1a2e;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

#chat-input::placeholder {
    color: #555;
}

/* Sidebar toggle strip — right edge, visible on hover */
#sidebar-toggle {
    position: absolute;
    right: 300px;
    top: 0;
    width: 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    user-select: none;
}

#sidebar-toggle:hover {
    opacity: 1;
    background: rgba(22, 33, 62, 0.8);
}

/* When sidebar is hidden */
#app.sidebar-hidden #sidebar {
    display: none;
}

#app.sidebar-hidden #status-bar {
    display: none;
}

#app.sidebar-hidden #sidebar-toggle {
    right: 0;
    opacity: 0.3;
}

#app.sidebar-hidden #sidebar-toggle:hover {
    opacity: 1;
}

/* Fullscreen toggle — sits below the sidebar arrow on the right edge */
#fullscreen-toggle {
    position: absolute;
    right: 300px;
    bottom: 60px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s, background 0.3s;
    z-index: 10;
    user-select: none;
}

#fullscreen-toggle:hover,
#fullscreen-toggle:active {
    opacity: 1;
    background: rgba(22, 33, 62, 0.8);
}

#app.sidebar-hidden #fullscreen-toggle {
    right: 0;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#overlay[hidden] {
    display: none;
}

#join-btn {
    padding: 16px 48px;
    font-size: 20px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#join-btn:hover {
    background: #c73e54;
}
