@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

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

:root {
    --bg: #181828;
    --gradient: #4B4B7D;
    --white: #fff;
}

body {
    min-height: 100vh;

    background: var(--bg);

    background-attachment: fixed;

    color: var(--white);
    font-family: 'Poppins', sans-serif;

    display: flex;
    justify-content: center;
    align-items: center;

    padding-bottom: 90px;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: 100%;
    height: 64px;
    padding: 0 18px;
    background: var(--bg);
}

.app-header-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
}

.app-logo {
    display: block;
    width: 142px;
    height: 42px;
    object-fit: contain;
    object-position: left center;
}

.header-menu {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    text-decoration: none;
    opacity: 0.75;
    font-size: 18px;
    transition: opacity 0.2s ease;
}

.header-menu span {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.header-menu:hover {
    opacity: 1;
}

.header-menu:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 4px;
}

body.stations-view-active {
    align-items: flex-start;
    padding-top: 84px;
}

body.menu-view-active {
    align-items: flex-start;
    padding-top: 84px;
}

body.player-view-active.station-background-enabled {
    background: linear-gradient(180deg, var(--station-color, var(--gradient)) 0%, var(--bg) 80%);
}

body.stations-view-active .station-card {
    margin-top: 0;
}

/* =========================
   PLAYER
========================= */

.player {
    --player-horizontal-padding: 25px;
    width: 100%;
    max-width: 420px;
    padding: 30px var(--player-horizontal-padding);
    text-align: center;
}

/* =========================
   COVER
========================= */

.cover {
    position: relative;
    width: 240px;
    height: 240px;

    border: 4px solid var(--station-color);

    background: rgba(255, 255, 255, 0.04);

    padding: 4px;

    margin: 0 auto 30px;

    border-radius: 24px;
    overflow: hidden;

    filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.35));
}

.cover img {
    width: 100%;
    height: 100%;

    border-radius: 16px;

    object-fit: cover;
    display: block;
}

.control-btn[aria-pressed="true"] {
    color: var(--station-color);
}

.control-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* =========================
   SONG INFO
========================= */

.song-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    height: 2.4em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;

    letter-spacing: 1px;

    text-transform: uppercase;

    margin-bottom: 8px;
}

.artist {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    height: 3em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;

    opacity: 0.7;

    margin-bottom: 32px;
}

/* =========================
   PLAYER CONTROLS
========================= */

.controls {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 28px;
}

.control-btn {
    width: 52px;
    height: 52px;

    border: 0;
    outline: none;

    background: transparent;
    color: var(--white);

    cursor: pointer;

    font-size: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        opacity 0.2s ease;
}

.control-btn:hover {
    opacity: 0.8;
}

/* =========================
   PLAY BUTTON
========================= */

.play-btn {
    width: 68px;
    height: 68px;

    border-radius: 50%;

    background: var(--white);
    color: var(--bg);

    font-size: 22px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.35);
}

.play-btn:hover {
    opacity: 0.7;
}

.play-btn.is-loading {
    position: relative;
    cursor: progress;
}

.play-btn.is-loading i {
    position: absolute;
    inset: 0;
    width: 1em;
    height: 1em;
    margin: auto;
    display: grid;
    place-items: center;
    line-height: 1;
    animation: connect-spin 0.8s linear infinite;
}

@keyframes connect-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   ACTION BAR
========================= */

.action-bar {
    position: fixed;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 76px;

    background: #181828;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 100;
}

.action-bar-inner {
    width: 100%;
    height: 100%;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;

    color: var(--white);
    text-decoration: none;

    opacity: 0.55;

    transition: opacity 0.2s ease;
}

.action-item:hover,
.action-item.active {
    opacity: 0.9;
}

.action-item:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: -4px;
}

.action-item i {
    font-size: 18px;
}

.action-item span {
    font-family: 'Poppins', sans-serif;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.5px;

    text-transform: uppercase;
}

