* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    background-color: #e8e8e8;
    background-image: none;
    color: #000000;
    font-family: 'Roboto', Arial, sans-serif;
    min-height: 100vh;
}

/* --- Header --- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
    border-bottom: 1px solid #dddddd;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 44px;
    width: auto;
}

html.dark .logo-img {
    filter: grayscale(1) brightness(0.15);
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

header h1 a:hover {
    opacity: 0.8;
}

header h1 {
    display: none;
}


.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-login {
    background: transparent;
    color: #111111;
    border: 1px solid #bbbbbb;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-login:hover {
    border-color: #000000;
    color: #000000;
}

.btn-signup {
    background: #000000;
    color: #ffffff;
    border: 1px solid #000000;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-signup:hover {
    background: #333333;
}

/* --- Page Tabs --- */
#page-tabs {
    display: flex;
    gap: 4px;
}

.page-tab {
    background: transparent;
    color: #555555;
    border: none;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-family: 'Roboto', Arial, sans-serif;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.page-tab:hover {
    color: #000000;
    background: #e5e5e5;
}

.page-tab.active {
    color: #000000;
    background: #e5e5e5;
    font-weight: 500;
}


/* --- Nav Tabs --- */
nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid #dddddd;
}


/* --- Composers Tab --- */
/* --- Composers Page --- */
#composers-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 30px 60px;
}

.composers-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.composers-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin: 0;
    flex-shrink: 0;
}

#composer-sort-tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.composer-sort-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.composer-sort-btn:hover:not(.active) { background: #f0f0f0; color: #333; }
.composer-sort-btn.active { background: #111; color: #fff; }

#composer-search {
    width: 100%;
    max-width: 540px;
    background: #e5e5e5;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

#composer-search:focus { border-color: #aaa; }
#composer-search::placeholder { color: #777; }

#composer-search-results { margin-bottom: 24px; }

.search-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    margin: 20px 0 10px;
}
.search-section-label:first-child { margin-top: 0; }

#composer-search-composers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.dark #composer-search-composers .composer-row { border-color: #2a2a2a; }
.dark #composer-search-composers .composer-row:hover { border-color: #555; }

#composers-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.composer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e5e5;
    transition: border-color 0.15s, transform 0.15s;
}

.composer-row:hover { border-color: #bbb; transform: translateY(-2px); }

.composer-row-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #777;
    flex-shrink: 0;
    overflow: hidden;
}

.composer-row-info { width: 100%; }

.composer-row-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #000;
}

.composer-row-works {
    font-size: 0.68rem;
    color: #888;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.composer-row-cat {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 20px;
}

.composer-row-cat--anime  { background: #e0e7ff; color: #3730a3; }
.composer-row-cat--game   { background: #dcfce7; color: #166534; }
.composer-row-cat--movie  { background: #f3e8ff; color: #6b21a8; }
.composer-row-cat--tvshow { background: #fef9c3; color: #854d0e; }

.catalog-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
    padding: 40px 0;
}


.trending-status {
    font-size: 0.85rem;
    color: #555;
    padding: 20px 0;
    text-align: center;
}

/* --- iTunes Search Results --- */
#itunes-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0 0;
}

#itunes-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 10px 30px 24px;
}

/* --- Search composer chips --- */
#search-composers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 30px 10px;
}

.search-composer-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 6px;
    background: #f0f0f0;
    border: 1px solid #d5d5d5;
    border-radius: 30px;
    text-decoration: none;
    color: #333333;
    font-size: 0.82rem;
    transition: border-color 0.15s, color 0.15s;
}

.search-composer-card:hover {
    border-color: #000000;
    color: #000000;
}

.search-composer-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: bold;
    color: #000000;
    flex-shrink: 0;
}

.itunes-card {
    background: #e5e5e5;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.2s, transform 0.2s;
}

.itunes-card:hover {
    border-color: #bbbbbb;
    transform: translateY(-3px);
}

