/* ============ Plotholes — gold marquee theme (from Amanda's mockup) ============
   Gold gradient header with in-header search · white "PLOTHOLES" plate logo
   with punched-out O's and a magnifying glass · light gray content · white
   poster cards with colored tightness chips and star ratings.
   =============================================================================== */
:root {
  --gold-dark: #7d5019;            /* sampled from the mockup */
  --gold: #b8860b;
  --gold-light: #f2d579;
  --accent: #b8860b;               /* interactive accent */
  --accent-soft: rgba(184, 134, 11, 0.12);
  --ink: #2e3138;                  /* near-black text, filled stars */
  --bg: #e6e9ec;                   /* page gray sampled from the mockup */
  --card: #ffffff;
  --border: #e2e4e9;
  --text: #2e3138;
  --text-dim: #8a8f99;
  --danger: #d92d20;
  --radius: 12px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- header: gold marquee (gradient sampled from the mockup) ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 96px;
  padding: 0 26px 0 320px;
  background: linear-gradient(90deg, #7d5019 0%, #b98c3b 28%, #f2d579 57%, #9e712d 85%, #ad7e38 100%);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(60, 42, 4, 0.25);
}

/* logo: the actual artwork cropped from Amanda's mockup.
   The image contains its own slice of gold header + gray page, so it is
   positioned so its internal gold→gray boundary (81% down the image)
   lands exactly on the header's bottom edge — letting the magnifier
   handle dangle below the header like the mockup. The right edge fades
   out so the image's gold blends into the CSS gradient. */
/* the logo is a transparent cutout (plate + magnifier only) — it sits on the
   gold like a sticker, so there are no background edges to blend */
.logo {
  position: absolute;
  left: 14px;
  top: 5px;
  display: block;
  z-index: 2;
  filter: drop-shadow(0 3px 5px rgba(60, 42, 4, 0.4));
}
.logo-cut {
  height: 106px;
  width: auto;
  display: block;
}

/* in-header search */
.header-search-wrap {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.header-search {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 18px 13px 44px;
  outline: none;
  box-shadow: 0 2px 8px rgba(60, 42, 4, 0.28);
}
.header-search::placeholder { color: var(--text-dim); }
.header-search:focus {
  box-shadow: 0 2px 8px rgba(60, 42, 4, 0.28), 0 0 0 3px rgba(201, 146, 14, 0.35);
}

/* header right: account + prototype note */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.auth-link {
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(60, 42, 4, 0.45);
  padding: 0;
}
.auth-link:hover { text-decoration: underline; }
.proto-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(60, 42, 4, 0.4);
  white-space: nowrap;
}

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-small { padding: 5px 13px; font-size: 0.82rem; }
.btn-danger-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1.5px solid transparent;
  font-weight: 600;
}
.btn-danger-ghost:hover { color: var(--danger); filter: none; }

/* ---------- home content ---------- */
.home { max-width: 1160px; margin: 0 auto; padding: 36px 24px 70px; }

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #3c4048;
  margin: 0 0 2px;
  position: relative;
  padding-bottom: 8px;
}
/* a short gold underline gives every section a marquee accent */
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.section-sub { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 20px; }

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

/* tagline + browse buttons, centered at the top of the home page */
.home-tagline {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.02rem;
  font-style: italic;
  margin: 2px 0 18px;
}
.home-tagline em { color: var(--gold); font-weight: 700; }
.browse-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}
.chip {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(20, 22, 26, 0.06);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* the Genre dropdown panel */
.genre-wrap { position: relative; display: inline-block; }
.genre-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 340px;
  max-width: 80vw;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 34px rgba(20, 22, 26, 0.18);
}
.genre-menu.open { display: flex; }
.genre-item {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
}
.genre-item:hover { border-color: var(--ink); }
.genre-item.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* horizontally scrolling shelf of cards */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 176px;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
  margin-bottom: 10px;
}
.rail .card { scroll-snap-align: start; }
/* slim, quiet scrollbars on the shelves */
.rail { scrollbar-width: thin; scrollbar-color: #c9ccd4 transparent; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-track { background: transparent; }
.rail::-webkit-scrollbar-thumb { background: #c9ccd4; border-radius: 99px; }
.rail::-webkit-scrollbar-thumb:hover { background: var(--gold); }
#browse-sections .section-title { margin-top: 34px; }
#browse-sections .section-title:first-child { margin-top: 0; }
.section-sub { margin-bottom: 12px; }

/* ---------- cards (mockup style) ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
  box-shadow: 0 2px 10px rgba(20, 22, 26, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(20, 22, 26, 0.16);
}
.poster-wrap { position: relative; overflow: hidden; }
img.poster-img { transition: transform 0.25s ease; }
.card:hover img.poster-img { transform: scale(1.045); }
.poster {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
img.poster-img {
  width: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
}
/* tightness label chip overlapping the poster */
.status-chip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
/* bullet holes on posters whose plots are full of holes */
.bullet-hole {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}
.bullet-hole svg { width: 100%; height: 100%; display: block; }
.bullet-hole.h1 { top: 9%;  left: 14%;  width: 34px; height: 34px; transform: rotate(15deg); }
.bullet-hole.h2 { top: 30%; right: 11%; width: 26px; height: 26px; transform: rotate(160deg); }
.bullet-hole.h3 { top: 55%; left: 26%;  width: 30px; height: 30px; transform: rotate(80deg); }
.bullet-hole.h4 { bottom: 14%; right: 24%; width: 24px; height: 24px; transform: rotate(-40deg); }

.card-body { padding: 12px 14px 14px; }
.card-title {
  font-weight: 800;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta { color: var(--text-dim); font-size: 0.82rem; margin: 2px 0 10px; }
.rating-row { display: flex; justify-content: space-between; align-items: center; }
.rating-label { font-weight: 700; font-size: 0.86rem; color: #3c4048; }
.stars { letter-spacing: 2px; font-size: 1.02rem; line-height: 1; }
.star { color: #d3d6dc; }
.star.on { color: var(--ink); }

.empty-note { color: var(--text-dim); text-align: center; padding: 40px 0; }

/* ---------- title page ---------- */
.title-page { max-width: 880px; margin: 0 auto; padding: 30px 24px 90px; }
.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--accent); }

.title-head { display: flex; gap: 24px; margin-bottom: 30px; }
.title-head .poster,
.title-head img.poster-img {
  width: 170px;
  flex-shrink: 0;
  border-radius: var(--radius);
  font-size: 1.05rem;
  align-self: flex-start;
  box-shadow: 0 8px 24px rgba(20, 22, 26, 0.2);
}
.title-info h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 4px; }
.title-info .meta-line { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 14px; }
.title-info .overview { color: var(--text); font-size: 0.95rem; max-width: 560px; }

/* ---------- tightness meter ---------- */
.meter-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(20, 22, 26, 0.08);
  padding: 20px 22px;
  margin-bottom: 34px;
}
.meter-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.meter-title { font-weight: 900; font-size: 1rem; }
.meter-score { font-size: 2.1rem; font-weight: 900; }
.meter-label { font-weight: 800; font-size: 1rem; }
.meter-votes { color: var(--text-dim); font-size: 0.82rem; }
.meter-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin: 12px 0 16px;
}
.meter-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.meter-help { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 10px; }
.meter-divider { border-top: 1px solid var(--border); margin: 18px 0; }
.meter-stars { font-size: 1.25rem; }
.vote-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vote-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.your-vote-note { color: var(--text-dim); font-size: 0.82rem; margin-left: 8px; }

