* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent1: #7c6fff;
    --accent2: #3ecfcf;
    --bg-base: #0a0a14;
    --shape-r: 20px;
    --shape-r-sm: 12px;
}
[data-theme="orange"] { --accent1: #e0973e; --accent2: #b8551f; --bg-base: #170f08; }
[data-theme="cyberpunk"] { --accent1: #ff2ec4; --accent2: #00e5ff; --bg-base: #05060d; --shape-r: 8px; --shape-r-sm: 6px; }

html, body {
    height: 100%;
    background: var(--bg-base);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

a { color: inherit; }

.gradient-text {
    background: linear-gradient(100deg, #fff 0%, var(--accent1) 25%, #fff 50%, var(--accent2) 75%, #fff 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: titleGlow 7s ease-in-out infinite;
}
@keyframes titleGlow { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ── Prologue ── */
#screen-prologue {
    position: relative;
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background-size: cover;
    background-position: center;
}
#screen-prologue.active { display: flex; }
#screen-prologue::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,5,10,0.55) 0%, rgba(5,5,10,0.85) 70%, rgba(5,5,10,0.97) 100%);
    z-index: 0;
}
.prologue-inner { position: relative; z-index: 1; max-width: 560px; }
.prologue-eyebrow {
    font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
    color: rgba(255,255,255,0.45); margin-bottom: 14px;
}
.prologue-title {
    font-size: clamp(32px, 8vw, 56px); font-weight: 900; line-height: 1.05; margin-bottom: 18px;
}
.prologue-text {
    font-size: 15px; line-height: 1.7; color: rgba(255,255,255,0.72); margin-bottom: 30px;
}
.btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    border: none; color: #fff; font-size: 15px; font-weight: 700;
    padding: 15px 30px; border-radius: 30px; cursor: pointer;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--accent1) 45%, transparent);
    transition: transform 0.15s;
}
.btn-primary:hover { transform: scale(1.04); }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 600;
    padding: 10px 18px; border-radius: 22px; cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: #fff; }
.prologue-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Selector ── */
#screen-selector { padding: 26px 18px 60px; max-width: 780px; margin: 0 auto; }
.top-bar {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px;
}
.top-bar .brand { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff;
}
.icon-btn svg { width: 18px; height: 18px; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.4); margin: 26px 0 12px; }

.char-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.char-chip {
    flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 68px; cursor: pointer;
}
.char-chip img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.15); }
.char-chip span { font-size: 11px; color: rgba(255,255,255,0.6); }
.char-chip:hover img { border-color: var(--accent1); }

.act-card {
    background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--shape-r); padding: 16px 18px; margin-bottom: 12px; cursor: pointer;
    backdrop-filter: blur(10px);
}
.act-card:hover { background: rgba(255,255,255,0.08); }
.act-card.open { border-color: color-mix(in srgb, var(--accent1) 40%, transparent); }
.act-head { display: flex; justify-content: space-between; align-items: baseline; }
.act-head .act-title { font-size: 16px; font-weight: 700; }
.act-head .act-years { font-size: 11px; color: rgba(255,255,255,0.4); }
.act-summary { font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,0.55); margin-top: 8px; }

.track-list { margin-top: 10px; display: none; flex-direction: column; gap: 6px; }
.act-card.open .track-list { display: flex; }
.track-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.track-row:hover { background: rgba(255,255,255,0.06); }
.track-row .num { width: 22px; font-size: 12px; color: rgba(255,255,255,0.35); text-align: right; }
.track-row .meta { flex: 1; }
.track-row .t-title { font-size: 13.5px; font-weight: 600; }
.track-row .t-sub { font-size: 11px; color: rgba(255,255,255,0.4); }

.play-all-bar { text-align: center; margin: 30px 0; }

/* ── Character bio overlay ── */
.overlay {
    position: fixed; inset: 0; z-index: 40; background: rgba(4,4,10,0.88);
    backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.bio-card {
    max-width: 420px; width: 100%; max-height: 86vh; overflow-y: auto;
    background: rgba(20,20,32,0.97); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--shape-r); padding: 26px; position: relative;
}
.bio-card .close-btn { position: absolute; top: 14px; right: 14px; }
.bio-portrait { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; border: 3px solid color-mix(in srgb, var(--accent1) 50%, transparent); }
.bio-name { font-size: 22px; font-weight: 800; }
.bio-role { font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.bio-summary { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.6; margin-bottom: 16px; font-style: italic; }
.bio-arc-item { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.bio-arc-item .year { width: 44px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--accent1); }
.bio-arc-item .text { font-size: 12.5px; color: rgba(255,255,255,0.68); line-height: 1.5; }

/* ── Cinematic player ── */
#screen-player {
    position: fixed; inset: 0; z-index: 20; background: #000; display: none;
    align-items: stretch; overflow: hidden;
}
#screen-player.active { display: flex; }
.cine-stage { position: relative; flex: 1; overflow: hidden; }
.cine-slide {
    position: absolute; inset: 0; width: 100%; height: 100%;
    overflow: hidden;
    opacity: 0; transition: opacity 1s ease;
}
.cine-slide.visible { opacity: 1; }
.cine-slide-img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    background: #000;
    transform: scale(1); transform-origin: 50% 50%;
    will-change: transform, transform-origin;
}

