/* DYSKUSYJNY KLUB FILMOWY — style v8 */

:root {
  --bg:          #0c0b09;
  --bg-card:     #131210;
  --bg-card-h:   #1e1a14;
  --border:      #302a22;
  --border-h:    #5a4a34;
  --gold:        #d4a84c;
  --gold-dim:    #8a6e38;
  --gold-label:  #b99145;
  --gold-dark:   #6f5830;
  --gold-glow:   rgba(212, 168, 76, 0.14);
  --cream:       #f0e8d8;
  --muted:       #90806a;
  --text:        #d4cabb;
  --text-dim:    #665a4a;
  --fw-red:      #E4261A;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-body:    'Barlow', system-ui, sans-serif;
  --ease-smooth:  cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

body.has-footer main {
  padding-bottom: calc(clamp(2.5rem, 5vw, 4rem) + 76px) !important;
}

/* GRAIN OVERLAY */
.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 11, 9, 0.93);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  flex-wrap: wrap;
  justify-content: center;
}

.logo-dkf {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-divider {
  width: 1px;
  height: 2rem;
  background: var(--border-h);
}

.logo-full {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* MAIN */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.25rem);
}

/* SECTION LABELS */
.section-label {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.label-line {
  flex: 1;
  height: 1px;
  background: #3a3128;
  transition: background 0.3s ease;
}

.label-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-label);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: 0.4em 0.8em;
  border-radius: 2px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.label-text::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.8em;
  right: 0.8em;
  height: 1px;
  background: var(--gold-label);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.label-link {
  text-decoration: none;
  display: inline-block;
}

.section-label:hover .label-text {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212, 168, 76, 0.7), 0 0 30px rgba(212, 168, 76, 0.35), 0 0 60px rgba(212, 168, 76, 0.15);
}

.section-label:hover .label-text::after { opacity: 1; }
.section-label:hover .label-line { background: var(--border-h); }

.section-label:active .label-text {
  color: var(--cream);
  text-shadow: 0 0 20px rgba(240, 232, 216, 0.6);
}

/* HINT POPUP — small unobtrusive tooltip */
.hint-popup {
  position: fixed;
  z-index: 2000;
  transform: translate(-50%, -100%) translateY(4px) scale(0.96);
  background: var(--bg-card-h);
  border: 1px solid var(--border-h);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  padding: 0.45em 0.8em;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transition: opacity 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-h);
}

.hint-popup.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0) scale(1);
}

/* ARCHIVE / RANKING TOGGLE HEADER */
.archive-toggle {
  width: min(300px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1.05rem;
}

.archive-toggle-divider {
  justify-self: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-label);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.archive-toggle-option {
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dark);
  cursor: pointer;
  user-select: none;
  padding: 0.4em 0.1em;
  border-radius: 2px;
  transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.2s ease;
}

.archive-toggle-option:first-child { justify-self: end; text-align: right; }
.archive-toggle-option:last-child { justify-self: start; text-align: left; }

.archive-toggle-option.is-selected {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212, 168, 76, 0.55), 0 0 30px rgba(212, 168, 76, 0.22);
}

.archive-toggle-option:not(.is-selected):hover { color: var(--gold-label); }
.archive-toggle-option:active { opacity: 0.7; }

.section-label:hover .archive-toggle-divider {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212, 168, 76, 0.35);
}

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  gap: 1.5rem;
  justify-content: center;
}

.download-section .cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
}

/* MOVIE CARD */
.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth), background 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.movie-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(19, 18, 16, 0.4) 0%, rgba(19, 18, 16, 0.85) 100%), var(--poster-url, none);
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  filter: grayscale(0.2);
  transition: opacity 0.4s ease, filter 0.4s ease;
  z-index: 0;
}

.movie-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.movie-card:hover {
  border-color: var(--border-h);
  transform: translateY(-6px);
  box-shadow: 0 26px 70px rgba(0,0,0,0.72), 0 6px 22px rgba(0,0,0,0.4), 0 0 0 1px var(--border-h);
  background: var(--bg-card-h);
}

.movie-card:hover::before {
  background-image: linear-gradient(180deg, rgba(19, 18, 16, 0.1) 0%, rgba(19, 18, 16, 0.45) 100%), var(--poster-url, none);
  opacity: 1;
  filter: grayscale(0);
}

