@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-400.woff2') format('woff2'),
         url('../fonts/Poppins-400.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-700.woff2') format('woff2'),
         url('../fonts/Poppins-400.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/Poppins-900.woff2') format('woff2'),
         url('../fonts/Poppins-400.woff') format('woff');
    font-weight: 900;
    font-style: normal;
}

:root {
    --accent: #e8a020;
    --accent-dark: #be7e10;
    --accent-glow: rgba(232,160,32,0.35);
    --bg: #0d1117;
    --bg2: #161b27;
    --bg3: #1e2538;
    --text: #eef0f8;
    --text-muted: #7e8da5;
    --card-w: 13vw;
    --card-h: 19.5vw;
    --hero-h: 58vh;
    --radius: 0.8vw;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', system-ui, sans-serif !important; }

html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #080c14;
}

body {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f1520 0%, #0d1117 50%, #080e18 100%);
    color: var(--text);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

/* ── Screens ─────────────────────────────────────────── */
.screen { display: none; width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; overflow: hidden; }
.screen.active { display: block; animation: screenFadeIn 180ms var(--ease-out) both; }

@keyframes screenFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Navbar ──────────────────────────────────────────── */
.nav-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 7.4vh;
    display: flex;
    align-items: center;
    padding: 0 3.1vw;
    gap: 3.1vw;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(8,12,20,0.96) 0%, rgba(8,12,20,0.7) 65%, transparent 100%);
}

.logo {
    height: 2.8vh;
    display: flex;
    align-items: center;
}

.nav-links { display: flex; gap: 2.8vw; align-items: center; }
.nav-link {
    font-size: 1.35vw;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.nav-link.active, .nav-link:hover { color: var(--text); }
.nav-link.focused { color: var(--text); text-decoration: underline; }

.nav-profile-btn {
    display: flex; align-items: center; gap: 0.5vw;
    cursor: pointer; margin-left: 0.5vw;
}
.nav-profile-btn:hover .nav-profile-name,
.nav-profile-btn.focused .nav-profile-name { color: var(--text); }
.nav-profile-btn.focused { outline: 2px solid var(--accent); border-radius: 0.5vw; }
.nav-profile-avatar {
    width: 2.2vw; height: 2.2vw; border-radius: 0.5vw;
    display: flex; align-items: center; justify-content: center;
    font-size: 1vw; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.nav-profile-name {
    font-size: 1.1vw; color: var(--text-muted);
    transition: color 0.2s;
}

.breadcrumb { font-size: 1.25vw; color: var(--text-muted); }

/* ── Setup Screen ────────────────────────────────────── */
#screen-setup {
    display: none;
    background: radial-gradient(ellipse at 50% 35%, #12192e 0%, #0d1117 70%);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2.8vh;
    padding: 3.7vh 2vw;
}
#screen-setup.active { display: flex; }

.setup-logo {
    height: 5.5vh;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.setup-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.6vh;
    width: 39.5vw;
}

.setup-box h2 { font-size: 2.1vw; font-weight: 400; }
.setup-box p  { font-size: 1.35vw; color: var(--text-muted); text-align: center; }

#server-input {
    width: 100%;
    padding: 2vh 1.5vw;
    font-size: 1.67vw;
    background: var(--bg2);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
}
#server-input:focus, #server-input.input-focused { border-color: var(--accent); }

#connect-btn {
    padding: 2vh 4vw;
    font-size: 1.67vw;
    font-weight: 700;
    background: var(--accent);
    color: #0d1117;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}
#connect-btn:hover { background: var(--accent-dark); }
#connect-btn:focus { background: var(--accent-dark); outline: 3px solid #fff; outline-offset: 3px; }

.form-error { font-size: 1.6vw; color: #ff7070; min-height: 2vh; text-align: center; font-weight: 600; }

/* ── Auth flow (device code) ────────────────────────── */
.auth-url {
    font-size: 2vw;
    font-weight: 700;
    color: #4ea8ff;
    letter-spacing: 0.05vw;
    padding: 1.5vh 0;
    user-select: all;
}
.auth-url {
    font-size: 2.2vw;
    font-weight: 700;
    color: #4fc3f7;
    letter-spacing: 0.05em;
    margin: 0.5vh 0 1vh;
    word-break: break-all;
}
.auth-code {
    font-size: 3.8vw;
    font-weight: 900;
    letter-spacing: 0.8vw;
    color: #fff;
    background: rgba(232,160,32,0.08);
    border: 2px solid rgba(232,160,32,0.3);
    border-radius: var(--radius);
    padding: 2vh 3vw;
    margin: 1.5vh 0;
}
.auth-status {
    font-size: 1.25vw;
    color: var(--text-muted);
    animation: authPulse 2s ease-in-out infinite;
}
@keyframes authPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ── Saved Devices ───────────────────────────────────── */
.saved-devices-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8vh;
}

.saved-devices-title {
    font-size: 1.35vw;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1vw;
}

.saved-devices-list {
    display: flex;
    gap: 1vw;
    flex-wrap: wrap;
    justify-content: center;
}

.saved-device-card {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    padding: 1.7vh 1.5vw;
    background: var(--bg2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    min-width: 15.6vw;
    transition: border-color 0.15s, transform 0.15s;
    position: relative;
}
.saved-device-card.focused { border-color: var(--accent); transform: scale(1.04); }
.saved-device-icon { font-size: 1.875vw; }
.saved-device-url  { font-size: 1.15vw; color: #ccc; flex: 1; word-break: break-all; }
.saved-device-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 1.15vw;
    cursor: pointer;
    padding: 0.2vh 0.4vw;
    border-radius: 0.2vw;
    transition: color 0.15s;
}
.saved-device-remove:hover { color: var(--accent); }

/* ── Page screens (drives / folders) ─────────────────── */
.page-content {
    padding: 9.3vh 3.1vw 3.7vh;
    display: flex;
    flex-direction: column;
    gap: 3.7vh;
    height: 100%;
}

.page-title { font-size: 2.3vw; font-weight: 700; }

/* ── Drives Grid ─────────────────────────────────────── */
.drives-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5vw;
}

.drive-card {
    display: flex;
    align-items: center;
    gap: 1.25vw;
    padding: 2.6vh 1.875vw;
    background: var(--bg2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    min-width: 19.8vw;
    transition: border-color 0.15s, transform 0.15s;
}
.drive-card.focused { border-color: var(--accent); transform: scale(1.03); box-shadow: 0 0 2vh var(--accent-glow); }

.drive-icon  { font-size: 3.3vw; }
.drive-letter{ font-size: 2.7vw; font-weight: 900; }
.drive-name  { font-size: 1.35vw; color: var(--text-muted); }
.drive-size  { font-size: 1.15vw; color: rgba(255,255,255,0.3); margin-top: 0.4vh; }

/* ── Folders Grid ────────────────────────────────────── */
.folders-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1vw;
    overflow-y: auto;
    max-height: 79.6vh;
}

.folder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1vh;
    width: 10.4vw;
    height: 16.7vh;
    background: var(--bg2);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    text-align: center;
    padding: 1.5vh 0.8vw;
}
.folder-card.focused { border-color: var(--accent); transform: scale(1.05); box-shadow: 0 0 1.5vh var(--accent-glow); }
.folder-card .folder-icon { font-size: 2.9vw; }
.folder-card .folder-name { font-size: 1.04vw; word-break: break-word; }

