/* =====================================================
   GLOBAL
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}


html {
    height: 100%;

    --nav-height: 80px;

    --rating-bar-height: 102px;
}


body {
    font-family: "Inter", sans-serif;

    background: #080808;

    color: #ffffff;

    min-height: 100dvh;

    overflow-x: clip;

    -webkit-font-smoothing: antialiased;
}


::selection {
    background: rgba(255, 47, 146, 0.28);

    color: #ffffff;
}


button,
input {
    font-family: inherit;
}


button {
    cursor: pointer;
}


/* =====================================================
   NAVBAR
===================================================== */

.navbar {
    min-height: 80px;

    height: auto;

    border-bottom: 1px solid #222;

    display: flex;

    align-items: center;

    gap: 16px;

    padding: calc(env(safe-area-inset-top) + 12px) 50px 12px;

    position: sticky;

    top: 0;

    background: rgba(8, 8, 8, 0.94);

    backdrop-filter: blur(20px);

    z-index: 100;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}


.logo {
    display: flex;

    align-items: center;

    height: 60px;

    width: auto;

    overflow: visible;

    cursor: pointer;

    flex-shrink: 0;
}


.logo img,
.auth-logo img {
    display: block;

    height: 60px;

    width: auto;

    max-width: none;

    margin: 0;

    flex-shrink: 0;

    object-fit: contain;

    object-position: center;
}


.logo:hover {
    opacity: 0.82;
}


/* =====================================================
   SEARCH
===================================================== */

.search-container {
    width: min(350px, 100%);

    height: 42px;

    background: #151515;

    border: 1px solid #292929;

    border-radius: 8px;

    display: flex;

    align-items: center;

    padding: 0 14px;

    transition: 0.2s;
}


.search-container:focus-within {
    border-color: #555;
}


.search-icon {
    font-size: 23px;

    color: #777;

    margin-right: 8px;
}


.search-container input {
    width: 100%;

    background: none;

    border: none;

    outline: none;

    color: white;

    font-size: 16px;
}


.search-container input::placeholder {
    color: #666;
}


/* =====================================================
   NAV LINKS
===================================================== */

.nav-links {
    margin-left: auto;

    display: flex;

    gap: 8px;

    align-items: center;
}


.nav-button {
    border: none;

    background: transparent;

    color: #888;

    padding: 10px 11px;

    font-size: 12px;

    font-weight: 600;

    border-radius: 6px;

    transition: 0.2s;
}


.nav-button:hover {
    color: white;

    background: #151515;
}


.nav-button.active {
    color: white;

    background: #151515;
}


.profile-button {
    border: 1px solid #292929;

    background: #151515;

    color: white;

    padding: 9px 15px;

    border-radius: 6px;

    font-size: 12px;

    font-weight: 700;

    transition: 0.2s;
}


.profile-button:hover {
    border-color: #555;

    background: #1c1c1c;
}


/* =====================================================
   MAIN
===================================================== */

main {
    max-width: 1450px;

    margin: auto;

    padding: 55px 50px 100px;
}


.page-header {
    margin-bottom: 45px;
}


.page-header-row {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;
}


.eyebrow {
    font-size: 10px;

    letter-spacing: 2px;

    color: #777;

    font-weight: 700;

    margin-bottom: 10px;
}


h1 {
    font-size: 46px;

    letter-spacing: -2px;
}


.subtitle {
    margin-top: 8px;

    color: #777;

    font-size: 16px;
}


.sort-wrap {
    position: relative;

    flex-shrink: 0;
}


.sort-button {
    background: #151515;

    border: 1px solid #292929;

    color: #ddd;

    border-radius: 8px;

    padding: 10px 14px;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    font-family: inherit;
}


.sort-button:hover {
    border-color: #444;

    color: white;
}


.sort-options {
    position: absolute;

    right: 0;

    top: calc(100% + 8px);

    min-width: 180px;

    background: #0e0e0e;

    border: 1px solid #292929;

    border-radius: 8px;

    padding: 6px;

    z-index: 40;

    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}


.sort-option {
    display: block;

    width: 100%;

    text-align: left;

    background: none;

    border: none;

    color: #bbb;

    padding: 9px 10px;

    border-radius: 6px;

    font-size: 13px;

    font-weight: 500;

    cursor: pointer;

    font-family: inherit;
}


.sort-option:hover {
    background: #171717;

    color: white;
}


.sort-option.active {
    color: #ff2f92;

    background: rgba(255, 47, 146, 0.08);
}


/* =====================================================
   ALBUM LIST
===================================================== */

.album-list {
    display: flex;

    flex-direction: column;

    border-top: 1px solid #222;
}


.album-card {
    display: grid;

    grid-template-columns:
        70px
        80px
        1fr
        130px
        130px
        130px;

    align-items: center;

    min-height: 100px;

    border-bottom: 1px solid #1e1e1e;

    transition: background 0.2s, transform 0.2s;

    cursor: pointer;

    padding: 12px 10px;

    content-visibility: auto;

    contain-intrinsic-size: 100px;
}


.album-card:hover {
    background: #111;
}


.empty-state {
    padding: 50px 10px;

    color: #555;

    font-size: 14px;
}


.album-number {
    color: #555;

    font-size: 13px;
}


.album-cover-small {
    width: 64px;

    height: 64px;

    aspect-ratio: 1 / 1;

    object-fit: cover;

    object-position: center;

    border-radius: 4px;

    border: 1px solid #2a2a2a;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}


.artist-link {
    color: inherit;

    cursor: pointer;

    transition: color 0.2s;
}


.artist-link:hover {
    color: #ff2f92;
}


.album-information {
    min-width: 0;
}


.album-information h3 {
    font-size: 15px;

    margin-bottom: 5px;

    overflow-wrap: anywhere;
}


.album-information p {
    color: #666;

    font-size: 12px;
}


.score-column {
    text-align: center;
}


.album-card.artist-card {
    grid-template-columns:
        70px
        80px
        1fr
        minmax(240px, 360px);
}


.score-triple {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 8px;

    align-items: center;
}


#artistSortOptions {
    min-width: 220px;

    max-height: min(70vh, 440px);

    overflow: auto;
}


.score-label {
    display: block;

    font-size: 9px;

    color: #555;

    letter-spacing: 1px;

    margin-bottom: 5px;
}


.score {
    font-size: 16px;

    font-weight: 700;
}


.user-score {
    color: white;
}


.friend-score {
    color: #a76cff;
}


.global-score {
    color: #ff3c91;
}


/* =====================================================
   HIDDEN
===================================================== */

.hidden {
    display: none !important;
}


/* =====================================================
   ALBUM HERO
===================================================== */

.back-button {
    border: none;

    background: none;

    color: #777;

    font-size: 13px;

    margin-bottom: 30px;

    transition: 0.2s;
}


.back-button:hover {
    color: white;
}


.album-hero {
    display: flex;

    gap: 35px;

    align-items: flex-end;

    padding-bottom: 45px;
}


.album-cover-large {
    width: 280px;

    height: 280px;

    aspect-ratio: 1 / 1;

    object-fit: cover;

    object-position: center;

    flex-shrink: 0;

    border-radius: 4px;

    border: 1px solid #2a2a2a;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7);
}


.album-title-row {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 24px;

    margin-bottom: 15px;
}


.album-details h1 {
    font-size: 58px;

    line-height: 1;

    margin: 0;

    flex: 1;

    min-width: 0;
}


.album-title-score {
    flex-shrink: 0;

    text-align: right;

    padding-top: 6px;
}


.album-title-score .small-label {
    display: block;
}


.album-title-score strong {
    display: block;

    font-size: 44px;

    line-height: 0.95;

    margin-top: 6px;

    min-width: 1.5em;
}


.album-details .artist {
    font-size: 19px;

    color: #aaa;

    margin-bottom: 18px;
}


