:root {
  color-scheme: dark;
  --background: #111317;
  --surface: #191c22;
  --surface-raised: #22262e;
  --text: #f5f7fa;
  --muted: #9da5b4;
  --border: #303641;
  --accent: #f1b94b;
  --success: #78d49a;
  --danger: #ff8c8c;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(241, 185, 75, 0.08), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 32px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 7px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.section-heading p,
footer {
  color: var(--muted);
}

.refresh-button,
select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.refresh-button {
  padding: 0 18px;
  cursor: pointer;
}

.refresh-button:hover,
select:hover {
  border-color: var(--accent);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

section {
  margin-bottom: 56px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.select-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

select {
  padding: 0 36px 0 14px;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.calendar-date {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 74px;
  border-radius: 12px;
  background: var(--surface-raised);
  text-align: center;
}

.calendar-date strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.calendar-date span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-info {
  min-width: 0;
}

.calendar-info h3,
.poster-card h3 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-info h3 {
  font-size: 1rem;
}

.calendar-info p {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.badge.available {
  background: rgba(120, 212, 154, 0.12);
  color: var(--success);
}

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

.poster-card {
  min-width: 0;
}

.poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, var(--surface-raised), var(--surface));
}

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

.poster-type {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.poster-resolution {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.poster-card h3 {
  font-size: 0.92rem;
}

.poster-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.error,
.empty,
.loading {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.error {
  border-color: rgba(255, 140, 140, 0.38);
  color: var(--danger);
}

.skeleton {
  overflow: hidden;
  position: relative;
  background: var(--surface);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

footer {
  padding: 0 0 36px;
  font-size: 0.78rem;
}

@media (max-width: 650px) {
  .site-header {
    padding-top: 30px;
  }

  .section-heading {
    align-items: start;
  }

  .calendar-item {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .badges {
    grid-column: 2;
    justify-content: start;
  }

  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
