* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0B0B12;
  color: #F2F2F5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

/* --- Auth --- */
#auth-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.logo { font-size: 2.2rem; margin: 0; letter-spacing: -0.02em; }
.tagline { color: #9A9AAE; max-width: 300px; }
#auth-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
#auth-form input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2A2A38;
  background: #16161F;
  color: #F2F2F5;
  font-size: 1rem;
}
#auth-form button {
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: #E50914;
  color: white;
  font-size: 1rem;
  font-weight: 600;
}
.msg { color: #9A9AAE; min-height: 1.2em; }

/* --- App shell --- */
#app-view, #settings-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.logo-small { font-weight: 700; flex: 1; }
.topbar button, .topbar select {
  background: #16161F;
  color: #F2F2F5;
  border: 1px solid #2A2A38;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* --- Card stack --- */
.card-stack {
  flex: 1;
  position: relative;
  min-height: 0;
}
.card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #16161F;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  user-select: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.card.dragging { transition: none; }
.card.fly-left { transform: translateX(-160%) rotate(-24deg) !important; opacity: 0; }
.card.fly-right { transform: translateX(160%) rotate(24deg) !important; opacity: 0; }

.stamp {
  position: absolute;
  top: 24px;
  padding: 6px 14px;
  border: 3px solid;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
}
.stamp-pass { left: 20px; color: #E50914; border-color: #E50914; transform: rotate(-14deg); }
.stamp-watch { right: 20px; color: #2F6BFF; border-color: #2F6BFF; transform: rotate(14deg); }
.card img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  min-height: 0;
  background: #222;
}
.card .info {
  padding: 14px 16px 18px;
  background: linear-gradient(to top, #0B0B12 60%, transparent);
  margin-top: -80px;
  position: relative;
}
.card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: #C4C4D2; font-size: 0.85rem; line-height: 1.4; max-height: 4.2em; overflow: hidden; }
.card .badge {
  display: inline-block;
  font-size: 0.7rem;
  color: #9A9AAE;
  border: 1px solid #2A2A38;
  border-radius: 6px;
  padding: 2px 6px;
  margin-bottom: 6px;
}

.empty-state { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #9A9AAE; }
.empty-sub { font-size: 0.85rem; }

.actions { display: flex; gap: 12px; padding: 14px 0; }
.actions button {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
}
.btn-dismiss { background: #23232F; color: #F2F2F5; }
.btn-watched { background: #2F6BFF; color: white; }

/* --- Settings --- */
.settings-body { overflow-y: auto; padding-bottom: 24px; }
.settings-body h2 { font-size: 0.95rem; color: #9A9AAE; margin: 18px 0 8px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #2A2A38;
  background: #16161F;
  color: #C4C4D2;
  font-size: 0.85rem;
}
.chip.active { background: #E50914; border-color: #E50914; color: white; }

/* Servicios donde esta disponible el titulo (un titulo puede estar en varios) */
.providers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.provider-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.provider-netflix       { background: rgba(229, 9, 20, 0.85);  border-color: rgba(229, 9, 20, 0.9); }
.provider-max           { background: rgba(0, 44, 255, 0.75);  border-color: rgba(64, 96, 255, 0.9); }
.provider-disney_plus   { background: rgba(17, 60, 207, 0.8);  border-color: rgba(60, 100, 240, 0.9); }
.provider-apple_tv_plus { background: rgba(28, 28, 30, 0.9);   border-color: rgba(255, 255, 255, 0.35); }
.provider-prime_video   { background: rgba(0, 168, 225, 0.8);  border-color: rgba(0, 168, 225, 0.9); }