.folder-use-btn {
    width: 10.4vw;
    height: 16.7vh;
    background: var(--accent);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.25vw;
    font-weight: 700;
    color: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.folder-use-btn.focused { border-color: #fff; transform: scale(1.05); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: var(--hero-h);
    overflow: hidden;
    transition: opacity 300ms var(--ease-out);
    z-index: 20;
    pointer-events: none;
}

.hero-btn, .hero-info { pointer-events: auto; }

.hero-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-size: cover;
    background-position: center top;
    filter: brightness(0.45) saturate(1.2);
    transition: background-image 400ms var(--ease-out), opacity 120ms var(--ease-out);
}

.hero-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(
        to bottom,
        rgba(13,17,23,0.0) 0%,
        rgba(13,17,23,0.45) 65%,
        rgba(13,17,23,1.0) 100%
    ), linear-gradient(
        to right,
        rgba(13,17,23,0.95) 0%,
        rgba(13,17,23,0.38) 42%,
        transparent 62%
    );
}

/* Poster image — full portrait on the right */
.hero-poster-wrap {
    position: absolute;
    right: 6vw;
    top: 6vh;
    bottom: 8vh;
    width: 20vw;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hero-poster-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 2vh 8vh rgba(0,0,0,0.9), 0 0 4vh rgba(232,160,32,0.1);
    opacity: 0;
    transition: opacity 400ms var(--ease-out);
}

.hero-poster-img.loaded { opacity: 1; }

/* Carousel dots */
.hero-dots {
    position: absolute;
    bottom: 2.2vh;
    left: 3.1vw;
    display: flex;
    gap: 0.55vw;
}

.hero-dot {
    width: 0.5vw;
    height: 0.18vh;
    border-radius: 0.25vw;
    background: rgba(255,255,255,0.25);
    transition: background 250ms, transform 250ms, width 250ms;
}

.hero-dot.active {
    background: var(--accent);
    width: 1.5vw;
}

.hero-info {
    position: absolute;
    bottom: 6vh;
    left: 3.1vw;
    max-width: 44vw;
}

.hero-title {
    font-size: 3.2vw;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.03vw;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
    margin-bottom: 1.4vh;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    font-size: 1.25vw;
    color: rgba(238,240,248,0.7);
    margin-bottom: 2.8vh;
    letter-spacing: 0.02vw;
}

.hero-actions { display: flex; gap: 1vw; }

.hero-btn {
    padding: 1.5vh 2.6vw;
    font-size: 1.35vw;
    font-weight: 700;
    border: none;
    border-radius: 10vw;
    cursor: pointer;
    transition: opacity 150ms var(--ease-out), transform 120ms var(--ease-out);
    letter-spacing: 0.03vw;
}
.hero-btn.focused { transform: scale(1.06); outline: 2.5px solid #fff; outline-offset: 4px; }
.hero-btn:active   { transform: scale(0.97); }

.play-btn { background: var(--accent); color: #0d1117; }
.info-btn { background: rgba(30,37,56,0.85); color: var(--text); border: 1.5px solid rgba(255,255,255,0.2); }

/* ── Content Rows ────────────────────────────────────── */
.rows-container {
    position: absolute;
    top: var(--hero-h); left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 3.7vh;
}

.content-row { margin-bottom: 1vh; overflow: visible; }
.content-row:first-child { padding-top: 1.5vh; }
.recent-row .row-title { color: var(--accent); }

.row-title {
    font-size: 1.25vw;
    font-weight: 700;
    padding: 0 3.1vw 0.8vh;
    color: rgba(238,240,248,0.9);
    letter-spacing: 0.04vw;
}

.row-cards {
    display: flex;
    align-items: flex-start;
    gap: 0.6vw;
    padding: 0 3.1vw 5vw;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
}
.row-cards::-webkit-scrollbar { display: none; }

/* ── Content Card ────────────────────────────────────── */
.content-card {
    flex-shrink: 0;
    width: var(--card-w);
    height: var(--card-h);
    border-radius: var(--radius);
    overflow: visible;
    cursor: pointer;
    position: relative;
    transition: transform 130ms var(--ease-out);
}
.content-card.focused {
    transform: scale(1.09);
    transform-origin: top center;
    z-index: 10;
    filter: drop-shadow(0 0.8vh 2.5vh rgba(232,160,32,0.45));
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.card-poster {
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    background: var(--bg3);
    overflow: hidden;
    position: relative;
}

/* Shimmer skeleton shown while poster image is loading */
.card-poster.loading::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.0) 0%,
        rgba(232,160,32,0.07) 40%,
        rgba(255,255,255,0.0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s linear infinite;
    border-radius: var(--radius);
    z-index: 1;
}

.card-poster-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    z-index: 1;
}

.card-no-poster {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.1vh 0.9vw 1.3vh;
    border-radius: var(--radius);
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 70% 15%, rgba(232,160,32,0.12) 0%, transparent 55%),
        linear-gradient(155deg, #1a2040 0%, #0f1829 45%, #0d1117 100%);
    z-index: 2;
}

.card-no-poster::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 0.35vh;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(232,160,32,0.15) 100%);
}

/* faint play mark fills the negative space and signals "playable" */
.card-no-poster::after {
    content: '';
    position: absolute;
    top: 44%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-style: solid;
    border-width: 1.5vw 0 1.5vw 2.5vw;
    border-color: transparent transparent transparent rgba(255,255,255,0.06);
    pointer-events: none;
}

.card-no-poster-label {
    position: relative;
    z-index: 1;
    font-size: 0.62vw;
    font-weight: 800;
    letter-spacing: 0.2vw;
    text-transform: uppercase;
    color: rgba(232,160,32,0.6);
}