.itunes-art {
    width: 100%;
    aspect-ratio: 1;
    background: #d5d5d5;
    background-size: cover;
    background-position: center;
}

.itunes-info {
    padding: 8px 10px;
}

.itunes-title {
    font-size: 0.75rem;
    color: #000000;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.itunes-composer {
    font-size: 0.65rem;
    color: #555555;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.itunes-year {
    font-size: 0.62rem;
    color: #555555;
}

/* --- Category Rows --- */
#category-rows {
    margin: 8px 0 24px;
}

.cat-row {
    margin-bottom: 32px;
}

.cat-row-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cat-row-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #000;
    letter-spacing: -0.01em;
}

.cat-row-see-all {
    flex: 0 0 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #555;
    text-decoration: none;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.cat-row-see-all:hover {
    background: rgba(0,0,0,0.12);
    color: #000;
}

.cat-row-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 6px;
}

.cat-row-scroll::-webkit-scrollbar { display: none; }

.cat-row-card {
    flex: 0 0 148px;
    text-decoration: none;
    color: inherit;
}

.cat-row-card-art {
    width: 148px;
    height: 148px;
    border-radius: 10px;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
    margin-bottom: 9px;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #bbb;
}

.cat-row-card:hover .cat-row-card-art {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.cat-row-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.cat-row-card-composer {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    line-height: 1.3;
}

/* ─── Category Page ──────────────────────────────────────────────────────── */

#cat-page {
    --cat-hue: 210;
    --cat-accent: hsl(var(--cat-hue), 70%, 50%);
}

/* Hero */
#cat-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg,
        hsl(var(--cat-hue), 72%, 22%) 0%,
        hsl(var(--cat-hue), 55%, 10%) 100%);
    padding: 72px 40px 60px;
    color: #fff;
    margin-bottom: 0;
}

#cat-hero::before {
    content: attr(data-label);
    position: absolute;
    right: -0.05em;
    bottom: -0.2em;
    font-size: 18vw;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: rgba(255,255,255,0.04);
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

#cat-hero-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

#cat-hero-icon {
    font-size: 5rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

#cat-hero-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 8px;
}

#cat-hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
}

#cat-hero-desc {
    font-size: 1rem;
    opacity: 0.65;
    max-width: 420px;
}

/* Controls bar */
#cat-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 40px;
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    position: sticky;
    top: 0;
    z-index: 10;
}

#cat-sort-tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.cat-sort-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cat-sort-btn.active {
    background: hsl(var(--cat-hue), 70%, 94%);
    color: hsl(var(--cat-hue), 60%, 30%);
}

.cat-sort-btn:hover:not(.active) {
    background: #f4f4f4;
    color: #333;
}

#cat-search {
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    max-width: 540px;
    background: #f8f8f8;
    transition: border-color 0.15s, background 0.15s;
}

#cat-search:focus {
    border-color: hsl(var(--cat-hue), 50%, 60%);
    background: #fff;
}

/* ── Genre tag dropdown ─────────────────────────────────────────────────────── */
#cat-tag-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: 'Roboto', Arial, sans-serif;
}

#cat-tag-btn:hover {
    background: #f4f4f4;
    border-color: #bbb;
    color: #111;
}

#cat-tag-active-label {
    color: hsl(var(--cat-hue), 60%, 38%);
    font-weight: 700;
}

#cat-tag-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

#cat-tag-chevron.flipped {
    transform: rotate(180deg);
}

#cat-tag-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 50;
    flex-wrap: wrap;
    gap: 6px;
}

#cat-tag-dropdown.open {
    display: flex;
}

.cat-tag-pill {
    background: #f2f2f2;
    border: 1px solid #e2e2e2;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    font-family: 'Roboto', Arial, sans-serif;
    white-space: nowrap;
}

.cat-tag-pill:hover {
    background: hsl(var(--cat-hue), 70%, 94%);
    border-color: hsl(var(--cat-hue), 60%, 76%);
    color: hsl(var(--cat-hue), 60%, 28%);
}

