* {
  box-sizing: border-box;
}

:root {
  --bg: #0a0a08;
  --bg-deep: #050504;
  --panel: rgba(16, 14, 8, 0.92);
  --panel-border: rgba(118, 98, 26, 0.55);
  --text: #f5efc6;
  --muted: #c7b98a;
  --accent: #ffd84a;
  --accent-2: #f4b400;
  --accent-3: #ffe88a;
  --shadow: rgba(0, 0, 0, 0.55);
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-3);
  text-decoration: none;
}

a:hover {
  color: #fff4b8;
  text-decoration: underline;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 120px;
  padding: 14px 24px;
  background: url("/assets/header_bg.png") center / cover no-repeat;
  background-color: #100c03;
  color: #fff6cc;
  border-bottom: 1px solid rgba(137, 116, 46, 0.45);
  gap: 18px;
}

.brand {
  display: grid;
  gap: 6px;
}

.brand a {
  font-weight: 700;
  font-size: 20px;
  color: #fff6cc;
}

.brand-tag {
  font-size: 12px;
  color: #e5d8a2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(8, 6, 2, 0.8);
  border: 1px solid rgba(159, 128, 34, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.search-form input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  width: 200px;
}

.search-form input::placeholder {
  color: rgba(233, 219, 172, 0.7);
}

.search-submit,
.search-clear {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.search-submit {
  background: var(--accent);
  color: #1b1404;
  border: 1px solid rgba(199, 159, 40, 0.8);
}

.search-submit:hover {
  background: var(--accent-2);
}

.search-clear {
  background: rgba(34, 26, 6, 0.95);
  color: #ffe9a6;
  border: 1px solid rgba(159, 128, 34, 0.7);
}

.search-clear:hover {
  background: rgba(52, 40, 10, 0.98);
  border-color: rgba(199, 159, 40, 0.85);
}

.nav .nav-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 26, 6, 0.95);
  border: 1px solid rgba(159, 128, 34, 0.7);
  color: #ffe9a6;
}

.nav .nav-pill:hover {
  background: rgba(52, 40, 10, 0.98);
  border-color: rgba(199, 159, 40, 0.85);
  color: #fff4c2;
}

.nav .nav-pill-admin {
  background: rgba(118, 16, 16, 0.95);
  border-color: rgba(204, 64, 64, 0.8);
  color: #ffd6d6;
}

.nav .nav-pill-admin:hover {
  background: rgba(154, 24, 24, 0.98);
  border-color: rgba(224, 92, 92, 0.9);
  color: #ffeaea;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 6px 10px;
  background: rgba(255, 216, 74, 0.92);
  border-radius: 999px;
  border: 1px solid rgba(199, 159, 40, 0.8);
  color: #1b1404;
}

.content {
  padding: 24px 48px 48px;
  flex: 1;
  background-image: url("/assets/bg.png"),
    radial-gradient(circle at 20% 20%, rgba(130, 96, 18, 0.25), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(110, 82, 16, 0.35), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(64, 50, 12, 0.6), transparent 55%);
  background-attachment: fixed;
  background-repeat: repeat;
  background-position: center top;
}

.gallery-header {
  margin-bottom: 18px;
  display: grid;
  gap: 6px;
}

.gallery-header h1 {
  margin: 0;
  font-size: 24px;
  color: #fff1b0;
}

.gallery-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.filter-status {
  font-size: 12px;
  color: #ffe9a6;
  min-height: 18px;
}

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

.cover-card {
  --card-accent: var(--accent);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px var(--shadow);
  position: relative;
  overflow: hidden;
}

.cover-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 65%, transparent);
  pointer-events: none;
  opacity: 0.5;
}

.cover-art {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--card-accent) 55%, #181409);
  background: #0d0c07;
  width: 100%;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
}

.cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: #f5efc6;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: #000000;
}

.cover-info {
  display: grid;
  gap: 4px;
}

.cover-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff5c2;
}

.cover-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.year-link {
  background: none;
  border: none;
  color: #ffe88a;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.year-link:hover {
  color: #fff4b8;
}

.cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #1a1304;
  background: var(--card-accent);
  border: 1px solid color-mix(in srgb, var(--card-accent) 70%, #2a210a);
  border-radius: 999px;
  padding: 4px 8px;
  width: fit-content;
}

