/* ============================================================
   vibing.ustoopia.nl — base theme
   Colours sampled from the reference design: deep purple ground,
   orange accent, white text. Tokens first, components after.
   ============================================================ */

:root {
    --bg:            #1a0832;
    --bg-deep:       #15062a;
    --surface:       #23093c;
    --surface-2:     #2d0b47;
    --line:          rgba(255, 255, 255, .08);
    --line-strong:   rgba(255, 255, 255, .16);

    --text:          #f6f1fb;
    --text-muted:    #b6a2c9;
    --text-dim:      #a48fb8;   /* 6.4:1 on the page background, 6.1:1 on panels */

    --accent:        #d95a00;
    --accent-bright: #ff7a1a;
    --accent-soft:   rgba(217, 90, 0, .16);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;

    --shadow: 0 10px 30px rgba(0, 0, 0, .35);

    --pad: 20px;
    --maxw: 1500px;
    --sb-w: 252px;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-bright); }

:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
    position: absolute; left: -9999px; top: 0;
    background: var(--accent); color: #fff;
    padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg-deep) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px var(--pad);
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.brand__mark {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: linear-gradient(140deg, var(--accent-bright), var(--accent));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset;
    position: relative;
}
.brand__mark::after {
    content: "";
    position: absolute; inset: 0;
    margin: auto;
    width: 0; height: 0;
    border-left: 7px solid #fff;
    border-top: 4.5px solid transparent;
    border-bottom: 4.5px solid transparent;
    transform: translateX(1px);
}

.search {
    flex: 1;
    max-width: 620px;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 6px 0 16px;
    transition: border-color .15s ease, background .15s ease;
}
.search:focus-within {
    border-color: var(--line-strong);
    background: var(--surface-2);
}
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    padding: 11px 0;
    outline: none;
}
.search input::placeholder { color: var(--text-dim); }
.search button {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 0; border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.search button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.topnav { display: flex; gap: 18px; }
.topnav a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- layout ---------- */

.main {
    flex: 1;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 28px var(--pad) 48px;
}

.section + .section { margin-top: 40px; }

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.section__head h2 {
    margin: 0;
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 650;
    letter-spacing: -.01em;
}

/* ---------- card grid ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 22px 18px;
}

.card { display: block; }
.card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card__thumb { border-color: var(--line-strong); }

.card__time {
    position: absolute;
    right: 8px; bottom: 8px;
    background: rgba(10, 4, 20, .82);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 6px;
    letter-spacing: .01em;
}

.card__title {
    margin: 10px 0 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card__meta {
    margin: 0;
    color: var(--text-dim);
    font-size: 13px;
}

/* ---------- chips ---------- */

.chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text-muted);
}
.chip:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.chip__count {
    background: var(--accent-soft);
    color: var(--accent-bright);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- prose / empty ---------- */

.prose {
    max-width: 780px;
    margin: 8px auto 0;
}
.prose h1 {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -.02em;
    margin: 0 0 18px;
}
.prose__body { color: var(--text-muted); font-size: 16.5px; line-height: 1.7; }
.prose__body a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }

/* Markdown output (help, privacy, terms). */
.prose__body h2 {
    margin: 34px 0 10px;
    font-size: clamp(19px, 2vw, 23px);
    color: var(--text);
    letter-spacing: -.01em;
}
.prose__body h3 {
    margin: 26px 0 8px;
    font-size: 16.5px;
    color: var(--text);
    letter-spacing: -.005em;
}
.prose__body h2:first-child, .prose__body h3:first-child { margin-top: 0; }
.prose__body p { margin: 0 0 14px; }
.prose__body strong { color: var(--text); font-weight: 650; }
.prose__body ul, .prose__body ol { margin: 0 0 16px; padding-left: 22px; }
.prose__body li { margin-bottom: 7px; }
.prose__body li::marker { color: var(--text-dim); }
.prose__body code {
    background: rgba(255, 255, 255, .09);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: .92em;
}
.prose__body hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.prose__body blockquote {
    margin: 0 0 16px;
    padding: 2px 0 2px 16px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

.md-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}
.md-table th, .md-table td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.md-table th {
    color: var(--text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255, 255, 255, .04);
}
.md-table tr:last-child td { border-bottom: 0; }