.album-meta {
    color: #666;

    font-size: 12px;
}


.album-stat-row {
    display: flex;

    gap: 40px;

    margin-top: 30px;
}


.album-stat strong {
    display: block;

    font-size: 24px;

    margin-top: 5px;
}


/* =====================================================
   RATING SECTION
===================================================== */

.rating-section {
    border-top: 1px solid #222;

    border-bottom: 1px solid #222;

    padding: 25px 0 30px;

    margin-bottom: 35px;
}


.rating-header {
    display: flex;

    justify-content: space-between;

    align-items: center;
}


.rating-header-actions {
    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 8px;
}


.reset-album-button {
    height: 28px;

    padding: 0 12px;

    border-radius: 4px;

    border: 1px solid #333;

    background: transparent;

    color: #888;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;

    cursor: pointer;
}


.reset-album-button:hover {
    border-color: #ff2f92;

    color: #ff2f92;
}


.small-label {
    font-size: 9px;

    letter-spacing: 2px;

    color: #666;

    font-weight: 700;
}


.big-score {
    font-size: 40px;

    font-weight: 800;

    margin-top: 5px;

    transition:
        color 0.08s linear,
        text-shadow 0.08s linear;
}


.rating-instructions {
    color: #555;

    font-size: 12px;
}


/* =====================================================
   RAINBOW
===================================================== */

.rainbow-rating {
    display: flex;

    align-items: center;

    gap: 15px;

    margin-top: 30px;

    font-size: 11px;

    color: #888;
}


.rainbow-line {
    height: 8px;

    flex: 1;

    border-radius: 100px;

    position: relative;

    background:
        linear-gradient(
            90deg,
            #ff2d2d,
            #ff941f,
            #e7e72b,
            #24d879,
            #286eff,
            #9d35ff,
            #ff2f92
        );
}


.rainbow-dot {
    position: absolute;

    top: 50%;

    left: 50%;

    width: 16px;

    height: 16px;

    background: #ffffff;

    border-radius: 50%;

    transform: translate(-50%, -50%);

    box-shadow:
        0 0 10px #ffffff,
        0 0 22px rgba(255, 255, 255, 0.55);

    opacity: 0;

    pointer-events: none;

    transition:
        left 0.08s linear,
        opacity 0.15s ease;
}


.rainbow-dot.visible {
    opacity: 1;
}


/* =====================================================
   SONG LAYOUT
===================================================== */

.songs-layout {
    display: grid;

    grid-template-columns: 1fr 350px;

    gap: 50px;
}


.songs-column {
    min-width: 0;
}


#songsList {
    display: flex;

    flex-direction: column;

    width: 100%;
}


.song-item {
    display: flex;

    flex-direction: column;

    width: 100%;

    flex: 0 0 auto;

    min-width: 0;
}


.song-item.is-current {
    z-index: 2;
}


.songs-header {
    display: grid;

    grid-template-columns:
        1fr
        120px
        120px;

    padding: 0 20px 12px;

    border-bottom: 1px solid #222;

    color: #555;

    font-size: 9px;

    letter-spacing: 1px;
}


.songs-header-track {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding-right: 8px;
}


.song-row {
    display: grid;

    grid-template-columns:
        1fr
        120px
        120px;

    align-items: center;

    width: 100%;

    flex: 0 0 auto;

    min-height: 65px;

    padding: 0 20px;

    border-bottom: 1px solid #171717;

    border-radius: 6px;

    position: relative;

    transition:
        background 0.2s,
        box-shadow 0.2s;

    cursor: pointer;
}


.song-row:hover {
    background: #111;
}


.song-row.current {
    background: #161616;

    box-shadow:
        inset 3px 0 0 #ff2f92,
        0 0 0 1px #2a2a2a;
}


.song-rater {
    display: none;

    width: 100%;

    box-sizing: border-box;

    flex: 0 0 auto;

    position: relative;

    z-index: 2;

    height: auto;

    padding: 14px 14px 16px;

    margin: 0 0 10px;

    overflow: visible;

    background: #120810;

    border: 1px solid #2a2a2a;

    border-top: none;

    border-radius: 0 0 8px 8px;

    box-shadow: inset 3px 0 0 #ff2f92;

    scroll-margin-bottom: calc(88px + env(safe-area-inset-bottom));
}


.song-rater-top {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 4px;

    margin-bottom: 12px;
}


.song-rater-label {
    font-size: 9px;

    letter-spacing: 2px;

    color: #666;

    font-weight: 700;
}


.song-rater-score {
    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    align-self: stretch;

    width: 100%;

    column-gap: 2px;
}


.song-rater-score > .song-rater-value {
    grid-column: 2;

    justify-self: center;
}


.song-rater-value {
    font-size: 28px;

    font-weight: 800;

    line-height: 1;
}


.song-rater-scale {
    margin-top: 0;

    margin-bottom: 14px;

    gap: 8px;

    min-height: 48px;

    height: auto;

    padding: 0;
}


.song-rater-scale,
.song-rate-line {
    touch-action: none;

    cursor: grab;
}


.song-rate-line {
    height: 10px;

    min-height: 10px;

    padding: 16px 0;

    box-sizing: content-box;

    background-clip: content-box;

    background-origin: content-box;
}


.song-rate-line .rainbow-dot {
    width: 28px;

    height: 28px;

    box-shadow:
        0 0 12px #ffffff,
        0 0 28px rgba(255, 255, 255, 0.6);

    transition: none;
}


.song-rate-end {
    border: none;

    background: none;

    color: #888;

    font: inherit;

    font-size: 12px;

    font-weight: 700;

    padding: 10px 4px;

    min-width: 44px;

    min-height: 44px;

    cursor: pointer;

    flex-shrink: 0;
}


.song-rate-line.is-dragging {
    cursor: grabbing;
}


.song-rate-line.is-dragging .rainbow-dot {
    transition: none;
}


.song-rater .done-button {
    width: 100%;
}


.song-name {
    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;

    padding-right: 8px;

    font-size: 13px;
}


.song-name .song-title {
    flex: 1;

    min-width: 0;
}


.song-name .song-score-user {
    flex-shrink: 0;

    width: 48px;

    text-align: right;
}


.song-row.current .song-title {
    color: #ffffff;

    font-weight: 600;
}


.track-number {
    color: #555;

    width: 25px;

    text-align: center;
}


.song-row.current .track-number {
    color: #ff2f92;

    font-weight: 700;
}


.play-icon {
    display: none;

    color: white;

    font-size: 13px;
}


.song-row:hover:not(.current) .track-number {
    display: none;
}


.song-row:hover:not(.current) .play-icon {
    display: block;
}


.rating-badge {
    display: none;

    margin-left: 6px;

    padding: 3px 7px;

    border-radius: 4px;

    background: rgba(255, 47, 146, 0.16);

    color: #ff2f92;

    font-size: 8px;

    font-weight: 800;

    letter-spacing: 1.2px;
}


.song-row.current .rating-badge {
    display: inline-block;
}


.song-row.current .song-score-user {
    font-weight: 800;

    font-size: 15px;
}


.song-score {
    text-align: center;

    font-size: 13px;

    color: #777;
}


.song-score.active {
    font-weight: 700;
}


/* =====================================================
   RATING PANEL
===================================================== */

.rating-panel {
    border: 1px solid #222;

    border-radius: 8px;

    padding: 30px;

    height: fit-content;

    background: #0d0d0d;

    position: sticky;

    top: 110px;
}


.rating-panel-title {
    font-size: 9px;

    color: #666;

    letter-spacing: 2px;

    text-align: center;
}


.rating-value {
    font-size: 52px;

    font-weight: 800;

    text-align: center;

    margin: 10px 0 18px;

    transition:
        color 0.08s linear,
        text-shadow 0.08s linear;

    user-select: none;
}