.card-no-poster-title {
    position: relative;
    z-index: 1;
    font-size: 1.4vw;
    font-weight: 900;
    line-height: 1.18;
    color: var(--text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    letter-spacing: -0.02vw;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* suppress redundant overlay + small-title when no poster fills the card */
.no-poster-card .card-gradient,
.no-poster-card .card-title,
.no-poster-card .card-badge { display: none; }

.card-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70%;
    background: linear-gradient(transparent, rgba(8,12,20,0.98));
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 2;
}

.card-title {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.2vh 0.7vw 1.3vh;
    font-size: 1vw;
    font-weight: 700;
    z-index: 3;
    line-height: 1.35;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-progress-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 3;
    height: 0.4vh;
    background: rgba(255,255,255,0.15);
    border-radius: 0 0 var(--radius) var(--radius);
}
.card-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 0 0 0 var(--radius);
}

.card-badge {
    position: absolute;
    top: 0.7vh; right: 0.4vw;
    background: var(--accent);
    color: #0d1117;
    font-size: 0.68vw;
    z-index: 3;
    font-weight: 800;
    padding: 0.2vh 0.5vw;
    border-radius: 0.3vw;
}

.card-focus-ring {
    position: absolute;
    top: -3px; right: -3px; bottom: -3px; left: -3px;
    border-radius: calc(var(--radius) + 3px);
    border: 2.5px solid var(--accent);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    box-shadow: 0 0 1.5vh var(--accent-glow);
}
.content-card.focused .card-focus-ring { opacity: 1; }

/* ── Detail Screen ───────────────────────────────────── */
#screen-detail { background: var(--bg); }

.detail-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-size: cover;
    background-position: center top;
    filter: brightness(0.28) saturate(1.3) blur(5px);
}

.detail-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(13,17,23,0.72);
}

.detail-content {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    gap: 3vw;
    padding: 5vh 3.5vw;
    align-items: flex-start;
}

.detail-poster-wrap { flex-shrink: 0; }

.detail-poster {
    width: 18vw;
    height: 27vw;
    border-radius: var(--radius);
    background: var(--bg3);
    background-size: cover;
    background-position: center;
    box-shadow: 0 2.5vh 8vh rgba(0,0,0,0.85);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.2vw;
}

.detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.3vh;
    height: 88vh;
    min-height: 0;
    overflow: hidden;
}

.detail-title { font-size: 2.9vw; font-weight: 900; line-height: 1.15; }
.detail-meta  { font-size: 1.25vw; color: var(--text-muted); }

.detail-actions { display: flex; gap: 0.8vw; flex-wrap: wrap; }

