:root {
    --bg: #0f172a;
    --bg-deep: #020617;
    --line: rgba(255, 255, 255, 0.16);
    --text: #f8fafc;
    --muted: rgba(248, 250, 252, 0.76);
    --panel: rgba(255, 255, 255, 0.9);
    --panel-line: rgba(15, 23, 42, 0.08);
    --panel-text: #17212b;
    --panel-muted: #697586;
    --blue-soft: rgba(37, 99, 235, 0.1);
    --blue-strong: #1d4ed8;
    --red-soft: rgba(239, 68, 68, 0.12);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 32%),
        radial-gradient(circle at bottom, rgba(14, 165, 233, 0.16), transparent 28%),
        linear-gradient(180deg, var(--bg), var(--bg-deep));
    color: var(--text);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

button {
    font: inherit;
}

.app,
.feed {
    width: 100vw;
    height: 100vh;
}

.feed {
    position: relative;
    overflow: hidden;
    background: #020617;
}

.slides {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slides::-webkit-scrollbar {
    display: none;
}

.slide {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #020617;
}

.slide-media {
    transform: scale(0.984);
    opacity: 0.92;
    transition: transform 220ms ease, opacity 220ms ease;
    will-change: transform, opacity;
}

.slide.is-active .slide-media {
    transform: scale(1);
    opacity: 1;
}

.slide.is-near .slide-media {
    transform: scale(0.99);
    opacity: 0.96;
}

.slide-media,
.slide-preview,
.slide-overlay,
.player-host,
.player-mask,
.video-fallback,
.slide-hit {
    position: absolute;
    inset: 0;
}

.slide-preview {
    z-index: 1;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: scale(1.08);
    filter: blur(18px) saturate(0.9) brightness(0.72);
    opacity: 1;
    transition: opacity 90ms linear;
    will-change: opacity;
}

.slide-preview.is-hidden {
    opacity: 0;
}

.slide-overlay {
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.14), transparent 24%),
        linear-gradient(180deg, transparent 66%, rgba(0, 0, 0, 0.34));
    transition: opacity 220ms ease;
}

.slide.is-active .slide-overlay {
    opacity: 0.86;
}

.slide.is-near .slide-overlay {
    opacity: 0.94;
}

.player-host {
    z-index: 0;
    overflow: hidden;
    background: #020617;
}

.player-host iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, calc(100vh * 0.5625));
    height: max(100%, calc(100vw * 1.7778));
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
}

.feed-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #020617;
}

.player-mask {
    pointer-events: none;
    z-index: 2;
}

.player-mask.top {
    height: 118px;
    background: linear-gradient(180deg, rgba(7, 20, 22, 0.9), transparent);
}

.player-mask.bottom {
    top: auto;
    height: 146px;
    background: linear-gradient(180deg, transparent, rgba(7, 20, 22, 0.92));
}

.video-fallback {
    display: grid;
    place-items: center;
    padding: 32px;
    text-align: center;
    line-height: 1.6;
    color: var(--muted);
    background:
        radial-gradient(circle at top, rgba(110, 231, 200, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.6));
}

.slide-hit {
    z-index: 3;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.top-bar,
.feed-progress,
.signal,
.install-hint,
.lock-layer,
.break-layer,
.offline-layer,
.parent-hint,
.center-play,
.profile-sheet {
    position: fixed;
    z-index: 5;
}

.top-bar {
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.08) 68%, transparent);
    pointer-events: none;
}

.top-bar::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    opacity: 0.7;
}

.feed-progress {
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.feed-progress.visible {
    opacity: 1;
}

.feed-progress__fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(147, 197, 253, 0.96));
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 90ms linear;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    min-height: 36px;
}

.brand img {
    width: 34px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.96;
}

.ghost-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 18, 28, 0.34);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.18);
    backdrop-filter: blur(10px);
    cursor: pointer;
    pointer-events: auto;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.ghost-pill {
    min-width: 104px;
    max-width: 180px;
    height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--panel-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.24);
}

.ghost-pill svg {
    flex: 0 0 auto;
}

.ghost-pill[hidden] {
    display: none;
}

.install-pill {
    background: rgba(255, 247, 232, 0.92);
    color: #0f172a;
}