.empty {
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--surface), var(--bg));
    padding: 54px 24px;
}
.empty h1 { margin: 0 0 10px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.empty p { margin: 0 auto; color: var(--text-muted); max-width: 52ch; }
.empty code {
    background: rgba(255, 255, 255, .07);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .92em;
}

.button {
    display: inline-block;
    margin-top: 18px;
    background: #c04d00; /* white text needs 4.5:1; #d95a00 only gives 3.9:1 */
    color: #fff;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 999px;
}
.button:hover { background: #d95a00; color: #fff; }

/* ---------- footer ---------- */

.footer {
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
    margin-top: auto;
}
.footer__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 22px var(--pad);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer nav a { color: var(--text-dim); font-size: 14px; }
.footer nav a:hover { color: var(--text); }
.footer__note { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------- responsive ---------- */

@media (max-width: 780px) {
    :root { --pad: 14px; }
    .topbar__inner { flex-wrap: wrap; gap: 10px; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .topnav { margin-left: auto; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
    .card__title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Phase 4 — shell with sidebar, hero, watch page, votes, cookie bar
   ============================================================ */

.shell {
    min-height: 100vh;
}

.shell__col {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left .22s ease;
}

/* A pinned menu docks beside the content instead of floating over it. */
body.sb-pinned .shell__col { margin-left: var(--sb-w); }

/* ---------- sidebar ---------- */

/* The menu is a drawer now: hidden until the hamburger is clicked, gone again as soon as
   the pointer leaves it (unless the pin is set). Closing on mouseleave is what makes it
   feel like a menu rather than a panel that competes with the videos. */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sb-w);
    z-index: 60;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 12px 26px;
    background: var(--bg-deep);
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 44px rgba(6, 2, 12, .5);
    will-change: transform;
}

body.sb-open .sidebar,
body.sb-pinned .sidebar { transform: none; }

.sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 2px 16px 10px;
}
.sidebar .brand { padding: 0; }

.sidebar__pin {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sidebar__pin:hover { background: var(--surface); color: var(--text); }
.sidebar__pin[aria-pressed="true"] { background: var(--surface-2); color: var(--accent-bright); }

/* The backdrop only exists while the drawer is open and unpinned. */
.sb-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(6, 2, 12, .55);
    opacity: 0;
    transition: opacity .2s ease;
}
.sb-scrim[hidden] { display: none; }
body.sb-open .sb-scrim { opacity: 1; }

.hamburger {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.hamburger:hover { background: var(--surface-2); color: var(--text); border-color: #4b2a63; }
body.sb-open .hamburger { color: var(--text); border-color: var(--accent); }

.sidenav { display: flex; flex-direction: column; gap: 2px; }

.sidenav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14.5px;
}
.sidenav__item:hover { background: var(--surface); color: var(--text); }
.sidenav__item.is-active {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
}

.sidenav__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .8;
    flex: 0 0 auto;
}
.sidenav__count {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, .06);
    padding: 1px 7px;
    border-radius: 999px;
}
.sidenav__label {
    margin: 20px 10px 6px;
    font-size: 11.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.sidenav--muted .sidenav__item { font-size: 13.5px; padding: 7px 10px; }

/* ---------- top bar inside the column ---------- */

.topbar { display: flex; align-items: center; gap: 16px; padding: 12px var(--pad); }
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }

.topnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }

.topnav a.topnav__chip {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom-width: 1px;
}
.topnav a.topnav__chip:hover { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.topnav a.topnav__chip.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent-bright); }

/* ---------- hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(120deg, var(--surface), var(--bg));
    margin-bottom: 36px;
    min-height: 250px;
}
.hero__media { display: block; overflow: hidden; }
.hero__img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.hero__body { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 26px 30px; }
.hero__tag {
    align-self: flex-start;
    background: var(--accent-soft);
    color: var(--accent-bright);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 6px;
}
.hero__title {
    font-size: clamp(20px, 2.3vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
}
.hero__meta { color: var(--text-dim); font-size: 13.5px; }
.hero:hover .hero__title { color: var(--accent-bright); }

/* ---------- card extras ---------- */

.card__src {
    position: absolute;
    left: 8px; top: 8px;
    background: rgba(10, 4, 20, .78);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 5px;
    letter-spacing: .02em;
}