.detail-btn {
    padding: 1.7vh 2.3vw;
    font-size: 1.4vw;
    font-weight: 700;
    border: none;
    border-radius: 10vw;
    cursor: pointer;
    transition: transform 0.15s;
}
.detail-btn.focused { transform: scale(1.05); outline: 2.5px solid #fff; outline-offset: 4px; }
.detail-btn.primary { background: var(--accent); color: #0d1117; }
.detail-btn.secondary { background: rgba(30,37,56,0.85); color: var(--text); border: 1.5px solid rgba(255,255,255,0.2); }

/* ── Season Tabs ─────────────────────────────────────── */
.season-tabs {
    display: flex;
    gap: 0.8vw;
    flex-wrap: wrap;
}
.season-tabs:empty { display: none; }

.season-tab {
    padding: 0.8vh 1.8vw;
    font-size: 1.15vw;
    font-weight: 700;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10vw;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.season-tab.active  { background: rgba(232,160,32,0.15); color: var(--accent); border-color: var(--accent); }
.season-tab.focused { transform: scale(1.07); outline: 2px solid #fff; outline-offset: 3px; }

/* ── Episode List ────────────────────────────────────── */
.episode-list {
    display: flex;
    flex-direction: column;
    gap: 0.4vh;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 1.2vw;
    padding: 2.4vh 1.6vw;
    background: rgba(255,255,255,0.04);
    border-radius: 0.7vw;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, transform 0.12s;
    font-size: 1.2vw;
    box-sizing: border-box;
}
.episode-item.focused {
    border-left-color: var(--accent);
    background: rgba(232,160,32,0.09);
    transform: translateX(0.3vw);
}
.episode-num {
    font-size: 1.1vw;
    font-weight: 700;
    color: var(--accent);
    min-width: 2.8vw;
    text-align: center;
    opacity: 0.8;
}
.episode-title {
    flex: 1;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Player ──────────────────────────────────────────── */
#screen-player { background: transparent; }
body.tv.playing, html.tv.playing { background: transparent; }

#video-player, #av-player {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background: transparent;
}

#av-player { display: none; }
body.tv #av-player  { display: block; }
body.tv #video-player { display: none; }

/* OSD overlay */
.player-ui {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}
.player-ui.visible { opacity: 1; pointer-events: all; }

/* Top bar */
.player-top {
    display: flex;
    align-items: center;
    gap: 1.7vw;
    padding: 3.7vh 3.1vw 7.4vh;
    background: linear-gradient(to bottom, rgba(8,12,20,0.95), transparent);
}

.player-back-btn {
    flex-shrink: 0;
    padding: 1.1vh 1.5vw;
    font-size: 1.35vw;
    font-weight: 700;
    background: rgba(30,37,56,0.8);
    color: var(--text);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.player-back-btn:hover,
.player-back-btn.focused { background: rgba(232,160,32,0.2); border-color: var(--accent); }

.player-title { font-size: 1.77vw; font-weight: 700; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.player-top-badges { display: flex; gap: 0.6vw; }
.player-badge {
    padding: 0.6vh 0.8vw;
    background: rgba(30,37,56,0.85);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.4vw;
    font-size: 1.15vw;
    font-weight: 700;
    letter-spacing: 0.05vw;
}
.sleep-badge { background: rgba(232,160,32,0.25); border-color: rgba(232,160,32,0.4); }

/* Bottom bar */
.player-bottom {
    padding: 7.4vh 3.1vw 4.6vh;
    background: linear-gradient(to top, rgba(8,12,20,0.95), transparent);
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

/* Progress row */
.progress-row { display: flex; align-items: center; gap: 1vw; }
.time-label { font-size: 1.25vw; color: rgba(238,240,248,0.7); min-width: 4vw; text-align: center; }

.progress-bar-wrap {
    flex: 1;
    padding: 1vh 0;
    cursor: pointer;
    user-select: none;
}
.progress-bar {
    height: 0.37vh;
    background: rgba(255,255,255,0.2);
    border-radius: 0.37vh;
    position: relative;
    transition: height 150ms var(--ease-out);
}
.progress-bar-wrap:hover .progress-bar,
.progress-bar-wrap.scrubbing .progress-bar {
    height: 0.7vh;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 0.37vh;
    width: 0%;
    transition: width 0.4s linear;
}
.progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 1.85vh;
    height: 1.85vh;
    background: var(--accent);
    border-radius: 50%;
    left: 0%;
    box-shadow: 0 0 8px rgba(232,160,32,0.6);
    transition: left 0.4s linear, transform 150ms var(--ease-out);
    pointer-events: none;
}
.progress-bar-wrap:hover .progress-thumb,
.progress-bar-wrap.scrubbing .progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}
.progress-bar-wrap.focused .progress-bar {
    height: 0.7vh;
    box-shadow: 0 0 0 0.2vh var(--accent);
}
.progress-bar-wrap.focused .progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* Main control buttons */
.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.7vw;
}
.ctrl-btn {
    padding: 1.3vh 1.875vw;
    font-size: 1.56vw;
    background: rgba(30,37,56,0.75);
    color: var(--text);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ctrl-btn.ctrl-play { padding: 1.3vh 2.5vw; }
.ctrl-btn.focused { border-color: var(--accent); background: rgba(232,160,32,0.2); transform: scale(1.08); }

/* Secondary controls row */
.player-secondary-row {
    display: flex;
    justify-content: center;
    gap: 1vw;
    flex-wrap: wrap;
}
.ctrl-btn-sm {
    padding: 0.9vh 1.25vw;
    font-size: 1.15vw;
    background: rgba(30,37,56,0.6);
    color: rgba(238,240,248,0.6);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.ctrl-btn-sm.focused { border-color: var(--accent); color: var(--text); background: rgba(232,160,32,0.15); }
.ctrl-btn-sm.active  { color: var(--accent); border-color: var(--accent); }

/* Sleep hint */
.sleep-hint { text-align: center; font-size: 1.15vw; color: var(--accent); }

/* Subtitle overlay */
.subtitle-display {
    position: absolute;
    bottom: 16.7vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 2.1vw;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 2px 6px #000, 0 0 20px #000;
    background: rgba(8,12,20,0.55);
    padding: 0.7vh 1.25vw;
    border-radius: 0.5vw;
    max-width: 83.3vw;
    pointer-events: none;
    z-index: 20;
    display: none;
}

/* Next episode banner */
.next-ep-banner {
    position: absolute;
    bottom: 20.4vh;
    right: 4.2vw;
    background: rgba(13,17,23,0.96);
    border: 2px solid rgba(232,160,32,0.5);
    border-radius: var(--radius);
    padding: 2.6vh 1.875vw;
    display: flex;
    align-items: center;
    gap: 2.1vw;
    z-index: 30;
    min-width: 26vw;
    box-shadow: 0 0 3vh rgba(232,160,32,0.2);
}
.next-ep-label  { font-size: 1.15vw; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1vw; }
.next-ep-title  { font-size: 1.56vw; font-weight: 700; margin-top: 0.6vh; }
.next-ep-countdown-wrap { text-align: center; }
.next-ep-countdown {
    width: 6.5vh;
    height: 6.5vh;
    border: 3px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.67vw;
    font-weight: 700;
    color: var(--accent);
    margin: 0 auto 0.7vh;
}
.next-ep-hint { font-size: 0.94vw; color: var(--text-muted); }

/* ── Hero→rows scrim ─────────────────────────────────── */
.rows-scrim {
    display: none;
}

/* ── Scrollbar ────────────────────────────────────────── */
.rows-container::-webkit-scrollbar { width: 0.25vw; }
.rows-container::-webkit-scrollbar-track { background: transparent; }
.rows-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 0.15vw; }

/* ── Loading / Empty ─────────────────────────────────── */
.msg {
    padding: 5.6vh 3.1vw;
    font-size: 1.67vw;
    color: var(--text-muted);
    text-align: center;
}

/* ── Search Screen ───────────────────────────────────── */
#screen-search { background: var(--bg); }

.search-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 7.4vh 3.1vw 1.8vh;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(13,17,23,0.99) 60%, transparent);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    background: rgba(30,37,56,0.7);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10vw;
    padding: 1.3vh 1.6vw;
    transition: border-color 0.18s, background 0.18s;
}

.search-input-wrap.focused {
    border-color: var(--accent);
    background: rgba(30,37,56,0.9);
    box-shadow: 0 0 2vh rgba(232,160,32,0.2);
}

.search-icon {
    width: 1.35vw;
    height: 1.35vw;
    flex-shrink: 0;
    color: rgba(255,255,255,0.35);
    transition: color 0.18s;
}

.search-input-wrap.focused .search-icon { color: var(--accent); }

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.55vw;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0.01vw;
}

.search-input::placeholder { color: rgba(126,141,165,0.6); }

.search-results {
    position: absolute;
    top: 15vh;
    left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.2vh 3.1vw 4vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.search-results::-webkit-scrollbar { width: 3px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.search-count {
    font-size: 0.95vw;
    font-weight: 600;
    color: rgba(232,160,32,0.6);
    letter-spacing: 0.08vw;
    margin-bottom: 1.4vh;
    text-transform: uppercase;
}

.search-chips-row {
    margin-bottom: 2.4vh;
}

.search-chips-label {
    font-size: 0.85vw;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1vw;
    color: rgba(255,255,255,0.3);
    margin-bottom: 1vh;
}

.search-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6vh 0.5vw;
}

.search-chip {
    display: flex;
    align-items: center;
    gap: 0.4vw;
    padding: 0.7vh 1.1vw;
    border-radius: 10vw;
    background: rgba(30,37,56,0.7);
    border: 1.5px solid rgba(255,255,255,0.1);
    font-size: 0.95vw;
    font-weight: 500;
    color: rgba(238,240,248,0.65);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.search-chip::before {
    content: '';
    display: inline-block;
    width: 0.8vw;
    height: 0.8vw;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.search-chip.focused,
.search-chip:hover {
    background: rgba(232,160,32,0.15);
    border-color: var(--accent);
    color: var(--text);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--card-w));
    gap: 0.9vh 0.6vw;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 55vh;
    gap: 1.6vh;
    color: rgba(255,255,255,0.2);
    text-align: center;
}

.search-empty-icon {
    width: 3.2vw;
    height: 3.2vw;
    opacity: 0.18;
    margin-bottom: 0.4vh;
}

.search-empty-text {
    font-size: 1.3vw;
    font-weight: 500;
    color: rgba(255,255,255,0.28);
}

.search-empty-sub {
    font-size: 0.9vw;
    color: rgba(255,255,255,0.15);
}

/* ── Search result stagger ───────────────────────────── */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

#search-grid .content-card {
    animation: cardIn 220ms var(--ease-out) both;
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .screen.active          { animation: none; }
    #search-grid .content-card { animation: none; opacity: 1; transform: none; }
    .content-card           { transition: none; }
    .hero-btn               { transition: none; }
    .hero-btn:active        { transform: none; }
    .hero-bg                { transition: none; }
    *                       { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ── Accounts Screen ─────────────────────────────────── */
#screen-accounts {
    background: radial-gradient(ellipse at 50% 35%, #12192e 0%, #0d1117 70%);
}
.accounts-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6vh 3vw;
    gap: 0;
}
.accounts-logo {
    height: 3.8vh;
    display: flex;
    align-items: center;
    margin-bottom: 4vh;
}
.accounts-title {
    font-size: 2.6vw;
    font-weight: 800;
    color: rgba(238,240,248,0.92);
    margin-bottom: 5vh;
    letter-spacing: -0.02vw;
}

.accounts-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0 2vw;
    margin-bottom: 4vh;
}

.account-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 11vw;
    padding: 0.5vh 0;
    transition: transform 120ms var(--ease-out);
}

.account-picture {
    width: 7vw;
    height: 7vw;
    border-radius: 50%;
    border: 0.3vw solid transparent;
    transition: border-color 120ms var(--ease-out), transform 120ms var(--ease-out);
    object-fit: cover;
    display: block;
}

.account-initials {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8vw;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.account-name {
    margin-top: 1.2vh;
    font-size: 1.15vw;
    font-weight: 500;
    color: rgba(238,240,248,0.5);
    max-width: 11vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    transition: color 120ms var(--ease-out);
}

.account-tile.focused .account-picture {
    border-color: var(--accent);
    transform: scale(1.08);
    box-shadow: 0 0 2vh var(--accent-glow);
}
.account-tile.focused .account-name { color: var(--text); }

/* Auth box inside accounts screen */
.accounts-auth-box {
    flex-direction: column;
    align-items: center;
    gap: 2.2vh;
    margin-bottom: 4vh;
    width: 39.5vw;
}
.accounts-auth-box h2 { font-size: 2.1vw; font-weight: 400; }
.accounts-auth-box p  { font-size: 1.35vw; color: var(--text-muted); text-align: center; }

.accounts-actions {
    flex-direction: column;
    align-items: center;
    gap: 1.4vh;
    margin-top: 1vh;
}

.accounts-add-btn {
    background: rgba(30,37,56,0.7);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: rgba(238,240,248,0.55);
    font-size: 1.15vw;
    padding: 1.1vh 2vw;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.accounts-add-btn:hover,
.accounts-add-btn.focused {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(232,160,32,0.1);
}

.accounts-signout-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 1.04vw;
    cursor: pointer;
    padding: 0.6vh 1vw;
    transition: color 0.18s;
}
.accounts-signout-btn:hover,
.accounts-signout-btn.focused { color: rgba(238,240,248,0.65); }

.proxy-url-row {
    display: flex;
    gap: 0.6vw;
    margin-top: 1.5vh;
    width: 100%;
}
.proxy-url-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1vw;
    padding: 0.6vh 1vw;
    outline: none;
}
.proxy-url-input:focus { border-color: var(--accent); }

/* ── Profiles ────────────────────────────────────────── */
#screen-profiles {
    background: radial-gradient(ellipse at 50% 35%, #141a2e 0%, #0d1117 70%);
}
.profiles-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6vh 3vw;
}
.profiles-logo {
    height: 3.8vh;
    display: flex;
    align-items: center;
    margin-bottom: 4vh;
}
.profiles-title {
    font-size: 2.6vw;
    font-weight: 800;
    color: rgba(238,240,248,0.92);
    margin-bottom: 5vh;
    letter-spacing: -0.02vw;
}

