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

:root {
    --bg-primary: #0c0b12;
    --bg-secondary: #16151f;
    --bg-card: #1a1924;
    --bg-input: #121119;
    --text-primary: #c7c8d1;
    --text-secondary: #8a8b99;
    --text-heading: #ffffff;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --accent-2: #8b5cf6;
    --success: #57f287;
    --danger: #ed4245;
    --warning: #fee75c;
    --border: #272636;
    --radius: 12px;
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(88, 101, 242, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 85% 100%, rgba(139, 92, 246, 0.10) 0%, transparent 45%),
        linear-gradient(160deg, #14131c 0%, #0c0b12 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/static/wallpaper.jpg') center / cover no-repeat;
    opacity: 0.05;
    z-index: -1;
}

nav {
    background: rgba(22, 21, 31, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav .brand-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
    padding: 4px 0;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--text-heading);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -20px; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 1px;
}

nav .spacer {
    flex: 1;
}

nav .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

nav .user-info img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
    border-color: rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

.card h2 {
    color: var(--text-heading);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.85;
}

.btn-success {
    background: var(--success);
    color: #1a1b1e;
}

.btn-success:hover {
    opacity: 0.85;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

td {
    font-size: 0.9rem;
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group .help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-online {
    background: rgba(87, 242, 135, 0.15);
    color: var(--success);
}

.badge-offline {
    background: rgba(237, 66, 69, 0.15);
    color: var(--danger);
}

.badge-text {
    background: rgba(88, 101, 242, 0.15);
    color: var(--accent);
}

.badge-action {
    background: rgba(254, 231, 92, 0.15);
    color: var(--warning);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(88, 101, 242, 0.4);
}

.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.actions-cell {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-header h1 { color: var(--text-heading); font-size: 1.5rem; margin: 0; }
.page-subtitle { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 16px;
}

.empty-icon { font-size: 2.5rem; margin-bottom: 8px; opacity: 0.4; }
.empty-hint { color: var(--text-secondary); font-size: 0.8rem; opacity: 0.6; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(237, 66, 69, 0.1);
    color: var(--danger);
    border: 1px solid rgba(237, 66, 69, 0.2);
}

.alert-success {
    background: rgba(87, 242, 135, 0.1);
    color: var(--success);
    border: 1px solid rgba(87, 242, 135, 0.2);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    color: var(--text-heading);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

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

.discord-icon {
    width: 24px;
    height: 24px;
}

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.error-detail {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    nav {
        padding: 0 16px;
        gap: 12px;
    }

    .container {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    th, td {
        padding: 8px 10px;
    }
}

/* ===== Landing / Home Page ===== */
body.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at 50% 30%, #2a2140 0%, transparent 55%),
        linear-gradient(160deg, #14131c 0%, #0c0b12 100%);
}

body.landing::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/static/wallpaper.jpg') center / cover no-repeat;
    opacity: 0.10;
    z-index: 0;
}

.landing-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.landing-orb-1 {
    width: 480px;
    height: 480px;
    background: #5865f2;
    top: -140px;
    left: -120px;
    animation: orbFloat1 14s ease-in-out infinite;
}

.landing-orb-2 {
    width: 420px;
    height: 420px;
    background: #8b5cf6;
    bottom: -160px;
    right: -120px;
    animation: orbFloat2 16s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(60px, 40px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -30px); }
}

.landing-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    animation: landingIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes landingIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-logo-ring {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 8px rgba(88, 101, 242, 0.06),
        0 20px 60px rgba(0, 0, 0, 0.5);
    margin-bottom: 28px;
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 0 8px rgba(88, 101, 242, 0.06), 0 20px 60px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 0 14px rgba(88, 101, 242, 0.10), 0 20px 70px rgba(0,0,0,0.55); }
}

.landing-logo {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
}

.landing-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 36px;
    background: linear-gradient(180deg, #ffffff 0%, #b9b6e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 32px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(88, 101, 242, 0.5);
}

.landing-btn:active {
    transform: translateY(0);
}

.landing-btn .discord-icon {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 2.25rem;
    }

    .landing-logo-ring {
        width: 124px;
        height: 124px;
    }

    .landing-logo {
        width: 86px;
        height: 86px;
    }
}

/* --- Music web player --- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; }

.now-playing { display: flex; gap: 20px; align-items: center; }
.np-thumb {
    width: 120px; height: 120px; border-radius: var(--radius);
    object-fit: cover; background: var(--bg-input); flex-shrink: 0;
}
.np-info { flex: 1; min-width: 0; }
.np-title { font-size: 1.2rem; font-weight: 700; color: var(--text-heading);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-uploader { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 10px; }
.np-progress { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.np-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s linear; }
.np-time { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); margin: 4px 0 12px; }
.player-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.player-controls .btn.active { border-color: var(--accent); color: var(--accent); }
.np-conn { color: var(--warning); font-size: 0.8rem; margin-left: auto; }

.player-search { display: flex; gap: 8px; align-items: center; }
.player-search input { flex: 1; }
.search-results, .queue-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.result-row, .queue-row {
    display: flex; gap: 12px; align-items: center; padding: 8px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
}
.result-row img, .queue-row img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.result-info { flex: 1; min-width: 0; }
.result-title { color: var(--text-heading); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 600px) {
    .now-playing { flex-direction: column; text-align: center; }
    .np-thumb { width: 100%; height: 180px; }
}