.card--compact { display: grid; grid-template-columns: 142px minmax(0, 1fr); gap: 10px; align-items: start; }
.card--compact .card__thumb { border-radius: 10px; }
.card--compact .card__title { margin: 0 0 3px; font-size: 13.5px; }
.card--compact .card__meta { font-size: 12px; }
.card--compact .card__time { font-size: 11px; padding: 2px 5px; }

/* ---------- watch page ---------- */

.watch { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 26px; align-items: start; }
.watch__main { min-width: 0; }

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.player iframe, .player__video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); }

.watch__title { font-size: clamp(19px, 2.1vw, 25px); margin: 16px 0 10px; letter-spacing: -.015em; }
.watch__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.watch__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13.5px; }
.watch__cat { color: var(--accent-bright); font-weight: 600; }

.votes { display: flex; align-items: center; gap: 8px; }
.vote {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 7px 13px;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}
.vote:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.vote.is-mine { background: var(--accent-soft); border-color: transparent; color: var(--accent-bright); }
.vote:disabled { cursor: default; opacity: .8; }
.votes__note { color: var(--text-dim); font-size: 12.5px; }

.watch__desc {
    margin-top: 16px;
    color: var(--text-muted);
    line-height: 1.65;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-wrap: anywhere;
}
.watch__desc a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }

.watch__preview { margin-top: 18px; }
.watch__preview img { max-width: 320px; border-radius: var(--radius); border: 1px solid var(--line); }
.watch__sidehead { font-size: 15px; margin: 0 0 12px; letter-spacing: -.01em; }
.watch__list { display: flex; flex-direction: column; gap: 12px; }

/* ---------- misc ---------- */

.page-heading { margin: 0; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -.02em; }
.section__more { font-size: 13px; color: var(--text-dim); }
.section__more:hover { color: var(--accent-bright); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 32px; }
.pager .button { margin-top: 0; }

.cookiebar {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 880px;
    margin: 0 auto;
    padding: 14px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: translateY(140%);
    transition: transform .25s ease;
}
.cookiebar.is-visible { transform: translateY(0); }
/* Reserve room so the fixed bar never sits on top of the last lines of a long page. */
body:has(.cookiebar) { padding-bottom: 120px; }
.cookiebar p { margin: 0; font-size: 13.5px; color: var(--text-muted); max-width: 60ch; }
.cookiebar a { color: var(--accent-bright); text-decoration: underline; }
.button--small { margin-top: 0; padding: 8px 16px; font-size: 13.5px; }

@media (max-width: 1100px) {
    .watch { grid-template-columns: 1fr; }
    .watch__side { border-top: 1px solid var(--line); padding-top: 18px; }
}

@media (max-width: 900px) {
    body.sb-pinned .shell__col { margin-left: 0; }
    .sidebar { width: min(86vw, 300px); }
    .topbar { flex-wrap: wrap; row-gap: 10px; }
    .topnav { order: 3; flex-basis: 100%; }
    .hero { grid-template-columns: 1fr; }
    .hero__body { padding: 18px 20px 22px; }
    /* Three readable columns on a tablet instead of four cramped ones. */
    .grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px 14px; }
}

@media (max-width: 560px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .card__title { font-size: 13.5px; }
    .cookiebar { gap: 10px; padding: 12px 14px; }
    .cookiebar p { font-size: 12.5px; }
}

/* ============================================================
   Phase 5 — custom player, autoplay switch, /player page
   ============================================================ */

.player { outline: none; }
.player:fullscreen { border-radius: 0; border: 0; }

.player__yt { position: absolute; inset: 0; }
.player__yt iframe { width: 100%; height: 100%; border: 0; }
.player__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }

.player__ui {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 40px 12px 10px;
    background: linear-gradient(to top,
        rgba(6, 2, 12, .94) 0%,
        rgba(6, 2, 12, .62) 55%,
        rgba(6, 2, 12, 0) 100%);
}