.profiles-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

/* tile = avatar + name; margin (not gap) for Chromium-63 compat */
.profile-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1.4vw;
    cursor: pointer;
    width: 11vw;
}
.profile-avatar {
    width: 9vw;
    height: 9vw;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.2vw;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    border: 0.3vw solid transparent;
    transition: transform 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.profile-name {
    margin-top: 1.4vh;
    font-size: 1.15vw;
    font-weight: 500;
    color: rgba(238,240,248,0.5);
    max-width: 11vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 120ms var(--ease-out);
}
.profile-tile.focused .profile-avatar {
    transform: scale(1.08);
    border-color: var(--accent);
    box-shadow: 0 0 2.5vh var(--accent-glow);
}
.profile-tile.focused .profile-name { color: var(--text); }

/* "Add profile" tile */
.profile-add .profile-avatar {
    background: rgba(30,37,56,0.6);
    border: 0.2vw dashed rgba(255,255,255,0.2);
    position: relative;
}
.profile-add .profile-avatar .plus-h,
.profile-add .profile-avatar .plus-v {
    position: absolute;
    top: 50%; left: 50%;
    background: rgba(255,255,255,0.4);
    border-radius: 0.2vw;
    transition: background 120ms var(--ease-out);
}
.profile-add .profile-avatar .plus-h { width: 3vw; height: 0.5vw; transform: translate(-50%, -50%); }
.profile-add .profile-avatar .plus-v { width: 0.5vw; height: 3vw; transform: translate(-50%, -50%); }
.profile-add.focused .profile-avatar { background: rgba(232,160,32,0.1); border-color: var(--accent); }
.profile-add.focused .plus-h, .profile-add.focused .plus-v { background: var(--accent); }

/* Create-profile panel */
.profile-create {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-create-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 34vw;
}
.profile-avatar-lg { width: 10vw; height: 10vw; font-size: 4.6vw; margin-bottom: 3vh; }
.profile-name-input {
    width: 100%;
    padding: 1.8vh 1.4vw;
    font-size: 1.6vw;
    text-align: center;
    background: var(--bg2);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    margin-bottom: 2.6vh;
    transition: border-color 0.2s;
}
.profile-name-input.input-focused { border-color: var(--accent); }
.profile-create-btn {
    padding: 1.7vh 3vw;
    font-size: 1.5vw;
    font-weight: 700;
    background: var(--accent);
    color: #0d1117;
    border: none;
    border-radius: 10vw;
    cursor: pointer;
    transition: transform 120ms var(--ease-out), background 0.2s;
}
.profile-create-btn.focused { transform: scale(1.05); outline: 3px solid #fff; outline-offset: 3px; }
.profile-create-btn:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
    .profile-avatar, .profile-name, .profile-create-btn,
    .profile-add .plus-h, .profile-add .plus-v { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════
   ANDROID / MOBILE RESPONSIVE LAYOUT
   Applied when WebView injects .is-android on <html> and <body>.
   TV keeps its fixed 1920×1080 viewport — these rules never fire there.
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS variable overrides by screen width ────────────────── */
html.is-android {
    --card-w: 28vw;
    --card-h: 42vw;
    --radius: 1.8vw;
    --hero-h: 50vw;
}
@media (max-width: 600px) {
    html.is-android { --card-w: 38vw; --card-h: 57vw; --radius: 2.5vw; --hero-h: 60vw; }
}
@media (max-height: 500px) and (orientation: landscape) {
    html.is-android { --card-w: 22vw; --card-h: 33vw; --hero-h: 45vw; }
}

/* ── Base: allow scrolling, remove fixed overflow ──────────── */
html.is-android,
body.is-android {
    overflow: hidden;
    height: 100dvh;
}
body.is-android .screen {
    height: 100dvh;
    overflow: hidden;
}

/* ── Scrollable content areas ──────────────────────────────── */
body.is-android .content-rows,
body.is-android .page-content,
body.is-android #detail-episodes-list,
body.is-android #search-grid {
    -webkit-overflow-scrolling: touch;
}
body.is-android .row-cards {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6vw;
}
body.is-android .row-cards::-webkit-scrollbar { display: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
body.is-android .nav-bar {
    height: 13vw;
    padding: 0 4vw;
    gap: 3vw;
}
body.is-android .logo { height: 5vw; }
body.is-android .nav-links { gap: 4vw; }
body.is-android .nav-link { font-size: 3.5vw; }
body.is-android .nav-profile-avatar { width: 7vw; height: 7vw; border-radius: 1.5vw; font-size: 3vw; }
body.is-android .nav-profile-name { font-size: 3vw; }
body.is-android .breadcrumb { font-size: 3.5vw; }

/* ── Hero ────────────────────────────────────────────────────── */
body.is-android .hero { height: var(--hero-h); }
body.is-android .hero-title { font-size: 7vw; line-height: 1.2; }
body.is-android .hero-meta  { font-size: 3vw; gap: 3vw; }
body.is-android .hero-desc  { font-size: 3vw; -webkit-line-clamp: 3; max-width: 80vw; }
body.is-android .hero-btns  { gap: 3vw; margin-top: 3vw; }
body.is-android .hero-btn   { padding: 2.5vw 6vw; font-size: 3.5vw; border-radius: 2vw; min-height: 11vw; }

/* ── Rows ────────────────────────────────────────────────────── */
body.is-android .content-row { margin-bottom: 2vw; }
body.is-android .row-header { padding: 0 3.5vw 2vw; }
body.is-android .row-title { font-size: 4.5vw; }
body.is-android .row-cards { padding: 0 3.5vw 6vw; gap: 3vw; }

/* ── Cards ───────────────────────────────────────────────────── */
body.is-android .card-focus-ring { display: none; }
body.is-android .content-card.focused { transform: none !important; box-shadow: none !important; }
body.is-android .content-card { transition: transform 0.12s ease; border-radius: var(--radius); }
body.is-android .content-card:active { transform: scale(0.94) !important; }
body.is-android .card-title { font-size: 3vw; padding: 1.5vw 1.2vw 1.8vw; }
body.is-android .card-gradient { height: 60%; }
body.is-android .card-badge { font-size: 2.2vw; padding: 0.8vw 1.5vw; }
body.is-android .card-progress-bar { height: 0.8vw; }

/* ── Detail screen ───────────────────────────────────────────── */
body.is-android .detail-hero { height: 55vw; }
body.is-android .detail-content { padding: 4vw; }
body.is-android .detail-title { font-size: 6vw; }
body.is-android .detail-meta  { font-size: 3vw; gap: 2.5vw; }
body.is-android .detail-desc  { font-size: 3.2vw; }
body.is-android .detail-btns  { gap: 3vw; margin: 4vw 0; }
body.is-android .detail-btn   { padding: 2.5vw 6vw; font-size: 3.5vw; min-height: 12vw; border-radius: 2vw; }
body.is-android .episodes-title { font-size: 4.5vw; padding: 4vw 4vw 2vw; }
body.is-android .episode-item { padding: 3.5vw 4vw; }
body.is-android .episode-title { font-size: 3.5vw; }
body.is-android .episode-item:active { background: rgba(255,255,255,0.1); }

/* ── Player controls ─────────────────────────────────────────── */
body.is-android .player-controls { padding: 3vw 5vw 6vw; }
body.is-android .player-title { font-size: 4vw; }
body.is-android .player-btn { width: 12vw; height: 12vw; font-size: 6vw; }
body.is-android .player-scrubber-wrap { height: 8vw; }
body.is-android .player-time { font-size: 3vw; }

/* ── Search ──────────────────────────────────────────────────── */
body.is-android #search-input { font-size: 4vw; padding: 3vw 4vw; border-radius: 2vw; }
body.is-android .search-chip { font-size: 3vw; padding: 1.5vw 3.5vw; border-radius: 5vw; }
body.is-android #search-grid { grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 3vw; padding: 4vw; }

/* ── Setup / Accounts / Profiles ─────────────────────────────── */
body.is-android .setup-box { width: 88vw; gap: 5vw; }
body.is-android .setup-box h2 { font-size: 6vw; }
body.is-android .setup-box p  { font-size: 3.5vw; }
body.is-android #server-input { font-size: 4vw; padding: 3.5vw; }
body.is-android #connect-btn  { font-size: 4vw; padding: 3.5vw 8vw; min-height: 13vw; }
body.is-android .form-error   { font-size: 3.5vw; }
body.is-android .auth-code    { font-size: 10vw; letter-spacing: 2vw; padding: 4vw 6vw; }
body.is-android .auth-url     { font-size: 4vw; }
body.is-android .auth-status  { font-size: 3.5vw; }
body.is-android .account-tile { width: 28vw; padding: 4vw 2vw; }
body.is-android .account-name { font-size: 3vw; }
body.is-android .account-avatar { width: 18vw; height: 18vw; font-size: 8vw; }
body.is-android .profile-avatar { width: 18vw; height: 18vw; font-size: 8vw; }
body.is-android .profile-name   { font-size: 3.5vw; }
body.is-android .accounts-logo, body.is-android .profiles-logo { height: 8vw; }
body.is-android .setup-logo { height: 10vw; }

/* ── Drives / folders ────────────────────────────────────────── */
body.is-android .page-title { font-size: 6vw; }
body.is-android .drive-card { min-width: 40vw; padding: 4vw; border-radius: 2vw; }
body.is-android .drive-card-icon { font-size: 8vw; }
body.is-android .drive-card-name { font-size: 4vw; }
body.is-android .folder-item { padding: 3.5vw 4vw; font-size: 4vw; }
body.is-android .folder-item:active { background: rgba(255,255,255,0.08); }

/* ── Request Screen ──────────────────────────────────────────── */
#req-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-top: 80px;
    background:
        radial-gradient(ellipse 70% 60% at 15% 50%, rgba(232,160,32,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 55% 50% at 85% 55%, rgba(70,90,200,0.10) 0%, transparent 60%),
        #06090f;
}
/* Left column — branding */
#req-box-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5vw 0 7vw;
}
/* Right column — form */
#req-box { display: flex; flex-direction: column; justify-content: center; padding: 0 7vw 0 4vw; }
#req-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1vw;
    margin-bottom: 2.5vw;
}
#req-logo-text {
    font-size: 3vw;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #eef0f8;
    line-height: 1;
}
#req-logo-text span { color: #e8a020; }
#req-logo-tagline {
    font-size: 0.6vw;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(238,240,248,0.3);
    text-transform: uppercase;
    margin-top: 0.4vw;
}
#req-left-headline {
    font-size: 2.2vw;
    font-weight: 800;
    color: #eef0f8;
    line-height: 1.25;
    margin-bottom: 1.2vw;
}
#req-left-headline span { color: #e8a020; }
#req-left-sub {
    font-size: 0.9vw;
    color: rgba(238,240,248,0.45);
    line-height: 1.7;
    max-width: 28vw;
}
#req-divider {
    width: 1px;
    background: rgba(255,255,255,0.06);
    position: absolute;
    left: 50%; top: 80px; bottom: 0;
}
#req-card {
    background: #0e1420;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1vw;
    padding: 2.2vw 2.5vw 2.5vw;
    width: 100%;
    position: relative;
    box-shadow: 0 2vw 5vw rgba(0,0,0,0.7), 0 0.5vw 1.5vw rgba(0,0,0,0.5);
}
#req-card-shine {
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent);
}
#req-card-glow {
    position: absolute;
    bottom: -2vw; left: 15%; right: 15%;
    height: 2.5vw;
    background: radial-gradient(ellipse, rgba(232,160,32,0.1) 0%, transparent 70%);
    filter: blur(6px);
    pointer-events: none;
}
#req-sbadge {
    display: none;
    position: absolute;
    top: 1.1vw; right: 1.2vw;
    padding: 0.2vw 0.6vw;
    border-radius: 999px;
    font-size: 0.45vw;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