.cat-tag-pill.active {
    background: hsl(var(--cat-hue), 70%, 94%);
    border-color: hsl(var(--cat-hue), 55%, 60%);
    color: hsl(var(--cat-hue), 60%, 28%);
    font-weight: 700;
}

html.dark #cat-tag-dropdown {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

html.dark .cat-tag-pill {
    background: #222;
    border-color: #333;
    color: #aaa;
}

/* Album grid */
#cat-grid-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 40px 60px;
}

#cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 32px 20px;
}

.cpage-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cpage-card-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    background: #ebebeb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 900;
    color: #ccc;
    transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cpage-card:hover .cpage-card-art {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 36px rgba(0,0,0,0.18);
}

.cpage-card-info {
    padding: 12px 4px 0;
}

.cpage-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cpage-card-sub {
    font-size: 0.77rem;
    color: #999;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Load more */
#cat-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}

#cat-load-more {
    background: hsl(var(--cat-hue), 65%, 45%);
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 13px 40px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: opacity 0.15s, transform 0.15s;
}

#cat-load-more:disabled { opacity: 0.35; cursor: default; transform: none; }
#cat-load-more:not(:disabled):hover { opacity: 0.88; transform: translateY(-1px); }

/* Dark mode */
html.dark #cat-hero {
    background: linear-gradient(150deg,
        hsl(var(--cat-hue), 45%, 16%) 0%,
        hsl(var(--cat-hue), 30%, 7%) 100%);
}

html.dark #cat-controls {
    background: #111;
    border-color: #222;
}

html.dark .cat-sort-btn { color: #666; }
html.dark .cat-sort-btn.active {
    background: hsl(var(--cat-hue), 40%, 18%);
    color: hsl(var(--cat-hue), 60%, 70%);
}
html.dark .cat-sort-btn:hover:not(.active) { background: #1e1e1e; color: #bbb; }
html.dark #cat-search { background: #1a1a1a; border-color: #2a2a2a; color: #eee; }
html.dark .cpage-card-art { background: #1e1e1e; color: #444; }
html.dark .cpage-card-title { color: #e8e8e8; }
html.dark .cpage-card-sub { color: #666; }
html.dark #cat-load-more { background: hsl(var(--cat-hue), 50%, 35%); }

/* --- Catalog Toolbar (filter + search) --- */
#catalog-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px 30px 16px;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 16px;
}

.catalog-search-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    position: relative;
}

#search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 100;
    overflow: hidden;
}
#search-dropdown.open { display: block; }
.sd-album {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}
.sd-album:last-child { border-bottom: none; }
.sd-album:hover { background: #f5f5f5; }
.sd-album-art {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #e5e5e5;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.sd-album-info { flex: 1; min-width: 0; }
.sd-album-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-album-title mark { background: #fef08a; color: #111; border-radius: 2px; padding: 0 1px; font-weight: 700; }
.sd-album-composer { font-size: 0.74rem; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-album-cat { font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; flex-shrink: 0; }
.sd-no-results { padding: 14px 16px; font-size: 0.85rem; color: #888; text-align: center; }

.catalog-search-wrap input {
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 0.95rem;
    color: #000;
    outline: none;
    width: 100%;
    max-width: 540px;
    transition: border-color 0.2s, width 0.25s;
}

.catalog-search-wrap input:focus {
    border-color: #aaa;
    width: 260px;
}

.catalog-search-wrap input::placeholder { color: #888; }

/* --- Catalog Filter Bar --- */
@keyframes heroBgIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes heroInfoIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes kenBurns {
    from { transform: scale(1) translateX(0); }
    to   { transform: scale(1.12) translateX(-2%); }
}

@keyframes heroProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

#catalog-hero {
    position: relative;
    height: 280px;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 0;
    flex-shrink: 0;
    transition: opacity 0.48s ease;
}

#catalog-hero.hero-fading {
    opacity: 0;
    pointer-events: none;
}

#catalog-hero.hero-entering .hero-bg-blur,
#catalog-hero.hero-entering .hero-bg-art {
    animation: heroBgIn 0.7s ease forwards;
}

#catalog-hero.hero-entering .hero-info {
    animation: heroInfoIn 0.65s ease forwards;
}

#catalog-hero:hover .hero-title {
    text-decoration: underline;
}

.hero-bg-blur {
    position: absolute;
    inset: -10px;
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.35);
}

.hero-bg-art {
    position: absolute;
    inset: 0;
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
    animation: kenBurns 10s linear forwards;
}

#catalog-hero:hover .hero-bg-art {
    animation-play-state: paused;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}

.hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.hero-composers {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
}

#catalog-hero .tag {
    font-size: 0.58rem;
    padding: 2px 7px;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.hero-composer-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.hero-composer-link:hover {
    color: #fff;
}

.hero-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(0,0,0,0.35);
    animation: heroProgress 10s linear forwards;
    border-radius: 0 1px 1px 0;
}

