body { background: #1a1a1a; color: #fff; font-family: sans-serif; margin: 0; }
.container { display: flex; height: 100vh; box-sizing: border-box; padding: 1rem; gap: 1rem; }
.player-wrap { display: flex; flex-direction: column; flex: 0 1 90%; min-width: 0; max-width: 90%; height: 100%; }
.now-header { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 1rem; padding: 0 0.25rem 0.75rem; }
.now-info { flex: 1 1 0; min-width: 0; text-align: center; }
.now-title { font-size: 1.6rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-artist { font-size: 1rem; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-rank { font-size: 0.95rem; color: #7fd62e; font-weight: 600; margin-top: 0.25rem; }
.now-points { font-size: 0.60rem; color: #fff; font-weight: 600; margin-top: 0.25rem; } 
.video-area { position: relative; flex: 1 1 0; min-height: 0; }
.next-btn {
    flex: 0 0 auto;
    margin-top: 0.25rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid #555;
    border-radius: 6px;
    background: rgba(20, 20, 20, 0.7);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}
.nav-btns { flex: 0 0 auto; display: flex; gap: 0.5rem; }
.next-btn:not(:disabled):hover { background: #7fd62e; color: #111; border-color: #7fd62e; }
.next-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
}
.overlay[hidden], .next-btn[hidden] { display: none; }
.overlay-text { font-size: 2rem; font-weight: 600; }
.start-btn {
    margin-top: 1.25rem;
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: 8px;
    background: #7fd62e;
    color: #111;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}
.start-btn:hover { background: #95e83f; }
.start-btn[hidden] { display: none; }
video { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.floating-image {
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: clamp(90px, 14vw, 180px);
    max-height: 30vh;
    object-fit: contain;
    pointer-events: none;
    animation: float-across 10s ease-in-out forwards;
}
@keyframes float-across {
    0% { opacity: 0; transform: translate(0, 0) scale(0.8); }
    10% { opacity: 1; }
    85% { opacity: 0.9; }
    100% { opacity: 0; transform: translate(var(--travel-x), var(--travel-y)) scale(1.15); }
}
.playlist { flex: 1 0 0; min-width: 200px; margin: 0; padding: 0.25rem 0.5rem 0 0; overflow-y: auto; list-style: none; }
.playlist li {
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: linear-gradient(145deg, #262626, #1e1e1e);
    border: 1px solid #2e2e2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.playlist li:hover {
    transform: translateY(-2px);
    border-color: #555;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.playlist li.active {
    border-color: #7fd62e;
    box-shadow: 0 0 0 1px #7fd62e, 0 8px 20px rgba(127, 214, 46, 0.18);
}
.playlist .song-title { font-size: 1.05rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.playlist .song-artist { color: #9a9a9a; font-size: 0.85rem; margin: 0.15rem 0 0.6rem; overflow: hidden; text-overflow: ellipsis; }
.playlist .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    margin-top: 0.3rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
    color: #ddd;
}
.playlist .row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.playlist .rank-row {background: rgba(127, 214, 46, 0.1); color: #fff; font-weight: 600; }
.playlist .rank-row span:last-child { color: #7fd62e; }

/* Home, library search and library results pages */
a.next-btn { text-decoration: none; display: inline-block; box-sizing: border-box; }
a.next-btn:hover { background: #7fd62e; color: #111; border-color: #7fd62e; }
.landing { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 1.5rem; }
.landing h1 { font-size: 2.6rem; margin: 0; }
.landing-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
a.start-btn { display: inline-block; margin-top: 0; text-decoration: none; }
.page { max-width: 960px; width: 100%; box-sizing: border-box; margin: 2.5rem auto; padding: 0 1rem; }
.page h1 { font-size: 1.8rem; margin: 0 0 0.5rem; }
.page-subtle { color: #9a9a9a; }
.page-nav { margin-bottom: 1.25rem; }
.page-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.nav-link { color: #7fd62e; text-decoration: none; }
.nav-link:hover { text-decoration: underline; }
.notice { background: rgba(255, 90, 90, 0.12); border: 1px solid #ff5a5a; color: #ffb3b3; padding: 0.6rem 1rem; border-radius: 8px; }
.notice[hidden] { display: none; }
.notice.success { background: rgba(127, 214, 46, 0.12); border-color: #7fd62e; color: #d4f5a8; }
.file-input { font-size: 1rem; color: #ddd; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.details[hidden] { display: none; }
.detail-card { padding: 0.9rem 1rem; border-radius: 12px; background: linear-gradient(145deg, #262626, #1e1e1e); border: 1px solid #2e2e2e; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.detail-card h3 { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9a9a9a; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 0.3rem; padding: 0.35rem 0.6rem; border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-size: 0.9rem; color: #ddd; }
.detail-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-row span:last-child { color: #7fd62e; font-weight: 600; }
.oauth-box { background: #262626; border: 1px solid #7fd62e; border-radius: 12px; padding: 1rem 1.25rem; margin-top: 1.5rem; }
.oauth-box[hidden] { display: none; }
.oauth-box ol { margin: 0.5rem 0 1rem; padding-left: 1.25rem; line-height: 1.6; }
.oauth-code { font-family: monospace; font-size: 1.3rem; font-weight: 700; color: #7fd62e; letter-spacing: 0.1em; }
.year-form { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.year-form .start-btn { margin-top: 0; }
.login-form { display: flex; flex-direction: column; gap: 0.75rem; width: min(320px, 90vw); }
.login-form .start-btn { margin-top: 0.25rem; }
.text-input { font-size: 1.05rem; padding: 0.6rem 0.8rem; border-radius: 8px; border: 1px solid #555; background: #262626; color: #fff; }
.text-input:focus { outline: none; border-color: #7fd62e; }
.signed-in { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.signed-in .next-btn { margin-top: 0; }
.year-input { font-size: 1.1rem; padding: 0.6rem 0.8rem; width: 9rem; border-radius: 8px; border: 1px solid #555; background: #262626; color: #fff; }
.year-input:focus { outline: none; border-color: #7fd62e; }
.progress-status { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; margin-top: 1.5rem; }
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid #555; border-top-color: #7fd62e; border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 10px; background: #2e2e2e; border-radius: 5px; overflow: hidden; margin-top: 1rem; }
.progress-bar[hidden] { display: none; }
.progress-fill { height: 100%; width: 0; background: #7fd62e; transition: width 0.3s; }
.library-list { overflow: visible; padding: 0; }
.library-list li { white-space: normal; }