/* =====================================================
   DIAL
===================================================== */

.dial-wrapper {
    width: 230px;

    height: 125px;

    margin: auto;

    position: relative;

    cursor: grab;

    user-select: none;

    touch-action: none;
}


.dial-wrapper.is-dragging {
    cursor: grabbing;
}


.dial-svg {
    width: 230px;

    height: 125px;

    display: block;

    overflow: hidden;

    pointer-events: none;
}


.dial-track-bg {
    stroke: #2a2a2a;

    stroke-width: 10;

    stroke-linecap: round;
}


.dial-track-fill {
    stroke: #ffffff;

    stroke-width: 10;

    stroke-linecap: round;

    stroke-dasharray: 100;

    stroke-dashoffset: 50;

    transition:
        stroke 0.08s linear,
        stroke-dashoffset 0.05s linear;
}


.dial-dot {
    position: absolute;

    width: 22px;

    height: 22px;

    background: white;

    border-radius: 50%;

    transform: translate(-50%, -50%);

    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.12),
        0 0 16px rgba(255, 255, 255, 0.45);

    z-index: 5;

    pointer-events: none;

    transition:
        left 0.05s linear,
        top 0.05s linear;
}


/* =====================================================
   DIAL SCALE
===================================================== */

.dial-scale {
    display: flex;

    justify-content: space-between;

    margin-top: 8px;

    color: #555;

    font-size: 10px;
}


/* =====================================================
   BUTTONS
===================================================== */

.rating-buttons {
    display: flex;

    flex-direction: column;

    gap: 8px;

    margin-top: 22px;
}


.done-button {
    width: 100%;

    height: 43px;

    border-radius: 5px;

    font-weight: 700;

    font-size: 12px;

    border: none;

    background: white;

    color: black;
}


.done-button:hover {
    background: #ddd;
}


.guest-note {
    color: #555;

    text-align: center;

    font-size: 10px;

    line-height: 1.5;

    margin-top: 18px;
}


/* =====================================================
   ALBUM RESULT
===================================================== */

.album-result {
    margin-top: 50px;

    padding: 50px;

    border: 1px solid #222;

    text-align: center;

    border-radius: 8px;
}


.album-result h2 {
    margin-top: 10px;

    font-size: 28px;
}


.final-score {
    font-size: 90px;

    font-weight: 800;

    margin: 10px 0;
}


.album-result p {
    color: #666;

    font-size: 12px;
}


.save-album-button {
    margin-top: 25px;

    border: none;

    background: white;

    color: black;

    padding: 13px 30px;

    border-radius: 5px;

    font-weight: 700;

    font-size: 12px;
}


.save-album-button:hover {
    background: #ddd;
}

.save-album-button:disabled {
    opacity: 1;
    background: white;
    color: black;
}


/* =====================================================
   ARTISTS
===================================================== */

.artist-photo {
    width: 64px;

    height: 64px;

    object-fit: cover;

    border-radius: 50%;

    border: 1px solid #2a2a2a;

    background: #151515;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}


.artist-hero {
    display: flex;

    gap: 35px;

    align-items: flex-end;

    padding-bottom: 45px;
}


.artist-hero-photo {
    width: 180px;

    height: 180px;

    border-radius: 50%;

    overflow: hidden;

    flex-shrink: 0;

    border: 1px solid #2a2a2a;

    background: #151515;

    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.65);
}


.artist-hero-cover {
    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;
}


/* =====================================================
   FRIENDS
===================================================== */

.friends-container {
    border-top: 1px solid #222;
}


.friend {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 20px;

    border-bottom: 1px solid #222;
}


.friend-avatar {
    width: 45px;

    height: 45px;

    border-radius: 50%;

    display: grid;

    place-items: center;

    background: #202020;

    font-weight: 700;
}


.friend strong {
    font-size: 14px;
}


.friends-search-wrap {
    display: flex;

    align-items: center;

    gap: 10px;

    max-width: 420px;

    margin-bottom: 28px;

    padding: 0 14px;

    height: 46px;

    border: 1px solid #2a2a2a;

    border-radius: 8px;

    background: #101010;
}


.friends-search-wrap input {
    flex: 1;

    min-width: 0;

    border: none;

    background: transparent;

    color: #f4f4f4;

    font: inherit;

    outline: none;
}


.friends-section-title {
    font-size: 13px;

    letter-spacing: 1.4px;

    text-transform: uppercase;

    color: #777;

    margin: 28px 0 12px;
}


.friend {
    width: 100%;

    border: none;

    background: transparent;

    color: inherit;

    text-align: left;

    cursor: pointer;
}


.friend:hover {
    background: #111;
}


.follow-button {
    margin-left: auto;

    height: 32px;

    padding: 0 14px;

    border-radius: 4px;

    border: 1px solid #333;

    background: transparent;

    color: #ddd;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.6px;

    text-transform: uppercase;

    cursor: pointer;

    flex-shrink: 0;
}


.follow-button:hover {
    border-color: #ff2f92;

    color: #ff2f92;
}


.follow-button.is-following {
    background: #ff2f92;

    border-color: #ff2f92;

    color: #080808;
}


.friend-avatar img {
    width: 100%;

    height: 100%;

    object-fit: cover;

    border-radius: 50%;
}


.friend-profile-hero {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 18px;

    margin: 20px 0 8px;
}


.friend-profile-hero .friend-avatar {
    width: 72px;

    height: 72px;

    font-size: 28px;
}


.friend-profile-hero h1 {
    font-size: 32px;

    letter-spacing: -1px;
}


/* =====================================================
   AUTH MODAL
===================================================== */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.78);

    backdrop-filter: blur(12px);

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 1000;

    padding: 20px;
}


.auth-modal {
    width: 100%;

    max-width: 430px;

    background: #0e0e0e;

    border: 1px solid #292929;

    border-radius: 10px;

    padding: 40px;

    position: relative;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.8);
}


.modal-close {
    position: absolute;

    right: 20px;

    top: 15px;

    border: none;

    background: none;

    color: #666;

    font-size: 28px;

    line-height: 1;
}


.modal-close:hover {
    color: white;
}


.auth-logo {
    width: auto;

    height: auto;

    overflow: visible;

    margin-bottom: 18px;
}


.auth-logo img {
    height: 72px;

    width: auto;
}


.auth-modal h2 {
    font-size: 28px;

    letter-spacing: -1px;
}


.auth-subtitle {
    color: #666;

    font-size: 12px;

    margin-top: 7px;

    margin-bottom: 25px;
}


.auth-modal form {
    display: flex;

    flex-direction: column;
}


.auth-modal label {
    font-size: 10px;

    color: #777;

    letter-spacing: 1px;

    font-weight: 700;

    margin-bottom: 7px;

    margin-top: 15px;
}


.auth-modal input {
    width: 100%;

    height: 45px;

    background: #151515;

    border: 1px solid #292929;

    border-radius: 5px;

    padding: 0 13px;

    color: white;

    outline: none;

    font-size: 16px;
}


.auth-modal input:focus {
    border-color: #555;
}


.auth-modal input[type="file"] {
    padding-top: 12px;

    color: #777;
}


.auth-submit {
    height: 45px;

    margin-top: 25px;

    background: white;

    color: black;

    border: none;

    border-radius: 5px;

    font-weight: 700;

    font-size: 12px;
}


.auth-submit:hover {
    background: #ddd;
}


.auth-switch {
    text-align: center;

    color: #666;

    font-size: 11px;

    margin-top: 18px;
}


.auth-switch button {
    border: none;

    background: none;

    color: white;

    font-weight: 700;

    margin-left: 4px;
}


.auth-message {
    color: #ff3c91;

    font-size: 11px;

    text-align: center;

    margin-top: 15px;

    min-height: 15px;
}


