:root {
  --bg: #16181d;
  --bg-alt: #1e2128;
  --accent: #2f6fed;
  --accent-2: #1e57c9;
  --text: #f2f3f5;
  --text-dim: #a7abb4;
  --ribbon: #2f6fed;
  --radius: 6px;
}

body.light {
  --bg: #f4f5f7;
  --bg-alt: #ffffff;
  --text: #16181d;
  --text-dim: #55585f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .2s, color .2s;
}

a { text-decoration: none; color: inherit; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .5px;
}
.logo span { color: var(--text); }

.header-icons { display: flex; gap: 8px; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(127,127,127,.15); }

/* Promo banner */
.promo-banner {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: .85rem;
  font-weight: 600;
}

/* Search bar */
.search-bar {
  display: none;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-alt);
}
.search-bar.open { display: flex; }
.search-bar input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(127,127,127,.3);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
}
.search-bar button {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }

.content-section { margin-bottom: 32px; }

.ribbon-label {
  display: inline-block;
  background: var(--ribbon);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  padding: 8px 18px 8px 14px;
  margin-bottom: 14px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
}

/* Poster grid */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.featured-grid { grid-template-columns: repeat(2, 1fr); }

.poster-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--bg-alt);
  cursor: pointer;
}

.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.poster-title {
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.25;
}

.poster-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.poster-card:hover img { transform: scale(1.04); }
.poster-card img { transition: transform .3s ease; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: .8rem;
  background: var(--bg-alt);
}

/* Tablet / Desktop breakpoints */
@media (min-width: 640px) {
  .poster-grid { grid-template-columns: repeat(3, 1fr); }
  .featured-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .poster-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .featured-grid { grid-template-columns: repeat(4, 1fr); }
  .poster-title { font-size: 1rem; }
}

@media (min-width: 1200px) {
  .poster-grid { grid-template-columns: repeat(6, 1fr); }
  .featured-grid { grid-template-columns: repeat(4, 1fr); }
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.page-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.page-num {
  color: var(--text-dim);
  font-size: .85rem;
}