/* =========================
   STATION LIST
========================= */

.station-name {
    margin: -22px 0 8px;
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.station-card {
    margin-top: 34px;
}

.menu-card {
    width: 100%;
    min-height: calc(100vh - 254px);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.menu-card[hidden] {
    display: none;
}

.menu-settings h2 {
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 700;
}

.menu-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.menu-setting-copy {
    min-width: 0;
}

.menu-setting-copy label {
    display: block;
    font-weight: 700;
}

.menu-setting-copy p {
    margin-top: 3px;
    font-size: 11px;
    opacity: 0.7;
}

.menu-toggle {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.18s ease;
    cursor: pointer;
}

.menu-toggle::before {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    content: '';
    transition: transform 0.18s ease;
}

.menu-toggle:checked {
    accent-color: var(--station-color, var(--gradient));
    background: var(--station-color, var(--gradient));
}

.menu-toggle:checked::before {
    transform: translateX(18px);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 4px;
}

.menu-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.menu-footer {
    display: grid;
    gap: 14px;
    padding-top: 24px;
    font-size: 12px;
    line-height: 1.6;
}

.menu-footer a {
    color: var(--white);
    text-decoration-color: rgba(255, 255, 255, 0.45);
    text-underline-offset: 3px;
}

.menu-project-logo {
    display: block;
    width: 170px;
    height: 48px;
    margin-top: 8px;
    object-fit: contain;
    object-position: left center;
}

.menu-legal-links {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
}

.station-card-heading {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.station-favorite-button:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.station-card-heading h2 {
    font-size: 15px;
    font-weight: 700;
}

.station-list {
    display: grid;
    gap: 8px;
    margin-inline: calc(-1 * var(--player-horizontal-padding));
    padding-inline: 8px;
}

.station-option {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    text-align: left;
}

.station-option.is-active,
.station-option:hover {
    border-color: var(--station-color, rgba(255, 255, 255, 0.45));
    background: rgba(255, 255, 255, 0.09);
}

.station-select {
    min-width: 0;
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.station-select:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.station-cover {
    position: relative;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 8px;
    display: block;
}

.station-cover img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.station-cover i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.station-option:hover .station-cover i,
.station-select:focus-visible .station-cover i,
.station-option.is-active .station-cover i {
    opacity: 1;
}

.station-option:hover .station-cover img,
.station-select:focus-visible .station-cover img {
    filter: brightness(0.55);
}

.station-option-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.station-option-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-option-name {
    font-size: 13px;
    font-weight: 700;
}

.station-option-track {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.65;
}

.station-track-content {
    display: inline-flex;
    width: max-content;
    white-space: nowrap;
}

.station-track-copy {
    display: block;
    padding-right: 32px;
    white-space: nowrap;
}

.station-option-track.is-overflowing .station-track-content {
    animation: station-track-scroll var(--ticker-duration, 12s) linear infinite;
}

.station-option:hover .station-option-track.is-overflowing .station-track-content {
    animation-play-state: paused;
}

@keyframes station-track-scroll {
    to {
        transform: translateX(-50%);
    }
}

.station-favorite-button {
    justify-self: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    font-size: 17px;
    opacity: 0.7;
}

.station-favorite-button:hover,
.station-favorite-button[aria-pressed="true"] {
    color: #ff7188;
    opacity: 1;
}

.station-empty {
    padding: 14px 4px;
    font-size: 13px;
    opacity: 0.65;
    text-align: center;
}

@media (hover: none) {
    .station-cover i {
        opacity: 0.8;
    }

    .station-cover img {
        filter: brightness(0.7);
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 480px) {

    .player {
        --player-horizontal-padding: 20px;
        padding: 25px var(--player-horizontal-padding);
    }

    .cover {
        width: 220px;
        height: 220px;
    }

    .song-title {
        font-size: 20px;
    }

    .controls {
        gap: 20px;
    }
}