.app-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media all {

    .navbar {
        padding-left: 20px;

        padding-right: 20px;
    }


    .logo {
        height: 46px;
    }


    .logo img {
        height: 46px;

        max-width: 168px;
    }


    main {
        padding: 32px 20px 100px;
    }


    .search-container {
        flex: 1;

        width: auto;

        min-width: 0;
    }


    .album-card {
        grid-template-columns:
            40px
            64px
            1fr
            90px;
    }


    .album-card .score-column:nth-child(n+5) {
        display: none;
    }


    .album-card.artist-card {
        grid-template-columns:
            40px
            64px
            1fr;

        row-gap: 10px;
    }


    .album-card.artist-card .score-triple {
        grid-column: 2 / -1;

        justify-items: start;
    }


    .artist-hero {
        flex-direction: column;

        align-items: flex-start;
    }


    .songs-layout {
        grid-template-columns: 1fr;
    }


    .rating-panel {
        display: none !important;
    }


    .song-item.is-current .song-row {
        border-radius: 6px 6px 0 0;

        border-bottom-color: transparent;
    }


    .song-item.is-current > .song-rater {
        display: block;

        height: auto;
    }


    .rating-section {
        position: sticky;

        top: var(--nav-height);

        z-index: 40;

        background: rgba(8, 8, 8, 0.96);

        backdrop-filter: blur(18px);

        margin: 0 -20px 12px;

        padding: 10px 20px 12px;

        border-bottom: 1px solid #222;
    }


    html {
        scroll-padding-top:
            calc(
                var(--nav-height)
                +
                var(--rating-bar-height)
                +
                8px
            );
    }


    .rating-instructions {
        display: none;
    }


    .rating-section .rainbow-rating {
        margin-top: 10px;
    }


    .rating-section .big-score {
        font-size: 28px;

        margin-top: 2px;
    }


    .rating-section .small-label {
        font-size: 8px;
    }


    .song-row {
        scroll-margin-top:
            calc(
                var(--nav-height)
                +
                var(--rating-bar-height)
                +
                8px
            );
    }


    #albumPage:not(.hidden) {
        padding-bottom:
            calc(
                100dvh
                -
                var(--nav-height)
                -
                var(--rating-bar-height)
                -
                80px
            );
    }

}


@media all {

    .nav-links .nav-button {
        display: none;
    }


    .app-tabbar {
        display: grid;

        grid-template-columns: repeat(5, 1fr);

        position: fixed;

        left: 0;

        right: 0;

        bottom: 0;

        z-index: 200;

        background: rgba(8, 8, 8, 0.96);

        border-top: 1px solid #222;

        padding: 6px 6px calc(8px + env(safe-area-inset-bottom));

        backdrop-filter: blur(20px);
    }


    .tab-button {
        border: none;

        background: none;

        color: #777;

        font-size: 10px;

        font-weight: 700;

        display: flex;

        flex-direction: column;

        align-items: center;

        gap: 3px;

        min-height: 48px;

        font-family: inherit;
    }


    .tab-icon {
        font-size: 16px;

        line-height: 1;
    }


    .tab-button.active {
        color: #ff2f92;
    }


    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }


    main {
        padding-bottom: 40px;
    }


    .album-details h1 {
        font-size: clamp(28px, 8vw, 48px);
    }


    h1 {
        font-size: clamp(28px, 8vw, 40px);
    }

}


@media all {

    .page-header-row {
        flex-direction: column;

        align-items: stretch;
    }


    .sort-button {
        width: 100%;
    }


    .sort-options {
        left: 0;

        right: 0;

        min-width: 0;
    }


    .album-hero,
    .artist-hero {
        flex-direction: column;

        align-items: stretch;

        gap: 20px;

        padding-bottom: 28px;
    }


    .album-cover-large {
        width: min(100%, 320px);

        height: auto;

        aspect-ratio: 1 / 1;

        object-fit: cover;

        object-position: center;

        margin: 0 auto;
    }


    .artist-hero-photo {
        width: min(180px, 55vw);

        height: auto;

        aspect-ratio: 1;

        margin: 0 auto;
    }


    .album-stat-row {
        gap: 20px;

        flex-wrap: wrap;
    }


    .album-card {
        grid-template-columns:
            52px
            1fr
            58px;

        min-height: 76px;

        padding: 10px 0;

        gap: 10px;
    }


    .album-card.artist-card {
        grid-template-columns:
            52px
            1fr;

        min-height: 0;
    }


    .album-card.artist-card .score-triple {
        grid-column: 2;
    }


    .album-number {
        display: none;
    }


    .album-cover-small,
    .artist-photo {
        width: 52px;

        height: 52px;
    }


    .album-information h3 {
        font-size: 14px;

        line-height: 1.3;
    }


    .score-label {
        font-size: 8px;
    }


    .rating-header {
        align-items: flex-end;

        gap: 12px;
    }


    .rating-instructions {
        max-width: 110px;

        text-align: right;
    }


    .album-details h1 {
        font-size: clamp(28px, 8vw, 40px);
    }


    .album-title-score strong {
        font-size: 32px;
    }


    .songs-header {
        grid-template-columns:
            1fr
            56px;
    }


    .songs-header > span:nth-child(2) {
        display: none;
    }


    .song-row {
        grid-template-columns:
            1fr
            56px;

        padding: 0 8px;

        min-height: 58px;
    }


    .song-row > :nth-child(2) {
        display: none;
    }


    .song-name {
        min-width: 0;

        gap: 10px;
    }


    .song-title {
        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }


    .rating-panel {
        display: none !important;
    }


    .final-score {
        font-size: 64px;
    }


    .album-result {
        padding: 28px 16px;
    }


    .auth-modal {
        padding: 28px 20px;

        max-height: calc(100dvh - 24px);

        overflow: auto;
    }


    .modal-overlay {
        padding: 12px;

        align-items: flex-end;
    }


    .rainbow-rating {
        gap: 10px;
    }

}


@media (max-width: 420px) {

    .navbar {
        flex-wrap: wrap;

        padding-bottom: 10px;
    }


    .search-container {
        order: 3;

        flex-basis: 100%;
    }


    .logo {
        height: 42px;
    }


    .logo img {
        height: 42px;

        max-width: 150px;
    }


    .profile-button {
        margin-left: auto;
    }


    .album-details .artist {
        font-size: 16px;
    }


    .big-score {
        font-size: 32px;
    }


    .rating-value {
        font-size: 42px;
    }

}


@media (hover: none) {

    .album-card:hover,
    .song-row:hover {
        background: transparent;
    }


    .song-row:hover:not(.current) .track-number {
        display: block;
    }


    .song-row:hover:not(.current) .play-icon {
        display: none;
    }


    .nav-button:hover,
    .profile-button:hover {
        background: #151515;
    }

}
/* =====================================================
   RATED v28 ? mobile shell, discovery, posters
===================================================== */

:root {
    --bg: #080808;
    --bg-elevated: #101010;
    --line: #242424;
    --text: #f4f4f4;
    --muted: #8a8a8a;
    --accent: #e8ff47;
    --poster-paper: #f3efe6;
    /* Real mobile chrome heights ? keep in sync with .navbar / .home-tabs / .app-tabbar */
    --nav-height: calc(56px + env(safe-area-inset-top, 0px));
    --home-tabs-h: 52px;
    --tabbar-h: 64px;
    --discovery-page: calc(
        100dvh
        - var(--nav-height)
        - var(--home-tabs-h)
        - var(--tabbar-h)
        - env(safe-area-inset-bottom, 0px)
    );
    --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
    --font-body: "DM Sans", system-ui, sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
}

.navbar {
    gap: 10px;
    padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
    min-height: 56px;
    height: var(--nav-height);
    box-sizing: border-box;
}

.logo {
    height: 40px;
    overflow: visible;
}

