:root {
  --bg: #0B0E14;
  --bg-raised: #12161F;
  --gold: #E8A33D;
  --teal: #3F6C6B;
  --ink: #F2F0EA;
  --ink-dim: #9AA0AC;
  --danger: #8A2E2E;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

.marquee-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 12px rgba(232, 163, 61, 0.4);
}
.marquee-title.small { font-size: 1.6rem; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.5rem;
  border-bottom: 1px solid #1D2230;
  position: sticky;
  top: 0;
  background: rgba(11, 14, 20, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.topnav { display: flex; align-items: center; gap: 1.5rem; }
.topnav a { color: var(--ink-dim); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.topnav a:hover { color: var(--ink); }

.btn-ghost {
  background: none;
  border: 1px solid #2A3040;
  color: var(--ink-dim);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Rows / catalog ---------- */
main { padding: 2rem 2.5rem 4rem; }
.row { margin-bottom: 2.5rem; }
.row h2 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  font-size: 1.4rem;
  color: var(--ink-dim);
  margin-bottom: 1rem;
}

.card-track {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.card-track.wrap { flex-wrap: wrap; overflow: visible; }

.movie-card {
  position: relative;
  flex: 0 0 200px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid #1D2230;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.movie-card:hover { transform: translateY(-4px); }

/* Signature marquee-bulb glow on hover */
.movie-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: repeating-linear-gradient(
    90deg, var(--gold) 0 6px, transparent 6px 14px
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s ease;
  animation: marquee-chase 0.9s linear infinite;
  pointer-events: none;
}
.movie-card:hover::after { opacity: 1; }
@keyframes marquee-chase {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .movie-card::after { animation: none; }
}

.movie-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #1A1F2B;
}
.movie-card .no-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  padding: 1rem;
  text-align: center;
}
.movie-card .card-label {
  padding: 0.6rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.movie-card .card-meta {
  padding: 0 0.7rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.progress-bar {
  height: 3px;
  background: #2A3040;
}
.progress-bar > div { height: 100%; background: var(--gold); }

.empty-state { color: var(--ink-dim); }

/* ---------- Player modal ---------- */
.player-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.player-modal.hidden, .hidden { display: none !important; }

.player-shell {
  width: min(90vw, 1100px);
  background: var(--bg-raised);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.player-shell video { width: 100%; display: block; background: #000; max-height: 70vh; }
.player-info { padding: 1.2rem 1.5rem; }
.player-info h3 { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em; font-size: 1.6rem; color: var(--gold); margin: 0 0 0.4rem; }
.player-info p { color: var(--ink-dim); margin: 0; line-height: 1.5; }

.close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 2rem;
  cursor: pointer;
  z-index: 5;
  line-height: 1;
}

/* ---------- Auth pages ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--bg-raised);
  border: 1px solid #1D2230;
  border-radius: 10px;
  padding: 2.5rem;
  width: min(90vw, 380px);
  text-align: center;
}
.tabs { display: flex; margin: 1.5rem 0; border-bottom: 1px solid #1D2230; }
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink-dim);
  padding: 0.6rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.auth-form label, .admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
}
input, textarea, select {
  background: #171B26;
  border: 1px solid #2A3040;
  color: var(--ink);
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.btn-primary {
  background: var(--gold);
  color: #14100A;
  border: none;
  padding: 0.7rem;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn-primary:hover { filter: brightness(1.08); }

.form-error { color: #E27272; font-size: 0.85rem; min-height: 1.1em; }
.form-success { color: var(--teal); font-size: 0.85rem; }

/* ---------- Admin ---------- */
.admin-main { max-width: 700px; margin: 0 auto; }
.admin-main h2 { font-family: 'Bebas Neue', sans-serif; color: var(--gold); letter-spacing: 0.05em; }
.hint { color: var(--ink-dim); font-size: 0.9rem; line-height: 1.5; }
.hint code { background: #171B26; padding: 0.1rem 0.35rem; border-radius: 4px; }
.admin-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; }
.form-row { display: flex; gap: 1rem; }
.form-row label { flex: 1; }

.admin-catalog { display: flex; flex-direction: column; gap: 0.6rem; }
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid #1D2230;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}
.admin-row .remove-btn {
  background: none;
  border: 1px solid var(--danger);
  color: #E27272;
  border-radius: var(--radius);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.admin-row .remove-btn:hover { background: var(--danger); color: white; }

@media (max-width: 640px) {
  .topbar, main { padding-left: 1.2rem; padding-right: 1.2rem; }
  .movie-card { flex-basis: 140px; }
}