/* ---------- discussion ---------- */
.discussion h2 { font-size: 1.3rem; font-weight: 900; margin-bottom: 4px; }
.discussion .disc-sub { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 18px; }

.composer {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(20, 22, 26, 0.08);
  padding: 16px;
  margin-bottom: 26px;
}
.composer textarea {
  width: 100%;
  min-height: 84px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  resize: vertical;
  outline: none;
}
.composer textarea:focus { border-color: var(--accent); background: #fff; }
.composer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.composer-row .spacer { flex: 1; }
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check-label input { accent-color: var(--accent); }
.attach-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.attach-label:hover { color: var(--accent); }
.attach-label input { display: none; }
.img-preview-wrap { position: relative; display: inline-block; margin-top: 12px; }
.img-preview-wrap img {
  max-width: 220px;
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.img-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.signin-nudge {
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--text);
  margin-bottom: 26px;
}
.signin-nudge .btn { margin-top: 10px; }

.comment {
  display: flex;
  gap: 13px;
  padding: 18px 2px;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.comment-author { font-weight: 800; font-size: 0.93rem; }
.comment-time { color: var(--text-dim); font-size: 0.78rem; }
.spoiler-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 7px;
}
.comment-text { font-size: 0.94rem; white-space: pre-wrap; overflow-wrap: break-word; }
.comment-img {
  max-width: min(340px, 100%);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 10px;
  display: block;
}
.comment-actions { display: flex; gap: 4px; margin-top: 9px; }
.reported-note { color: var(--text-dim); font-size: 0.8rem; padding: 5px 11px; }

/* spoiler blur */
.spoiler-veil { position: relative; cursor: pointer; }
.spoiler-veil .veiled { filter: blur(9px); user-select: none; pointer-events: none; }
.spoiler-veil .veil-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.83rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 32, 38, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(20, 22, 26, 0.3);
  padding: 26px;
  width: 100%;
  max-width: 380px;
}
.modal h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 6px; }
.modal p { color: var(--text-dim); font-size: 0.87rem; margin-bottom: 16px; }
.modal input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 16px;
}
.modal input[type="text"]:focus { border-color: var(--accent); background: #fff; }
.modal input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 16px;
}
.modal input[type="password"]:focus { border-color: var(--accent); background: #fff; }
.modal-msg { color: var(--danger); font-size: 0.84rem; min-height: 1.2em; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- footer & document pages ---------- */
.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer a { color: var(--text-dim); font-weight: 600; }
.site-footer a:hover { color: var(--accent); }
.footer-note { margin-top: 8px; font-size: 0.76rem; }

.doc-header { padding-right: 26px; }
.doc-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}
.doc-page h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 2px; }
.doc-date { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 22px; }
.doc-page h2 { font-size: 1.1rem; font-weight: 800; margin: 26px 0 8px; }
.doc-page p, .doc-page li { font-size: 0.95rem; margin-bottom: 10px; }
.doc-page ul { padding-left: 22px; }
.doc-page a { color: var(--accent); }

.modal-fineprint { color: var(--text-dim); font-size: 0.78rem; margin: -6px 0 12px; }
.modal-fineprint a { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .site-header { gap: 12px; height: 68px; padding: 0 16px 0 225px; }
  .logo { left: 8px; top: 4px; }
  .logo-cut { height: 74px; }
  .header-search-wrap { max-width: none; }
  .proto-badge { display: none; }
  .title-head { flex-direction: column; }
  .title-head .poster, .title-head img.poster-img { width: 130px; }
}
