* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b2654, #050509 55%);
  color: #f5f5f5;
  min-height: 100vh;
}

a {
  color: #7fb8ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo {
  width: 160px;
  filter: invert(1);
}

.title-group h1 {
  margin: 0;
  font-size: 1.9rem;
}

.title-group p {
  margin: 4px 0 0;
  color: #c2c7d3;
  font-size: 0.95rem;
}

.card {
  background: rgba(10, 12, 28, 0.9);
  border-radius: 16px;
  padding: 20px 20px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(146, 168, 255, 0.28);
  backdrop-filter: blur(16px);
}

.card + .card {
  margin-top: 20px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8ba0ff;
  margin-bottom: 8px;
}

.code-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input {
  flex: 1;
  min-width: 160px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(180, 196, 255, 0.7);
  background: rgba(8, 10, 30, 0.95);
  color: #f5f5f5;
  font-size: 1rem;
  outline: none;
}

.input::placeholder {
  color: #8089a6;
}

.input:focus {
  border-color: #9fc1ff;
  box-shadow: 0 0 0 1px rgba(152, 188, 255, 0.55);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  white-space: nowrap;
}

.btn span {
  pointer-events: none;
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4d8dff, #9e6bff);
  color: white;
  box-shadow: 0 10px 25px rgba(62, 123, 255, 0.55);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(62, 123, 255, 0.75);
}

.btn-secondary {
  background: rgba(22, 26, 60, 0.95);
  color: #d8e1ff;
  border: 1px solid rgba(143, 160, 255, 0.48);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(36, 43, 94, 0.95);
}

.btn-ghost {
  background: transparent;
  color: #c9d3ff;
  border: 1px solid rgba(146, 168, 255, 0.4);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(21, 26, 66, 0.9);
}

/* Shimmer loading for redeem */

.btn-loading {
  position: relative;
  background: linear-gradient(120deg, #3a6bff, #9b6bff, #3a6bff);
  background-size: 220% 100%;
  animation: shimmer 1s linear infinite;
  box-shadow: 0 8px 22px rgba(62, 123, 255, 0.6);
}

@keyframes shimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: -220% 0%;
  }
}

.hero-footer {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #9ba3c2;
}

.hero-footer span {
  color: #f8f8ff;
  font-weight: 600;
}

.subtle-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(160, 177, 255, 0.55), transparent);
  margin: 24px 0 12px;
}

/* QR modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(30, 51, 112, 0.96), rgba(2, 4, 14, 0.98));
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

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

.modal-panel {
  width: min(420px, 92vw);
  background: rgba(5, 7, 20, 0.97);
  border-radius: 18px;
  padding: 20px 20px 22px;
  border: 1px solid rgba(153, 182, 255, 0.65);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-subtitle {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #9ba3c2;
}

.modal-close {
  border: none;
  background: transparent;
  color: #c7cbe4;
  font-size: 1.3rem;
  cursor: pointer;
}

.qr-preview-shell {
  border-radius: 14px;
  background: radial-gradient(circle at top, #242f5e, #050615 60%);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.qr-video {
  width: 100%;
  border-radius: 10px;
  background: black;
}

/* Toast */

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 22px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 70;
}

.toast-inner {
  min-width: 260px;
  max-width: 360px;
  background: rgba(32, 9, 16, 0.97);
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffd1da;
  font-size: 0.9rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 116, 140, 0.78);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast-inner.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-message {
  flex: 1;
}

.toast-close {
  border: none;
  background: transparent;
  color: #ffd6dd;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Unlock splash */

.unlock-splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #ffffff, #ffffff 8%, #2b91ff 35%, #030616 80%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  overflow: hidden;
}

.unlock-splash.active {
  display: flex;
  animation: splashFade 1.9s ease forwards;
}

@keyframes splashFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.unlock-splash-inner {
  text-align: center;
  color: #050617;
}

.unlock-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid rgba(10, 36, 110, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 20px 55px rgba(1, 11, 35, 0.9);
  background: radial-gradient(circle at top, #f7fbff, #c8ddff);
}

.unlock-badge {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at top, #4f8bff, #7f5cff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.65rem;
  animation: popIn 0.7s cubic-bezier(0.18, 0.89, 0.3, 1.45);
}

.unlock-badge span {
  font-size: 1.6rem;
  margin-top: 4px;
}

@keyframes popIn {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.unlock-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.unlock-subtitle {
  font-size: 0.95rem;
  color: #16234d;
}

/* Library */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.movie-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at top, #262b55, #050716 60%);
  border: 1px solid rgba(140, 162, 255, 0.7);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.movie-thumb-wrap {
  position: relative;
  overflow: hidden;
}

.movie-thumb {
  width: 100%;
  display: block;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(53, 224, 146, 0.95);
  color: #021208;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge span {
  font-size: 0.9rem;
}

.movie-body {
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.movie-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.movie-meta {
  font-size: 0.82rem;
  color: #b8c1ff;
}

.movie-desc {
  font-size: 0.86rem;
  color: #d3d7f5;
}

.movie-video {
  width: 100%;
  border: none;
  border-radius: 0 0 13px 13px;
  margin-top: 6px;
  background: black;
}

.empty-state {
  padding: 40px 22px 32px;
  text-align: center;
  color: #b6bedd;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 18px;
  font-size: 0.94rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(39, 45, 96, 0.96);
  border: 1px solid rgba(157, 175, 255, 0.7);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d8e0ff;
}

.footer {
  margin-top: 30px;
  padding-top: 14px;
  border-top: 1px solid rgba(109, 128, 192, 0.4);
  font-size: 0.8rem;
  color: #9ea6c8;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer a {
  color: #c7d5ff;
}

/* Mobile tweaks */

@media (max-width: 768px) {
  .page-shell {
    padding: 22px 14px 40px;
  }

  .header {
    flex-direction: column;
    text-align: center;
  }

  .logo {
    width: 200px;
    margin-bottom: 10px;
  }

  .title-group {
    text-align: center;
  }

  .code-input-row {
    flex-direction: column;
  }

  .input {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}