:root {
  --red: #d81d2a;
  --red-dark: #960f18;
  --red-soft: #ffe9eb;
  --ink: #151114;
  --ink-soft: #5c5257;
  --line: #e8e2e3;
  --paper: #ffffff;
  --paper-2: #faf7f7;
  --shadow: 0 14px 34px rgba(21, 17, 20, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo-text {
  font-family: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.02em;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 74px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.logo-text em {
  color: var(--red);
  font-style: normal;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin-left: auto;
}

.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  background: var(--paper-2);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.search-wrap input:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(216, 29, 42, 0.1);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-size: 20px;
  pointer-events: none;
}

.suggestions {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f4eff0;
}

.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion.active { background: var(--red-soft); }
.suggestion .sug-year { color: var(--ink-soft); font-size: 12px; margin-left: auto; }
.suggestion mark { background: transparent; color: var(--red); font-weight: 700; }

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-label {
  font-size: 13px;
  color: var(--ink-soft);
}

.user-box input {
  width: 132px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.user-box input:focus { border-color: var(--red); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 36px;
  align-items: center;
  padding: 54px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.95;
  text-transform: uppercase;
}

.hero h1 span { color: var(--red); }

.hero-sub {
  margin: 0 0 24px;
  max-width: 480px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 22px rgba(216, 29, 42, 0.28);
}

.btn-primary:hover { background: var(--red-dark); }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover { border-color: var(--red); color: var(--red); }

.btn-mini {
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 999px;
}

.stats {
  display: flex;
  gap: 26px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat b {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--red);
}

.stat span { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }

.hero-art {
  position: relative;
  height: 280px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 70% 30%, rgba(216, 29, 42, 0.2), transparent 60%),
    linear-gradient(140deg, #1a1216, #3a1119 60%, #7c1119);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.blood-drop {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 35% 30%, #ff3b47, var(--red-dark));
  border-radius: 50% 50% 50% 8%;
  transform: rotate(45deg);
  box-shadow: 0 0 60px rgba(255, 59, 71, 0.55);
  animation: pulse 3.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.08); }
}

.hero-frame {
  position: absolute;
  bottom: 18px;
  right: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border-radius: 6px;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 10px;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.tab {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s;
}

.tab:hover { color: var(--red); border-color: #f3c3c7; }

.tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 8px 18px rgba(216, 29, 42, 0.24);
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.sort-wrap select {
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  padding: 0 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-info {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.search-info b { color: var(--red); }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 26px 0 60px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #f0c9cc;
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.08) 55%);
}

.poster-title {
  position: relative;
  z-index: 2;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 24px;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.poster-year {
  position: relative;
  z-index: 2;
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
}

.badge.seen { background: var(--red); color: #fff; }

.rating-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.grad-red { background: linear-gradient(160deg, #7c1119, #d81d2a 55%, #2a0a0e); }
.grad-dark { background: linear-gradient(160deg, #1a1216, #3a2a33 55%, #120a10); }
.grad-orange { background: linear-gradient(160deg, #4a1206, #e0661c 60%, #200704); }
.grad-blue { background: linear-gradient(160deg, #08131f, #1d4e6e 60%, #050a11); }
.grad-blood { background: linear-gradient(160deg, #2a0507, #8f0d17 50%, #4d0a0a); }
.grad-purple { background: linear-gradient(160deg, #140a1f, #4a2a6b 60%, #09040f); }
.grad-warm { background: linear-gradient(160deg, #3a2411, #b07a3a 60%, #1a0f06); }
.grad-metal { background: linear-gradient(160deg, #0a1013, #2b3b42 55%, #0a0f12); }
.grad-green { background: linear-gradient(160deg, #0d1a10, #3c6b3f 60%, #071009); }
.grad-noir { background: linear-gradient(160deg, #0b0b0d, #3a3a40 55%, #080809); }

.card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-genre {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  font-weight: 700;
}

.card-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn {
  flex: 1;
  padding: 9px 10px;
  font-size: 12.5px;
  border-radius: 10px;
}

.like-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.like-btn:hover { border-color: var(--red); color: var(--red); }
.like-btn.liked { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.seen-btn { background: #fff; border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; }
.seen-btn:hover { border-color: var(--red); color: var(--red); }
.seen-btn.is-seen { background: var(--red); border-color: var(--red); color: #fff; }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 60px 0 90px;
  font-size: 15px;
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 17, 20, 0.55);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: pop 0.18s ease-out;
}

.modal-card.modal-wide { width: min(860px, 100%); }

@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { background: var(--red-soft); color: var(--red); }

.modal-title {
  margin: 0 0 18px;
  font-size: 26px;
  text-transform: uppercase;
}

.detail {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.detail .poster { border-radius: 14px; cursor: default; }
.detail h2 { margin: 0 0 6px; font-size: 32px; text-transform: uppercase; line-height: 1; }
.detail-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.detail-desc { font-size: 14.5px; line-height: 1.6; color: #342c30; margin: 0 0 18px; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.comments-title {
  margin: 24px 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  font-weight: 800;
}

.comment-form { display: flex; gap: 8px; margin-bottom: 14px; }

.comment-form input {
  flex: 1;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.comment-form input:focus { border-color: var(--red); }

.comment-list { display: flex; flex-direction: column; gap: 10px; }

.comment {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.comment-name { font-weight: 700; font-size: 13px; }
.comment-time { font-size: 11px; color: #9b8f94; }
.comment-text { color: #3a3135; }
.no-comments { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form input, .form textarea {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  outline: none;
  resize: vertical;
}

.form input:focus, .form textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(216, 29, 42, 0.1); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: #9b8f94; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- footer / toast ---------- */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: pop 0.18s ease-out;
}

.toast.err { background: var(--red-dark); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 34px; }
  .hero-art { display: none; }
  .detail { grid-template-columns: 1fr; }
  .detail .poster { max-width: 220px; }
  .topbar-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
  .search-wrap { order: 3; max-width: none; margin-left: 0; width: 100%; }
  .user-box { margin-left: auto; }
}
