:root {
  --bg: #0a0a0e;
  --surface: #13131a;
  --surface-2: #1b1b25;
  --border: #262633;
  --text: #ececf2;
  --muted: #9c9cae;
  --accent: #f5b83d;
  --accent-ink: #14110a;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(1100px 480px at 50% -12%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.modal-open { overflow: hidden; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .01em; text-decoration: none; font-size: 18px; }
.logo { height: 34px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; display: block; }
.ig {
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
}
.ig:hover { color: var(--text); border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 36px 0 20px; }
.hero h1 { margin: 0; font-size: clamp(28px, 5.2vw, 46px); line-height: 1.1; letter-spacing: -.02em; }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: clamp(15px, 2vw, 18px); max-width: 60ch; }
.note {
  margin: 16px 0 0; padding: 10px 14px; font-size: 14px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: 12px;
}

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.search { flex: 1 1 280px; max-width: 520px; }
.search input {
  width: 100%; height: 48px; padding: 0 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font: inherit; font-size: 16px;
}
.search input::placeholder { color: #70708a; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.count { margin: 0; color: var(--muted); font-size: 14px; }

.status { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- grid + cards ---------- */
.grid {
  display: grid; gap: 12px; padding-bottom: 56px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
@media (min-width: 640px) {
  .grid { gap: 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.poster {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5;
  padding: 0; border: 0; background: var(--surface-2); color: inherit;
  cursor: pointer; overflow: hidden;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .poster img { transform: scale(1.04); }

.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(150deg, hsl(var(--h, 40) 40% 22%), hsl(calc(var(--h, 40) + 40) 45% 11%));
}
.ph span { font-size: clamp(34px, 8vw, 56px); font-weight: 800; color: rgb(255 255 255 / .22); letter-spacing: -.03em; }

.badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 9px; font-size: 12px; font-weight: 700;
  background: rgb(10 10 14 / .72); border: 1px solid rgb(255 255 255 / .14);
  border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chip {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
}
.play {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px rgb(0 0 0 / .45);
  transition: transform .18s ease;
}
.poster:hover .play { transform: scale(1.08); }
.play svg { margin-left: 2px; }

.body { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px; flex: 1; }
.body h2 {
  margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.desc {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 14px; border-radius: 12px;
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: filter .15s ease, border-color .15s ease;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--accent); }

@media (min-width: 640px) {
  .body { padding: 14px 14px 16px; }
  .body h2 { font-size: 16px; }
  .desc { font-size: 14px; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--border); padding: 22px 0 30px; color: var(--muted); font-size: 13px; }
.foot p { margin: 0; max-width: 70ch; }

/* ---------- reel player ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 12px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(100%, 420px); max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 24px 80px rgb(0 0 0 / .6);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgb(10 10 14 / .75); color: var(--text); border: 1px solid rgb(255 255 255 / .16);
}
.close:hover { border-color: var(--accent); }

.stage { background: #000; height: min(calc(100dvh - 230px), 700px); min-height: 300px; }
.stage iframe, .stage video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.stage video { object-fit: contain; }
.stage-note { margin: 0; height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }

.modal-meta { padding: 14px 16px 16px; }
.modal-num { margin: 0; font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.modal-meta h2 {
  margin: 2px 0 12px; font-size: 16px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.modal-meta .actions { flex-direction: row; padding-top: 0; }
.modal-meta .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
