:root {
    color-scheme: dark;
    --bg: #090909;
    --surface: #11110f;
    --text: #f4f1e8;
    --muted: #9b998f;
    --line: rgba(255, 255, 255, 0.14);
    --accent: #f8cf03;
    --danger: #ff8a7b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body { width: 100%; min-height: 100%; margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

.is-player { overflow: hidden; }

.player-shell,
.artplayer-app {
    width: 100vw;
    height: 100vh;
    height: 100svh;
}

.player-shell {
    position: relative;
    isolation: isolate;
    background: #000;
}

.artplayer-app {
    position: absolute;
    inset: 0;
    animation: player-in 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.artplayer-app .art-video-player {
    --art-theme: var(--accent);
    font-family: inherit;
}

.artplayer-app .art-control-quality {
    min-width: 52px;
    color: var(--accent) !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

.artplayer-app .art-bottom {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.artplayer-app .art-control:hover,
.artplayer-app .art-control:focus-visible {
    color: var(--accent);
    transform: translateY(-1px);
}

.artplayer-app .art-subtitle {
    font-weight: 650;
    letter-spacing: .01em;
    text-shadow: 0 2px 5px #000, 0 0 14px #000;
}

.player-status {
    position: absolute;
    z-index: 4;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    background: rgba(9, 9, 9, .68);
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.player-status.is-visible { opacity: 1; transform: translateY(0); }

.status-mark {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(230, 184, 92, .45);
    animation: status-pulse 1.5s ease-out infinite;
}

.player-error {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    padding: 28px;
    text-align: center;
    background: radial-gradient(circle at 50% 45%, rgba(50, 42, 29, .58), transparent 38%), rgba(4, 4, 4, .92);
    animation: error-in 260ms ease both;
}

.player-error[hidden] { display: none; }

.player-error h1 {
    max-width: 720px;
    margin: 8px 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 5vw, 58px);
    font-weight: 500;
    line-height: .98;
}

.player-error p:not(.eyebrow) {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.player-error button,
.url-form button {
    min-height: 48px;
    border: 1px solid var(--accent);
    border-radius: 0;
    margin-top: 26px;
    padding: 0 22px;
    background: var(--accent);
    color: #17120a;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.player-error button:hover,
.url-form button:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }

.player-error button:focus-visible,
.url-form button:focus-visible,
.url-form input:focus-visible,
.samples a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.launcher {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(22px, 4vw, 58px);
    overflow: hidden;
    background:
        linear-gradient(90deg, transparent 49.94%, rgba(255, 255, 255, .055) 50%, transparent 50.06%),
        radial-gradient(circle at 78% 32%, rgba(230, 184, 92, .09), transparent 32%),
        var(--bg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .16em;
}

.brand-mark {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    border: 1px solid var(--accent);
    transform: rotate(45deg);
}

.launcher-copy {
    width: min(980px, 100%);
    align-self: center;
    padding: 8vh 0;
    animation: copy-in 620ms cubic-bezier(.2, .8, .2, 1) both;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.launcher h1 {
    margin: 12px 0 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(54px, 10vw, 132px);
    font-weight: 500;
    letter-spacing: -.055em;
    line-height: .84;
}

.lede {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.55;
}

code { color: #d7d2c4; font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }

.url-form { margin-top: clamp(38px, 6vw, 70px); }

.url-form label {
    display: block;
    margin-bottom: 10px;
    color: #d2cfc5;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
}

.input-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }

.url-form input {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    border-radius: 0;
    padding: 0 2px;
    background: transparent;
    color: var(--text);
    outline: none;
    transition: border-color 160ms ease;
}

.url-form input:focus { border-bottom-color: var(--accent); }
.url-form input::placeholder { color: #66645e; }
.url-form button { min-height: 58px; margin: 0; }

.form-help { margin: 10px 0 0; color: #77756e; font-size: 12px; }
.form-help.is-error { color: var(--danger); }

.samples { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 24px; font-size: 13px; }
.samples span { color: #6e6c65; }
.samples a { color: #c9c5b8; text-underline-offset: 4px; transition: color 150ms ease; }
.samples a:hover { color: var(--accent); }

.launcher footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    color: #77756e;
    font-size: 11px;
    letter-spacing: .045em;
}

@keyframes player-in { from { opacity: 0; transform: scale(1.012); } }
@keyframes copy-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes error-in { from { opacity: 0; } }
@keyframes status-pulse { 60% { box-shadow: 0 0 0 8px rgba(230, 184, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(230, 184, 92, 0); } }

@media (max-width: 700px) {
    .launcher { background: radial-gradient(circle at 90% 20%, rgba(230, 184, 92, .1), transparent 32%), var(--bg); }
    .launcher-copy { padding: 10vh 0 8vh; }
    .launcher h1 { line-height: .9; }
    .input-row { grid-template-columns: 1fr; }
    .url-form button { width: 100%; }
    .launcher footer { flex-direction: column; }
    .player-status { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
}

@media (max-width: 480px) {
    .artplayer-app .art-control-volume,
    .artplayer-app .art-control-pip,
    .artplayer-app .art-control-fullscreenWeb { display: none !important; }
    .artplayer-app .art-control-hls-quality { padding-inline: 6px !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