.logo img,
.auth-logo img {
    height: 40px;
    width: auto;
    max-width: min(52vw, 220px);
    object-fit: contain;
    object-position: left center;
}

.nav-spacer {
    flex: 1;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button.active {
    border-color: #555;
    color: var(--accent);
}

.desktop-only {
    display: none !important;
}

.search-panel {
    position: fixed;
    top: var(--nav-height, 56px);
    left: 0;
    right: 0;
    bottom: calc(var(--tabbar-h, 64px) + env(safe-area-inset-bottom));
    z-index: 80;
    display: flex;
    flex-direction: column;
    background: #080808;
    padding: 10px 16px 12px;
    overflow: hidden;
}

.search-panel .search-container {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    flex-basis: auto;
    order: 0;
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #121212;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 12px;
}

.search-panel input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 14px 0;
    outline: none;
    font-size: 16px;
}

.search-close {
    border: none;
    background: none;
    color: #aaa;
    font-size: 24px;
    line-height: 1;
    padding: 4px 6px;
}

.search-results {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 14px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    -webkit-overflow-scrolling: touch;
}

.search-hit {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 10px 0;
    min-height: 64px;
    border-bottom: 1px solid #1c1c1c;
}

.search-hit-mark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c1c;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.search-hit img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #161616;
}

.search-hit strong,
.search-hit-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-hit-copy span {
    color: #aaa;
    font-size: 13px;
    margin-top: 2px;
}

.search-panel .saved-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-results h3 {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.home-page {
    padding: 0 !important;
    max-width: none;
}

.home-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    position: sticky;
    top: var(--nav-height);
    z-index: 40;
    height: var(--home-tabs-h);
    box-sizing: border-box;
    padding: 8px 16px;
    align-items: center;
    background: rgba(8,8,8,0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.home-tab {
    border: none;
    background: transparent;
    color: #777;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 8px 2px;
    border-radius: 10px;
    white-space: nowrap;
}

.home-tab.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.new-releases-panel {
    overflow: auto;
    padding: 8px 16px 96px;
    height: calc(100dvh - var(--nav-height) - 108px);
}

.new-section {
    margin-bottom: 28px;
}

.new-section h2 {
    font-size: 18px;
    margin: 4px 0 12px;
}

.new-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.new-card {
    flex: 0 0 148px;
    text-align: left;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 0;
}

.new-card img {
    width: 148px;
    height: 148px;
    object-fit: cover;
    border-radius: 8px;
    background: #161616;
}

.new-card strong,
.new-card span,
.new-card em {
    display: block;
    margin-top: 6px;
}

.new-card strong {
    font-size: 14px;
}

.new-card span,
.new-card em {
    color: #aaa;
    font-size: 12px;
    font-style: normal;
}

.discovery-pill {
    display: inline-block;
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
    background: #fff;
    border-radius: 999px;
    padding: 2px 6px;
}

.new-artist-mark {
    width: 148px;
    height: 148px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    font-size: 42px;
    color: #fff;
}

.discovery-feed {
    height: var(--discovery-page);
    max-height: var(--discovery-page);
    overflow-x: hidden;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: auto;
    scroll-padding-top: 0;
    scroll-padding-bottom: 0;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.discovery-card {
    /* Exact one scrollport page ? not 100vh / content-sized (that causes half-snaps). */
    height: var(--discovery-page);
    min-height: var(--discovery-page);
    max-height: var(--discovery-page);
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    scroll-margin: 0;
    display: flex;
    align-items: stretch;
    padding: 10px 14px 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.discovery-stage {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

/*
 * Hero square cover (~360px max). Slot consumes leftover column height;
 * img is a true square via aspect-ratio + max-height 100% (no flex stretch distortion).
 * object-fit: contain keeps full artwork visible (no crop).
 */
.discovery-cover-slot {
    /* Hold the 360 cover. Shrink only when the phone is too short. Extra room goes to the text. */
    flex: 0 1 360px;
    min-height: 0;
    max-height: 360px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discovery-cover {
    width: min(100%, 360px);
    max-width: 100%;
    height: auto;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    margin: 0;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

.discovery-meta {
    padding: 0 2px;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 12px;
}

.discovery-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
}

.discovery-title-text {
    min-width: 0;
    flex: 1 1 auto;
}

.discovery-title {
    font-family: var(--font-display);
    font-size: clamp(26px, 7.5vw, 42px);
    letter-spacing: 0.02em;
    line-height: 0.95;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.discovery-artist {
    color: #cfcfcf;
    font-size: 14px;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discovery-title-scores {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    flex-shrink: 0;
    padding-top: 4px;
}

.discovery-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    white-space: nowrap;
}

.discovery-score-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.72);
}

.discovery-score strong {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.01em;
    min-width: 2.4ch;
    text-align: right;
}

.discovery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}

.genre-chip,
.taste-chip,
.saved-chip {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.28);
    color: #ddd;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
}

.genre-chip.is-saved,
.taste-chip.is-saved {
    border-color: var(--accent);
    color: var(--accent);
}

.discovery-actions {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 12px;
    flex-shrink: 0;
}

.discovery-primary,
.discovery-save {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #333;
    font-weight: 700;
}

.discovery-primary {
    background: #f5f5f5;
    color: #111;
}

.discovery-save {
    background: transparent;
    color: #fff;
}

.discovery-save.is-saved {
    border-color: var(--accent);
    color: var(--accent);
}

.discovery-hint {
    margin-top: 0;
    color: #666;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Short phones: tighten meta only ? keep the large cover target */
@media (max-height: 780px) {
    .discovery-card {
        padding: 6px 12px 8px;
    }

    .discovery-stage {
        gap: 12px;
    }

    .discovery-meta {
        gap: 8px;
        justify-content: flex-start;
    }

    .discovery-title {
        font-size: clamp(24px, 7vw, 36px);
    }

    .discovery-title-row {
        gap: 12px;
        margin-bottom: 0;
    }

    .discovery-score strong {
        font-size: 19px;
    }

    .discovery-score-icon {
        width: 20px;
        height: 20px;
    }

    .discovery-tags .genre-chip:nth-child(n+3) {
        display: none;
    }

    .discovery-hint {
        display: none;
    }
}

@media (max-height: 700px) {
    .discovery-tags {
        display: none;
    }

    .discovery-artist {
        font-size: 12px;
    }

    .discovery-title {
        font-size: clamp(22px, 6.5vw, 32px);
        margin-bottom: 4px;
    }

    .discovery-meta {
        gap: 8px;
        justify-content: flex-start;
    }

    .discovery-title-row {
        gap: 10px;
        margin-bottom: 0;
    }

    .discovery-title-scores {
        gap: 6px;
        padding-top: 2px;
    }

    .discovery-score strong {
        font-size: 18px;
    }

    .discovery-score-icon {
        width: 18px;
        height: 18px;
    }
}

.home-friends-feed {
    padding: 16px;
    padding-bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom));
}

.best-albums-panel {
    overflow: auto;
    padding: 8px 16px 96px;
    height: calc(100dvh - var(--nav-height) - 108px);
    -webkit-overflow-scrolling: touch;
}

.activity-card,
.inbox-row {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: left;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.02);
    color: inherit;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
}

.activity-card img,
.inbox-row img {
    width: 56px;
    height: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    object-fit: cover;
    object-position: center;
}

.activity-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.activity-user {
    color: var(--muted);
    font-size: 12px;
}

.activity-score,
.inbox-score {
    font-weight: 800;
}

.album-progress-bar {
    position: sticky;
    top: var(--nav-height, 56px);
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 12px;
    margin-bottom: 8px;
    background: rgba(8,8,8,0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.sticky-score {
    display: block;
    font-size: 34px;
    line-height: 1;
    margin-top: 2px;
}

.sticky-count {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 6px;
    white-space: nowrap;
}

#stickyAlbumStatus.is-complete {
    color: var(--accent);
}

.score-pop {
    animation: scorePop 280ms ease;
}

@keyframes scorePop {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.album-extra-actions {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.artist-extra-actions .discovery-save {
    width: 100%;
    max-width: 280px;
}

.album-artist-save-row {
    margin-bottom: 2px;
}

.saved-artist-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #222;
}

.saved-artist-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 4px;
    border: 0;
    border-bottom: 1px solid #222;
    background: transparent;
    color: #fff;
    text-align: left;
    cursor: pointer;
    min-height: 64px;
}

.saved-artist-row:active {
    background: rgba(255, 255, 255, 0.04);
}

.saved-artist-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #2a2a2a;
    background: #151515;
}

.saved-artist-photo-fallback {
    display: inline-block;
}

.saved-artist-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.album-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Profile */
.profile-header {
    text-align: center;
    padding: 8px 0 20px;
    position: relative;
}

.profile-header-tools {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.profile-edit-btn {
    position: static;
}

.profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 8px auto 12px;
}

.profile-avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #2a2a2a;
    background: #111;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-btn {
    font-size: 12px;
    font-weight: 700;
    color: #ddd;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.profile-avatar-btn[hidden] {
    display: none !important;
}

