:root {
  --bg: #0c0c0d;
  --bg-raised: #161618;
  --bg-card: #1d1d20;
  --border: #2c2c30;
  --text: #f2f2f2;
  --text-dim: #a3a3a8;
  --accent: #f5c518; /* IMDb-style yellow */
  --accent-dark: #caa30f;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.brand .accent {
  color: var(--accent);
}

.brand-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
  border-color: var(--border);
}

.socials {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.social-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dark);
  background: var(--bg-card);
}

.social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
  }

  .brand-tag {
    display: none;
  }

  .social-btn {
    width: 30px;
    height: 30px;
  }
}

/* ---------- layout ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 4px;
}

.page-subtitle {
  color: var(--text-dim);
  margin: 0 0 24px;
  font-size: 15px;
}

/* ---------- search ---------- */

.search-row {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-dark);
}

/* ---------- sort controls ---------- */

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.sort-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.sort-btn {
  background: var(--bg-card);
  color: var(--text-dim);
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--border);
}

.sort-btn:last-child {
  border-right: none;
}

.sort-btn:hover {
  color: var(--text);
}

.sort-btn.active {
  background: var(--accent);
  color: #141414;
}

.result-count {
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
}

.page-btn {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 36px;
}

.page-btn:hover {
  color: var(--text);
  border-color: var(--accent-dark);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
}

.page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn.page-nav {
  font-weight: 700;
}

/* ---------- grid / cards ---------- */

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.poster {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
}

.poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster .rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
}

.card-meta {
  font-size: 12.5px;
  color: var(--text-dim);
}

.card-date {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--text-dim);
  padding-top: 8px;
}

@media (max-width: 480px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .poster {
    font-size: 30px;
  }

  .card-body {
    padding: 10px 10px 12px;
  }

  .card-name {
    font-size: 13.5px;
  }

  .card-meta {
    font-size: 11px;
  }

  .card-date {
    font-size: 10.5px;
  }
}

/* ---------- interactive map page ---------- */

.map-page-main {
  max-width: 1400px;
}

.leaflet-map-container {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 20px;
  background: var(--bg-card);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-raised);
  color: var(--text);
  border-radius: 8px;
}

.leaflet-popup-tip {
  background: var(--bg-raised);
}

.map-popup .popup-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}

.map-popup .popup-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.map-popup .popup-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12.5px;
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- detail page ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.back-link:hover {
  color: var(--accent);
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.detail-name {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  background: var(--bg-card);
}

.site-btn {
  background: var(--accent);
  color: #141414;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  white-space: nowrap;
}

.site-btn:hover {
  background: var(--accent-dark);
}

.section {
  margin-top: 32px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 12px;
}

.video-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 9 / 16;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.video-frame.wide {
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.map-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .map-wrap {
    grid-template-columns: 1fr;
  }
}

.map-frame {
  position: relative;
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  min-height: 260px;
}

.address-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.address-card .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.address-card .value {
  font-size: 15px;
  font-weight: 600;
}

.address-card .directions-link {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

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

/* ---------- stats page ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px 22px;
}

.stat-tile-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-tile-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* -- hero tile -- */

.stat-tile--hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-value {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: proportional-nums;
}

.stat-label {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.stat-caption {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* -- bar list tile -- */

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.bar-list--scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -8px;
  padding-bottom: 24px;
  margin-bottom: -24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent 100%);
}

.bar-list--scroll.bar-list--at-bottom {
  -webkit-mask-image: none;
  mask-image: none;
}

.bar-list--scroll::-webkit-scrollbar {
  width: 6px;
}

.bar-list--scroll::-webkit-scrollbar-track {
  background: transparent;
}

.bar-list--scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.bar-list--scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 34px;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  outline: none;
}

.bar-label {
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  background: var(--bg-raised);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.bar-value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-row:hover .bar-fill,
.bar-row:focus-visible .bar-fill {
  background: #ffd84d;
}

.bar-row:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-dark);
}

/* -- trend tile -- */

.stat-tile--trend {
  grid-column: 1 / -1;
}

.trend-chart-wrap {
  position: relative;
  margin-top: 6px;
}

.trend-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.trend-baseline {
  stroke: var(--border);
  stroke-width: 1;
}

.trend-area {
  fill: var(--accent);
  fill-opacity: 0.1;
  stroke: none;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend-tick {
  fill: var(--text-dim);
  font-size: 10px;
  text-anchor: middle;
}

.trend-marker {
  fill: var(--accent);
  stroke: var(--bg-card);
  stroke-width: 2;
}

.trend-point-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.trend-crosshair {
  stroke: var(--border);
  stroke-width: 1;
}

.trend-hover-dot {
  fill: var(--accent);
  stroke: var(--bg-card);
  stroke-width: 2;
}

.trend-hit {
  fill: transparent;
  cursor: pointer;
}

.trend-hit:focus-visible {
  outline: none;
  fill: rgba(245, 197, 24, 0.06);
}

.trend-tooltip {
  position: absolute;
  top: 4px;
  pointer-events: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  white-space: nowrap;
}

.trend-tooltip-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.trend-tooltip-label {
  font-size: 11px;
  color: var(--text-dim);
}

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

  .stat-value {
    font-size: 42px;
  }

  .bar-row {
    grid-template-columns: 78px 1fr 28px;
  }
}