.letterbox { position: absolute; left: 0; right: 0; height: clamp(20px, 5.5vh, 70px); background: #000; z-index: 5; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }

.cine-scrim {
    position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: 3;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.cine-top-ui {
    position: absolute; top: 0; left: 0; right: 0; z-index: 6;
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 18px 0;
}
.cine-back { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: rgba(255,255,255,0.75); }
.cine-badge {
    font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.08); padding: 5px 12px; border-radius: 14px;
}

.lang-toggle {
    font-size: 10px; font-weight: 700; letter-spacing: 1px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
    color: #fff; padding: 6px 11px; border-radius: 12px; cursor: pointer;
}
.lang-toggle:hover { background: rgba(255,255,255,0.18); }

.story-caption {
    position: absolute; top: 74px; left: 0; right: 0; z-index: 6;
    text-align: center; padding: 0 30px;
}
.story-text {
    display: inline-block; max-width: 480px;
    font-size: clamp(12.5px, 2.2vw, 14.5px); font-style: italic; line-height: 1.55;
    color: rgba(255,255,255,0.65);
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    background: rgba(0,0,0,0.28); padding: 8px 16px; border-radius: 14px;
    backdrop-filter: blur(3px);
}
.story-text.pulse { animation: storyIn 0.5s ease; }
@keyframes storyIn { from { opacity:0; transform: translateY(-6px);} to {opacity:1; transform:translateY(0);} }

.cine-lyrics {
    position: absolute; left: 0; right: 0; bottom: 118px; z-index: 6;
    text-align: center; padding: 0 24px;
}
.lyric-current {
    font-size: clamp(19px, 3.6vw, 30px); font-weight: 800; line-height: 1.3;
    text-shadow: 0 2px 18px rgba(0,0,0,0.7);
    animation: lyricIn 0.35s ease;
}
.lyric-next {
    margin-top: 8px; font-size: clamp(12px, 2vw, 15px); color: rgba(255,255,255,0.4); font-weight: 500;
}
@keyframes lyricIn { from { opacity:0; transform: translateY(8px);} to {opacity:1; transform:translateY(0);} }

.cine-meta {
    position: absolute; left: 24px; bottom: 84px; z-index: 6;
}
.cine-meta .m-title { font-size: 13px; font-weight: 700; }
.cine-meta .m-sub { font-size: 11px; color: rgba(255,255,255,0.45); }

.cine-transport {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
    padding: 10px 20px 22px; display: flex; flex-direction: column; gap: 8px;
}
.seek-row { display: flex; align-items: center; gap: 10px; }
.seek-row span { font-size: 10px; color: rgba(255,255,255,0.4); width: 34px; }
.seek-row input[type=range] {
    flex: 1; -webkit-appearance: none; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,0.18); outline: none; cursor: pointer;
}
.seek-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
}
.transport-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.transport-controls button {
    background: none; border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.transport-controls svg { width: 22px; height: 22px; }
.transport-controls .play-pause {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
}
.transport-controls .play-pause svg { width: 22px; height: 22px; fill: #fff; }

/* ── Epilogue ── */
#screen-epilogue {
    display: none; min-height: 100vh; align-items: center; justify-content: center;
    text-align: center; padding: 40px 24px; background-size: cover; background-position: center;
    position: relative;
}
#screen-epilogue.active { display: flex; }
#screen-epilogue::before { content:''; position:absolute; inset:0; background: rgba(5,5,10,0.82); }
.epilogue-inner { position: relative; z-index: 1; max-width: 520px; }
.epilogue-inner p { font-size: 15px; line-height: 1.8; color: rgba(255,255,255,0.75); margin-bottom: 24px; }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px);
    background: rgba(20,20,30,0.97); border: 1px solid rgba(255,255,255,0.14);
    padding: 11px 20px; border-radius: 14px; font-size: 12.5px; color: #fff;
    opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
    .cine-lyrics { bottom: 106px; }
    .cine-meta { bottom: 78px; }
}

/* ── Access banner (превью/триал/куплено) ── */
.access-banner {
    font-size: 12px; color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 10px 14px; margin-bottom: 6px;
}

/* ── Paywall ── */
.paywall-card { text-align: center; }
.paywall-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.paywall-text { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 18px; }
.paywall-card .btn-primary, .paywall-card .btn-secondary, .paywall-card .login-option-btn {
    display: block; width: 100%; margin-bottom: 10px; text-align: center; text-decoration: none;
}

