:root {
    --bg: #0b0617;
    --bg-2: #150b2a;
    --panel: rgba(28, 17, 48, 0.78);
    --panel-strong: rgba(39, 25, 66, 0.96);
    --panel-soft: rgba(18, 12, 32, 0.92);
    --stroke: rgba(255, 255, 255, 0.11);
    --text: #fbf7ff;
    --muted: rgba(255, 255, 255, 0.68);
    --faint: rgba(255, 255, 255, 0.42);
    --orchid: #d57dff;
    --violet: #9c53ff;
    --glow: rgba(154, 79, 255, 0.72);
    --glow-soft: rgba(214, 128, 255, 0.3);
    --danger: #ff7da9;
    --safe-bottom: calc(20px + env(safe-area-inset-bottom));
    --safe-top: calc(18px + env(safe-area-inset-top));
    font-family: "SF Pro Rounded", "Avenir Next", "Trebuchet MS", sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top center, rgba(131, 52, 228, 0.36), transparent 36%),
        radial-gradient(circle at bottom center, rgba(147, 60, 255, 0.18), transparent 42%),
        linear-gradient(180deg, #090512 0%, #12091e 28%, #0a0614 100%);
    color: var(--text);
}

body {
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    max-width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    padding: var(--safe-top) 18px calc(178px + var(--safe-bottom));
}

.install-banner {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(30, 20, 52, 0.95), rgba(14, 10, 26, 0.94));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.install-banner__title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
}

.install-banner__text {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
    font-size: 0.88rem;
}

.install-banner__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.header-block {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.header-copy {
    flex: 1;
}

.header-kicker {
    margin: 0 0 8px;
    color: var(--orchid);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.header-title {
    margin: 0;
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    line-height: 0.96;
}

.header-subtitle {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.46;
    font-size: 0.96rem;
}

.header-orb {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.22), transparent 26%),
        linear-gradient(145deg, rgba(80, 31, 139, 0.96), rgba(24, 15, 43, 0.96));
    box-shadow: 0 14px 30px rgba(142, 69, 255, 0.24);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
}

.frost-panel,
.section-card,
.row-card,
.playlist-row,
.mini-player,
.queue-card,
.empty-card,
.picker-list {
    border: 1px solid var(--stroke);
    background: linear-gradient(160deg, rgba(34, 21, 58, 0.86), rgba(12, 9, 24, 0.94));
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 0 36px rgba(149, 73, 255, 0.08);
    border-radius: 30px;
}

.hero-panel {
    padding: 20px;
}

.hero-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(28px, 1fr) minmax(220px, 290px) minmax(28px, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 274px;
}

.hero-stage--overlay {
    min-height: 332px;
}

.hero-wave-lane {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
}

.cover-card {
    position: relative;
    min-height: 250px;
    border-radius: 42px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(circle at 62% 24%, rgba(201, 111, 255, 0.22), transparent 28%),
        radial-gradient(circle at 50% 56%, rgba(112, 42, 194, 0.42), transparent 48%),
        linear-gradient(155deg, #130a23 0%, #1a1031 46%, #0b0717 100%);
}

.cover-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 34px;
    background:
        radial-gradient(circle at center, rgba(195, 110, 255, 0.16), transparent 44%),
        linear-gradient(160deg, rgba(20, 12, 37, 0.94), rgba(11, 8, 21, 0.98));
}

.cover-card__art,
.cover-card__video {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.cover-card__video video {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    margin: 10px;
    object-fit: cover;
    border-radius: 32px;
}

.cover-glow {
    position: absolute;
    width: 64%;
    aspect-ratio: 1;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(221, 128, 255, 0.74), rgba(126, 47, 233, 0.16) 58%, transparent 72%);
    filter: blur(18px);
}

.cover-smoke {
    position: absolute;
    inset: 18% 10%;
    border-radius: 999px;
    border: 14px solid rgba(168, 80, 255, 0.18);
    filter: blur(10px);
    opacity: 0.84;
}

.cover-symbol {
    position: relative;
    z-index: 2;
    font-size: clamp(5.2rem, 10vw, 6.2rem);
    line-height: 1;
    text-shadow:
        0 0 18px rgba(230, 118, 255, 0.6),
        0 0 34px rgba(161, 70, 255, 0.54);
}

.cover-pill {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: 58px;
    height: 5px;
    border-radius: 999px;
    background: rgba(230, 201, 255, 0.72);
    z-index: 2;
}

.hero-copy {
    margin-top: 14px;
}

