*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #05060a;
  color: #f7f7ff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, #05060a, #05060aee);
  padding: 0.6rem 1rem 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.top-bar-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  color: #ff3cac;
}

.logo span {
  color: #9b5cff;
}

.search {
  flex: 1;
}

.search input {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 0.5rem 0.9rem;
  background: #14151d;
  color: #f7f7ff;
  font-size: 0.9rem;
}

.search input::placeholder {
  color: #6e7489;
}

.search input:focus {
  outline: 2px solid #ff3cac;
  outline-offset: 0;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  overflow-x: auto;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  border-radius: 999px;
  border: none;
  background: #14151d;
  color: #c8c9dd;
  font-size: 0.7rem;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.lang-btn.active {
  background: linear-gradient(135deg, #ffb347, #ff3cac);
  color: #05060a;
  font-weight: 600;
}

.tab {
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  background: #14151d;
  color: #c8c9dd;
  font-size: 0.78rem;
  white-space: nowrap;
}

.tab.active {
  background: linear-gradient(135deg, #ffb347, #ff3cac);
  color: #05060a;
  font-weight: 600;
}

.page {
  padding: 0.75rem 0 4.75rem;
}

.section {
  padding: 0 1rem 0.25rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.section-tag {
  font-size: 0.7rem;
  color: #ffb347;
  text-transform: uppercase;
}

.card-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 44%;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

@media (min-width: 768px) {
  .card-row {
    grid-auto-columns: 18%;
  }
}

.media-card {
  position: relative;
  border: none;
  background: #101119;
  border-radius: 0.8rem;
  padding: 0;
  text-align: left;
  color: inherit;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
  background: #171827;
}

.media-card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #1f202b;
}

.media-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card-label {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  background: rgba(5, 6, 10, 0.8);
}

.media-card-label span {
  color: #ffd54f;
}

.media-card-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  padding: 0.16rem 0.35rem;
  border-radius: 0.35rem;
  background: #ffc400;
  color: #111;
  font-size: 0.6rem;
  font-weight: 700;
}

.media-card-info {
  padding: 0.45rem 0.55rem 0.55rem;
}

.media-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.media-card-meta {
  font-size: 0.7rem;
  color: #9ea3c0;
}

.load-more-btn {
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.9rem;
  background: #14151d;
  color: #f5f5ff;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.load-more-btn::before {
  content: '+';
  font-weight: 700;
}

.load-more-btn:hover {
  background: #1b1d2a;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* increase a lot */
  padding: 1rem;
}


.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.overlay-card {
  position: relative;
  max-width: 880px;
  width: 94%;
  max-height: calc(100dvh - 20px);
  background: radial-gradient(circle at top left, #2b143a 0, #05060a 55%);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  overflow-y: auto;   /* ✅ allow vertical scroll */
}

}

.overlay-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  border-radius: 999px;
  width: 1.8rem;
  height: 1.8rem;
  background: rgba(0, 0, 0, 0.7);
  color: #f7f7ff;
  cursor: pointer;
}

.overlay-layout {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 1rem;
  align-items: flex-start;
}

@media (max-width: 720px) {
  .overlay-card {
    padding: 0.75rem;
  }
@media (max-width: 768px) {
  .overlay-card {
    padding-bottom: 100px;
  }
}

  .overlay-layout {
    grid-template-columns: 1fr;
  }
}

.overlay-poster-wrapper {
  border-radius: 0.9rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.overlay-content {
  font-size: 0.9rem;
}

.overlay-title {
  font-size: 1.2rem;
}

.overlay-meta {
  font-size: 0.8rem;
  color: #c8c9dd;
  margin-top: 0.15rem;
}

.overlay-overview {
  margin-top: 0.5rem;
  margin-bottom: 0.6rem;
  color: #e0e1f1;
  max-height: 5.5rem;
  overflow: auto;
}

.overlay-steps h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #ffd54f;
}

.overlay-steps ol {
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: #f8f9ff;
}

.overlay-steps li + li {
  margin-top: 0.18rem;
}

.overlay-warning {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #ffb3c1;
}

.overlay-cta {
  margin-top: 0.85rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #ffc400, #ff3cac);
  color: #05060a;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.8);
}

.overlay-cta:active {
  transform: translateY(1px);
}

.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 25;
  background: #05060a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  padding: 0.3rem 0.6rem env(safe-area-inset-bottom, 0.3rem);
  gap: 0.3rem;
}

.bottom-nav-btn {
  flex: 1;
  border-radius: 999px;
  border: none;
  background: #101119;
  color: #d1d5f0;
  font-size: 0.8rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.bottom-nav-btn.active {
  background: linear-gradient(135deg, #ffb347, #ff3cac);
  color: #05060a;
  font-weight: 600;
}

@media (min-width: 960px) {
  .bottom-nav {
    max-width: 960px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    margin-bottom: 0.6rem;
  }
}