.movie-card:hover .date-day,
.movie-card:hover .date-month-year,
.movie-card:hover .card-title,
.movie-card:hover .card-alt,
.movie-card:hover .card-year {
  text-shadow:
    0 2px 4px rgba(19, 18, 16, 0.6),
    0 4px 12px rgba(19, 18, 16, 0.8);
  transition: text-shadow 0.3s ease;
}

.movie-card:hover::after { opacity: 1; }

.movie-card.is-today {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px var(--gold-dim), 0 0 50px var(--gold-glow);
}

.movie-card.is-today::after {
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.movie-card.is-past { opacity: 0.72; }

.movie-card > * {
  position: relative;
  z-index: 1;
}

.card-date {
  width: 100%;
  padding: 0.5rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, rgba(212,168,76,0.06) 0%, transparent 100%);
  position: relative;
}

.card-count {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  background: rgba(48, 42, 34, 0.55);
  border: 1px solid rgba(212, 168, 76, 0.18);
  padding: 0.2em 0.55em;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.date-day {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 900;
  color: var(--cream);
  line-height: 1;
  letter-spacing: -0.04em;
}

.date-gap { height: 0.9rem; }

.date-month-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gold-dim);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-today {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--bg);
  padding: 0.3em 0.9em;
  border-radius: 1px;
  font-weight: 500;
}

.card-divider {
  width: calc(100% - 2.5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-h), transparent);
  margin: 1.25rem 0 0;
}

.card-info {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 1;
  width: 100%;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* main card altName — NOT italic, same display font as title, distinct colour */
.card-alt {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.1rem;
  color: var(--gold-label);
  line-height: 1.3;
}

.card-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  margin-top: 0.6rem;
}

.card-author {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--cream);
  background: rgba(48, 42, 34, 0.4);
  padding: 0.3em 0.85em;
  border-radius: 999px;
  margin-top: 0.3rem;
  line-height: 1.4;
  border: 1px solid rgba(212, 168, 76, 0.18);
  backdrop-filter: blur(6px);
}

.card-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-top: 1px solid var(--border);
  transition: background 0.2s ease;
  margin-top: auto;
  text-decoration: none;
}

.card-link:hover { background: rgba(212,168,76,0.06); }

.filmweb-logo-full {
  height: 29px;
  width: auto;
  display: block;
  transition: transform 0.25s var(--ease-smooth), filter 0.25s ease;
}

.card-link:hover .filmweb-logo-full {
  transform: scale(1.08);
  filter: drop-shadow(0 0 8px rgba(212, 169, 76, 0.368)) drop-shadow(0 0 24px rgba(212, 168, 76, 0.12));
}

/* POSTER GRID (archive poster mode) — inverse of upcoming: image first, dim+info on hover */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  animation: fadeInUp 0.4s var(--ease-smooth) both;
}

.poster-card {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color 0.3s ease, transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
  animation: fadeInUp 0.4s var(--ease-smooth) both;
}

.poster-card:hover {
  border-color: var(--border-h);
  transform: translateY(-5px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.7), 0 5px 18px rgba(0,0,0,0.4), 0 0 0 1px var(--border-h);
}

.poster-card.is-filtered-out { opacity: 0.38; }

.poster-card.is-filtered-out::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0; /* Sits above the image */
  pointer-events: none; /* Ensures the card is still clickable/hoverable */
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(0, 0, 0, 0.5) 8px,
    rgba(0, 0, 0, 0.5) 16px
  );
}

.poster-card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.4s ease, transform 0.5s var(--ease-smooth);
  background-color: var(--bg-card);
}

.poster-card:hover .poster-card-img {
  filter: brightness(0.22) grayscale(0.3);
  transform: scale(1.05);
}

.poster-card-noimg {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.poster-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-smooth), transform 0.35s var(--ease-smooth);
  z-index: 1;
}

.poster-card:hover .poster-card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.poster-card-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(48, 42, 34, 0.5);
  border: 1px solid rgba(212, 168, 76, 0.25);
  padding: 0.2em 0.6em;
  border-radius: 999px;
  margin-bottom: 0.2rem;
}

.poster-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.2;
}

.poster-card-alt {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--gold-label);
  line-height: 1.25;
}

.poster-card-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text);
}

