* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #0d0d0f; color: #fff; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-y: auto; }
body.player-active { overflow: hidden; }
.app { min-height: 100vh; padding-bottom: 72px; }
.hidden { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(360px, 100%); padding: 24px; background: #19191d; border-radius: 14px; box-shadow: 0 8px 30px #0006; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { margin: 0 0 20px; color: #999; font-size: 13px; }
.login-card label { display: block; margin: 12px 0 6px; color: #aaa; font-size: 12px; }
.login-card input { width: 100%; padding: 11px 12px; color: #fff; background: #111114; border: 1px solid #34343a; border-radius: 8px; outline: 0; }
.login-card input:focus { border-color: #7b64f2; }
.login-card button { width: 100%; margin-top: 18px; padding: 11px; color: #fff; background: #5b43d6; border: 0; border-radius: 8px; font-size: 14px; }
.login-card button:disabled { opacity: .55; }
.login-error { min-height: 18px; margin-top: 10px; color: #ff8a8a; font-size: 12px; text-align: center; }
.waterfall { column-count: 2; column-gap: 10px; padding: 12px 10px 20px; }
.series-card { display: inline-block; width: 100%; margin: 0 0 10px; break-inside: avoid; overflow: hidden; background: #19191d; border-radius: 10px; box-shadow: 0 2px 10px #0004; cursor: pointer; }
.series-card:active { transform: scale(.99); }
.series-cover { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #25252a; }
.series-content { padding: 10px; }
.series-title { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.series-description { margin: 0; color: #bbb; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.series-count { margin-top: 8px; color: #85858d; font-size: 11px; }
.page-nav { display: flex; justify-content: center; gap: 6px; padding: 2px 12px 28px; }
.page-button { min-width: 34px; height: 32px; color: #aaa; background: #1c1c21; border: 1px solid #33343a; border-radius: 7px; font-size: 12px; }
.page-button.active { color: #fff; background: #5b43d6; border-color: #7b64f2; }
.page-button:disabled { opacity: .45; }
.player-controls { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 5px; min-height: 82px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: rgba(13,13,15,.96); border-top: 1px solid #29292d; }
.progress-row { display: flex; align-items: center; gap: 7px; width: 100%; color: #bbb; font-size: 10px; }
.progress-row input { flex: 1; accent-color: #7258ec; height: 18px; }
.episode-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.player-back { flex: 0 0 auto; color: #fff; background: transparent; border: 0; padding: 8px 4px; font-size: 14px; }
.episode-strip { flex: 1 1 auto; display: flex; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.episode-strip::-webkit-scrollbar { display: none; }
.episode-button { flex: 0 0 auto; min-width: 44px; padding: 7px 10px; color: #aaa; background: #1c1c21; border: 1px solid #33343a; border-radius: 999px; font-size: 12px; }
.episode-button.active { color: #fff; background: #5b43d6; border-color: #7b64f2; }
.player-stage { position: relative; min-height: calc(100vh - 82px); background: #000; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.player-poster, .player-video { width: 100%; height: calc(100vh - 82px); object-fit: contain; }
.player-poster { position: absolute; inset: 0; z-index: 1; }
.player-video { position: relative; z-index: 0; background: #000; }
.player-stage.playing .player-poster { opacity: 0; }
.player-hint { position: absolute; z-index: 2; left: 14px; bottom: 18px; color: #ddd; font-size: 12px; text-shadow: 0 1px 4px #000; }
.settings-content { padding: 16px 12px 30px; }
.settings-title { margin: 0 0 14px; font-size: 20px; }
.settings-meta { color: #999; font-size: 12px; margin-bottom: 16px; }
.module-card { margin-bottom: 12px; padding: 14px; border-radius: 10px; background: #19191d; }
.module-card h2 { margin: 0 0 8px; font-size: 16px; }
.module-card p { margin: 4px 0; color: #aaa; font-size: 12px; }
.update-button { margin-top: 10px; padding: 8px 12px; color: #fff; background: #5b43d6; border: 0; border-radius: 7px; font-size: 12px; }
.update-button:disabled { opacity: .55; }
.logout-button { width: 100%; margin-top: 8px; padding: 10px; color: #fff; background: #2b2b31; border: 1px solid #45454d; border-radius: 7px; font-size: 12px; }
.empty { padding: 60px 20px; text-align: center; color: #999; }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: 60px; display: flex; background: rgba(15,15,17,.96); border-top: 1px solid #303035; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { flex: 1; color: #999; background: transparent; border: 0; font-size: 13px; }
.bottom-nav button.active { color: #fff; font-weight: 700; }
@media (min-width: 700px) { .waterfall { column-count: 3; max-width: 1100px; margin: 0 auto; } .player-stage, .player-poster, .player-video { max-width: 720px; margin: 0 auto; } }