.hero-title {
    margin: 0;
    font-size: clamp(1.85rem, 5vw, 2.4rem);
    font-weight: 800;
    line-height: 1;
}

.hero-subtitle {
    margin: 10px 0 0;
    color: var(--orchid);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.78rem;
}

.meta-line {
    margin-top: 14px;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.26em;
    font-size: 0.72rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.action-row,
.transport-row,
.hero-actions,
.modal-actions,
.top-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-row,
.hero-actions {
    margin-top: 18px;
}

.pill-button,
.glass-button,
.transport-button,
.transport-button--primary {
    border: 1px solid rgba(216, 141, 255, 0.2);
    background: linear-gradient(145deg, rgba(143, 64, 255, 0.98), rgba(32, 18, 58, 0.96));
    color: #fff;
    min-height: 48px;
    border-radius: 22px;
    padding: 0 18px;
    font-weight: 700;
    box-shadow: 0 14px 26px rgba(140, 68, 255, 0.18);
}

.pill-button--ghost,
.glass-button--ghost,
.transport-button {
    background: linear-gradient(145deg, rgba(36, 24, 58, 0.96), rgba(18, 12, 31, 0.96));
}

.pill-button[disabled],
.transport-button[disabled] {
    opacity: 0.42;
}

.section-card {
    padding: 18px;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head__copy {
    flex: 1;
}

.section-head__title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
}

.section-head__detail {
    margin: 4px 0 0;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.row-card,
.playlist-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
}

.row-main,
.playlist-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-align: left;
}

.media-tile {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at 62% 34%, rgba(221, 126, 255, 0.34), transparent 26%),
        linear-gradient(160deg, rgba(79, 34, 139, 0.98), rgba(16, 12, 29, 0.98));
    display: grid;
    place-items: center;
}

.media-tile::after {
    content: "";
    position: absolute;
    inset: auto 10px 10px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(175, 94, 255, 0.1), rgba(255, 240, 255, 0.95), rgba(175, 94, 255, 0.1));
    opacity: 0.76;
}

.media-tile__symbol {
    font-size: 1.8rem;
    text-shadow: 0 0 16px rgba(221, 132, 255, 0.62);
}

.row-copy,
.playlist-copy,
.queue-copy {
    min-width: 0;
}

.row-title,
.playlist-title,
.queue-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-meta,
.playlist-meta,
.queue-meta {
    margin: 6px 0 0;
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.84rem;
}

.badge-mono {
    color: var(--orchid);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.action-menu {
    position: relative;
}

.action-menu summary {
    list-style: none;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(44, 29, 72, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 198px;
    padding: 8px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: rgba(14, 10, 26, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 12;
}

.menu-button {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    text-align: left;
    color: var(--text);
    background: rgba(49, 32, 82, 0.5);
}

.menu-button--danger {
    color: var(--danger);
}

.empty-card {
    padding: 22px;
    text-align: left;
}

.empty-card h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.empty-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.playlist-stat-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.stat-pill {
    flex: 1;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(25, 18, 44, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-pill__value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
}

.stat-pill__label {
    display: block;
    margin-top: 6px;
    color: var(--faint);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.mini-player-slot {
    position: fixed;
    left: 50%;
    bottom: calc(112px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100vw - 28px), 424px);
    z-index: 18;
}

.mini-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.mini-player__main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.mini-player__controls {
    display: flex;
    gap: 10px;
}

.circle-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(42, 27, 68, 0.98), rgba(19, 13, 33, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bottom-dock {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 428px);
    min-height: 96px;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    align-items: center;
    border-radius: 36px;
    border: 1px solid var(--stroke);
    background:
        linear-gradient(180deg, rgba(27, 18, 45, 0.98), rgba(13, 9, 23, 0.98));
    box-shadow:
        0 22px 44px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 0 44px rgba(144, 68, 255, 0.12);
    z-index: 20;
}

.dock-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--faint);
}

.dock-tab.is-active {
    color: var(--text);
}

.dock-icon {
    font-size: 1.35rem;
}

.dock-label {
    font-size: 0.86rem;
    font-weight: 700;
}

.dock-plus {
    justify-self: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    font-weight: 300;
    color: white;
    background:
        radial-gradient(circle at 50% 30%, rgba(250, 182, 255, 0.62), transparent 18%),
        linear-gradient(145deg, rgba(161, 78, 255, 1), rgba(72, 32, 145, 1));
    box-shadow:
        0 0 0 8px rgba(121, 56, 208, 0.14),
        0 0 40px rgba(183, 93, 255, 0.36),
        0 18px 28px rgba(0, 0, 0, 0.38);
}

.sheet-backdrop,
.modal-backdrop,
.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(3, 2, 8, 0.56);
    backdrop-filter: blur(10px);
}

.sheet-backdrop {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
}

.sheet-card,
.modal-card {
    width: min(100%, 440px);
    border: 1px solid var(--stroke);
    border-radius: 30px;
    background: linear-gradient(165deg, rgba(29, 19, 47, 0.98), rgba(11, 8, 22, 0.98));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.46);
}

