:root {
    color-scheme: dark;

    --bg: #080808;
    --surface: #101010;
    --surface-2: #151515;
    --border: #242424;
    --text: #f5f5f5;
    --muted: #777;
    --accent: #ffffff;
    --danger: #ff4d4d;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        Inter,
        system-ui,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    touch-action: manipulation;
}


/* HEADER */

.top-header {
    position: sticky;
    top: 0;
    z-index: 20;

    background:
        rgba(8, 8, 8, 0.92);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom:
        1px solid var(--border);
}

.header-inner {
    max-width: 900px;
    margin: auto;

    padding:
        calc(18px + env(safe-area-inset-top))
        18px
        18px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.song-count {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


/* MAIN */

.main-container {
    width: 100%;
    max-width: 900px;

    margin: auto;

    padding: 18px;
}


/* SEARCH */

.search-wrapper {
    position: relative;

    margin-bottom: 16px;
}

.search-wrapper input {
    width: 100%;

    height: 48px;

    padding:
        0 16px 0 46px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    outline: none;

    background: var(--surface);

    color: var(--text);

    transition:
        border-color 0.2s,
        background 0.2s;
}

.search-wrapper input:focus {
    border-color: #444;
    background: var(--surface-2);
}

.search-wrapper input::placeholder {
    color: #555;
}

.search-icon {
    position: absolute;

    width: 19px;
    height: 19px;

    left: 17px;
    top: 14px;

    color: #666;

    pointer-events: none;
}


/* SONG LIST */

.song-list {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.song-item {
    min-height: 64px;

    display: grid;

    grid-template-columns:
        42px
        minmax(0, 1fr)
        42px
        42px;

    align-items: center;

    padding: 7px;

    border:
        1px solid transparent;

    border-radius: 14px;

    transition:
        background 0.18s,
        border-color 0.18s;
}

.song-item:hover {
    background: var(--surface);
}

.song-item.playing {
    background: var(--surface-2);
    border-color: var(--border);
}

.play-song,
.like-button,
.download-button,
.control-button {
    border: 0;
    background: transparent;

    color: #777;

    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;

    transition:
        color 0.15s,
        transform 0.15s;
}

.play-song {
    width: 42px;
    height: 48px;
}

.play-song:hover,
.like-button:hover,
.download-button:hover {
    color: var(--text);
}

.play-song:active,
.like-button:active,
.download-button:active {
    transform: scale(0.88);
}

.play-icon {
    font-size: 13px;
}

.song-info {
    min-width: 0;

    cursor: pointer;

    padding-left: 6px;
}

.song-title {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
    font-weight: 500;
}

.song-number {
    margin-top: 4px;

    color: #555;

    font-size: 10px;
}

.like-button {
    width: 42px;
    height: 42px;
}

.like-button svg,
.download-button svg {
    width: 19px;
    height: 19px;
}

.like-button.liked {
    color: #fff;
}

.download-button {
    width: 42px;
    height: 42px;

    text-decoration: none;
}


/* EMPTY */

.empty-state {
    padding: 50px 20px;

    text-align: center;

    color: var(--muted);

    font-size: 13px;
}

.hidden {
    display: none !important;
}


/* PLAYER */

.player {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 100;

    padding-bottom:
        env(safe-area-inset-bottom);

    background:
        rgba(10, 10, 10, 0.94);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    border-top:
        1px solid var(--border);
}

.player-progress-wrapper {
    height: 4px;
}

#progressBar {
    width: 100%;

    height: 4px;

    display: block;

    appearance: none;
    -webkit-appearance: none;

    margin: 0;

    background: #222;

    cursor: pointer;
}

#progressBar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 0;
    height: 0;
}

#progressBar::-moz-range-thumb {
    width: 0;
    height: 0;
    border: 0;
}

#progressBar::-webkit-slider-runnable-track {
    height: 4px;
    background: #333;
}

.player-inner {
    min-height: 76px;

    max-width: 1000px;

    margin: auto;

    padding:
        10px 16px
        calc(10px + env(safe-area-inset-bottom));

    display: grid;

    grid-template-columns:
        minmax(100px, 1fr)
        auto
        minmax(100px, 1fr);

    align-items: center;

    gap: 12px;
}

.now-playing {
    min-width: 0;
}

.player-title {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 12px;
    font-weight: 600;
}

.player-time {
    margin-top: 4px;

    color: #666;

    font-size: 10px;
}

.player-controls {
    display: flex;

    align-items: center;

    gap: 5px;
}

.control-button {
    width: 40px;
    height: 40px;
}

.control-button svg {
    width: 17px;
    height: 17px;
}

.main-play-button {
    width: 46px;
    height: 46px;

    border: 0;

    border-radius: 50%;

    background: #f5f5f5;

    color: #080808;

    cursor: pointer;

    font-size: 12px;
    font-weight: 800;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.15s;
}

