/* CineRust — Lightweight Dark Cinema UI
   Android 7-10 & Low-Heat optimized:
   - Zero backdrop-filter blur (solid dark surfaces + crisp 1px borders)
   - Zero infinite animations / GPU loops
   - Zero :has() selectors; pure flexbox & CSS grid */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: #0b0b10;
  color: #f4f4f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: #0b0b10;
  color: #f4f4f8;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #f87171;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

button:focus, input:focus, select:focus, a:focus {
  outline: 2px solid #e50914;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: #0e0e15;
  border-bottom: 1px solid #242434;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background-color: #181824;
  border: 1px solid #e50914;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  width: 24px;
  height: 24px;
  display: block;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.brand-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background-color: #261317;
  color: #ff6b72;
  border: 1px solid #591c22;
  border-radius: 4px;
  vertical-align: middle;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  position: relative;
  flex: 1 1 240px;
  max-width: 420px;
  min-width: 0;
}

.search-input {
  width: 100%;
  background-color: #161621;
  border: 1px solid #2b2b3d;
  border-radius: 999px;
  padding: 9px 36px 9px 14px;
  font-size: 0.9rem;
  color: #f4f4f8;
}

.search-input::placeholder {
  color: #84869e;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background-color: #29293a;
  color: #e2e4f0;
  font-size: 0.85rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.search-clear.visible {
  display: flex;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: #e50914;
  color: #ffffff;
  border-color: #e50914;
}

.btn-primary:hover {
  background-color: #c80711;
}

.btn-secondary {
  background-color: #1b1b28;
  color: #f4f4f8;
  border-color: #323247;
}

.btn-secondary:hover {
  background-color: #252536;
}

.btn-ghost {
  background-color: #14141e;
  color: #d0d2e2;
  border-color: #29293b;
}

.btn-ghost:hover {
  background-color: #1e1e2c;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

/* Main container */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* Hero Banner */
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #282839;
  background-color: #13131c;
  margin-bottom: 22px;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.hero-scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(11,11,16,0.94) 0%, rgba(11,11,16,0.72) 52%, rgba(11,11,16,0.28) 100%),
              linear-gradient(0deg, rgba(11,11,16,0.95) 0%, rgba(11,11,16,0.15) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 28px 24px 24px;
  max-width: 620px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-free {
  background-color: #102a1d;
  color: #4ade80;
  border: 1px solid #1e5638;
}

.badge-rust {
  background-color: #2a1811;
  color: #fb923c;
  border: 1px solid #5e311e;
}

.badge-pd {
  background-color: #1c2238;
  color: #93c5fd;
  border: 1px solid #303d66;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 2.15rem;
  line-height: 1.1;
  font-weight: 800;
  color: #ffffff;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #c7c9da;
  margin-bottom: 10px;
}

.star {
  color: #f5c518;
  font-weight: 700;
}

.hero-desc {
  margin: 0 0 18px;
  font-size: 0.94rem;
  color: #d4d6e6;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Status strip */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: #13131d;
  border: 1px solid #242435;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: #b7b9cc;
}

.trust-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trust-item strong {
  color: #ffffff;
}

/* Genre Pills */
.genre-nav {
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.genre-list {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pill {
  background-color: #151520;
  color: #c9cbe0;
  border: 1px solid #2a2a3c;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pill:hover {
  background-color: #1f1f2f;
  color: #ffffff;
}

.pill.active {
  background-color: #e50914;
  border-color: #e50914;
  color: #ffffff;
}

/* Section Headers */
.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.section-count {
  font-size: 0.82rem;
  color: #9395ab;
}

/* Continue Watching Rail */
.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.continue-card {
  background-color: #14141e;
  border: 1px solid #28283a;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.continue-card:hover {
  border-color: #e50914;
  background-color: #191926;
}

.continue-thumb {
  width: 56px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #1e1e2b;
}

.continue-info {
  min-width: 0;
  flex: 1;
}

.continue-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-sub {
  font-size: 0.76rem;
  color: #a4a6bc;
  margin: 3px 0 7px;
}

.progress-track {
  height: 4px;
  background-color: #272738;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #e50914;
}

/* Movie Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.movie-card {
  background-color: #14141d;
  border: 1px solid #262637;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  border-color: #4a4a68;
}

.poster-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background-color: #1a1a26;
  cursor: pointer;
  aspect-ratio: 9 / 13;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-custom-art {
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #241422 0%, #141422 65%, #0d0d14 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: #f4f4f8;
}

.poster-badge-top {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background-color: #0e0e16;
  color: #4ade80;
  border: 1px solid #22543d;
}

.poster-badge-top.pd {
  color: #93c5fd;
  border-color: #2b3f6b;
}

.poster-badge-top.custom {
  color: #fbbf24;
  border-color: #6b4e16;
}

.poster-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  background-color: #0d0d14;
  color: #e6e7f2;
  border: 1px solid #2b2b3d;
}

.card-body {
  padding: 10px 11px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.card-meta {
  font-size: 0.76rem;
  color: #9b9db4;
  margin-bottom: 10px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 6px;
}

.card-actions .btn-play-sm {
  flex: 1;
}

.empty-state {
  background-color: #14141e;
  border: 1px solid #262637;
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  color: #a9abc2;
}

/* Footer & Rust Architecture Badge */
.site-footer {
  border-top: 1px solid #232334;
  background-color: #0e0e16;
  padding: 22px 16px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.82rem;
  color: #9698b0;
}

.arch-trigger {
  background-color: #171724;
  border: 1px solid #35354c;
  color: #f4f4f8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.arch-trigger:hover {
  border-color: #fb923c;
  color: #ffffff;
}

/* Modals & Drawers (solid dark surfaces, zero blur) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 5, 10, 0.88);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 820px;
  background-color: #13131d;
  border: 1px solid #2f2f44;
  border-radius: 14px;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.modal-panel.narrow {
  max-width: 540px;
}

.modal-header {
  padding: 14px 16px;
  background-color: #171724;
  border-bottom: 1px solid #28283b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-close {
  background-color: #242435;
  border: 1px solid #383850;
  color: #ffffff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.video-stage {
  background-color: #050508;
  border: 1px solid #262637;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.video-stage video {
  width: 100%;
  max-height: 430px;
  display: block;
  background-color: #000000;
}

.player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background-color: #161622;
  border: 1px solid #262637;
  border-radius: 10px;
  margin-bottom: 14px;
}

.speed-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.speed-label {
  font-size: 0.78rem;
  color: #a4a6bc;
  margin-right: 4px;
}

.speed-btn {
  background-color: #1e1e2d;
  border: 1px solid #313147;
  color: #d7d9ea;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.speed-btn.active {
  background-color: #e50914;
  border-color: #e50914;
  color: #ffffff;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: #b7b9ce;
  margin-bottom: 10px;
}

.detail-synopsis {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: #dcdeec;
}

.detail-note {
  font-size: 0.78rem;
  color: #9395ab;
  background-color: #171723;
  border: 1px solid #252536;
  border-radius: 8px;
  padding: 9px 11px;
}

/* Forms inside Add Video modal */
.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d2d4e6;
  margin-bottom: 5px;
}

.field input, .field select {
  width: 100%;
  background-color: #191926;
  border: 1px solid #323248;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.9rem;
  color: #ffffff;
}

.form-error {
  color: #fca5a5;
  font-size: 0.8rem;
  margin: 6px 0 10px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* Architecture Spec Grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.spec-box {
  background-color: #171724;
  border: 1px solid #2a2a3e;
  border-radius: 10px;
  padding: 11px;
}

.spec-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9395ad;
  margin-bottom: 4px;
}

.spec-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.arch-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #d0d2e2;
  font-size: 0.86rem;
}

.arch-list li {
  margin-bottom: 6px;
}

/* Mobile 390px adjustments */
@media (max-width: 600px) {
  .topbar-inner {
    padding: 10px 12px;
  }
  .search-wrap {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
  .hero {
    min-height: 290px;
  }
  .hero-content {
    padding: 20px 16px 18px;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .hero-desc {
    font-size: 0.86rem;
  }
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card-title {
    font-size: 0.84rem;
  }
  .card-meta {
    font-size: 0.72rem;
  }
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

#openArchTopBtn,#openArchStripBtn,#openArchFooterBtn,.badge-rust,#archModal{display:none!important}

/* v1.1 style: dark gold + red, bottom tabs */
html,body{background-color:#050505}
.brand-name{color:#f5c542}
.section-title{color:#f5c542}
.btn-primary{background:linear-gradient(135deg,#e11d2e,#a30f1c);border-color:#f5c542}
.hero-title{color:#f5c542}
body{padding-bottom:72px}
.btabs{position:fixed;left:0;right:0;bottom:0;z-index:50;display:flex;background:#0a0a0a;border-top:1px solid #3a2f12;padding-bottom:env(safe-area-inset-bottom)}
.btabs button{flex:1;background:none;border:0;color:#9a9a9a;font-size:11px;padding:9px 2px 8px;cursor:pointer}
.btabs button b{display:block;font-size:19px;line-height:1.1;font-weight:400}
.btabs button.on,.btabs button:active{color:#f5c542}

.search-wrap{position:relative}
.voice-btn{position:absolute;right:36px;top:50%;transform:translateY(-50%);background:none;border:0;font-size:18px;cursor:pointer;color:#f5c518;padding:4px 6px}
.voice-btn.listening{color:#ff3b3b;animation:vp 1s infinite}
@keyframes vp{50%{opacity:.4}}
.search-input{padding-right:70px}