#catalog-hero:hover .hero-progress {
    animation-play-state: paused;
}

#catalog-filter-bar {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.catalog-filter-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Roboto', Arial, sans-serif;
}

.catalog-filter-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.catalog-filter-btn.active {
    background: #111;
    color: #fff;
    font-weight: 600;
}

.catalog-filter-btn.active[data-cat="anime"]  { background: #be185d; }
.catalog-filter-btn.active[data-cat="game"]   { background: #1d4ed8; }
.catalog-filter-btn.active[data-cat="movie"]  { background: #6d28d9; }
.catalog-filter-btn.active[data-cat="tvshow"] { background: #b45309; }

/* --- Catalog List (card grid) --- */
#catalog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.catalog-row {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f7f7f7;
    border: 1px solid #ebebeb;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.catalog-row:hover {
    transform: translateY(-3px);
    border-color: #ccc;
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}

.catalog-thumb {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #e5e5e5;
    flex-shrink: 0;
}

.catalog-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.catalog-info .tag {
    align-self: flex-start;
    margin-bottom: 2px;
}

.catalog-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-composer {
    font-size: 0.72rem;
    color: #777;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-composer:hover {
    color: #000;
    text-decoration: underline;
}

.composer-name-link {
    color: #555555;
    text-decoration: none;
}

.composer-name-link:hover {
    color: #000000;
    text-decoration: underline;
}

/* --- Category Tags --- */
.tag {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag.game   { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag.anime  { background: #fce7f3; color: #be185d; border: 1px solid #fbcfe8; }
.tag.movie  { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.tag.tvshow { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-box {
    background: #e5e5e5;
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
    position: relative;
}

.modal-box h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    color: #000000;
}

.modal-box label {
    display: block;
    font-size: 0.75rem;
    color: #555555;
    margin-bottom: 6px;
}

.modal-box input {
    width: 100%;
    background: #eeeeee;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 10px 12px;
    color: #000000;
    font-size: 0.85rem;
    margin-bottom: 16px;
    outline: none;
}

.modal-box input:focus {
    border-color: #000000;
}

.modal-submit {
    width: 100%;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}

.modal-submit:hover {
    background: #333333;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: none;
    color: #555555;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #000000;
}

.modal-switch {
    text-align: center;
    font-size: 0.75rem;
    color: #555555;
    margin-top: 16px;
}

.modal-switch a {
    color: #000000;
    cursor: pointer;
    text-decoration: underline;
}

.auth-error {
    font-size: 0.78rem;
    color: #333333;
    margin-bottom: 10px;
    min-height: 1em;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 5px 14px 5px 6px;
    color: #222;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.user-menu-trigger:hover {
    background: #ebebeb;
    border-color: #bbb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.user-menu-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    min-width: 170px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 11px 18px;
    background: transparent;
    border: none;
    color: #222;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.user-dropdown-item:hover {
    background: #f5f5f5;
}

.user-dropdown-logout {
    border-top: 1px solid #f0f0f0;
    color: #e53e3e;
}

.user-dropdown-logout:hover {
    background: #fff5f5;
    color: #c53030;
}

/* --- Live Performances --- */
#live {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 30px 40px;
}

#live h2 {
    font-size: 1.3rem;
    color: #000000;
    margin-bottom: 6px;
}

.section-sub {
    font-size: 0.8rem;
    color: #555555;
    margin-bottom: 24px;
}

#live-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#live-search {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: transparent;
    font-size: 0.82rem;
    color: inherit;
    outline: none;
}

#live-search:focus {
    border-color: #888;
}

html.dark #live-search {
    border-color: #444;
    color: #eee;
}

html.dark #live-search:focus {
    border-color: #777;
}

#live-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.live-filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: transparent;
    color: #555;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.live-filter-btn:hover {
    background: #e0e0e0;
    border-color: #aaa;
}