.sheet-card {
    padding: 18px;
}

.sheet-handle {
    width: 56px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
}

.sheet-kicker {
    margin: 0 0 8px;
    color: var(--orchid);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.sheet-card h2,
.modal-card h2,
.overlay-content h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1;
}

.sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.sheet-button {
    min-height: 54px;
    padding: 0 16px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(145, 68, 255, 0.98), rgba(33, 20, 58, 0.96));
    color: white;
    font-weight: 700;
}

.sheet-button--ghost {
    background: rgba(41, 28, 69, 0.9);
}

.modal-backdrop {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    padding: 20px;
}

.modal-card--large {
    max-height: min(82vh, 760px);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.text-field {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 12, 31, 0.92);
    color: white;
}

.picker-list {
    padding: 10px;
    max-height: min(48vh, 420px);
    overflow: auto;
}

.picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 18px;
}

.picker-row + .picker-row {
    margin-top: 6px;
}

.picker-row input {
    width: 18px;
    height: 18px;
}

.player-overlay {
    overflow: auto;
}

.overlay-content {
    max-width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    padding: var(--safe-top) 18px calc(34px + var(--safe-bottom));
    background:
        radial-gradient(circle at top center, rgba(140, 61, 255, 0.18), transparent 24%),
        linear-gradient(180deg, #090512 0%, #11091c 34%, #090512 100%);
}

.overlay-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.overlay-top__copy {
    flex: 1;
}

.overlay-top__eyebrow {
    margin: 0 0 6px;
    color: var(--orchid);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.overlay-top__hint {
    margin: 0;
    color: var(--faint);
    font-size: 0.82rem;
}

.overlay-title {
    margin: 18px 0 0;
    font-size: clamp(2.1rem, 6vw, 3rem);
    font-weight: 800;
}

.overlay-subtitle {
    margin: 10px 0 0;
    color: var(--orchid);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.overlay-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.progress-panel {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seek-range {
    width: 100%;
    accent-color: var(--orchid);
}

.time-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.82rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.transport-row {
    justify-content: space-between;
    margin-top: 20px;
}

.transport-center {
    display: flex;
    gap: 16px;
    align-items: center;
}

.transport-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: grid;
    place-items: center;
}

.transport-button--primary {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.5rem;
    display: grid;
    place-items: center;
    box-shadow:
        0 0 0 8px rgba(115, 54, 201, 0.12),
        0 0 36px rgba(175, 90, 255, 0.24),
        0 20px 30px rgba(0, 0, 0, 0.38);
}

.queue-card {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
}

.queue-spacer {
    flex: 1;
}

.row-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(42, 28, 70, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wave-cluster {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 54px;
}

.wave-cluster--compact {
    gap: 2px;
    height: 16px;
}

.wave-bar {
    width: 4px;
    border-radius: 999px;
    background: rgba(213, 125, 255, 0.16);
    transform-origin: center;
    transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease;
}

.wave-cluster--compact .wave-bar {
    width: 3px;
}

.wave-cluster[data-accent="violet"] .wave-bar {
    background: rgba(156, 83, 255, 0.18);
}

.wave-bar.is-live {
    background: rgba(255, 246, 255, 0.98);
    box-shadow: 0 0 12px rgba(225, 125, 255, 0.5);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(132px + var(--safe-bottom));
    transform: translateX(-50%);
    min-width: 220px;
    max-width: calc(100vw - 40px);
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid var(--stroke);
    background: rgba(16, 11, 28, 0.96);
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 60;
}

.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

.media-parking,
.media-engine.engine-hidden {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.media-engine {
    display: block;
}

.muted {
    color: var(--muted);
}

@media (max-width: 380px) {
    .app-shell,
    .overlay-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bottom-dock {
        width: calc(100vw - 18px);
        grid-template-columns: 1fr 88px 1fr;
        padding: 14px 18px;
    }
}
