:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --text: #211f2e;
  --text-muted: #6f6b80;
  --accent: #ef6c4d;
  --accent-alt: #1f9c8f;
  --border: #e6e0d4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Drifting poster background */
.poster-wall {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.poster-row {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: driftLeft 70s linear infinite;
}

.poster-row.reverse {
  animation-name: driftRight;
}

.poster-row img {
  width: 130px;
  height: 195px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.85;
  flex-shrink: 0;
}

@keyframes driftLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes driftRight {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.backdrop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(247, 243, 236, 0.5), rgba(247, 243, 236, 0.72) 45%, var(--bg) 85%);
}

/* Background is decorative and data-heavy -- skip it on small screens */
@media (max-width: 768px) {
  .poster-wall {
    display: none;
  }
  .backdrop-overlay {
    background: var(--bg);
  }
}

/* Phones specifically (not tablets -- no iPad is this narrow) get a
   lighter single-row hint near the top instead of nothing. script.js
   also only builds one row of images at this width, so this isn't
   costing extra data over the fully-hidden version. */
@media (max-width: 480px) {
  .poster-wall {
    display: flex;
    justify-content: flex-start;
  }

  .poster-row img {
    width: 70px;
    height: 105px;
  }

  .backdrop-overlay {
    background: linear-gradient(180deg, rgba(247, 243, 236, 0.4), var(--bg) 28%);
  }
}

main {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  transition: max-width 0.2s ease;
}

main.wide {
  max-width: 920px;
}

.hero {
  text-align: center;
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: 3rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  color: var(--text);
  flex-shrink: 0;
}

.logo-play {
  fill: var(--accent);
}

.back-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

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

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 2.5rem;
  line-height: 1.5;
}

#search-form {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

#search-input:focus {
  border-color: var(--accent);
}

.suggestions {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.suggestions.hidden,
.result.hidden {
  display: none;
}

.suggestions li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
}

.suggestions li:hover {
  background: #f1ece1;
}

.suggestions img {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--border);
}

.suggestions .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.result {
  margin-top: 3rem;
  text-align: left;
}

.result-body {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.result-left {
  flex: 0 0 220px;
}

.result-poster-large {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.result-left h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
}

.result-overview {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.result-right {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .result-body {
    flex-direction: column;
  }
  .result-left {
    flex: none;
    width: 100%;
    max-width: 180px;
  }
}

.platform {
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}

.platform-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.platform-name {
  font-weight: 500;
}

.platform-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.platform.unavailable .platform-name,
.platform.unavailable .platform-count {
  color: var(--text-muted);
}

.platform-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.region-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--text);
  border: none;
  color: var(--surface);
}

.see-more {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.more-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.more-regions.hidden {
  display: none;
}

.trending {
  margin-top: 3rem;
}

.trending h2 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.trending.hidden {
  display: none;
}

.trending-wrap {
  position: relative;
}

.trending-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.trending-arrow:hover {
  border-color: var(--accent);
}

.trending-arrow-left {
  left: -6px;
}

.trending-arrow-right {
  right: -6px;
}

.trending-grid {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.trending-grid::-webkit-scrollbar {
  height: 6px;
}

.trending-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.trending-item {
  flex-shrink: 0;
  width: 100px;
  cursor: pointer;
}

.trending-item img {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}

.trending-item:hover img {
  transform: translateY(-3px);
}

.trending-title {
  font-size: 0.8rem;
  margin-top: 0.4rem;
  line-height: 1.3;
}

.note {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.vpn-section {
  margin-top: 1.5rem;
}

.vpn-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.vpn-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.4rem;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-alt), var(--accent));
  background-size: 200% 200%;
  animation: bannerShift 6s ease infinite;
  transition: transform 0.15s ease;
}

.vpn-banner:hover {
  transform: translateY(-2px);
}

@keyframes bannerShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.vpn-banner-message {
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.vpn-banner-cta {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.vpn-disclosure {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.attribution {
  position: fixed;
  bottom: 0.75rem;
  right: 1rem;
  z-index: 2;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.attribution a {
  color: var(--text-muted);
}
