:root {
    --bg-color: #0c1424;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-orange: #fb923c;
    --accent-pink: #f472b6;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(251, 146, 60, 0.05) 0, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 100px;
    width: 100%;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 80px;
    background: rgba(12, 20, 36, 0.8);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.stats {
    color: var(--text-secondary);
    font-size: 0.95rem;
    white-space: nowrap;
}

.stats strong {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: -4px;
    letter-spacing: 0.05em;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 32px;
    padding: 20px 40px;
    margin-bottom: 10px;
}

.filter-row {
    flex: 1 1 100%;
    /* Stacks the categories vertically, but keeps internal items horizontal */
    min-width: 0;
}

.filter-row.bottom-row {
    flex: 1 1 100%;
}

.filter-group {
    display: flex;
    flex-direction: row;
    /* Horizontal for PC */
    align-items: flex-start;
    gap: 16px;
}

.tag-scroll {
    display: flex;
    flex-wrap: wrap;
    /* Restore wrap for PC */
    gap: 8px;
    flex: 1;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 80px;
    padding-top: 8px;
    /* Alignment with tags */
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.tag:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.tag.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #000;
    font-weight: 600;
}

.random-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.random-btn:hover {
    background: var(--accent-orange);
    color: #000;
    box-shadow: 0 0 15px rgba(251, 146, 60, 0.3);
}

.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 0 40px 40px;
}

.song-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.song-card:hover {
    transform: translateY(-8px);
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.song-card .year {
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 8px;
}

.song-card .title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.song-card .artist {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.song-card .themes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.theme-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.view-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-top: 10px;
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.view-tab.active {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
}

.view-tab:not(.active):hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.view-tab i {
    width: 18px;
    height: 18px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 40px 40px;
}

.album-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.album-card:hover {
    transform: translateY(-8px);
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.album-image-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.album-image-link:hover {
    transform: translateY(-4px);
}

.album-cover {
    width: 200px;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.amazon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: var(--accent-orange);
}

.amazon-overlay i {
    width: 40px;
    height: 40px;
}

.album-image-link:hover .amazon-overlay {
    opacity: 1;
}

.album-icon {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    position: relative;
}

.album-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}

.album-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.album-category {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.album-tracks-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
}

.active-album-banner {
    margin: 0 40px 20px;
    padding: 16px 24px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-blue);
}

.active-album-banner strong {
    color: white;
}

.clear-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 6px 16px;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-weight: bold;
}

.clear-btn:hover {
    background: var(--accent-blue);
    color: #000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-content {
    background: #141b2d;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow-y: auto;
    padding: 40px;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    transition: all 0.3s ease;
}

.link-btn i {
    width: 20px;
    height: 20px;
}

.lyrics-link {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.lyrics-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.amazon-link {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.amazon-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.spotify-link {
    background: linear-gradient(135deg, #1db954, #1ed760);
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.spotify-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

.apple-link {
    background: linear-gradient(135deg, #fa233b, #fb5c74);
    box-shadow: 0 4px 15px rgba(250, 35, 59, 0.3);
}

.apple-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 35, 59, 0.4);
}

.ytmusic-link {
    background: linear-gradient(135deg, #ff0000, #c30000);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

.ytmusic-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.youtube-link {
    background: linear-gradient(135deg, #282828, #111111);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.youtube-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: #ff0000;
}

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 16px 24px;
    margin: 20px 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.album-list {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.album-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.album-item:last-child {
    border-bottom: none;
}

footer {
    margin-top: 80px;
    padding: 60px 40px;
    border-top: 1px solid var(--border-color);
    background: rgba(12, 20, 36, 0.5);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-contact {
    margin-top: 24px;
}

.footer-contact a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.05);
}

.footer-contact a:hover {
    background: rgba(56, 189, 248, 0.15);
    transform: translateY(-2px);
}

.footer-contact i {
    width: 16px;
    height: 16px;
}

.footer-bottom {
    margin-top: 32px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.1em;
}

/* ============================================
   NEW COMPONENTS (v3.0)
   ============================================ */

/* ----- Card top row (year + fav btn) ----- */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-top-row .year {
    margin-bottom: 0;
}

/* ----- Favorite button (on cards) ----- */
.fav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fav-btn i {
    width: 16px;
    height: 16px;
}

.fav-btn:hover {
    color: var(--accent-pink);
    background: rgba(244, 114, 182, 0.1);
}

.fav-btn.active {
    color: var(--accent-pink);
}

.fav-btn.active i {
    fill: var(--accent-pink);
    stroke: var(--accent-pink);
}

/* ----- Favorite button (in modal) ----- */
.modal-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    margin-top: 12px;
}

.modal-fav-btn i {
    width: 18px;
    height: 18px;
}

.modal-fav-btn:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.modal-fav-btn.active {
    background: rgba(244, 114, 182, 0.15);
    border-color: var(--accent-pink);
    color: var(--accent-pink);
    font-weight: 600;
}

.modal-fav-btn.active i {
    fill: var(--accent-pink);
    stroke: var(--accent-pink);
}

/* ----- Modal top bar: [←] [×] [→] in one flex row ----- */
.modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* Prev / Next buttons */
.modal-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--accent-blue);
}

.modal-nav i {
    width: 20px;
    height: 20px;
}

/* Inline close button inside top bar */
.modal-close-inline {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close-inline:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.modal-close-inline i {
    width: 18px;
    height: 18px;
}

/* ----- Amazon CTA block (song modal) ----- */
.amazon-cta {
    display: flex;
    justify-content: center;
    margin: 28px 0 0;
}

.amazon-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff9900, #e47911);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 32px;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 153, 0, 0.35);
}

.amazon-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 153, 0, 0.5);
}

.amazon-cta-btn i {
    width: 20px;
    height: 20px;
}

/* ----- Similar Songs section ----- */
.similar-songs {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.similar-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.similar-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.similar-year {
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 4px;
}

.similar-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.similar-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.similar-mood {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(251, 146, 60, 0.2);
    color: var(--accent-orange);
    display: inline-block;
}

/* ----- FAVORITES tab ----- */
.favorites-tab {
    position: relative;
}

.fav-count-badge {
    background: var(--accent-pink);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 100px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ----- Empty state (Favorites) ----- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: var(--text-secondary);
    text-align: center;
}

/* ----- Album Tracklist (album detail modal) ----- */
.album-tracklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tracklist-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tracklist-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-color);
}

