* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f2f4f7;
    color: #1f2933;
}

#main {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
}

.page-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.button-primary {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.button-primary:hover {
    background: #15803d;
}

.button-danger {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #b91c1c;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.button-danger:hover {
    background: #991b1b;
}

#content {
    margin-top: 16px;
}

#loading {
    text-align: center;
    padding: 20px;
    color: #334155;
}

#list_songs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.listitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.listitem:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.listitem.selected {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 600;
}

.listitem:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.request-count {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
}

#submitted {
    text-align: center;
    padding: 14px;
    background: #16a34a;
    color: #ffffff;
    border-radius: 8px;
    margin-top: 16px;
}

body.jukebox-page {
    background: #000000;
    color: #ffffff;
}

body.jukebox-page #main {
    max-width: 960px;
    width: min(960px, 100%);
    height: 100vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

body.jukebox-page .button-primary {
    border: 1px solid #005841;
    background: #005841;
    font-size: 1rem;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

body.jukebox-page .button-primary:hover,
body.jukebox-page .button-primary:focus-visible {
    background: #0a7a5a;
    box-shadow: 0 0 0 2px #005841;
}

body.jukebox-page .button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.jukebox-page .header-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
}

body.jukebox-page #selection-hint {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 400;
    text-align: right;
}

body.jukebox-page #loading,
body.jukebox-page #submitted {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    padding: 12px 18px;
    border-radius: 10px;
    border: 2px solid #005841;
    color: #ffffff;
    background: #005841;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
}

body.jukebox-page .page-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

body.jukebox-page #content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

body.jukebox-page .listitem {
    border-color: #005841;
    color: #d3d3d3;
    background: #000000;
}

body.jukebox-page .listitem:hover {
    border-color: #005841;
    background: #000000;
}

body.jukebox-page .listitem.selected {
    border-color: #005841;
    background: #d3d3d3;
    color: #005841;
    font-weight: 700;
}

body.jukebox-page .listitem.selected:hover {
    border-color: #005841;
    background: #d3d3d3;
}

body.jukebox-page .request-count {
    background: #005841;
    color: #ffffff;
}

@media (max-width: 640px) {
    body.jukebox-page #main {
        padding: 10px;
    }

    body.jukebox-page .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.jukebox-page .page-header h1 {
        text-align: center;
    }

    body.jukebox-page .header-action {
        width: 100%;
        justify-content: center;
    }

    body.jukebox-page #selection-hint {
        text-align: center;
    }

    body.jukebox-page #submit-button {
        width: 100%;
        justify-content: center;
    }

    body.jukebox-page .listitem {
        font-size: 0.95rem;
        line-height: 1.35;
    }
}
