@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #fbf8ff;
  --paper: #fffdfb;
  --ink: #141217;
  --text: #201d27;
  --muted: #777180;
  --purple: #7c6cf2;
  --purple-dark: #5e50d8;
  --line: rgba(20, 18, 23, 0.14);
  --shadow-soft: 0 22px 70px rgba(124, 108, 242, 0.15);
  --shadow-card: 0 18px 42px rgba(31, 24, 55, 0.12);
  --radius-xl: 34px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html { min-height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: Inter, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(194, 181, 255, 0.55), transparent 22%),
    radial-gradient(circle at 78% 16%, rgba(248, 221, 234, 0.72), transparent 25%),
    radial-gradient(circle at 46% 82%, rgba(124, 108, 242, 0.22), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

body.modal-open { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(rgba(124, 108, 242, 0.55) 1px, transparent 1px),
    radial-gradient(rgba(248, 181, 218, 0.55) 1px, transparent 1px);
  background-size: 58px 58px, 86px 86px;
  background-position: 0 0, 24px 26px;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.page {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 34px 0 136px;
}

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 34px 26px;
  background:
    radial-gradient(circle at 20% 12%, rgba(237, 232, 255, 0.95), transparent 26%),
    radial-gradient(circle at 82% 20%, rgba(248, 221, 234, 0.78), transparent 24%),
    rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(20, 18, 23, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 26px;
}

.brand-logo {
  width: min(560px, 86vw);
  height: auto;
  display: block;
}

.hero-strip {
  width: min(620px, 86%);
  height: 70px;
  margin: 22px auto 0;
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-top: 7px solid var(--ink);
  border-bottom: 7px solid var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

.hero-strip span {
  flex: 1;
  border: 2.5px solid var(--ink);
  background:
    radial-gradient(circle at 18% 25%, rgba(124, 108, 242, 0.22), transparent 36%),
    radial-gradient(circle at 78% 72%, rgba(248, 221, 234, 0.56), transparent 38%),
    linear-gradient(145deg, #ffffff, #f7f2ff);
}

.view-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 8px;
}

.view-tab, .tab, .genre {
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-weight: 700;
  transition: 0.22s ease;
}

.view-tab.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.controls { margin: 18px 0 20px; }

.tabs, .genres {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar, .genres::-webkit-scrollbar, .film-strip::-webkit-scrollbar { display: none; }

.tab, .genre {
  white-space: nowrap;
  font-size: 13px;
  padding: 11px 17px;
}

.tab.active, .genre.active {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 10px 24px rgba(124, 108, 242, 0.25);
}

.section-title { margin: 30px 0 16px; }

.section-title h2 {
  margin: 0;
  font-family: Caveat, cursive;
  font-size: 48px;
  color: var(--ink);
}

.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.film-strip {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  padding: 20px 6px 54px;
  background: transparent;
  scroll-snap-type: x mandatory;
}

.frame {
  flex: 0 0 230px;
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  padding: 0;
  background: transparent;
  border: 0;
  scroll-snap-align: start;
}

.frame-inner {
  position: relative;
  width: 230px;
  height: 560px;
  padding: 18px;
  padding-bottom: 82px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  transition: 0.25s ease;
}

.frame:hover .frame-inner { transform: translateY(-7px); }

.poster {
  width: 194px;
  height: 300px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 13px solid var(--ink);
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 108, 242, 0.45), transparent 34%),
    radial-gradient(circle at 80% 70%, rgba(248, 221, 234, 0.82), transparent 38%),
    linear-gradient(145deg, #fff, #eee8ff);
}

.poster:not(img) {
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--purple);
  font-family: Caveat, cursive;
  font-size: 32px;
}

.frame-inner::before, .frame-inner::after {
  content: "";
  position: absolute;
  top: 31px;
  width: 13px;
  height: 300px;
  z-index: 2;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0 12px,
    transparent 12px 24px
  );
  border-radius: 6px;
}

.frame-inner::before { left: 31px; }
.frame-inner::after { right: 31px; }

.meta { padding: 18px 2px 0; }

.meta h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.18;
  color: var(--text);
  min-height: 42px;
}

.meta p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: #d8ccff;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
}

.frame button {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  width: calc(100% - 36px);
  padding: 13px;
  border: 1.5px solid rgba(124, 108, 242, 0.55);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--purple-dark);
  font-weight: 800;
  cursor: pointer;
}

.floating-add {
  position: fixed;
  left: 50%;
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 34px));
  transform: translateX(-50%);
  z-index: 20;
  width: min(320px, 88vw);
  height: 56px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-pill);
  border: 0;
  background: var(--purple);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(124, 108, 242, 0.35);
}

.floating-add span {
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}

.floating-add:active {
  transform: translateX(-50%) scale(0.98);
}

.empty {
  width: 100%;
  padding: 42px;
  text-align: center;
  color: var(--muted);
  font-family: Caveat, cursive;
  font-size: 38px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 18, 23, 0.38);
  backdrop-filter: blur(8px);
}

.modal.hidden, .hidden { display: none !important; }

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(237, 232, 255, 0.85), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(248, 221, 234, 0.68), transparent 32%),
    var(--paper);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
}

.close, .delete-icon {
  position: absolute;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.close {
  right: 18px;
  font-size: 30px;
  line-height: 1;
}

.delete-icon {
  right: 62px;
  display: grid;
  place-items: center;
  color: #b42318;
}

.delete-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.delete-icon:hover {
  background: rgba(180, 35, 24, 0.1);
}

.modal-card h2 {
  margin: 0 0 18px;
  padding-right: 86px;
  font-family: Caveat, cursive;
  font-size: 48px;
  line-height: 1;
}

.image-picker {
  display: block;
  margin-bottom: 18px;
  cursor: pointer;
}

.image-picker input { display: none; }

.image-preview {
  height: 210px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 18%, rgba(124, 108, 242, 0.35), transparent 34%),
    radial-gradient(circle at 80% 70%, rgba(248, 221, 234, 0.75), transparent 38%),
    linear-gradient(145deg, #ffffff, #eee8ff);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  border: 1.5px dashed rgba(20, 18, 23, 0.18);
  color: var(--purple);
}

.image-preview strong { font-size: 42px; }
.image-preview small { margin-top: -58px; font-weight: 800; }

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 18, 23, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  outline: none;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.save {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  color: #ffffff;
  background: var(--purple);
  font-weight: 800;
}

.frame.watching-out { animation: watched 0.58s ease forwards; }

@keyframes watched {
  to {
    opacity: 0;
    transform: translateY(-42px) rotate(-7deg) scale(0.86);
  }
}

@media (max-width: 760px) {
  .page {
    width: min(94vw, 520px);
    padding: 22px 0 136px;
  }

  .hero {
    padding: 30px 18px 28px;
    border-radius: 28px;
  }

  .brand-logo {
    width: min(460px, 88vw);
  }

  .hero-strip {
    width: 92%;
    height: 62px;
    padding: 9px 12px;
    gap: 8px;
    border-top-width: 6px;
    border-bottom-width: 6px;
  }

  .view-tab {
    flex: 1;
    max-width: 180px;
  }

  .section-title h2 {
    font-size: 44px;
  }

  .film-strip {
    gap: 22px;
    padding-bottom: 110px;
  }

  .frame, .frame-inner {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
  }

  .poster {
    width: 194px;
    height: 300px;
  }

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