.live-filter-btn.active {
    background: #222;
    color: #fff;
    border-color: #222;
}

html.dark .live-filter-btn {
    color: #bbb;
    border-color: #444;
}

html.dark .live-filter-btn:hover {
    background: #333;
    border-color: #666;
}

html.dark .live-filter-btn.active {
    background: #fff;
    color: #111;
    border-color: #fff;
}

#events-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.event-card {
    background: #e5e5e5;
    border: 1px solid #d5d5d5;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: border-color 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.event-card:hover {
    border-color: #bbbbbb;
}

.event-card-img {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.events-loading {
    color: #888;
    font-size: 0.9rem;
    padding: 20px 0;
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    background: #eeeeee;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.event-month {
    font-size: 0.6rem;
    color: #555555;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.event-day {
    font-size: 1.4rem;
    font-weight: bold;
    color: #000000;
    line-height: 1.2;
}

.event-info {
    flex: 1;
}

.event-info h3 {
    font-size: 0.95rem;
    color: #000000;
    margin-bottom: 4px;
}

.event-venue {
    font-size: 0.75rem;
    color: #555555;
    margin-bottom: 4px;
}

.event-desc {
    font-size: 0.75rem;
    color: #555555;
    line-height: 1.5;
}

.event-tag {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* --- Albums Layout (catalog + sidebar) --- */
#albums-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 0 30px;
    margin-bottom: 60px;
}

#albums-main {
    flex: 1;
    min-width: 0;
}

/* --- Right Panel (sticky column) --- */
#right-panel {
    width: 310px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d5d5d5 transparent;
}