.poster-card-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.poster-card-author {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--cream);
  background: rgba(48, 42, 34, 0.5);
  border: 1px solid rgba(212, 168, 76, 0.2);
  padding: 0.2em 0.65em;
  border-radius: 999px;
  margin-top: 0.15rem;
}

.poster-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.2rem;
  border-radius: 5px;
  text-decoration: none;
}

.poster-card-link:hover .filmweb-logo-sq {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(212, 169, 76, 0.368));
}

/* FILTERS */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem 2rem;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.filter-group--year { flex: 1; min-width: 220px; }

.filter-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-label);
}

.filter-countries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* interactive chip = rounded; inner content blocks = squared */
.country-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.32rem 0.5rem 0.28rem;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
  filter: grayscale(0.6);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: opacity 0.2s ease, border-color 0.2s ease, filter 0.2s ease, transform 0.18s var(--ease-smooth), box-shadow 0.2s ease;
}

.country-chip:hover { opacity: 0.9; border-color: var(--border-h); transform: translateY(-2px); }

.country-chip.is-active {
  opacity: 1;
  filter: grayscale(0);
  border-color: var(--gold-dim);
  box-shadow: 0 0 14px var(--gold-glow);
}

.country-flag { font-size: 1.05rem; }

.country-count {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  line-height: 1;
}

/* AUTHOR FILTER CHIPS */
.filter-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.author-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.32rem 0.7rem 0.28rem;
  cursor: pointer;
  line-height: 1;
  filter: grayscale(0.6);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: opacity 0.2s ease, border-color 0.2s ease, filter 0.2s ease, transform 0.18s var(--ease-smooth), box-shadow 0.2s ease;
}

.author-chip:hover { opacity: 0.9; border-color: var(--border-h); transform: translateY(-2px); }

.author-chip.is-active {
  opacity: 1;
  filter: grayscale(0);
  border-color: var(--gold-dim);
  background: rgba(138, 110, 56, 0.18);
  box-shadow: 0 0 14px var(--gold-glow);
}

.author-chip-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1.3;
}

/* AUTHOR BUBBLE — translucent, modern */
.author-bubble {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--cream);
  background: rgba(48, 42, 34, 0.35);
  border: 1px solid rgba(212, 168, 76, 0.16);
  padding: 0.26em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
  align-self: center;
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.archive-item:hover .author-bubble {
  background: rgba(48, 42, 34, 0.55);
  border-color: rgba(212, 168, 76, 0.3);
}

/* YEAR DUAL-SLIDER */
.year-slider { width: 100%; }

.year-track {
  position: relative;
  height: 1.4rem;
  display: flex;
  align-items: center;
}

.year-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
}

.year-range {
  position: absolute;
  height: 3px;
  border-radius: 3px;
  background: var(--gold-dim);
}

.year-input {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.year-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold-glow);
  transition: transform 0.15s var(--ease-smooth);
}

.year-input::-webkit-slider-thumb:hover { transform: scale(1.15); }

.year-input::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  cursor: pointer;
}

.year-input::-moz-range-track { background: transparent; }

.year-values {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--gold-dim);
  margin-top: 0.35rem;
}

.year-slider--single .year-input { display: none; }
.year-slider--single .year-track::before,
.year-slider--single .year-range { display: none; }
.year-slider--single .year-values { justify-content: center; }
.year-slider--single #year-max-val { display: none; }

/* FILTER SWITCHES */
.filter-switches {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-self: flex-end;
}

.switch-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.switch-control input { position: absolute; opacity: 0; pointer-events: none; }

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-h);
  flex-shrink: 0;
  transition: background 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
}

.switch-thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.3s var(--ease-smooth), background 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.switch-control input:checked + .switch-track {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateY(-50%) translateX(16px);
  background: var(--cream);
  box-shadow: 0 0 8px var(--gold-glow);
}

.switch-control:hover .switch-track { border-color: var(--gold-dim); }

.switch-text {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.switch-control input:checked ~ .switch-text { color: var(--gold-label); }

/* ARCHIVE — numbered list */
.archive-section { opacity: 0.95; }

.archive-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease-smooth) both;
}

