:root {
    --bg-main: #0f1015;
    --bg-surface: #181920;
    --bg-card: #1f212d;
    --bg-card-hover: #262937;
    --border: #2e3244;
    --text-primary: #f2f3f5;
    --text-secondary: #949ba4;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --success: #57f287;
    --danger: #ed4245;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #e0e6ed;
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Forms & Inputs */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="password"],
select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--accent);
}

/* Drop zones */
.drop-zone {
    border: 2px dashed var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(88, 101, 242, 0.05);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.file-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.cover-preview {
    max-height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-top: 8px;
    border: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

/* Color Picker */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 40px;
    background: var(--bg-card);
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 8px;
}

.color-chip {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s;
}

.color-chip:hover {
    transform: scale(1.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: rgba(237, 66, 69, 0.15);
    color: var(--danger);
    border: 1px solid rgba(237, 66, 69, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Track list */
.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.track-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border-left: 4px solid var(--track-color, var(--accent));
}

.track-head {
    display: flex;
    gap: 14px;
}

.track-thumb {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #000;
    flex-shrink: 0;
}

.track-info {
    overflow: hidden;
}

.item-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    font-size: 0.75rem;
    color: #6d7380;
    margin-top: 4px;
}

.track-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.empty-state, .loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Embed Standalone Page */
.embed-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at 50% 20%, #1f2130, #0c0d12);
}

.player-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    position: relative;
}

.artwork-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
}

.artwork-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
    position: relative;
    z-index: 2;
    border: 1px solid var(--border);
}

.artwork-glow {
    position: absolute;
    inset: -10px;
    background: var(--accent-color, var(--accent));
    opacity: 0.35;
    filter: blur(25px);
    z-index: 1;
    border-radius: var(--radius-md);
}

.track-details h1 {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.track-artist {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.track-album {
    color: #72767d;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.video-container {
    margin: 20px 0;
}

.native-video {
    width: 100%;
    border-radius: var(--radius-sm);
    background: #000;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}

.footer-links {
    margin-top: 25px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.info-card ol {
    margin-left: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notice {
    background: rgba(88, 101, 242, 0.1);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.app-footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-msg {
    margin-top: 10px;
    font-size: 0.9rem;
}

.status-msg.error {
    color: var(--danger);
}

.status-msg.success {
    color: var(--success);
}