/* --- Upgrade Tab --- */
#upgrade-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    text-align: center;
}
.upgrade-hero { margin-bottom: 40px; }
.upgrade-title { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.upgrade-sub { color: #888; font-size: 1rem; }
.upgrade-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.upgrade-card {
    background: #f7f7f7;
    border: 1.5px solid #e5e5e5;
    border-radius: 16px;
    padding: 28px 24px;
    width: 240px;
    text-align: left;
    position: relative;
}
.upgrade-card-premium {
    border-color: #7c3aed;
    background: #faf5ff;
}
.upgrade-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #7c3aed;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 20px;
}
.upgrade-plan-name { font-size: 0.8rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.upgrade-price { font-size: 2.2rem; font-weight: 700; margin-bottom: 20px; }
.upgrade-price span { font-size: 0.9rem; font-weight: 400; color: #888; }
.upgrade-features { list-style: none; padding: 0; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.upgrade-features li { font-size: 0.88rem; padding-left: 20px; position: relative; }
.upgrade-features li::before { content: '✓'; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.upgrade-limit::before { content: '–' !important; color: #aaa !important; }
.upgrade-btn {
    width: 100%;
    padding: 12px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.upgrade-btn:hover { background: #6d28d9; }
.upgrade-btn:disabled { opacity: 0.5; cursor: default; }
.upgrade-status { font-size: 0.82rem; margin-top: 10px; color: #555; }
.upgrade-manage-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: transparent;
    color: #7c3aed;
    border: 1.5px solid #7c3aed;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.upgrade-manage-btn:hover { background: #7c3aed; color: #fff; }

/* --- Live Widget --- */
#live-widget-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.lw-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    background: #e0e0e0;
    display: block;
    margin-bottom: 10px;
}
.lw-img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    background: #e0e0e0;
    margin-bottom: 10px;
}
.lw-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.lw-name {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lw-location {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}
.lw-tickets {
    font-size: 0.75rem;
    color: #2563eb;
    font-weight: 600;
}
#live-widget-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 12px;
}
.lw-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.2s;
}
.lw-dot.active { background: #555; }

/* --- Popular Sidebar & Chart Panels --- */
#popular-sidebar,
.chart-panel {
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
}

.pop-heading {
    font-size: 0.68rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

#popular-period-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}

.pop-tab {
    flex: 1;
    background: none;
    border: 1px solid #d5d5d5;
    color: #555555;
    font-size: 0.65rem;
    padding: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.pop-tab:hover {
    color: #333333;
    border-color: #bbbbbb;
}

.pop-tab.active {
    color: #000000;
    border-color: #000000;
    background: #e5e5e5;
}

#popular-list,
#most-rated-list,
#top-rated-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#popular-list li,
#most-rated-list li,
#top-rated-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pop-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: #d5d5d5;
    background-size: cover;
    background-position: center;
    object-fit: cover;
}

.pop-rank {
    color: #3a3a3a;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 14px;
    text-align: right;
    flex-shrink: 0;
}

.pop-item {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pop-title {
    font-size: 0.78rem;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pop-item:hover .pop-title {
    color: #000000;
}

.pop-composer {
    font-size: 0.68rem;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pop-count {
    font-size: 0.65rem;
    color: #333333;
    flex-shrink: 0;
}

.pop-loading,
.pop-empty {
    font-size: 0.75rem;
    color: #444444;
    list-style: none;
}

/* --- Recently Added --- */

#recently-added-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recently-added-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recently-added-num {
    font-size: 0.7rem;
    color: #444;
    width: 14px;
    text-align: right;
    flex-shrink: 0;
}

.recently-added-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.recently-added-title {
    font-size: 0.8rem;
    color: #1f1f1f;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recently-added-title:hover {
    color: #000000;
    text-decoration: underline;
}

.recently-added-composer {
    font-size: 0.7rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#recently-added-showall {
    display: block;
    font-size: 0.7rem;
    color: #555;
    text-decoration: none;
    text-align: center;
    padding-top: 6px;
    border-top: 1px solid #d5d5d5;
    transition: color 0.15s;
}

#recently-added-showall:hover {
    color: #555555;
}

/* --- Profile Tab --- */

#tab-profile {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 30px;
}

.following-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.following-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 12px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}
.following-card:hover { border-color: #aaa; background: #f0f0f0; }
.following-card-name { font-size: 0.85rem; font-weight: 600; color: #111; }

.profile-loading,
.profile-empty {
    color: #555555;
    font-size: 0.85rem;
    padding: 20px 0;
}

.profile-guest {
    text-align: center;
    padding: 80px 0;
    color: #555555;
    font-size: 0.95rem;
}

.profile-guest-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#profile-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #f0f0f0;
    border: 1px solid #d5d5d5;
    border-radius: 12px;
    padding: 28px 32px;
}

.profile-avatar-wrap {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #e5e5e5;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #000000;
    transition: filter 0.15s;
}

.profile-avatar-img {
    background-size: cover;
    background-position: center;
    background-color: #e5e5e5;
    font-size: 0;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    opacity: 0;
    transition: opacity 0.15s;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-wrap:hover .profile-avatar {
    filter: brightness(0.7);
}

.profile-avatar-uploading .profile-avatar-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.header-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e5e5;
    border: 1px solid #000000;
    font-size: 0.65rem;
    font-weight: bold;
    color: #000000;
    margin-right: 6px;
    vertical-align: middle;
    background-size: cover;
    background-position: center;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #000000;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 0.8rem;
    color: #555555;
    margin-bottom: 10px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: #000000;
}

.profile-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0;
}

.profile-subtab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #555;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-subtab:hover {
    color: #333;
}

.profile-subtab.active {
    color: #000000;
    border-bottom-color: #000000;
}

.subtab-count {
    background: #ddd;
    color: #555;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
}

.profile-subtab.active .subtab-count {
    background: #e5e5e5;
    color: #000000;
}

.profile-filter-row {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.profile-filter-btn {
    background: none;
    border: 1px solid #d5d5d5;
    color: #555;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.profile-filter-btn:hover {
    color: #333;
    border-color: #aaa;
}

.profile-filter-btn.active {
    color: #000;
    border-color: #000000;
    background: #e5e5e5;
}

.profile-section-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.listened-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.listened-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.15s;
}

.listened-list-item:hover {
    background: #e5e5e5;
}

.listened-list-num {
    color: #555;
    font-size: 0.78rem;
    width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.listened-list-rating {
    margin-left: auto;
    font-size: 0.75rem;
    color: #555555;
    flex-shrink: 0;
}

.list-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.list-thumb-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #e1e1e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #444;
    flex-shrink: 0;
}

.listened-list-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-decoration: none;
    flex: 1;
}

.listened-list-title {
    font-size: 0.9rem;
    color: #1f1f1f;
    font-weight: 500;
}

.listened-list-link:hover .listened-list-title {
    color: #000000;
}

.listened-list-composer {
    font-size: 0.75rem;
    color: #555;
}

.list-create-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.list-create-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.list-create-input:focus {
    border-color: #888;
}

.list-create-btn {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.15s;
}

.list-create-btn:hover {
    background: #555;
}

.list-create-btn:disabled {
    opacity: 0.5;
}

.lists-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.list-card:hover {
    background: #f7f7f7;
}

.list-card-art {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.list-card-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.list-card-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #888;
}

.list-card-empty-art {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #aaa;
}

.list-card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.list-card-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-count {
    font-size: 0.78rem;
    color: #888;
}

.list-card-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 0.8rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.1s, background 0.1s;
    flex-shrink: 0;
}

.list-card-delete:hover {
    color: #cc0000;
    background: rgba(204,0,0,0.08);
}

.list-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.list-detail-back {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    transition: background 0.1s;
}

.list-detail-back:hover {
    background: #f0f0f0;
}

.list-detail-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.profile-rating-card {
    background: #f0f0f0;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s;
}

.profile-rating-card:hover {
    border-color: #000000;
}

.profile-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.profile-thumb-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #333333;
}

.profile-card-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-card-title {
    font-size: 0.78rem;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-rating-card:hover .profile-card-title {
    color: #000000;
}

.profile-card-composer {
    font-size: 0.68rem;
    color: #555555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-card-stars {
    font-size: 0.75rem;
    color: #333333;
    margin-top: 4px;
}



/* --- Footer --- */
footer {
    text-align: center;
    padding: 30px;
    font-size: 0.75rem;
    color: #444444;
    border-top: 1px solid #dddddd;
    margin-top: 20px;
}

/* --- Settings Tab --- */
#settings-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 30px 60px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
}

.settings-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-avatar-img {
    background-size: cover;
    background-position: center;
}

.settings-username {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
}

.settings-section {
    margin-bottom: 36px;
}

.settings-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #555;
    margin-bottom: 16px;
}

.settings-row {
    margin-bottom: 20px;
}

.settings-row-inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #222;
    margin-bottom: 8px;
}

.settings-row-inline .settings-label {
    margin-bottom: 0;
    flex: 1;
}

.settings-field-group {
    display: flex;
    gap: 8px;
}

.settings-input {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.875rem;
    color: #111;
    outline: none;
    transition: border-color 0.2s;
}

.settings-input:focus {
    border-color: #000;
}

.settings-save-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.settings-save-btn:hover {
    background: #333;
}

.settings-save-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.settings-hint {
    font-size: 0.78rem;
    margin-top: 6px;
    min-height: 1em;
    color: #555;
}

.settings-toggle-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-toggle-btn:hover {
    background: #333;
}

/* --- Dark Mode --- */
.theme-toggle {
    background: transparent;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #555555;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    border-color: #000000;
    color: #000000;
}

html.dark {
    filter: invert(1);
}

/* Force all text to pure black so filter:invert(1) renders it as pure white.
   Excludes colored category tags which rely on specific hues. */
html.dark *:not(.tag):not(.event-tag):not(.catalog-tag):not(.composer-row-cat):not(.cat-tag):not(.catalog-filter-btn) {
    color: #000000 !important;
}

html.dark *::placeholder {
    color: #444444 !important;
}

html.dark #catalog-toolbar {
    background: #e8e8e8;
    border-bottom-color: #e8e8e8;
}