.profile-username-display {
    margin: 0 auto 8px;
    max-width: 360px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fff;
    line-height: 1.2;
}

.profile-username-display[hidden] {
    display: none !important;
}

.profile-username-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 auto 8px;
    max-width: 360px;
}

.profile-username-row[hidden] {
    display: none !important;
}

.profile-username-input {
    flex: 1 1 160px;
    min-width: 0;
    background: #161616;
    color: #fff;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.profile-username-save {
    flex: 0 0 auto;
}

.profile-username-hint {
    font-size: 12px;
    margin: 0 auto 12px;
    min-height: 1.2em;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-friends-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.profile-friend {
    border: none;
    background: none;
    padding: 0;
}

.profile-friend-more {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px dashed #444;
    background: transparent;
    color: #aaa;
    font-size: 12px;
    font-weight: 700;
}

.profile-taste-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.taste-chip.genre span {
    color: var(--muted);
    margin-left: 4px;
}

.profile-actions-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.text-button {
    border: none;
    background: none;
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-button.danger {
    color: #ff6b6b;
}

.profile-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 12px;
}

.profile-section-head h2 {
    font-size: 16px;
}

.profile-sort {
    display: flex;
    gap: 4px;
}

.profile-sort-btn,
.profile-collection-tab {
    border: 1px solid transparent;
    background: transparent;
    color: #777;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-radius: 999px;
}

.profile-sort-btn.active,
.profile-collection-tab.active {
    color: #111;
    background: #f2f2f2;
}

.profile-collection-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 22px 0 12px;
}

.profile-collections {
    margin-bottom: 40px;
}

.saved-album-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-album-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 8px;
    border: 1px solid #222;
    border-radius: 16px;
    background: #101010;
    cursor: pointer;
}

.saved-album-cover {
    width: 64px;
    height: 64px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

.saved-album-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saved-album-title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.saved-album-title,
.saved-album-score {
    margin: 0;
    font-weight: 700;
}

.saved-album-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-album-score {
    flex: 0 0 auto;
    font-size: 24px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: #fff;
}

.saved-album-meta {
    margin: 0;
    color: #666;
    font-size: 12px;
}

@media all {
    .saved-album-title {
        font-size: 13px;
        line-height: 1.25;
    }

    .saved-album-score {
        font-size: 22px;
        line-height: 1;
    }

    .saved-album-card {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
    }

    .saved-album-cover {
        width: 52px;
        height: 52px;
    }
}

.saved-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Poster cards ? IGOR-inspired */
.poster-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.poster-card {
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    color: #f5f5f5;
    cursor: pointer;
}

.poster-inner {
    position: relative;
    background: #111;
    color: #f5f5f5;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
}

.poster-wash {
    position: absolute;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
}

.poster-wash img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.32) saturate(0.85);
    transform: scale(1.15);
}

.poster-wash::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.poster-cover,
.poster-copy,
.poster-score-row,
.poster-tracks {
    position: relative;
    z-index: 1;
}

.poster-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 6px;
}

.poster-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 12px;
    min-height: 0;
    margin-top: 8px;
}

.poster-tracks {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: 5.2px;
    line-height: 1.32;
    font-weight: 700;
    text-transform: uppercase;
}

.poster-tracks li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2px;
    padding: 0.5px 0;
}

.poster-track-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poster-track-score {
    font-variant-numeric: tabular-nums;
}

.poster-card.is-tight .poster-tracks {
    font-size: 4.4px;
    line-height: 1.24;
}

.poster-card.is-compact .poster-tracks {
    font-size: 3.6px;
    line-height: 1.16;
}

.poster-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.poster-artist {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
}

.poster-title-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.poster-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.poster-score-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    gap: 3px;
    min-width: 0;
}

.poster-title,
.poster-title-score {
    font-family: var(--font-display);
    margin: 0;
    font-weight: 800;
    text-transform: uppercase;
}

.poster-title {
    width: 100%;
    min-width: 0;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poster-title-score {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.poster-scores {
    display: block;
    margin-bottom: 6px;
}

.poster-score-you {
    width: 100%;
}

.poster-score-you span {
    display: block;
    font-size: 5.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.72);
}

.poster-score-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    font-size: 18px;
    line-height: 1;
}

.poster-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin-top: 4px;
}

.poster-score-you strong {
    display: block;
    font-size: 1em;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.poster-logo {
    height: 15px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    object-position: right center;
}

.poster-score-stack .poster-logo {
    height: 15px;
    margin: 0;
    object-position: right center;
}

.poster-score-row > .poster-logo {
    height: 15px;
    margin: 0;
    object-position: left center;
}

.poster-meta {
    font-size: 4.5px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 6px;
    color: rgba(255,255,255,0.7);
}

.poster-face {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    color: #f5f5f5;
}

.poster-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 0 0 auto;
}

.poster-card.is-large {
    position: relative;
    width: min(82vw, 300px);
    margin: 0 auto;
    perspective: 1200px;
}

.poster-card.is-large .poster-flip {
    position: relative;
    aspect-ratio: 5 / 6;
    height: auto;
    max-height: min(84dvh, 420px);
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
    cursor: pointer;
}

.poster-card.is-flipped .poster-flip {
    transform: rotateY(180deg);
}

.poster-card.is-large .poster-face {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateY(0deg);
}

.poster-card.is-large .poster-back {
    display: flex;
    flex-direction: column;
    transform: rotateY(180deg);
}

.poster-card.is-large .poster-tracks {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    overflow: auto;
    font-size: 13px;
    line-height: 1.4;
    margin: 4px 0 8px;
    color: #fff;
}

.poster-modal > .modal-close {
    display: none;
}

.poster-card.is-large .poster-tracks li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.25;
}

.poster-card.is-large .poster-artist {
    font-size: 16px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.poster-card.is-large .poster-title {
    font-size: 20px;
    line-height: 1.1;
    margin: 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poster-card.is-large .poster-title-score {
    font-size: 30px;
    line-height: 1;
    margin: 0;
}

.poster-card.is-large .poster-brand .poster-logo,
.poster-card.is-large .poster-score-stack .poster-logo,
.poster-card.is-large .poster-score-row .poster-logo {
    height: 20px;
}

.poster-card.is-large .poster-score-you span,
.poster-card.is-large .poster-meta {
    font-size: 9px;
}

.poster-card.is-large .poster-back .poster-score-row {
    gap: 4px;
    font-size: 20px;
    line-height: 1;
    margin-top: auto;
}

.poster-modal-body {
    max-height: 100%;
    overflow: hidden;
    padding: 0;
}

.friends-activity {
    margin-bottom: 18px;
}

.app-tabbar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(8, 8, 8, 0.96);
    border-top: 1px solid #222;
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(20px);
}

.tab-button {
    border: none;
    background: none;
    color: #777;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 48px;
    font-family: inherit;
}

.tab-button.active {
    color: #fff;
}

.tab-icon {
    display: flex;
    line-height: 1;
}

body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

main#app {
    /* Mobile shell is full-bleed; pages add their own padding. */
    padding: 0;
}

