:root {
    color-scheme: dark;
    --embed-bg: #0a0a0a;
    --embed-surface: rgba(12, 12, 12, 0.94);
    --embed-panel: rgba(18, 18, 18, 0.92);
    --embed-border: rgba(255, 255, 255, 0.08);
    --embed-border-strong: rgba(255, 255, 255, 0.16);
    --embed-text: #f5f5f5;
    --embed-text-soft: rgba(245, 245, 245, 0.62);
    --embed-accent: #b21f24;
    --embed-accent-strong: #dc2626;
    --embed-accent-glow: rgba(178, 31, 36, 0.35);
    --embed-shadow: 0 18px 36px rgba(0, 0, 0, 0.5);
    --embed-radius-xl: 20px;
    --embed-radius-lg: 14px;
    --embed-radius-md: 10px;
    --embed-radius-sm: 999px;
    --embed-font-display: "Fraunces", Georgia, serif;
    --embed-font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--embed-font-body);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(178, 31, 36, 0.14), transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(178, 31, 36, 0.08), transparent 40%),
        linear-gradient(168deg, #0a0a0a 0%, #111 50%, #0d0d0d 100%);
    color: var(--embed-text);
}

.podcast-embed-page {
    width: 100%;
    height: 100%;
}

.podcast-embed-root {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 4px;
}

/* ── Main container ───────────────────────────────────────── */

.podcast-embed-player {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 10px;
    overflow: hidden;
    border: 1px solid var(--embed-border);
    border-radius: var(--embed-radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
        var(--embed-surface);
    box-shadow: var(--embed-shadow);
    isolation: isolate;
}

.podcast-embed-player::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(178, 31, 36, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(220, 38, 38, 0.06), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Subtle top-edge highlight */
.podcast-embed-player::after {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(178, 31, 36, 0.4), transparent);
    pointer-events: none;
    z-index: 1;
}

.podcast-embed-player.is-loading .podcast-embed-play-button {
    cursor: wait;
    opacity: 0.7;
}

/* ── Topline & Controls shared flex row ───────────────────── */

.podcast-embed-player__topline,
.podcast-embed-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── Shared pill/chip base ────────────────────────────────── */

.podcast-embed-badge,
.podcast-embed-chip,
.podcast-embed-share-button,
.podcast-embed-speed-button,
.podcast-embed-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--embed-radius-sm);
    border: 1px solid var(--embed-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--embed-text);
    font: inherit;
    text-decoration: none;
}

.podcast-embed-badge,
.podcast-embed-chip {
    padding: 4px 9px;
    color: var(--embed-text-soft);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.podcast-embed-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--embed-accent), var(--embed-accent-strong));
    box-shadow: 0 0 0 4px var(--embed-accent-glow);
}

/* ── Interactive pills ────────────────────────────────────── */

.podcast-embed-share-button,
.podcast-embed-speed-button,
.podcast-embed-icon-button {
    min-height: 30px;
    padding: 0 10px;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.podcast-embed-icon-button {
    min-width: 34px;
    padding: 0 9px;
}

.podcast-embed-icon-button--plain {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    background: transparent;
    border-color: transparent;
}

.podcast-embed-share-button:hover,
.podcast-embed-speed-button:hover,
.podcast-embed-icon-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--embed-border-strong);
}