.archive-item {
  display: grid;
  grid-template-columns: 2.5rem 165px auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.archive-item:last-child { border-bottom: none; }
.archive-item:hover {
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px var(--border-h), 0 6px 22px rgba(0,0,0,0.35);
}

.archive-item.is-filtered-out {
  opacity: 0.4;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(212,168,76,0.04) 8px,
    rgba(212,168,76,0.04) 16px
  );
}

.archive-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}

.archive-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.archive-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-h);
  flex-shrink: 0;
}

.archive-title {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 400;
}

/* archive altName — distinct colour, not italic */
.archive-alt {
  font-style: normal;
  color: var(--gold-label);
  margin-left: 0.4rem;
}

.archive-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

.archive-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0.2rem;
  border-radius: 3px;
}

.filmweb-logo-sq {
  width: 26px;
  height: 26px;
  display: block;
  transition: transform 0.2s var(--ease-smooth), filter 0.2s ease;
}

.archive-link:hover .filmweb-logo-sq {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(212, 169, 76, 0.368)) drop-shadow(0 0 24px rgba(212, 168, 76, 0.12));
}

/* RANKING */
.archive-view--ranking { display: block; }

.ranking-list { margin-top: 0; }

.ranking-item {
  grid-template-columns: 2.5rem 1.5rem minmax(0, 1fr) auto auto;
  cursor: grab;
  user-select: none;
}

.ranking-item:active { cursor: grabbing; }

.ranking-item.is-dragging {
  opacity: 0.52;
  background: var(--bg-card-h);
  box-shadow: inset 0 0 0 1px var(--border-h), 0 10px 30px rgba(0,0,0,0.5);
}

.ranking-num { color: var(--gold-label); }

.ranking-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dim);
  cursor: grab;
  opacity: 0.6;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s var(--ease-smooth);
}

.ranking-handle svg { display: block; }

.ranking-item:hover .ranking-handle { color: var(--gold); opacity: 1; transform: scale(1.1); }
.ranking-title { min-width: 0; }

/* RANKING ACTIONS */
.ranking-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.ranking-actions--top { margin-bottom: 1.25rem; }

.ranking-copy-btn {
  appearance: none;
  border: 1px solid var(--border-h);
  background: linear-gradient(180deg, var(--bg-card-h), var(--bg-card));
  color: var(--gold-label);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s var(--ease-smooth), transform 0.18s var(--ease-smooth);
}

.ranking-copy-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: linear-gradient(180deg, #26201780, var(--bg-card-h));
  box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 28px rgba(212, 168, 76, 0.12);
  transform: translateY(-2px);
}

.ranking-copy-btn:active { transform: translateY(-1px) scale(0.98); }

.ranking-restore-btn { color: var(--muted); }

/* DOWNLOAD SECTION */
.drive-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  width: 100%;
  min-height: 160px;
  padding: 1.5rem 1rem;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s ease, transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth), background 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.drive-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drive-card:hover {
  border-color: var(--border-h);
  transform: translateY(-6px);
  box-shadow: 0 26px 70px rgba(0,0,0,0.72), 0 6px 22px rgba(0,0,0,0.4), 0 0 0 1px var(--border-h);
  background: var(--bg-card-h);
}

.drive-card:hover::after { opacity: 1; }

.card-icon { padding: 0; }

.drive-icon-large {
  width: 5rem;
  height: auto;
  transition: filter 0.25s ease, transform 0.25s var(--ease-smooth);
}

.drive-card:hover .drive-icon-large {
  filter: drop-shadow(0 0 8px rgba(212, 169, 76, 0.368)) drop-shadow(0 0 24px rgba(212, 168, 76, 0.12));
  transform: scale(1.08);
}

.drive-title {
  font-family: 'Google Sans', 'Poppins', var(--font-body), sans-serif;
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  color: var(--cream);
  line-height: 1.2;
  transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.25s var(--ease-smooth);
}

.drive-card:hover .drive-title {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212, 168, 76, 0.4);
  transform: scale(1.04);
}

.drive-desc {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* STICKY FOOTER */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 76px;
  background: rgba(12, 11, 9, 0.93);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.footer-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  height: 100%;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  height: 100%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.footer-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-divider {
  width: 1px;
  height: 2rem;
  background: var(--border-h);
  flex-shrink: 0;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.footer-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--gold-dim);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.footer-sep { color: var(--border-h); font-size: 0.9rem; flex-shrink: 0; }

.footer-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.footer-alt {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--gold-label);
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.1em;
}

