/* 5play.info — lightweight mobile-first clone */
:root {
  --bg: #0f1419;
  --bg2: #171d25;
  --card: #1c2430;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --muted: #9aa6b5;
  --accent: #ffcc33;
  --green: #3dd68c;
  --blue: #4da3ff;
  --purple: #a78bfa;
  --red: #ff6b6b;
  --radius: 14px;
  --max: 1100px;
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --header-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(100% - 1.25rem, var(--max));
  margin-inline: auto;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  /* anchor for absolute mobile nav */
  isolation: isolate;
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.nav-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  font-size: 1.15rem;
  line-height: 1;
}

.nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  z-index: 45;
  background: rgba(15, 20, 25, 0.98);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav.open {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.nav a {
  color: var(--text);
  padding: 0.85rem 0.75rem;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  touch-action: manipulation;
}

.nav a:hover,
.nav a.active {
  background: var(--card);
  color: var(--accent);
  text-decoration: none;
}

@media (min-width: 820px) {
  .nav-toggle {
    display: none;
  }
  .nav {
    display: flex !important;
    position: static;
    inset: auto;
    background: transparent;
    border: 0;
    padding: 0;
    gap: 0.15rem;
    overflow: visible;
    z-index: auto;
  }
  .nav a {
    padding: 0.45rem 0.7rem;
    min-height: 0;
    font-size: 0.9rem;
  }
  body.nav-open {
    overflow: auto;
    touch-action: auto;
  }
}

/* Search */
.search {
  display: none;
  margin: 0.75rem auto 0;
  width: min(100% - 1.25rem, var(--max));
}

.search.open {
  display: block;
}

@media (min-width: 820px) {
  .search {
    display: block;
  }
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom on focus */
}

/* Cards grid */
.section {
  padding: 1.25rem 0 0.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.section-head a {
  font-size: 0.85rem;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
  contain: content;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 204, 51, 0.35);
  text-decoration: none;
  color: inherit;
}

.card-img {
  aspect-ratio: 1;
  background: #10151c;
  object-fit: cover;
  width: 100%;
}

.card-body {
  padding: 0.65rem 0.7rem 0.8rem;
  display: grid;
  gap: 0.25rem;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 204, 51, 0.15);
  color: var(--accent);
  width: fit-content;
}

/* App page */
.crumbs {
  padding: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.crumbs a {
  color: var(--muted);
}

.app-hero {
  display: grid;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
}

@media (min-width: 800px) {
  .app-hero {
    grid-template-columns: 160px 1fr;
    align-items: start;
  }
}

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  object-fit: cover;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  margin-inline: auto;
}

@media (min-width: 800px) {
  .app-icon {
    margin-inline: 0;
  }
}

@media (min-width: 800px) {
  .app-icon {
    width: 160px;
    height: 160px;
  }
}

.app-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 4.2vw, 1.75rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

@media (min-width: 800px) {
  .app-hero h1 {
    text-align: left;
  }
}

.app-hero .pills {
  justify-content: center;
}

@media (min-width: 800px) {
  .app-hero .pills {
    justify-content: flex-start;
  }
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.pill.ok {
  color: var(--green);
  border-color: rgba(61, 214, 140, 0.3);
}

.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.specs th,
.specs td {
  text-align: left;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.specs th {
  color: var(--muted);
  font-weight: 600;
  width: 40%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  text-decoration: none !important;
  touch-action: manipulation;
}

.btn-dl {
  background: linear-gradient(135deg, #ffcc33, #ffb020);
  color: #1a1400 !important;
  box-shadow: 0 8px 24px rgba(255, 204, 51, 0.25);
  width: 100%;
}

@media (min-width: 560px) {
  .btn-dl {
    width: auto;
    min-width: 220px;
  }
}

.btn-dl:hover {
  filter: brightness(1.05);
}

.prose {
  padding: 0.5rem 0 1rem;
  color: #d5dde8;
}

.prose h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.prose p {
  margin: 0 0 0.85rem;
}

/* Comments */
.comments {
  margin: 1.5rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.comments-list {
  display: grid;
  gap: 0.75rem;
}

.comment {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.comment-head {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #ffcc33, #ff8a3d);
  color: #1a1400;
  flex-shrink: 0;
}

.comment-author {
  font-weight: 800;
  font-size: 0.95rem;
}

.comment-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-text {
  margin: 0;
  color: #d5dde8;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.comment-reply {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.comment-reply-label {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.25rem;
}

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 72vw);
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 800px) {
  .shots {
    grid-auto-columns: minmax(240px, 280px);
  }
}

.shots img {
  border-radius: 12px;
  scroll-snap-align: start;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--card);
  border: 1px solid var(--line);
}

.related-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.05rem;
}

/* Sticky bar */
.sticky-dl {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.6rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(12, 16, 22, 0.96);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.sticky-dl.show {
  transform: translateY(0);
}

.sticky-dl .meta {
  display: none;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (min-width: 560px) {
  .sticky-dl .meta {
    display: block;
    flex: 1;
  }
}

.sticky-dl .btn-dl {
  width: 100%;
  flex: 1;
  min-width: 0;
}

@media (min-width: 560px) {
  .sticky-dl .btn-dl {
    width: auto;
    flex: 0 0 auto;
  }
}

body.has-sticky {
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
}

.crumbs {
  overflow-wrap: anywhere;
}

.pager {
  max-width: 100%;
}

.pager a,
.pager span {
  min-width: 44px;
  height: 44px;
}

.cats {
  scrollbar-width: none;
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
}

.cats::-webkit-scrollbar {
  display: none;
}

.shots {
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
  scrollbar-width: thin;
}

@media (max-width: 379px) {
  .grid {
    gap: 0.5rem;
  }
  .card-body {
    padding: 0.5rem 0.55rem 0.65rem;
  }
  .card-title {
    font-size: 0.8rem;
  }
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--muted);
}

.footer-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer h3 {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 0.95rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin: 0.25rem 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0.5rem;
}

.pager a,
.pager span {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

.pager a:hover,
.pager .current {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-home {
  padding: 1.25rem 0 0.25rem;
}

.hero-home h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.hero-home p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.cats {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.75rem 0 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.cats a {
  flex: 0 0 auto;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cats a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .sticky-dl {
    transition: none;
  }
}