.cover-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.media-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  margin-bottom: 28px;
  align-items: start;
}

.media-poster {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(159, 128, 34, 0.7);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45);
  background: rgba(8, 7, 4, 0.8);
  width: 300px;
  height: 400px;
  display: grid;
  place-items: center;
}

.media-poster-link {
  display: block;
  width: 100%;
  height: 100%;
}

.media-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-hero-info {
  display: grid;
  gap: 14px;
}

.media-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: #f9e29a;
}

.media-title {
  font-size: 36px;
  margin: 0;
  color: #fff6cc;
}

.media-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 26, 6, 0.95);
  border: 1px solid rgba(159, 128, 34, 0.7);
  color: #ffe9a6;
  font-size: 12px;
}

.media-pill-accent {
  background: var(--accent);
  color: #1b1404;
  border-color: rgba(199, 159, 40, 0.9);
}

.media-pill-accent:hover {
  background: var(--accent-2);
}

.media-pill-genre {
  background: rgba(255, 216, 74, 0.18);
  border-color: rgba(255, 216, 74, 0.6);
  color: #fff1b0;
}

.media-summary {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(22, 17, 8, 0.95), rgba(14, 11, 5, 0.85));
  border: 1px solid rgba(159, 128, 34, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.media-summary h2 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #ffd84a;
}

.media-summary p {
  margin: 0;
  color: #f3e6b8;
  font-size: 14px;
  line-height: 1.6;
}

.media-block {
  margin-bottom: 24px;
}

.media-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.media-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 320px);
  gap: 22px;
}

.media-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px var(--shadow);
}

.media-card h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #fff1b0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.media-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.media-bullets {
  list-style: disc;
  padding-left: 18px;
}

.media-list strong {
  color: #fff3b8;
}

.media-desc {
  margin: 0;
  color: #f0e3b6;
  font-size: 14px;
  line-height: 1.6;
}

.media-meta {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.media-meta span {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(14, 11, 5, 0.8);
  border: 1px solid rgba(118, 98, 26, 0.4);
}

.media-trailer .plyr {
  border-radius: 12px;
  overflow: hidden;
  width: 740px;
  height: 400px;
}

.plyr--fullscreen-enabled .plyr__video-wrapper,
.plyr--fullscreen-enabled video,
.plyr--fullscreen-fallback .plyr__video-wrapper,
.plyr--fullscreen-fallback video {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.media-hero .media-trailer {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .media-hero {
    grid-template-columns: 1fr;
  }

  .media-layout {
    grid-template-columns: 1fr;
  }

  .media-poster {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .media-trailer .plyr {
    width: 100%;
    height: auto;
  }
}

.load-status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sentinel {
  height: 1px;
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: #e9dbac;
  display: grid;
  gap: 6px;
  font-size: 13px;
  margin-top: auto;
}

.footer-divider {
  border: none;
  border-top: 1px solid rgba(137, 116, 46, 0.5);
  margin: 0;
}

@media (max-width: 900px) {
  .content {
    padding: 20px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-form {
    width: 100%;
    justify-content: space-between;
  }

  .search-form input {
    width: 100%;
  }
}

.admin-panel {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  align-items: start;
}

.admin-form {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 24px var(--shadow);
}

.admin-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(159, 128, 34, 0.7);
  background: rgba(7, 6, 3, 0.7);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}

.admin-form textarea {
  resize: vertical;
  min-height: 140px;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.admin-checkbox input {
  accent-color: var(--accent);
}

.admin-button {
  justify-self: start;
  background: var(--accent);
  border: 1px solid rgba(199, 159, 40, 0.8);
  color: #1b1404;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.admin-button:hover {
  background: var(--accent-2);
}

.admin-result {
  background: rgba(12, 10, 5, 0.7);
  border: 1px solid rgba(118, 98, 26, 0.4);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.admin-block h2 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #fff3b8;
}

.admin-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.admin-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(88, 22, 12, 0.7);
  border: 1px solid rgba(190, 80, 40, 0.7);
  color: #ffd1b8;
}

@media (max-width: 900px) {
  .admin-panel {
    grid-template-columns: 1fr;
  }
}