.install-pill span {
    font-weight: 700;
}

.slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 18px 16px 24px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12) 20%, rgba(0, 0, 0, 0.3));
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
}

.slide.is-active .slide-caption {
    transform: translateY(0);
    opacity: 1;
}

.slide:not(.is-active) .slide-caption {
    transform: translateY(8px);
    opacity: 0.9;
}

.slide-title {
    margin: 0;
    font-size: clamp(1rem, 2.4vw, 1.28rem);
    line-height: 1.03;
    font-weight: 600;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.center-play {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.88);
    width: 94px;
    height: 94px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(3, 12, 14, 0.58);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    backdrop-filter: blur(10px);
}

.center-play.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.center-play svg {
    width: 34px;
    height: 34px;
    margin-left: 4px;
}

.signal {
    left: 16px;
    right: 16px;
    top: 74px;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.signal.visible {
    display: block;
    background: rgba(12, 20, 31, 0.6);
    color: rgba(248, 250, 252, 0.92);
}

.install-hint {
    left: 16px;
    right: 16px;
    top: 74px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 247, 232, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #17212b;
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.24);
    backdrop-filter: blur(10px);
}

.install-hint[hidden] {
    display: none;
}

.parent-hint {
    left: 50%;
    top: 94px;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(8, 15, 24, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(248, 250, 252, 0.78);
    font-size: 0.78rem;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 180ms ease;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.parent-hint.visible {
    opacity: 1;
}

.lock-layer {
    inset: 0;
    display: none;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(16px);
    padding: 24px;
}

.lock-layer.visible {
    display: grid;
    place-items: center;
}

.lock-card,
.break-card,
.offline-card {
    width: min(100%, 332px);
    padding: 24px 22px 22px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(20, 32, 46, 0.92), rgba(7, 14, 23, 0.94)),
        rgba(7, 14, 23, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    box-shadow: 0 28px 72px rgba(2, 6, 23, 0.38);
    color: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(16px);
}

.lock-card h2,
.break-card h2,
.offline-card h2 {
    margin: 0 0 10px;
    font-size: 1.56rem;
    line-height: 1;
}

.lock-card p,
.break-card p,
.offline-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.55;
}

.break-layer {
    inset: 0;
    display: none;
    background: rgba(2, 6, 23, 0.48);
    backdrop-filter: blur(14px);
    padding: 24px;
}

.break-layer.visible {
    display: grid;
    place-items: center;
}

.break-card {
    width: min(100%, 340px);
}

.offline-layer {
    inset: 0;
    display: none;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(18px);
    padding: 24px;
}

.offline-layer.visible {
    display: grid;
    place-items: center;
}

.offline-card {
    width: min(100%, 360px);
}

.overlay-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(191, 219, 254, 0.96);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overlay-actions {
    margin-top: 18px;
    display: grid;
    gap: 0.7rem;
}

.overlay-button,
.break-card .meta-button.primary {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.overlay-button {
    display: inline-flex;
    align-items: center;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(147, 197, 253, 0.24);
    color: rgba(239, 246, 255, 0.98);
    text-decoration: none;
}

.break-card .meta-button,
.lock-card .meta-button {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(248, 250, 252, 0.98);
    font-size: 0.92rem;
    cursor: pointer;
}

.break-card .meta-button.primary {
    display: inline-flex;
    border: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}

.profile-sheet {
    inset: 0;
    display: none;
}

.profile-sheet.visible {
    display: block;
}

.profile-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.64);
    backdrop-filter: blur(10px);
}

.profile-sheet__card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(420px, calc(100% - 32px));
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text);
    transform: translate(-50%, -50%);
}

.profile-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 0 6px;
}

.profile-sheet__head strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text);
}

.profile-sheet__list {
    display: grid;
    gap: 14px;
}

.profile-option,
.profile-empty {
    width: 100%;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 23, 42, 0.66);
    color: var(--text);
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.profile-option strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
}

.profile-option.active {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(37, 99, 235, 0.24);
}

.profile-option__main {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.profile-option__avatar {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.profile-empty {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.tone-1 {
    background: linear-gradient(135deg, #ec4899, #f97316);
}

.tone-2 {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.tone-3 {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.tone-4 {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}
