body.style-waveform {
    --artwork-border-radius: 20px;
}

/* Dynamic-tinted mapping: only when a dynamic theme is active.
   Under the other themes, each theme file's own variables flow through untouched. */
body.style-waveform.theme-dynamic,
body.style-waveform.theme-dynamic-advanced {
    --widget-bg: var(--dynamic-bg, #141b3d);
    --widget-border: var(--dynamic-primary, #ff4d9d);
    --widget-shadow: 0 0 24px var(--dynamic-glow, rgba(255, 77, 157, 0.35));
    --widget-gradient: linear-gradient(135deg, var(--dynamic-gradient-start, rgba(255, 77, 157, 0.28)) 0%, rgba(20, 27, 61, 0) 65%);

    --card-background: var(--dynamic-card, rgba(0, 0, 0, 0.35));

    --title-color: var(--dynamic-title, #ffffff);
    --artist-color: var(--dynamic-secondary, #b0b8d8);
    --time-color: var(--dynamic-time, #ffffff);

    --artwork-border: var(--dynamic-primary, #ff4d9d);

    --progress-bg: transparent;
    --progress-fill: var(--dynamic-primary, #ff4d9d);

    --glow-color: var(--dynamic-glow, rgba(255, 77, 157, 0.6));
}

/* Spec layout: 30px outer margins, square artwork, right column with two
   stacked cards, full-width pill progress pinned near the bottom edge. */
body.style-waveform .widget {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    padding: 30px;
    gap: 20px;
    align-items: flex-start;
}

body.style-waveform .widget::before,
body.style-waveform .widget::after {
    display: none;
}

body.style-waveform .widget-background {
    display: none;
}

/* Dynamic+: blurred album art lives inside the floating panels at 20%
   opacity instead of on the widget shell (shell stays background-free). */
body.style-waveform.theme-dynamic-advanced .widget-info-text,
body.style-waveform.theme-dynamic-advanced .wave-row {
    position: relative;
    overflow: hidden;
}

body.style-waveform.theme-dynamic-advanced .widget-info-text::before,
body.style-waveform.theme-dynamic-advanced .wave-row::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--dynamic-artwork-url, none);
    background-size: cover;
    background-position: center;
    filter: blur(24px) saturate(1.2);
    opacity: 0.2;
    pointer-events: none;
}

body.style-waveform.theme-dynamic-advanced .widget-info-text > *,
body.style-waveform.theme-dynamic-advanced .wave-row > * {
    position: relative;
    z-index: 1;
}

body.style-waveform .widget-artwork {
    width: 290px;
    height: auto;
    aspect-ratio: 1 / 1;
    align-self: flex-start;
    flex-shrink: 0;
}

body.style-waveform .widget-artwork img {
    border: none;
    border-radius: 20px;
    width: 100%;
    height: 100%;
}

body.style-waveform .widget:hover .widget-artwork img {
    transform: none;
}

body.style-waveform .widget-info {
    height: 290px;
    flex: 1;
    min-height: 0;
    padding-bottom: 0;
    justify-content: flex-start;
    gap: 10px;
    position: static;
}

body.style-waveform .widget-info-top {
    flex: 1.35;
    min-height: 0;
    gap: 0;
}

body.style-waveform .widget-status-area {
    display: none;
}

/* Upper card: track title + artist */
body.style-waveform .widget-info-text {
    background: var(--card-background, var(--progress-bg, rgba(0, 0, 0, 0.35)));
    border-radius: 20px;
    padding: 18px 44px;
    gap: 10px;
    height: 100%;
    justify-content: center;
}

body.style-waveform .widget-title {
    font-size: 54px;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: none;
}

body.style-waveform .widget-artist {
    font-size: 36px;
    line-height: 1.2;
}

body.style-waveform .play-status {
    display: none;
}

body.style-waveform .progress-time {
    display: none;
}

body.style-waveform .widget-progress {
    margin-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Lower card: elapsed time, waveform, total duration */
body.style-waveform .wave-row {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 24px;
    background: var(--card-background, var(--progress-bg, rgba(0, 0, 0, 0.35)));
    border-radius: 20px;
    padding: 16px 40px;
    margin-top: 0;
    margin-bottom: 0;
    min-height: 0;
    overflow: hidden;
}

body.style-waveform .wave-time {
    color: var(--time-color);
    font-size: 34px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 120px;
}

body.style-waveform .wave-time:last-child {
    text-align: right;
}

body.style-waveform .waveform {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--progress-fill, #ff4d9d);
    height: 72px;
    min-width: 0;
    filter: drop-shadow(0 0 4px var(--glow-color, rgba(255, 77, 157, 0.6)));
}

body.style-waveform .waveform span {
    flex: 1;
    min-width: 8px;
    height: 80%;
    border-radius: 5px;
    animation: waveBar 1.4s ease-in-out infinite alternate;
}

/* Tapered silhouette: short outer edges, tall dense middle */
body.style-waveform .waveform span:nth-child(-n+2),
body.style-waveform .waveform span:nth-child(n+23) {
    height: 50%;
}

body.style-waveform .waveform span:nth-child(3),
body.style-waveform .waveform span:nth-child(4),
body.style-waveform .waveform span:nth-child(21),
body.style-waveform .waveform span:nth-child(22) {
    height: 65%;
}

body.style-waveform .waveform span:nth-child(n+9):nth-child(-n+16) {
    height: 100%;
}

body.style-waveform .widget.is-paused .waveform span,
body.style-waveform .widget.is-idle .waveform span {
    animation-play-state: paused;
}

@keyframes waveBar {
    0% { transform: scaleY(0.6); }
    100% { transform: scaleY(1); }
}

/* Thin pill progress aligned with the content column: artwork's left edge
   to the cards' right edge */
body.style-waveform .progress-bar {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 0;
    width: auto;
    height: 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    margin-top: 0;
    overflow: hidden;
}

body.style-waveform .progress-fill {
    border-radius: 6px;
    box-shadow: 0 0 10px var(--glow-color, rgba(255, 77, 157, 0.7));
    transition: width 1s linear;
}