/* ── Auth widget (плавающий пилл сверху справа) ── */
.auth-widget { position: fixed; top: 16px; right: 16px; z-index: 50; }
.auth-widget-pill {
    display: flex; align-items: center; gap: 8px;
    background: rgba(20,20,32,0.85); border: 1px solid rgba(255,255,255,0.14);
    color: #fff; font-size: 12px; font-weight: 600;
    padding: 8px 14px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(8px);
}
.auth-widget-pill img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.auth-widget-dropdown {
    display: none; position: absolute; top: 46px; right: 0; width: 240px;
    background: rgba(20,20,32,0.97); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px; padding: 12px; backdrop-filter: blur(10px);
}
.auth-widget-dropdown.open { display: block; }
.login-option-btn {
    display: block; width: 100%; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12); color: #fff; font-size: 12.5px; font-weight: 600;
    padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: center; text-decoration: none;
    margin-bottom: 8px; box-sizing: border-box;
}
.login-option-btn:hover { background: rgba(255,255,255,0.12); }
.auth-widget-email-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.auth-widget-email-form input {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
    color: #fff; padding: 9px 10px; border-radius: 8px; font-size: 12.5px;
}
.auth-widget-error { font-size: 11.5px; color: #ff6b6b; min-height: 14px; }
.auth-widget-username { font-size: 13px; font-weight: 700; margin-bottom: 10px; text-align: center; }

/* ── Простой плеер (без слайд-шоу) — тот же визуальный язык, что у радио-плеера ── */
#screen-simple-player {
    min-height: 100vh; display: none; flex-direction: column; align-items: center;
    padding: 26px 18px 60px; max-width: 420px; margin: 0 auto; text-align: center;
}
#screen-simple-player.active { display: flex; }
#screen-simple-player .top-bar { width: 100%; margin-bottom: 40px; }

.simple-cover-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 26px; }
.simple-cover-ring {
    position: absolute; inset: -4px; border-radius: 26px; padding: 3px;
    background: conic-gradient(from 0deg, var(--accent1) 0deg, var(--accent2) 90deg, var(--accent1) 180deg, var(--accent2) 270deg, var(--accent1) 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity 0.5s;
}
.simple-cover-ring.active { opacity: 1; animation: simpleSpinRing 10s linear infinite; }
@keyframes simpleSpinRing { to { transform: rotate(360deg); } }
.simple-cover-img {
    position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 22px;
    object-fit: cover; z-index: 1; background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.simple-track-name { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.simple-track-sub { font-size: 12.5px; color: rgba(255,255,255,0.45); margin-bottom: 30px; }

.simple-controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin-bottom: 26px; }
.simple-btn-side {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.7); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.simple-btn-side:hover { background: rgba(255,255,255,0.1); color: #fff; }
.simple-btn-side svg { width: 18px; height: 18px; }
.simple-play-btn {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent1) 0%, var(--accent2) 100%);
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--accent1) 50%, transparent);
    transition: transform 0.15s;
}
.simple-play-btn:hover { transform: scale(1.06); }
.simple-play-btn svg { width: 26px; height: 26px; fill: #fff; }

.simple-seek-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.simple-seek-row span { font-size: 10px; color: rgba(255,255,255,0.4); width: 34px; }
.simple-seek-row input[type=range] {
    flex: 1; -webkit-appearance: none; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,0.18); outline: none; cursor: pointer;
}
.simple-seek-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
}

/* ── Переключатель языка витрины (рядом с auth-пиллом) ── */
.locale-switcher {
    position: fixed; top: 16px; right: 132px; z-index: 50;
    display: flex; gap: 4px; background: rgba(20,20,32,0.85);
    border: 1px solid rgba(255,255,255,0.14); border-radius: 20px; padding: 4px;
    backdrop-filter: blur(8px);
}
.locale-option {
    padding: 5px 10px; border-radius: 16px; border: none; cursor: pointer;
    background: transparent; color: rgba(255,255,255,0.55); font-size: 11px; font-weight: 600;
    font-family: inherit;
}
.locale-option:hover { color: #fff; }
.locale-option.active {
    background: color-mix(in srgb, var(--accent1) 25%, transparent); color: #fff;
}
@media (max-width: 480px) {
    .locale-switcher { top: auto; bottom: 16px; right: 16px; }
}

/* ── Мягкое напоминание о покупке/подписке (пролог + экран выбора) ── */
.pricing-strip {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin-top: 14px;
}
.pricing-strip:empty { display: none; }
.pricing-pill {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.75); font-size: 11.5px; font-weight: 600;
    padding: 8px 14px; border-radius: 16px; cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.pricing-pill:hover {
    background: color-mix(in srgb, var(--accent1) 15%, transparent);
    border-color: color-mix(in srgb, var(--accent1) 40%, transparent);
    color: #fff;
}
