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

body {
    background: black;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#videoPlayer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
}

#textOverlay {
    position: fixed;
    top: 5%;
    left: 15%;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: left;
    text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
    z-index: 10;
    opacity: 0;
    max-width: 90vw;
    transform: scaleX(1.2);
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    text-wrap-mode: nowrap;
}

#textOverlay.show {
    opacity: 1;
}

#controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

#controlsHeader {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 8px;
    flex-shrink: 0;
}

#toggleControls, #aboutBtn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#toggleControls {
    transition: background-color 0.2s ease, transform 0.3s ease;
    transform-origin: center;
}

#toggleControls:hover, #aboutBtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#toggleControls.collapsed {
    transform: rotate(0deg);
}

#toggleControls.expanded {
    transform: rotate(180deg);
}
#controlsContent {
    padding: 0 12px 12px 12px;
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.3s ease, padding 0.3s ease;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#controlsContent.collapsed {
    max-width: 0;
    padding: 8px 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#controlsContent:not(.collapsed) {
    max-width: 250px;
    padding: 8px 12px 8px 12px;
}


#qualitySelect {
    margin-left: 10px;
    padding: 5px;
}

#niceBoatBtn {
    position: fixed;
    right: -200px;
    z-index: 25;
    background: none;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#niceBoatBtn.show {
    opacity: 1;
    pointer-events: auto;
    animation: danmaku-scroll 8s linear forwards;
}

#niceBoatBtn:hover {
    color: #ffff99;
    text-shadow: 2px 2px 6px rgba(255, 255, 153, 0.6);
    transform: scale(1.1);
}

@keyframes danmaku-scroll {
    from {
        right: -200px;
    }
    to {
        right: 100vw;
    }
}

@keyframes danmaku-scroll-slow {
    from {
        right: -200px;
    }
    to {
        right: 100vw;
    }
}

@keyframes danmaku-scroll-fast {
    from {
        right: -200px;
    }
    to {
        right: 100vw;
    }
}

#exitNiceBoatBtn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid #666;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#exitNiceBoatBtn.show {
    opacity: 1;
}

#exitNiceBoatBtn:hover {
    background: rgba(50, 50, 50, 0.9);
}

.hidden {
    display: none;
}