.footer-fw-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.2s var(--ease-smooth), filter 0.2s ease;
  border-radius: 4px;
}

.footer-fw-link:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(212, 169, 76, 0.368)) drop-shadow(0 0 24px rgba(212, 168, 76, 0.12));
}

.footer-fw-icon { width: 36px; height: 36px; display: block; }

footer.toast-active .footer-content {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.footer-toast-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: pre-line;
  text-align: center;
}

footer.toast-active .footer-toast-msg { opacity: 1; transform: translateY(0); }

/* TOAST — floating fallback */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--bg-card-h);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75em 1.5em;
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(212,168,76,0.1);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  white-space: pre-line;
  pointer-events: none;
  text-align: center;
}

.copy-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* EMPTY STATE */
.empty-state {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 3rem 1rem;
}

/* POSTER HOVER POPUP */
.poster-popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-h);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 168, 76, 0.08),
    0 0 32px rgba(212, 168, 76, 0.06);
  background: var(--bg-card);
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition:
    opacity 0.2s var(--ease-smooth),
    transform 0.2s var(--ease-smooth);
  pointer-events: none;
  z-index: 500;
}

.poster-popup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  z-index: 1;
  opacity: 0.7;
}

.poster-popup.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.poster-popup-img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  background: var(--bg-card);
}

.poster-popup.is-loading .poster-popup-img {
  opacity: 0;
}

.hidden { display: none !important; }

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* FOOTER — ANNOUNCEMENT MODE */
footer.footer--announcement {
  border-top-color: var(--gold-dim);
  background: rgba(12, 11, 9, 0.96);
}

footer.footer--announcement::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.footer-announce-label {
  display: flex;
  align-items: center;
  gap: 0.55em;
  color: var(--gold) !important;
  letter-spacing: 0.28em !important;
  text-shadow: 0 0 12px rgba(212, 168, 76, 0.55), 0 0 30px rgba(212, 168, 76, 0.2);
}

.footer-announce-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(212, 168, 76, 0.8);
  animation: announcePulse 2s ease-in-out infinite;
}

@keyframes announcePulse {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px  rgba(212, 168, 76, 0.8); }
  50%      { opacity: 0.4; box-shadow: 0 0 12px rgba(212, 168, 76, 0.3); }
}

.footer-announce-text {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .footer-announce-label { display: none; }
  .footer--announcement .footer-divider { display: none; }
  .footer-announce-text { font-size: 0.88rem; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .poster-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  html { font-size: 16px; }

  .cards-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .download-section .cards-grid { grid-template-columns: 1fr; }

  .poster-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }

  .date-day { font-size: 5rem; }
  .card-title { font-size: 1.45rem; }

  .archive-toggle { width: min(360px, 100%); column-gap: 0.65rem; }
  .archive-toggle-option,
  .archive-toggle-divider { font-size: 0.68rem; letter-spacing: 0.18em; }

  .filters { padding: 1rem; gap: 1rem; }
  .filter-switches { align-self: flex-start; flex-direction: row; gap: 1.25rem; flex-wrap: wrap; }

  .archive-item {
    grid-template-columns: 2rem 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.75rem;
    padding: 0.85rem 1rem;
  }

  .archive-num   { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .archive-date  { grid-column: 2; grid-row: 2; font-size: 0.7rem; }
  .archive-dot   { display: none; }
  .archive-title { grid-column: 2; grid-row: 1; }
  .author-bubble { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .archive-link  { grid-column: 4; grid-row: 1 / 3; align-self: center; }

  .ranking-item {
    grid-template-columns: 2rem 1.5rem minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    gap: 0.5rem;
  }

  .ranking-item .archive-num   { grid-column: 1; grid-row: 1; align-self: center; }
  .ranking-handle               { grid-column: 2; grid-row: 1; }
  .ranking-item .archive-title  { grid-column: 3; grid-row: 1; }
  .ranking-item .author-bubble  { grid-column: 4; grid-row: 1; align-self: center; }
  .ranking-item .archive-link   { grid-column: 5; grid-row: 1; align-self: center; }

  .footer-label,
  .footer-alt,
  .footer-year { display: none; }

  .footer-divider:first-of-type { display: none; }
  .footer-title { font-size: 0.9rem; }
}