.track-number {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ----- Album thumb (in song modal "Included in") ----- */
.album-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.album-icon-small {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ----- Header icon button (shortcuts) ----- */
.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

/* ----- Keyboard shortcut modal ----- */
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.shortcut-keys {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    min-width: 80px;
}

.shortcut-item span {
    color: var(--text-primary);
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82rem;
    font-family: monospace;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* ----- Toast notification ----- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 27, 45, 0.96);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.9rem;
    z-index: 9999;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* ============================================
   ALBUM LIST VIEW (image-free redesign)
   ============================================ */

/* Category color variables */
.badge-album,
.cat-album {
    --cat-color: var(--accent-blue);
}

.badge-single,
.cat-single {
    --cat-color: var(--accent-orange);
}

.badge-digital,
.cat-digital {
    --cat-color: var(--accent-pink);
}

/* Category pill badge */
.album-cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--cat-color, var(--accent-blue));
    color: var(--cat-color, var(--accent-blue));
    background: rgba(255, 255, 255, 0.05);
}

.badge-album {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.badge-single {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.badge-digital {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

/* List container */
.album-list-view {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 40px 40px;
}

/* Individual album row */
.album-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.album-row.cat-album {
    border-left: 3px solid var(--accent-blue);
}

.album-row.cat-single {
    border-left: 3px solid var(--accent-orange);
}

.album-row.cat-digital {
    border-left: 3px solid var(--accent-pink);
}

.album-row:hover {
    background: var(--card-hover);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Left: badge + year */
.album-row-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 76px;
}

.album-row-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Center */
.album-row-center {
    flex: 1;
    min-width: 0;
}

.album-row-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.album-row-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right */
.album-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.album-row-tracks {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.album-row-amazon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 153, 0, 0.1);
    border: 1px solid rgba(255, 153, 0, 0.3);
    color: #ff9900;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.album-row-amazon:hover {
    background: rgba(255, 153, 0, 0.28);
}

.album-row-amazon i {
    width: 14px;
    height: 14px;
}

.album-row-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    opacity: 0.4;
    flex-shrink: 0;
}

/* ----- Album detail modal header (image-free) ----- */
.album-modal-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.album-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.album-modal-icon.badge-album {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-blue);
}

.album-modal-icon.badge-single {
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.35);
    color: var(--accent-orange);
}

.album-modal-icon.badge-digital {
    background: rgba(244, 114, 182, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.35);
    color: var(--accent-pink);
}

.album-modal-icon i {
    width: 36px;
    height: 36px;
}

.album-modal-info {
    flex: 1;
    min-width: 0;
}

.album-modal-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.3;
    margin: 6px 0 4px;
}

/* ----- "Included in" rows in song modal ----- */
.included-album-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.included-album-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.included-album-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.included-album-icon.badge-album {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-blue);
}

.included-album-icon.badge-single {
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.3);
    color: var(--accent-orange);
}

.included-album-icon.badge-digital {
    background: rgba(244, 114, 182, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.3);
    color: var(--accent-pink);
}

