/* AI Music Charts - Basic styling */
:root {
    --bg: #050816;
    --bg-soft: #0b1022;
    --accent: #ff4fd8;
    --accent-soft: #ffb9f0;
    --accent-2: #31e0ff;
    --text: #f5f5ff;
    --muted: #a0a3c0;
    --card-radius: 18px;
    --shadow: 0 18px 45px rgba(0,0,0,0.55);
    --border-soft: 1px solid rgba(255,255,255,0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background: radial-gradient(circle at top, #161a3b 0, #050816 35%, #02010a 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.header {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logo-sub {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
}

.nav-links a {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted);
    transition: all 0.16s ease-out;
}

.nav-links a:hover {
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    background: rgba(255,255,255,0.02);
}

.nav-links a.primary {
    background: linear-gradient(130deg, var(--accent), var(--accent-2));
    color: #050816;
    font-weight: 600;
    box-shadow: 0 12px 35px rgba(0,0,0,0.6);
}

.nav-links a.primary:hover {
    transform: translateY(-1px);
}

/* Layout */
.page-wrap {
    max-width: 1120px;
    margin: 0 auto 60px;
    padding: 0 20px 40px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.1fr);
    gap: 26px;
    margin-top: 8px;
}

.hero-main {
    background: radial-gradient(circle at top left, rgba(255,79,216,0.15), transparent 60%),
                linear-gradient(150deg, rgba(10,18,44,0.95), rgba(6,8,26,0.96));
    border-radius: 28px;
    padding: 26px 26px 22px;
    border: var(--border-soft);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(2,1,10,0.7);
    color: var(--accent-soft);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255,79,216,0.32);
}

.hero-title {
    font-size: clamp(2.2rem, 3.2vw, 2.9rem);
    line-height: 1.03;
    margin: 0 0 10px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: 0.98rem;
    color: var(--muted);
    max-width: 460px;
    line-height: 1.5;
}

.hero-cta-row {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 17px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    font-size: 0.88rem;
    background: rgba(5,8,30,0.9);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease-out;
}

.btn span.icon {
    font-size: 1.1rem;
}

.btn.primary {
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #050816;
    font-weight: 600;
}

.btn.primary:hover {
    transform: translateY(-1px);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.04);
}

/* Hero side card */
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-card {
    background: rgba(8,12,38,0.92);
    border-radius: 24px;
    padding: 16px 18px 14px;
    border: var(--border-soft);
    box-shadow: 0 18px 35px rgba(0,0,0,0.65);
}

.hero-card-title {
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.hero-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-chart-rank {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
}

.hero-chart-rank span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
}

.hero-chart-meta {
    font-size: 0.82rem;
    color: var(--muted);
}

.hero-wave {
    margin-top: 10px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 3px;
    padding: 3px;
}

.hero-wave-bar {
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-soft), var(--accent));
    opacity: 0.22;
}

.hero-wave-bar:nth-child(odd) { opacity: 0.5; }
.hero-wave-bar:nth-child(3n) { opacity: 0.75; }

.hero-mini {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}

.hero-mini span.value {
    font-weight: 600;
    color: var(--accent-soft);
}

/* Sections */
.section-title-row {
    margin: 32px 0 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.section-sub {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Song grid */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.song-card {
    background: radial-gradient(circle at top left, rgba(49,224,255,0.14), transparent 55%),
                rgba(6,10,36,0.96);
    border-radius: var(--card-radius);
    padding: 14px 14px 12px;
    border: var(--border-soft);
    box-shadow: 0 14px 30px rgba(0,0,0,0.65);
    position: relative;
    overflow: hidden;
}

.song-rank-pill {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(5,8,26,0.9);
    color: var(--muted);
}

.song-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.song-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 2px 0 3px;
}

.song-artist {
    font-size: 0.86rem;
    color: var(--muted);
}

.song-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 8px;
}

.tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    padding: 3px 8px;
    color: var(--muted);
}

.tag.accent {
    border-color: rgba(255,79,216,0.7);
    color: var(--accent-soft);
}

.song-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.song-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-icon {
    border-radius: 999px;
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(5,12,40,0.9);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon span.icon {
    font-size: 1rem;
}

.btn-icon.vote {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #050816;
    font-weight: 600;
}

.btn-icon.vote:hover {
    transform: translateY(-1px);
}

.song-votes {
    font-size: 0.8rem;
    color: var(--muted);
}

.audio-wrap {
    width: 100%;
    margin-top: 6px;
}

audio {
    width: 100%;
    height: 30px;
}

/* Upload form */
.form-card {
    margin-top: 24px;
    background: rgba(6,9,30,0.98);
    border-radius: 24px;
    border: var(--border-soft);
    padding: 20px 20px 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.7);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

input[type="text"],
select,
input[type="file"] {
    background: rgba(3,4,20,0.9);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    padding: 8px 12px;
    font-size: 0.86rem;
    color: var(--text);
    outline: none;
}

input[type="file"] {
    border-radius: 999px;
}

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

.helper {
    font-size: 0.74rem;
    color: var(--muted);
}

.form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.alert {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.alert.success {
    background: rgba(0, 210, 120, 0.09);
    border: 1px solid rgba(0, 210, 120, 0.4);
    color: #76fcbc;
}

.alert.error {
    background: rgba(255, 83, 135, 0.12);
    border: 1px solid rgba(255, 83, 135, 0.65);
    color: #ffb3d0;
}

/* Leaderboard */
.leaderboard-list {
    margin-top: 12px;
    border-radius: 24px;
    background: rgba(6,9,30,0.97);
    border: var(--border-soft);
    box-shadow: 0 18px 40px rgba(0,0,0,0.7);
    overflow: hidden;
}

.leader-row {
    display: grid;
    grid-template-columns: 40px minmax(0,3fr) minmax(0,2fr) 80px;
    gap: 8px;
    align-items: center;
    padding: 9px 16px;
    font-size: 0.86rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.leader-row:nth-child(odd) {
    background: rgba(7,10,34,0.9);
}

.leader-row.head {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    background: rgba(9,11,40,0.98);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.leader-rank {
    font-weight: 600;
}

.leader-rank.gold { color: #ffd76f; }
.leader-rank.silver { color: #e0e4ff; }
.leader-rank.bronze { color: #ffb38b; }

.leader-title {
    font-weight: 600;
}

.leader-artist {
    color: var(--muted);
    font-size: 0.78rem;
}

.leader-meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.leader-votes {
    font-weight: 600;
}

/* Footer */
.footer {
    max-width: 1120px;
    margin: 0 auto 24px;
    padding: 0 20px;
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.footer span.accent {
    color: var(--accent-soft);
}

/* Responsive */
@media (max-width: 880px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* Simple vertical forms for auth / profile / messages */
.form-card.narrow {
    max-width: 520px;
    margin: 40px auto;
}

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.field input,
.field textarea {
    background: rgba(5,7,22,0.95);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 8px 12px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.field textarea {
    border-radius: 16px;
    min-height: 90px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent-2);
}

/* Community / social layout */
.community-grid {
    margin-top: 26px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.community-column {
    background: rgba(6,9,30,0.98);
    border-radius: 24px;
    border: var(--border-soft);
    padding: 16px 18px 14px;
    box-shadow: var(--shadow);
}

.community-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.community-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.community-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.community-avatar.small {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
}

.community-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.community-subtext {
    font-size: 0.8rem;
    color: var(--muted);
}

.community-time {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Messages list */
.message-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-item {
    background: rgba(5,7,22,0.9);
    border-radius: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.message-subject {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.message-body {
    font-size: 0.85rem;
}