.podcast-embed-share-button {
    color: var(--embed-text-soft);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ── Hero: art + copy ─────────────────────────────────────── */

.podcast-embed-player__hero {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.podcast-embed-art {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(178, 31, 36, 0.15);
    background: linear-gradient(145deg, rgba(178, 31, 36, 0.25), rgba(60, 10, 12, 0.4));
}

.podcast-embed-art a,
.podcast-embed-art img {
    display: block;
    width: 100%;
    height: 100%;
}

.podcast-embed-art img {
    object-fit: cover;
}

.podcast-embed-art__fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-family: var(--embed-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.92);
}

/* ── Copy block ───────────────────────────────────────────── */

.podcast-embed-copy {
    min-width: 0;
}

.podcast-embed-copy__eyebrow {
    margin: 0 0 4px;
    color: var(--embed-accent-strong);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.podcast-embed-copy__title {
    margin: 0;
    font-family: var(--embed-font-display);
    font-size: clamp(0.96rem, 3.3vw, 1.14rem);
    line-height: 0.92;
    letter-spacing: -0.035em;
}

.podcast-embed-copy__title-viewport {
    display: block;
    overflow: hidden;
}

.podcast-embed-copy__title-track {
    display: inline-flex;
    align-items: baseline;
    min-width: 100%;
    white-space: nowrap;
}

.podcast-embed-copy__title.is-marquee .podcast-embed-copy__title-track {
    gap: 24px;
    width: max-content;
    animation: embedTitleMarquee var(--title-scroll-duration, 16s) linear 5s infinite;
}

.podcast-embed-copy__title-segment {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podcast-embed-copy__title a {
    color: inherit;
    text-decoration: none;
}

.podcast-embed-copy__title a:hover {
    color: var(--embed-accent-strong);
}

.podcast-embed-copy__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

/* ── Progress panel ───────────────────────────────────────── */

.podcast-embed-player__panel {
    padding: 8px 9px 7px;
    border: 1px solid var(--embed-border);
    border-radius: var(--embed-radius-lg);
    background: var(--embed-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.podcast-embed-progress {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.podcast-embed-progress__slider,
.podcast-embed-volume input[type="range"] {
    width: 100%;
    height: 4px;
    margin: 0;
    appearance: none;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--embed-accent) 0%,
        var(--embed-accent-strong) var(--progress, 0%),
        rgba(255, 255, 255, 0.1) var(--progress, 0%),
        rgba(255, 255, 255, 0.1) 100%
    );
    outline: none;
}

.podcast-embed-progress__slider::-webkit-slider-thumb,
.podcast-embed-volume input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 3px var(--embed-accent-glow);
}

.podcast-embed-progress__slider::-moz-range-thumb,
.podcast-embed-volume input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 3px var(--embed-accent-glow);
}

.podcast-embed-progress__time {
    color: var(--embed-text-soft);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── Controls row ─────────────────────────────────────────── */

.podcast-embed-controls {
    gap: 8px;
}

.podcast-embed-controls__cluster,
.podcast-embed-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Seek buttons (rewind/forward icons) ──────────────────── */

.podcast-embed-icon-button svg {
    display: block;
}

/* ── Play button ──────────────────────────────────────────── */

.podcast-embed-play-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--embed-accent-strong), var(--embed-accent));
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 8px 20px var(--embed-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.podcast-embed-play-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 26px rgba(178, 31, 36, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.podcast-embed-play-button__ring {
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(178, 31, 36, 0.3);
    border-radius: 999px;
    opacity: 0;
}

.podcast-embed-player.is-playing .podcast-embed-play-button__ring {
    opacity: 1;
    animation: embedRing 2s ease-out infinite;
}

.podcast-embed-play-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

/* ── Volume ───────────────────────────────────────────────── */

.podcast-embed-volume {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 96px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--embed-border);
    border-radius: var(--embed-radius-sm);
    background: rgba(255, 255, 255, 0.04);
}

.podcast-embed-volume input[type="range"] {
    --progress: 100%;
}

/* ── Speed menu ───────────────────────────────────────────── */

.podcast-embed-speed {
    position: relative;
}

.podcast-embed-speed__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    gap: 4px;
    min-width: 92px;
    padding: 6px;
    border: 1px solid var(--embed-border-strong);
    border-radius: 14px;
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
}

.podcast-embed-speed__option {
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--embed-text-soft);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.podcast-embed-speed__option.is-active,
.podcast-embed-speed__option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--embed-text);
}

/* ── Share sheet ───────────────────────────────────────────── */

.podcast-embed-share-sheet {
    position: absolute;
    inset: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--embed-border-strong);
    border-radius: 16px;
    background: rgba(8, 8, 8, 0.97);
    box-shadow: 0 24px 34px rgba(0, 0, 0, 0.5);
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
}

.podcast-embed-player.is-share-open .podcast-embed-share-sheet {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.podcast-embed-share-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.podcast-embed-share-sheet__title {
    margin: 0;
    font-family: var(--embed-font-display);
    font-size: 1rem;
    letter-spacing: -0.03em;
}

.podcast-embed-share-sheet__text {
    margin: 4px 0 0;
    color: var(--embed-text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.podcast-embed-share-sheet__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.podcast-embed-share-sheet__actions button,
.podcast-embed-share-sheet__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--embed-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--embed-text);
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.podcast-embed-share-sheet__actions button:hover,
.podcast-embed-share-sheet__actions a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--embed-border-strong);
}

/* ── Utilities ────────────────────────────────────────────── */

.podcast-embed-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;
}

/* ── Keyframes ────────────────────────────────────────────── */

@keyframes embedRing {
    0% { transform: scale(0.92); opacity: 0.55; }
    100% { transform: scale(1.14); opacity: 0; }
}

@keyframes embedTitleMarquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(var(--title-scroll-distance, 0px) * -1));
    }
}

/* ── Small viewport ───────────────────────────────────────── */

@media (max-width: 340px) {
    .podcast-embed-player {
        gap: 6px;
        padding: 8px;
    }

    .podcast-embed-player__hero {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 10px;
    }

    .podcast-embed-art {
        width: 54px;
        height: 54px;
    }

    .podcast-embed-controls,
    .podcast-embed-footer {
        flex-wrap: wrap;
    }

    .podcast-embed-volume {
        width: 84px;
    }
}

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .podcast-embed-player *,
    .podcast-embed-player::before {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}