#req-sbadge.run { background: rgba(232,160,32,0.15); color: #e8a020; border: 1px solid rgba(232,160,32,0.3); }
#req-sbadge.ok  { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
#req-sbadge.bad { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.req-ctitle {
    font-size: 1.3vw;
    font-weight: 700;
    color: #eef0f8;
    margin-bottom: 0.35vw;
    line-height: 1.3;
}
.req-csub {
    font-size: 0.72vw;
    color: rgba(238,240,248,0.45);
    margin-bottom: 1.5vw;
    line-height: 1.6;
}
.req-sep { height: 1px; background: rgba(255,255,255,0.06); margin-bottom: 1.4vw; }
.req-fwrap { margin-bottom: 1.1vw; }
.req-flbl {
    display: block;
    font-size: 0.5vw;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(238,240,248,0.3);
    text-transform: uppercase;
    margin-bottom: 0.4vw;
}
#req-it, #req-iy {
    display: block;
    width: 100%;
    padding: 0.85vw 0.95vw;
    font-size: 1vw;
    font-family: Arial, sans-serif;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 0.5vw;
    color: #eef0f8;
    outline: none;
}
#req-it.on, #req-iy.on {
    border-color: #e8a020;
    background: rgba(232,160,32,0.05);
    box-shadow: 0 0 0 0.2vw rgba(232,160,32,0.15);
}
#req-btn {
    display: block;
    width: 100%;
    margin-top: 0.6vw;
    padding: 0.95vw;
    font-size: 0.9vw;
    font-weight: 700;
    font-family: Arial, sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #e8a020;
    color: #06090f;
    border: none;
    border-radius: 0.5vw;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0.2vw 1.5vw rgba(232,160,32,0.28);
}
#req-btn.on  { box-shadow: 0 0 0 0.22vw rgba(232,160,32,0.35), 0 0.3vw 2vw rgba(232,160,32,0.3); }
#req-btn.cx  { background: #1a2035; color: rgba(238,240,248,0.55); box-shadow: none; border: 1px solid rgba(255,255,255,0.07); }
#req-btn.cx.on { box-shadow: 0 0 0 0.22vw rgba(255,255,255,0.09); }
#req-prog { display: none; margin-bottom: 1vw; }
#req-prow { height: 1.4vw; position: relative; margin-bottom: 0.6vw; }
#req-spin {
    position: absolute; left: 0; top: 0.2vw;
    width: 0.9vw; height: 0.9vw;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.08);
    border-top-color: #e8a020;
    animation: req-sp 0.85s linear infinite;
}
@keyframes req-sp { to { transform: rotate(360deg); } }
#req-plbl {
    position: absolute; left: 1.4vw; top: 0.28vw;
    font-size: 0.5vw; font-weight: 700; letter-spacing: 0.2em; color: rgba(238,240,248,0.35);
}
#req-ppct {
    position: absolute; right: 0; top: 0.28vw;
    font-size: 0.65vw; color: rgba(238,240,248,0.5);
}
#req-ptrk { height: 0.2vw; background: rgba(255,255,255,0.07); border-radius: 0.2vw; overflow: hidden; }
#req-pfll { height: 0.2vw; background: #e8a020; width: 0%; border-radius: 0.2vw; transition: width 0.5s ease; }
#req-pfll.ok  { background: #34d399; }
#req-pfll.bad { background: #f87171; }
#req-act { display: none; margin-top: 0.8vw; overflow: hidden; max-height: 8vw; }
.req-al { font-size: 0.45vw; font-weight: 700; letter-spacing: 0.22em; color: rgba(238,240,248,0.28); margin-bottom: 0.5vw; }
.req-ar {
    padding: 0.35vw 0 0.35vw 1vw;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8vw;
    color: #eef0f8;
    position: relative;
}
.req-ar:first-child { border-top: none; }
.req-adot { position: absolute; left: 0; top: 0.5vw; width: 0.35vw; height: 0.35vw; border-radius: 50%; background: #e8a020; }
.req-adot.ok  { background: #34d399; }
.req-adot.bad { background: #f87171; }
.req-atm { float: right; font-size: 0.6vw; color: rgba(238,240,248,0.3); }
#req-foot {
    margin-top: 0.9vw;
    text-align: center;
    font-size: 0.45vw;
    color: rgba(238,240,248,0.2);
    letter-spacing: 0.08em;
}
#req-eb {
    display: none;
    position: fixed;
    top: 0.85vw; left: 50%;
    transform: translateX(-50%);
    background: rgba(248,113,113,0.12);
    color: #f87171;
    padding: 0.65vw 1.2vw;
    font-size: 0.9vw;
    border-radius: 999px;
    z-index: 9;
    border: 1px solid rgba(248,113,113,0.3);
    white-space: nowrap;
}

/* ── Fullscreen button (Electron only) ──────────────────── */
.ctrl-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    line-height: 0;
}
.ctrl-fullscreen-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}