.main-play-button:active {
    transform: scale(0.92);
}

.volume-container {
    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap: 8px;
}

.volume-icon {
    width: 18px;
    height: 18px;

    color: #666;
}

#volumeBar {
    width: 80px;

    appearance: none;
    -webkit-appearance: none;

    height: 3px;

    background: #333;

    border-radius: 10px;
}

#volumeBar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: #ddd;
}


/* ADMIN */

.admin-link {
    color: #777;

    text-decoration: none;

    font-size: 12px;

    transition: color 0.15s;
}

.admin-link:hover {
    color: white;
}

.admin-link.danger:hover {
    color: var(--danger);
}

.admin-actions {
    display: flex;
    gap: 18px;
}

.admin-container {
    max-width: 900px;

    margin: auto;

    padding: 20px 18px 60px;

    display: flex;
    flex-direction: column;

    gap: 18px;
}

.admin-panel {
    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 18px;

    padding: 18px;
}

.admin-panel h1 {
    margin: 0 0 18px;

    font-size: 15px;
}

.panel-header {
    display: flex;

    align-items: center;
    justify-content: space-between;
}

.panel-header span {
    color: #666;
    font-size: 12px;
}


/* UPLOAD */

.upload-form {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.upload-box {
    min-height: 150px;

    border:
        1px dashed #333;

    border-radius: 15px;

    display: flex;

    flex-direction: column;

    justify-content: center;
    align-items: center;

    gap: 8px;

    cursor: pointer;

    color: #888;

    transition:
        border-color 0.2s,
        background 0.2s;
}

.upload-box:hover {
    border-color: #555;
    background: #141414;
}

.upload-box svg {
    width: 26px;
    height: 26px;
}

.upload-box span {
    font-size: 13px;
}

.upload-box small {
    color: #555;
    font-size: 10px;
}

.selected-files {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.selected-file {
    padding: 9px 11px;

    border-radius: 9px;

    background: #151515;

    color: #777;

    font-size: 11px;
}


/* BUTTON */

.primary-button {
    width: 100%;

    min-height: 46px;

    border: 0;

    border-radius: 12px;

    background: #f5f5f5;

    color: #080808;

    cursor: pointer;

    font-size: 13px;
    font-weight: 700;

    transition: transform 0.15s;
}

.primary-button:active {
    transform: scale(0.98);
}


/* ADMIN SONGS */

.admin-song-list {
    display: flex;

    flex-direction: column;

    gap: 5px;
}

.admin-song {
    min-height: 60px;

    padding: 10px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    border-radius: 11px;

    background: #131313;
}

.admin-song-info {
    min-width: 0;
}

.admin-song-info .song-number {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    max-width: 60vw;
}

.delete-button {
    border: 0;

    background: transparent;

    color: #666;

    cursor: pointer;

    font-size: 11px;
}

.delete-button:hover {
    color: var(--danger);
}

.empty-admin {
    padding: 30px;

    text-align: center;

    color: #666;

    font-size: 12px;
}


/* MESSAGES */

.success-message,
.error-message {
    margin-bottom: 15px;

    padding: 11px 13px;

    border-radius: 10px;

    font-size: 12px;
}

.success-message {
    background: #122016;
    color: #78c88a;
}

.error-message {
    background: #211313;
    color: #e87a7a;
}


/* AUTH */

.auth-page {
    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;

    padding: 28px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: 20px;
}

.auth-title {
    font-size: 20px;
    font-weight: 800;

    letter-spacing: 0.12em;
}

.auth-subtitle {
    margin-top: 5px;
    margin-bottom: 25px;

    color: #666;

    font-size: 11px;
}

.auth-card label {
    display: block;

    margin:
        15px 0 7px;

    color: #888;

    font-size: 11px;
}

.auth-card input {
    width: 100%;

    height: 46px;

    padding: 0 13px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    outline: none;

    background: #0d0d0d;

    color: white;
}

.auth-card input:focus {
    border-color: #444;
}

.auth-card .primary-button {
    margin-top: 20px;
}

.back-link {
    display: block;

    margin-top: 18px;

    text-align: center;

    color: #666;

    text-decoration: none;

    font-size: 11px;
}


/* MOBILE */

@media (max-width: 650px) {

    .player-inner {
        grid-template-columns:
            1fr
            auto
            1fr;

        gap: 5px;
    }

    .volume-container {
        display: none;
    }

    .now-playing {
        min-width: 0;
    }

    .player-controls {
        justify-content: center;
    }

    .player-title {
        font-size: 11px;
    }

    .player-time {
        font-size: 9px;
    }

    .control-button {
        width: 36px;
        height: 40px;
    }

    .main-play-button {
        width: 43px;
        height: 43px;
    }

    .song-item {
        grid-template-columns:
            38px
            minmax(0, 1fr)
            40px
            40px;
    }
}