.page:not(#homePage) {
    padding: 16px 16px 28px;
}

#homePage.page {
    padding: 0;
}

.legacy-album-grid {
    display: none !important;
}

/* =====================================================
   PHONE APP
   The phone layout is the product. A wider window just
   shows that same phone, centered. It does not stretch.
===================================================== */

:root {
    --app-w: 430px;
}

html {
    background: #000;
    overscroll-behavior: none;
}

body {
    width: min(100%, var(--app-w));
    max-width: var(--app-w);
    margin: 0 auto;
    min-height: 100dvh;
    background: #080808;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior-y: none;
}

button,
.home-tab,
.tab-button,
.genre-chip,
.icon-button,
.discovery-primary,
.discovery-save,
.nav-button {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

* {
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

input,
textarea,
select {
    font-size: 16px;
}

.navbar {
    flex-wrap: nowrap;
    width: 100%;
}

.app-tabbar,
.search-panel,
.modal-overlay {
    left: 50%;
    right: auto;
    width: min(100%, var(--app-w));
    max-width: var(--app-w);
    transform: translateX(-50%);
}

.poster-grid {
    grid-template-columns: 1fr 1fr;
}

.tab-button:active,
.home-tab:active,
.icon-button:active,
.discovery-primary:active,
.discovery-save:active {
    opacity: 0.7;
}

@media (min-width: 431px) {
    body {
        min-height: 100dvh;
        box-shadow: 0 0 0 1px #1a1a1a;
    }
}

/* =====================================================
   RATING STAGE
   One frame for rating, and for a screen recording.
===================================================== */

body.is-rating {
    padding-bottom: 0;
    overflow: hidden;
}

body.is-rating .navbar,
body.is-rating .app-tabbar {
    display: none !important;
}

body.is-rating #albumPage:not(.hidden) {
    position: relative;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
}

.rate-stage {
    position: relative;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
}

.rate-wash {
    position: absolute;
    inset: -28%;
    width: 156%;
    height: 156%;
    object-fit: cover;
    filter: blur(46px) brightness(0.32) saturate(1.2);
    z-index: 0;
    pointer-events: none;
}

.rate-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.5) 42%,
            rgba(0, 0, 0, 0.78) 100%
        );
}

.rate-stage-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding:
        calc(12px + env(safe-area-inset-top))
        18px
        calc(12px + env(safe-area-inset-bottom));
}

.rate-top {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.rate-back {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.rate-album-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1px;
}

.rate-mark {
    height: 13px;
    width: auto;
    margin-bottom: 3px;
}

.rate-album-meta strong,
.rate-album-meta span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rate-album-meta strong {
    font-size: 13px;
    font-weight: 700;
}

.rate-album-meta span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

.rate-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: "Bebas Neue", sans-serif;
    font-size: 30px;
    line-height: 0.85;
    letter-spacing: 0.03em;
}

.rate-count::before {
    content: "RATED";
    font-family: "DM Sans", sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.55);
}

.rate-cover {
    width: min(48vw, 196px);
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    align-self: center;
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}

.rate-kicker {
    margin: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.62);
}

.rate-song-title {
    margin: 0;
    text-align: center;
    font-size: clamp(22px, 6.4vw, 30px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.is-rating .song-rater {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

body.is-rating .song-rater-top {
    margin-bottom: 2px;
}

body.is-rating .song-rater-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.55);
}

body.is-rating .song-rater-value {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(96px, 30vw, 136px);
    font-weight: 400;
    line-height: 0.8;
    letter-spacing: 0.02em;
}

body.is-rating .song-rater-scale {
    width: 100%;
    margin: 0 0 8px;
    min-height: 56px;
}

body.is-rating .song-rate-end {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

body.is-rating .song-rate-line {
    height: 16px;
    min-height: 16px;
    border-radius: 999px;
}

body.is-rating .song-rate-line .rainbow-dot {
    width: 36px;
    height: 36px;
    border: 3px solid #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

body.is-rating .song-rater .done-button {
    height: 52px;
    border-radius: 999px;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.rate-album-line {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.rate-album-score-live {
    display: none;
}

.rate-album-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.55);
}

.rate-album-score {
    font-family: "Bebas Neue", sans-serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
}

.rate-album-rainbow {
    margin: 0;
    min-height: 0;
}

.rate-album-rainbow .rainbow-line {
    height: 8px;
    border-radius: 999px;
}

body.is-rating .songs-layout {
    margin: 0;
    gap: 0;
}

body.is-rating .songs-header,
body.is-rating .rating-panel,
body.is-rating .play-icon,
body.is-rating .song-title,
body.is-rating .rating-badge,
body.is-rating .song-score-friends,
body.is-rating .song-score-global {
    display: none !important;
}

body.is-rating #songsList {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 0;
    scroll-snap-type: x proximity;
}

body.is-rating .song-item {
    width: auto;
    flex: 0 0 auto;
    scroll-snap-align: center;
}

body.is-rating .song-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-height: 64px;
    padding: 8px 4px;
    gap: 1px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.42);
    box-shadow: none;
}

body.is-rating .song-row.current {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

body.is-rating .song-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: auto;
    min-width: 0;
    padding: 0;
}

body.is-rating .track-number {
    font-size: 10px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
}

body.is-rating .song-name .song-score-user {
    width: auto;
    text-align: center;
    font-family: "Bebas Neue", sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 0.9;
}

body.is-rating #albumResult:not(.hidden) {
    position: absolute;
    inset: 0;
    z-index: 6;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-height: 740px) {
    body.is-rating .rate-cover {
        width: min(34vw, 132px);
    }

    body.is-rating .song-rater-value {
        font-size: 84px;
    }

    body.is-rating .rate-song-title {
        font-size: 20px;
    }

    body.is-rating .song-row {
        width: 54px;
        min-height: 54px;
    }
}

.poster-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.poster-face {
    background: transparent;
}

.poster-card.is-large {
    perspective: 1200px;
    width: min(82vw, 300px);
    max-height: none;
    overflow: visible;
    border-radius: 12px;
}

.poster-card.is-large .poster-tracks {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin: 4px 0 8px;
    font-size: 13px;
    line-height: 1.4;
    color: inherit;
    -webkit-overflow-scrolling: touch;
}

.poster-card.is-light,
.poster-card.is-light .poster-face,
.poster-card.is-light .poster-score-row strong,
.poster-card.is-light .poster-title-score {
    color: #141414;
}

.poster-card.is-light .poster-artist,
.poster-card.is-light .poster-track-num {
    color: rgba(0, 0, 0, 0.62);
}

.poster-card.is-light .poster-logo {
    filter: brightness(0);
}

body.poster-open,
html.poster-open {
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100dvh !important;
    overscroll-behavior: none;
}

.poster-modal.modal-overlay {
    align-items: center;
    justify-content: center;
    overflow: hidden;
    overscroll-behavior: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: 16px 12px;
}

.poster-modal .poster-modal-body {
    width: 100%;
    max-width: 300px;
    max-height: min(90dvh, 460px);
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.poster-modal .poster-card.is-large {
    width: min(82vw, 300px);
    height: auto;
    max-height: min(84dvh, 420px);
    aspect-ratio: 5 / 6;
    margin: 0;
    overflow: visible;
    border-radius: 12px;
    perspective: 1200px;
}

.poster-modal .poster-flip {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 5 / 6;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
    cursor: pointer;
}

.poster-modal .poster-card.is-flipped .poster-flip {
    transform: rotateY(180deg);
}

.poster-modal .poster-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: 12px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: transparent;
    color: inherit;
}