/* ── Electron Google Sign-In ─────────────────────────────── */
#electron-auth-section {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}
.google-signin-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 28px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', system-ui, sans-serif;
    cursor: pointer;
    transition: box-shadow .15s, background .15s;
    white-space: nowrap;
}
.google-signin-btn:hover:not(:disabled) {
    box-shadow: 0 1px 6px rgba(0,0,0,.18);
    background: #f8f9fa;
}
.google-signin-btn:active:not(:disabled) {
    background: #f1f3f4;
    transform: scale(0.98);
}
.google-signin-btn:disabled {
    opacity: .6;
    cursor: default;
}
.electron-auth-status {
    font-size: 13px;
    color: var(--text-muted);
    min-height: 18px;
    text-align: center;
}

/* ── Downloads screen ────────────────────────────────────── */
.dl-page {
    padding: 4.5vw 5vw 2vw;
    height: calc(100vh - 4vw);
    overflow-y: auto;
    margin-top: 4vw;
}
.dl-search-wrap {
    position: relative;
    margin-bottom: 1.5vw;
}
.dl-search-icon {
    position: absolute;
    left: 1vw;
    top: 50%;
    transform: translateY(-50%);
    width: 1.3vw;
    height: 1.3vw;
    color: var(--text-muted);
    pointer-events: none;
}
.dl-search-input {
    width: 100%;
    padding: 0.85vw 1.2vw 0.85vw 3vw;
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1vw;
    outline: none;
    transition: border-color 180ms;
}
.dl-search-input:focus {
    border-color: var(--accent);
}
.dl-search-results {
    margin-bottom: 2vw;
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    overflow: hidden;
}
.dl-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8vw 1.2vw;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 120ms;
    cursor: default;
}
.dl-result-row:last-child { border-bottom: none; }
.dl-result-row:hover, .dl-result-row.focused {
    background: var(--bg3);
    border-left: 3px solid var(--accent);
    padding-left: calc(1.2vw - 3px);
}
.dl-result-title {
    font-size: 0.9vw;
    color: var(--text);
}
.dl-result-status {
    display: flex;
    align-items: center;
    gap: 0.5vw;
    flex-shrink: 0;
}
.dl-download-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 999px;
    padding: 0.3vw 1vw;
    font-size: 0.8vw;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 150ms;
}
.dl-download-btn:hover { opacity: 0.85; }
.dl-status-done {
    color: #4ade80;
    font-size: 0.8vw;
}
.dl-status-pct {
    color: var(--accent);
    font-size: 0.8vw;
    font-weight: 700;
}
.dl-no-results {
    padding: 1.5vw 1.2vw;
    color: var(--text-muted);
    font-size: 0.9vw;
}
.dl-section-title {
    font-size: 1vw;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8vw;
}
.dl-active-row {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 0.9vw 1.2vw;
    margin-bottom: 0.6vw;
}
.dl-active-title {
    font-size: 0.85vw;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.4vw;
}
.dl-active-bar-wrap {
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    height: 0.3vw;
    overflow: hidden;
}
.dl-active-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 400ms linear;
}
#dl-active-section, #dl-done-section { margin-bottom: 2vw; }
.dl-done-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 0.9vw 1.2vw;
    margin-bottom: 0.5vw;
    border: 1px solid transparent;
    transition: border-color 140ms;
}
.dl-done-row:hover, .dl-done-row.focused {
    border-color: var(--accent);
}
.dl-done-title {
    font-size: 0.95vw;
    color: var(--text);
    margin-bottom: 0.2vw;
}
.dl-done-meta {
    font-size: 0.75vw;
    color: var(--text-muted);
}
.dl-done-actions {
    display: flex;
    gap: 0.7vw;
    flex-shrink: 0;
}
.dl-play-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 999px;
    padding: 0.35vw 1.1vw;
    font-size: 0.8vw;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 150ms;
}
.dl-play-btn:hover { opacity: 0.85; }
.dl-del-btn {
    background: rgba(248,113,113,0.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 999px;
    padding: 0.35vw 0.9vw;
    font-size: 0.8vw;
    cursor: pointer;
    transition: background 150ms;
}
.dl-del-btn:hover { background: rgba(248,113,113,0.22); }
.dl-empty-msg {
    color: var(--text-muted);
    font-size: 1vw;
    text-align: center;
    padding: 4vw 2vw;
}
.dl-confirm-overlay {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.dl-confirm-box {
    background: var(--bg2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: calc(var(--radius) * 1.5);
    padding: 2vw 2.5vw;
    text-align: center;
    min-width: 20vw;
}
.dl-confirm-title {
    font-size: 1.1vw;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5vw;
}
.dl-confirm-label {
    font-size: 0.9vw;
    color: var(--text-muted);
    margin-bottom: 1.5vw;
}
.dl-confirm-btns {
    display: flex;
    gap: 1vw;
    justify-content: center;
}
.dl-confirm-btn {
    border: none;
    border-radius: 999px;
    padding: 0.5vw 1.8vw;
    font-size: 0.9vw;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 150ms;
}
.dl-confirm-btn-cancel {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
}
.dl-confirm-btn-ok {
    background: #ef4444;
    color: #fff;
}
.dl-confirm-btn.focused, .dl-confirm-btn:hover { opacity: 0.85; outline: 2px solid var(--accent); outline-offset: 2px; }
