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

:root {
  --bg: #0d0e12;
  --bg-raised: #16181f;
  --bg-hover: #1f222b;
  --line: #262933;
  --text: #eef0f4;
  --text-dim: #9199ab;
  --gold: #e0ac47;
  --gold-dim: #8a6c2e;
  --red: #c0463a;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, .brand, .btn, .video-title {
  font-family: 'Oswald', sans-serif;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(13, 14, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
  white-space: nowrap;
}

.search-box {
  flex: 1;
  max-width: 420px;
  display: flex;
}

.search-box input {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px;
  outline: none;
}

.search-box input:focus { border-color: var(--gold-dim); }

.search-box button {
  background: var(--bg-hover);
  border: 1px solid var(--line);
  border-left: none;
  color: var(--text-dim);
  padding: 0 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}

.header-spacer { flex: 1; }

.admin-link {
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-link:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ===== Category rail ===== */
.category-rail {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.category-rail::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-raised);
}

.cat-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #17130a;
}

/* ===== Grid ===== */
.section-title {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 20px 12px;
  color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 0 20px 20px;
}

.poster-card { cursor: pointer; }

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.poster-card:hover .poster-wrap img { transform: scale(1.04); }

.poster-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.poster-card:hover .poster-wrap::after { opacity: 1; }

.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.poster-card:hover .play-badge { opacity: 1; }

.play-badge svg { width: 40px; height: 40px; fill: var(--gold); filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }

.video-title {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.video-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

/* ===== Player page ===== */
.player-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-info { margin-top: 16px; }

.player-info h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
}

.related-title {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 12px;
}

/* ===== Forms (admin) ===== */
.form-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}

.form-card h1 { font-size: 20px; margin: 0 0 20px; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.field input, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}

.field input:focus, .field select:focus { border-color: var(--gold-dim); }

.btn {
  display: inline-block;
  background: var(--gold);
  color: #17130a;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.btn:hover { background: #eabb60; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
}

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

.msg { font-size: 13px; margin-top: 10px; }
.msg.err { color: var(--red); }
.msg.ok { color: #6dbf7a; }

/* ===== Admin dashboard ===== */
.admin-shell { max-width: 1000px; margin: 0 auto; padding: 20px; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 { font-size: 15px; margin: 0 0 16px; color: var(--gold); }

.row-flex { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row-flex .field { flex: 1; min-width: 160px; margin-bottom: 0; }

.admin-list { display: flex; flex-direction: column; gap: 8px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-row img {
  width: 42px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
  flex-shrink: 0;
}

.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info .t { font-size: 14px; font-weight: 500; }
.admin-row .info .s { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.chip {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
}