.poster-modal .poster-front {
    transform: rotateY(0deg);
}

.poster-modal .poster-back {
    transform: rotateY(180deg);
}

.poster-modal .poster-cover {
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: 1;
    align-self: stretch;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 8px;
}

.poster-modal .poster-copy {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}

.poster-modal .poster-card.is-large .poster-title {
    font-size: 20px;
    line-height: 1.1;
    margin: 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poster-modal .poster-card.is-large .poster-title-score {
    font-size: 30px;
    line-height: 1;
    margin: 0;
}

.poster-modal .poster-card.is-large .poster-artist {
    font-size: 16px;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.poster-modal .poster-card.is-large .poster-brand {
    margin-top: 3px;
}

.poster-modal .poster-card.is-large .poster-brand .poster-logo,
.poster-modal .poster-card.is-large .poster-score-stack .poster-logo,
.poster-modal .poster-card.is-large .poster-score-row .poster-logo {
    height: 20px;
}

.poster-modal .poster-card.is-large .poster-back .poster-score-row {
    font-size: 20px;
    margin-top: auto;
    gap: 4px;
}

.poster-modal .poster-card.is-large .poster-tracks {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    margin: 0 0 8px;
    padding: 0;
    font-size: 13px;
    line-height: 1.3;
    color: inherit;
    touch-action: pan-y;
}

.poster-modal .poster-card.is-large .poster-tracks li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: inherit;
    line-height: inherit;
}

.poster-modal .poster-track-name,
.poster-modal .poster-track-score,
.poster-modal .poster-track-num {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-save {
    display: none;
}

body.is-rating .song-rater-score .song-save {
    grid-column: 3;
    justify-self: start;
}

body.is-rating .song-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-family: inherit;
    position: relative;
}

body.is-rating .song-save-star {
    font-size: 32px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.92);
}

body.is-rating .song-save-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

body.is-rating .song-save.is-sparkling {
    animation: saveSpark 460ms ease;
}

body.is-rating .song-save.is-sparkling .song-save-star {
    color: #e8b230;
}

body.is-rating .song-save.is-sparkling::before,
body.is-rating .song-save.is-sparkling::after {
    content: "✦";
    position: absolute;
    top: -7px;
    color: #ffe7a3;
    font-size: 11px;
    pointer-events: none;
    animation: sparkBit 460ms ease forwards;
}

body.is-rating .song-save.is-sparkling::before {
    left: 8px;
}

body.is-rating .song-save.is-sparkling::after {
    right: 8px;
}

body.is-rating .song-save.is-saved {
    background: transparent;
    color: #f0c14a;
    box-shadow: none;
}

body.is-rating .song-save.is-saved .song-save-star {
    font-size: 36px;
    color: #f0c14a;
}

@keyframes saveSpark {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 90, 0); }
    40% { transform: scale(1.08); box-shadow: 0 0 16px rgba(255, 214, 90, 0.95); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 214, 90, 0); }
}

@keyframes sparkBit {
    0% { opacity: 0; transform: translateY(4px) scale(0.6); }
    30% { opacity: 1; transform: translateY(-2px) scale(1); }
    100% { opacity: 0; transform: translateY(-10px) scale(0.8); }
}

.profile-collection-tabs {
    grid-template-columns: 1fr 1fr;
}

.profile-collection-tab {
    border: 1px solid #2c2c2c;
    background: #141414;
    color: #eee;
    min-height: 44px;
    border-radius: 12px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

.profile-collection-tab.active {
    background: #f2f2f2;
    color: #111;
    border-color: #f2f2f2;
}

.profile-saved-songs-btn {
    border: 1px solid #2c2c2c;
    background: #141414;
    color: #fff;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}

.profile-saved-songs-btn:active {
    background: #f2f2f2;
    color: #111;
}

.saved-song-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-song-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    padding: 8px 10px;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    background: #121212;
    color: #fff;
    text-align: left;
    font-family: inherit;
}

.saved-song-btn img,
.saved-song-fallback {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1c1c1c;
}

.saved-song-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.saved-song-copy strong,
.saved-song-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-song-copy strong {
    font-size: 15px;
}

.saved-song-copy span {
    color: #9a9a9a;
    font-size: 12px;
}

.saved-song-star {
    color: #f0c14a;
    font-size: 20px;
    flex-shrink: 0;
}

.app-screen-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}

.app-screen-head h1 {
    font-size: 22px;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0;
}

.app-screen-head .eyebrow {
    margin: 0 0 2px;
}

.app-back {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #161616;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-screen-label {
    margin: 8px 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8a8a8a;
}

#artistPage .artist-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding-bottom: 8px;
}

#artistPage .artist-hero-photo {
    width: 112px;
    height: 112px;
    margin: 0 auto;
}

#artistPage .album-details,
#artistPage .album-details h1,
#artistPage .album-meta {
    width: 100%;
    text-align: center;
}

#artistPage .album-details h1 {
    font-size: 28px;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

#artistPage .album-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

#artistPage .album-stat {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 14px;
    padding: 10px 4px;
    text-align: center;
}

#artistPage .album-stat .small-label {
    font-size: 9px;
}

#artistPage .album-stat strong {
    font-size: 18px;
}

#artistPage .artist-extra-actions {
    width: 100%;
    justify-items: center;
}

#artistPage .artist-extra-actions .discovery-save {
    max-width: 220px;
}

.app-album-list {
    border-top: 0;
    gap: 8px;
}

.app-album-list .album-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 8px;
    border: 1px solid #222;
    border-radius: 16px;
    background: #101010;
}

.app-album-list .album-number,
.app-album-list .album-card .score-column:nth-child(n+5) {
    display: none;
}

.app-album-list .album-cover-small {
    width: 56px;
    height: 56px;
    border-radius: 10px;
}

.app-album-list .score-column {
    text-align: right;
}

@media (max-height: 740px) {
    body.is-rating .song-save-star {
        font-size: 26px;
    }

    body.is-rating .song-save.is-saved .song-save-star {
        font-size: 30px;
    }
}

/* ---------- Taste profile (My Ratings) — additive ---------- */

.taste-profile {
    margin: 8px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.taste-profile-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.taste-profile-heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.04em;
    font-weight: 400;
    color: var(--text);
}

.taste-profile-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.taste-profile-stat {
    min-width: 0;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elevated);
    text-align: center;
}

.taste-profile-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 0.03em;
    color: var(--accent);
    line-height: 1.1;
}

.taste-profile-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taste-ratings-list,
.taste-genre-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.taste-rating-row {
    display: grid;
    grid-template-columns: 36px minmax(72px, 1fr) 40px minmax(0, 1.35fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elevated);
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.taste-rating-score {
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--accent);
    text-align: center;
}

.taste-rating-bar-track,
.taste-genre-bar-track {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #1c1c1c;
    overflow: hidden;
}

.taste-rating-bar-fill,
.taste-genre-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.taste-rating-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #151515;
}

.taste-rating-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.taste-rating-title,
.taste-rating-artist,
.taste-genre-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taste-rating-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.taste-rating-artist {
    font-size: 11px;
    color: var(--muted);
}

.taste-genre-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(48px, 1.4fr) 36px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elevated);
}

.taste-genre-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.taste-genre-score {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--accent);
    text-align: right;
}

.taste-profile-empty {
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elevated);
    text-align: center;
}

.taste-profile-empty-title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.04em;
    color: var(--text);
}

.taste-profile-empty-copy {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.taste-profile-muted {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}