.player__big {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 76px; height: 76px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(10, 4, 20, .5);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s ease, transform .15s ease;
}
.player__big:hover { background: #c04d00; border-color: transparent; transform: scale(1.04); }

.player__controls { display: flex; align-items: center; gap: 8px; }

.player__btn {
    display: grid; place-items: center;
    min-width: 34px; height: 34px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #fff;
    opacity: .88;
    cursor: pointer;
}
.player__btn:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.player__btn--text { font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 9px; }

.player__time {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .92);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 2px;
}
.player__sep { margin: 0 3px; opacity: .55; }

.player__progress {
    position: relative;
    flex: 1 1 auto;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}
.player__progress::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .26);
}
.player__fill {
    position: absolute;
    left: 0;
    width: 0;
    height: 4px;
    border-radius: 2px;
    background: #ff7a1a;
}
.player__knob {
    position: absolute;
    left: 0;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .12s ease;
    pointer-events: none;
}
.player__progress:hover .player__knob,
.player__progress:focus-visible .player__knob { opacity: 1; }

.player__qual { position: relative; }
.player__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 132px;
    padding: 6px;
    background: #2d0b47;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 6;
}
.player__item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.player__item:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.player__item.is-active { color: var(--accent-bright); font-weight: 600; }

.player__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); background: #000; }

/* ---------- autoplay switch ---------- */

.watch__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch__track {
    position: relative;
    width: 38px; height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    transition: background .15s ease;
}
.switch__dot {
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: #c04d00; }
.switch input:checked + .switch__track .switch__dot { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.switch__label { font-size: 13px; color: var(--text-muted); }

/* ---------- /player page ---------- */

.playerpage { max-width: 1080px; }
.playerpage__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.playerpage__filter select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-size: 13.5px;
}
.playerpage__info { margin-top: 16px; }
.playerpage__title { margin: 0 0 4px; font-size: clamp(18px, 2vw, 24px); letter-spacing: -.015em; }
.playerpage__hint { margin-top: 14px; max-width: 62ch; }

.playerpage__nav { display: flex; gap: 10px; margin-top: 14px; }
.playerpage__nav .button { margin-top: 0; }

/* Ghost button, used by the pager and the /player navigation. */
.button--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.button--ghost:hover { background: var(--surface-2); color: var(--text); }
.button:disabled { opacity: .45; cursor: not-allowed; }

/* ============================================================
   Phase 6 — contact form
   ============================================================ */

.prose--wide { max-width: 720px; }
.prose__body--intro { margin-bottom: 22px; }

.form { display: grid; gap: 16px; margin-top: 8px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: grid; gap: 6px; }
.form__field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form__field .hint { font-size: 12.5px; color: var(--text-dim); }
.form__field .muted { font-weight: 400; }
.req { color: #ff7a1a; font-weight: 700; }

.form input[type="text"],
.form input[type="email"],
.form textarea {
    width: 100%;
    background: #271038;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    padding: 11px 13px;
}
.form input:hover, .form textarea:hover { border-color: rgba(255, 255, 255, .26); }
.form input:focus, .form textarea:focus {
    outline: 2px solid #ff7a1a;
    outline-offset: 1px;
    border-color: transparent;
}
.form textarea { min-height: 170px; resize: vertical; line-height: 1.6; }
.form__actions .button { margin-top: 4px; }

/* Honeypot: off-screen, not display:none, so bots still fill it in. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    border-radius: 10px;
    padding: 12px 15px;
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.55;
}
.alert--ok { background: rgba(31, 143, 78, .16); border: 1px solid rgba(31, 143, 78, .45); color: #9fe6bd; }
.alert--err { background: rgba(179, 57, 47, .16); border: 1px solid rgba(179, 57, 47, .5); color: #f3aca5; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

@media (max-width: 620px) {
    .form__row { grid-template-columns: 1fr; }
}

/* Touch: the player bar is used with a thumb, so the buttons need more height,
   and the quality label must not push the progress bar away. */
@media (max-width: 560px) {
    .player__controls { gap: 4px; }
    .player__btn { min-width: 38px; height: 38px; }
    /* Phones change volume with the hardware buttons; the bar needs that space
       for the progress strip, which was down to 29 px with the volume button shown. */
    .player__btn[data-act="mute"] { display: none; }
    .player__btn--text {
        max-width: 62px;
        padding: 0 6px;
        font-size: 11.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .player__time { font-size: 11.5px; }
    .player__ui { padding: 34px 8px 8px; }
}