html.dark #popular-sidebar,
html.dark .chart-panel {
    background: #e8e8e8;
    border-color: #e8e8e8;
}

html.dark .header-search-wrap input {
    background: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

html.dark .header-search-wrap input::placeholder { color: #888; }

html.dark .emoji {
    display: inline-block;
    filter: invert(1);
}

html.dark img:not(.logo-img),
html.dark .hero-bg-art,
html.dark .hero-bg-blur,
html.dark .catalog-thumb,
html.dark .anime-card-thumb,
html.dark .op-anime-img,
html.dark .op-extra-poster,
html.dark .header-avatar,
html.dark .settings-avatar-img,
html.dark .composer-row-avatar img,
html.dark .cat-box-tile,
html.dark .cat-row-card-art {
    filter: invert(1);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Header ── */
    header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .logo { flex: 1; }
    .logo img { height: 28px; width: auto; }
    header h1 { font-size: 1.25rem; letter-spacing: 1px; }

    /* Nav tabs: scrollable strip below logo row */
    #page-tabs {
        order: 3;
        flex: 0 0 100%;
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
        gap: 2px;
        padding-bottom: 2px;
    }
    #page-tabs::-webkit-scrollbar { display: none; }

    .page-tab { padding: 5px 12px; font-size: 0.78rem; }

    /* Auth buttons: smaller */
    .auth-buttons { gap: 6px; }
    .btn-login, .btn-signup { padding: 6px 11px; font-size: 0.78rem; }

    /* ── Home layout — hide sidebar, single column ── */
    #albums-layout {
        flex-direction: column;
        padding: 0 14px;
        gap: 0;
    }

    #right-panel { display: none; }

    /* ── Catalog toolbar ── */
    #catalog-toolbar {
        flex-wrap: wrap;
        padding: 12px 14px 10px;
        gap: 8px;
    }

    #catalog-filter-bar {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }
    #catalog-filter-bar::-webkit-scrollbar { display: none; }
    .catalog-filter-btn { white-space: nowrap; }

    .catalog-search-wrap { width: 100%; }
    .catalog-search-wrap input { width: 100%; }

    /* ── Category page ── */
    #cat-hero { padding: 24px 16px; }
    #cat-hero-icon { font-size: 3rem; }
    #cat-hero-title { font-size: clamp(2rem, 8vw, 3rem); }

    #cat-controls {
        gap: 10px;
        padding: 12px 16px;
    }

    #cat-sort-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
    }
    #cat-sort-tabs::-webkit-scrollbar { display: none; }

    #cat-grid-wrap { padding: 20px 14px 40px; }

    #cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 16px 10px;
    }

    /* ── Category rows (home) ── */
    .cat-row { padding: 0 14px; }
    .cat-row-scroll { gap: 10px; }
    .cat-row-card { width: 130px; }
    .cat-row-card-art { height: 130px; }

    /* ── Catalog hero ── */
    #catalog-hero { height: 200px; border-radius: 10px; }

    /* ── Modals ── */
    .modal-box {
        width: 94%;
        padding: 24px 18px;
        margin: 0 auto;
    }

    /* ── Composers page ── */
    #composer-sort-tabs { flex-wrap: wrap; justify-content: center; }
    #composer-search { max-width: 100%; }
}