.included-album-icon i {
    width: 18px;
    height: 18px;
}

.included-album-text {
    flex: 1;
    min-width: 0;
}

.included-album-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.included-album-meta {
    display: flex;
    align-items: center;
    margin-top: 4px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.song-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 1024px) {
    header {
        padding: 0 20px;
    }

    .search-container {
        margin: 0 20px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
        align-items: stretch;
    }

    .logo-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 2px;
    }

    .logo {
        font-size: 1.2rem;
        justify-content: center;
        width: 100%;
    }

    .subtitle {
        font-size: 0.6rem;
        opacity: 0.8;
        margin-top: 0;
        text-align: center;
    }

    .header-right {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .header-right .search-container {
        flex: 1;
        margin: 0;
        max-width: none;
        min-width: 0;
        /* Important for flex child */
    }

    .stats {
        display: none;
    }

    .random-btn span {
        display: none;
    }

    .random-btn {
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
        flex-shrink: 0;
    }

    /* ヘッダー高さを JS が計算するので固定値は削除 */
    body {
        padding-top: 120px;
    }

    /* ===== Tab bar: 3タブを均等に並べる ===== */
    .view-tabs {
        gap: 8px;
        padding: 8px 16px 4px;
    }

    .view-tab {
        flex: 1;
        /* 均等幅 */
        padding: 10px 8px;
        font-size: 0.78rem;
        gap: 5px;
        justify-content: center;
        min-width: 0;
    }

    .view-tab i {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    /* FAVORITESのバッジが溢れないよう */
    .fav-count-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
        margin-left: 3px;
    }

    /* タブのラベルテキストを短縮 */
    .tab-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    /* ===== Grids ===== */
    .song-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 20px;
        gap: 12px;
    }

    /* ===== Filter controls ===== */
    .controls {
        flex-direction: column;
        padding: 8px 16px;
        gap: 10px;
        width: 100%;
    }

    .filter-row {
        width: 100%;
        min-width: 0;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }

    .filter-label {
        font-size: 0.68rem;
        min-width: unset;
        font-weight: 800;
        color: var(--accent-blue);
        opacity: 0.9;
        padding-top: 0;
    }

    .tag-scroll {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        gap: 8px;
        padding: 4px 0 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .tag-scroll::-webkit-scrollbar {
        display: none;
    }

    .tag {
        flex: 0 0 auto;
        scroll-snap-align: start;
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    /* ===== Active album banner ===== */
    .active-album-banner {
        margin: 0 16px 16px;
    }

    /* ===== Song cards ===== */
    .song-card {
        padding: 18px;
    }

    .song-card .title {
        font-size: 1.1rem;
    }

    /* ===== Album list view ===== */
    .album-list-view {
        padding: 0 16px 20px;
        gap: 5px;
    }

    .album-row {
        gap: 10px;
        padding: 12px 14px;
    }

    .album-row-left {
        width: 56px;
        gap: 4px;
    }

    .album-row-year {
        font-size: 0.7rem;
    }

    .album-row-title {
        font-size: 0.9rem;
    }

    .album-row-meta {
        font-size: 0.75rem;
    }

    .album-row-amazon {
        display: none;
    }

    /* スペース節約 */
    .album-row-chevron {
        display: block;
    }

    /* → は残す */

    /* ===== Album modal ===== */
    .album-modal-header {
        flex-direction: column;
        gap: 12px;
    }

    .album-modal-icon {
        width: 56px;
        height: 56px;
    }

    .album-modal-icon i {
        width: 26px;
        height: 26px;
    }

    .album-modal-title {
        font-size: 1.2rem;
    }

    /* ===== Modals ===== */
    .modal-overlay {
        padding: 8px;
    }

    .modal-content {
        padding: 20px 14px;
        border-radius: 20px;
    }

    .modal-top-bar {
        margin-bottom: 16px;
    }

    .modal-nav {
        width: 36px;
        height: 36px;
    }

    .modal-close-inline {
        width: 36px;
        height: 36px;
    }

    /* ===== Song modal body ===== */
    .modal-content h2 {
        font-size: 1.6rem !important;
    }

    .amazon-cta {
        margin: 20px 0 0;
    }

    .amazon-cta-btn {
        font-size: 0.88rem;
        padding: 11px 20px;
    }

    .external-links {
        gap: 10px;
        margin-top: 20px;
    }

    .link-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* ===== Similar songs ===== */
    .similar-grid {
        grid-template-columns: 1fr;
    }

    .similar-songs {
        margin-top: 28px;
        padding-top: 28px;
    }

    /* ===== Keyboard shortcut modal ===== */
    .shortcut-keys {
        min-width: 56px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    /* ===== Footer ===== */
    footer {
        padding: 40px 16px;
        margin-top: 40px;
    }
}