:root {
  --bg-0: #07050f;
  --bg-1: #120a24;
  --bg-2: #1a1038;
  --card: rgba(24, 16, 48, 0.72);
  --card-border: rgba(167, 139, 250, 0.22);
  --text: #f8f4ff;
  --muted: #b7a8d9;
  --purple: #8b5cf6;
  --purple-deep: #6d28d9;
  --blue: #38bdf8;
  --pink: #f472b6;
  --pink-deep: #ec4899;
  --success: #34d399;
  --danger: #fb7185;
  --shadow: 0 18px 50px rgba(76, 29, 149, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, #0b1730);
  color: var(--text);
  font-family: Inter, Segoe UI, Roboto, sans-serif;
  overflow-x: hidden;
}

body {
  position: relative;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  width: 220px;
  height: 220px;
  background: var(--purple-deep);
  top: -40px;
  left: -30px;
  animation: float 8s ease-in-out infinite;
}

.bg-glow-2 {
  width: 260px;
  height: 260px;
  background: #1d4ed8;
  right: -60px;
  top: 120px;
  animation: float 10s ease-in-out infinite reverse;
}

.bg-glow-3 {
  width: 200px;
  height: 200px;
  background: var(--pink-deep);
  bottom: 40px;
  left: 20%;
  animation: float 12s ease-in-out infinite;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px 28px;
}

.topbar {
  margin-bottom: 16px;
}

.topbar-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  column-gap: 10px;
  margin-bottom: 8px;
}

.topbar-row .eyebrow {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  padding-right: 0;
}

.icon-btn {
  justify-self: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn.is-ghost {
  visibility: hidden;
  pointer-events: none;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}

.icon-btn:hover,
.action-card:hover,
.list-card:hover,
.primary-btn:hover {
  transform: translateY(-2px);
}

.icon-btn:active,
.action-card:active,
.list-card:active,
.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

.screens {
  position: relative;
  min-height: calc(100vh - 90px);
}

.screen {
  display: none;
  animation: fadeOut 0.2s ease;
}

.screen.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

.hero-card,
.admin-card,
.selected-cinema {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.35), rgba(56, 189, 248, 0.12), rgba(236, 72, 153, 0.18));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.hero-card h2,
.admin-card h3,
.selected-cinema h3 {
  margin: 0 0 10px;
}

.hero-card p,
.admin-card p,
.selected-cinema p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.meta-line {
  margin-top: 12px !important;
  font-size: 0.82rem;
  color: #9ad8ff !important;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.18);
  border: 1px solid rgba(244, 114, 182, 0.35);
  color: #ffd7ec;
  font-size: 0.82rem;
}

.action-grid {
  display: grid;
  gap: 12px;
}

.action-card,
.list-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(14px);
  color: var(--text);
  border-radius: 20px;
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: 0 10px 30px rgba(15, 8, 35, 0.35);
}

.action-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 12px;
  align-items: center;
}

.action-icon {
  grid-row: span 2;
  font-size: 1.5rem;
}

.action-title {
  font-weight: 700;
}

.action-sub,
.list-sub {
  color: var(--muted);
  font-size: 0.88rem;
}

.search-box input,
.admin-form input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(8, 6, 20, 0.65);
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus,
.admin-form input:focus {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.search-box {
  margin-bottom: 14px;
}

.custom-watch {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-chip.active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.16);
}

.custom-watch label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.custom-watch-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.custom-watch-row input {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.custom-watch-row .primary-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.card-list {
  display: grid;
  gap: 12px;
}

.list-card {
  position: relative;
  overflow: hidden;
}

.list-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--blue));
  opacity: 0.9;
}

.list-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.list-card.danger {
  border-color: rgba(251, 113, 133, 0.35);
}

.primary-btn,
.danger-btn,
.ghost-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.35);
}

.danger-btn {
  background: rgba(251, 113, 133, 0.16);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(7, 5, 15, 0.92);
  backdrop-filter: blur(10px);
}

.access-gate-card {
  width: min(100%, 420px);
  padding: 28px 22px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background:
    radial-gradient(circle at 20% 10%, rgba(251, 113, 133, 0.18), transparent 55%),
    rgba(24, 16, 48, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.access-gate-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.access-gate-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.access-gate-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.access-gate-card .primary-btn {
  width: 100%;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--pink);
  animation: spin 0.9s linear infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 10, 34, 0.92);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 30;
  max-width: calc(100% - 32px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pager-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.pager-row .ghost-btn {
  justify-self: start;
}

.pager-row .primary-btn {
  justify-self: end;
}

.pager-info {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.status-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.status-waiting {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.status-on_sale {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.status-announced {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
}

.modal-card {
  width: min(100%, 360px);
  background: #151028;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 8px;
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

.slide-up {
  animation: slideUp 0.55s ease both;
}

.delay-1 {
  animation-delay: 0.08s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.source-badge {
  margin: 10px 0 2px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.source-badge.is-loading {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.45);
  animation: pulse-soft 1.6s ease-in-out infinite;
}

.source-badge.is-live {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

.source-badge.is-cache {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.movies-live-loader {
  margin-top: 18px;
  padding: 28px 18px 24px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  background:
    radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.22), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.16), transparent 50%),
    rgba(24, 16, 48, 0.72);
  text-align: center;
  box-shadow: var(--shadow);
}

.radar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
}

.radar-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.35);
  animation: radar-pulse 2.2s ease-out infinite;
}

.radar-ring.delay {
  inset: 0;
  animation-delay: 0.7s;
  border-color: rgba(56, 189, 248, 0.28);
}

.radar-core {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.45);
}

.radar-sweep {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(139, 92, 246, 0.55) 50deg, transparent 70deg);
  animation: spin 1.4s linear infinite;
  mask-image: radial-gradient(circle, transparent 42%, #000 43%);
}

.movies-live-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.movies-live-sub {
  color: var(--muted);
  font-size: 13px;
  min-height: 1.4em;
  margin-bottom: 16px;
  transition: opacity 0.25s ease;
}

.movies-live-bar {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.movies-live-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--pink), var(--purple));
  animation: bar-slide 1.5s ease-in-out infinite;
}

.movies-live-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.movies-live-actions .primary-btn,
.movies-live-actions .ghost-btn {
  width: 100%;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

@keyframes radar-pulse {
  0% { transform: scale(0.82); opacity: 0.9; }
  100% { transform: scale(1.18); opacity: 0; }
}

@keyframes bar-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@media (max-width: 420px) {
  .admin-form {
    grid-template-columns: 1fr;
  }
}
