:root {
  --bg: #0f0c09;
  --bg-elev: #1a1510;
  --bg-card: #221b14;
  --line: rgba(232, 165, 75, 0.18);
  --text: #f3ebe0;
  --muted: #a89882;
  --accent: #e8a54b;
  --accent-2: #ff6b3d;
  --ok: #3ecf8e;
  --danger: #e85d5d;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Bebas Neue", Impact, sans-serif;
  --max: 1280px;
  --header-h: auto;
  --touch: 44px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(232, 165, 75, 0.16), transparent 55%),
    radial-gradient(700px 400px at 90% 0%, rgba(255, 107, 61, 0.12), transparent 50%),
    linear-gradient(180deg, #14100c 0%, #0f0c09 40%, #0c0a08 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffc06e; }

.wrap {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(15, 12, 9, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  min-height: 3.4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  flex-shrink: 0;
  z-index: 2;
}

.logo:hover { color: var(--text); }

.logo-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1008;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(232, 165, 75, 0.25);
}

.logo-text {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: 0.06em;
  line-height: 1;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle-bars {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 2px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border-bottom: none;
  transition: color 0.2s, background 0.2s;
}

.main-nav a:hover {
  color: var(--accent);
  background: rgba(232, 165, 75, 0.1);
}

.header-search-bar {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0 0.8rem;
  background: rgba(10, 8, 6, 0.5);
}

.search-form {
  display: flex;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elev);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
  border-color: rgba(232, 165, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.12);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.1rem;
  font: inherit;
  outline: none;
  font-size: 1rem;
}

.search-form input::placeholder { color: #7d6f5c; }

.search-form button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1008;
  font-weight: 700;
  padding: 0 1.35rem;
  cursor: pointer;
  min-height: var(--touch);
  white-space: nowrap;
}

.search-form button:hover { filter: brightness(1.06); }

/* ——— Content ——— */
.main-content {
  padding: 1.5rem 0 3.5rem;
}

.hero-band {
  margin-bottom: 1.75rem;
  padding: 1.75rem 0 0.5rem;
  animation: rise 0.7s ease both;
}

.brand-signal {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  letter-spacing: 0.08em;
  line-height: 0.9;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  font-weight: 600;
  color: var(--text);
  max-width: 40rem;
}

.lead {
  margin: 0.6rem 0 0;
  color: var(--muted);
  max-width: 38rem;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.05em;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 400;
}

.section-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ——— Video grid (PC: up to 4 cols) ——— */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 1.1rem;
}

.video-card {
  animation: rise 0.55s ease both;
  min-width: 0;
}

.thumb-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.thumb-link:hover {
  border-color: rgba(232, 165, 75, 0.55);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.thumb-link:hover img { transform: scale(1.06); }

.duration {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.play-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: rgba(0, 0, 0, 0.28);
}

.play-hint::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent var(--accent);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  margin-left: 4px;
}

.thumb-link:hover .play-hint { opacity: 1; }

.card-meta { padding: 0.6rem 0.05rem 0; }

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }

.card-stats {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 28px;
}

.card-action:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.card-action-dl {
  border-color: rgba(232, 165, 75, 0.35);
  color: var(--accent);
  background: rgba(232, 165, 75, 0.08);
}

.card-action-dl:hover {
  color: #1a1008;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

/* ——— Watch page ——— */
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}

.player-shell {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.watch-head h1 {
  margin: 1rem 0 0.45rem;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  line-height: 1.25;
}

.watch-stats {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  min-height: var(--touch);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1008;
}

.btn-primary:hover { filter: brightness(1.08); color: #1a1008; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: rgba(232, 93, 93, 0.15);
  border-color: rgba(232, 93, 93, 0.4);
  color: #ff8e8e;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.watch-desc {
  margin-top: 1.2rem;
  padding: 1.1rem;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.watch-desc h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.watch-desc p { margin: 0; color: var(--muted); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tag-list a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.tag-list a:hover { color: var(--accent); border-color: var(--accent); }

.side-title {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  letter-spacing: 0.05em;
  font-size: 1.45rem;
  font-weight: 400;
}

.related-list {
  display: grid;
  gap: 1rem;
}

.related-list .video-card .card-title { font-size: 0.88rem; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.pagination a {
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(26, 21, 16, 0.5);
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.flash-success { background: rgba(62, 207, 142, 0.15); color: var(--ok); }
.flash-error { background: rgba(232, 93, 93, 0.15); color: #ff8e8e; }

/* ——— Ads ——— */
.ad-slot {
  margin: 0.85rem 0;
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.ad-slot:empty { display: none; }

.ad-placeholder {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed rgba(232, 165, 75, 0.45);
  border-radius: var(--radius);
  background: rgba(232, 165, 75, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem;
}

.ad-sidebar.ad-placeholder,
.ad-slot.ad-sidebar { min-height: 250px; }

.grid-ad-break { grid-column: 1 / -1; }

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.25rem 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(8, 6, 4, 0.55);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem 2rem;
  align-items: start;
}

.footer-brand {
  font-family: var(--display);
  letter-spacing: 0.06em;
  font-size: 1.5rem;
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

.footer-links a:hover { color: var(--accent); }

.copy {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.8;
  grid-column: 1 / -1;
}

.muted { color: var(--muted); }

.layout-with-side {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  margin-top: 1.25rem;
  align-items: start;
}

.last-searches {
  margin-top: 2.25rem;
  padding-top: 0.5rem;
}

.last-searches-empty {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.5rem 0.95rem;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.search-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 165, 75, 0.08);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ——— Large desktop ——— */
@media (min-width: 1400px) {
  :root { --max: 1360px; }
  .video-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.35rem 1.2rem;
  }
}

/* ——— Tablet ——— */
@media (max-width: 1100px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .watch-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}

@media (max-width: 900px) {
  .wrap { width: min(100% - 1.25rem, var(--max)); }

  .nav-toggle { display: inline-flex; }

  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.75rem 1.25rem 1rem;
    background: rgba(18, 14, 10, 0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    z-index: 60;
  }

  .main-nav.is-open { display: flex; }

  .main-nav a {
    padding: 0.85rem 0.9rem;
    min-height: var(--touch);
    border-radius: 10px;
    font-size: 1rem;
  }

  .header-top {
    position: relative;
    flex-wrap: nowrap;
  }

  .search-form { max-width: none; }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
  }

  .watch-layout,
  .layout-with-side {
    grid-template-columns: 1fr;
  }

  .related-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links { justify-content: flex-start; }

  .watch-actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
  }

  .player-shell {
    border-radius: 10px;
    margin-inline: 0;
  }

  .side-ads { order: -1; }
}

/* ——— Mobile small ——— */
@media (max-width: 560px) {
  .wrap { width: min(100% - 1rem, var(--max)); }

  .main-content { padding: 1rem 0 2.5rem; }

  .hero-band {
    padding: 1rem 0 0.25rem;
    margin-bottom: 1.15rem;
  }

  .lead { font-size: 0.92rem; }

  .video-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 0.55rem;
  }

  .card-title { font-size: 0.82rem; }
  .card-stats { font-size: 0.72rem; }

  .search-form {
    border-radius: 12px;
  }

  .search-form button {
    padding: 0 0.95rem;
    font-size: 0.9rem;
  }

  .related-list {
    grid-template-columns: 1fr 1fr;
  }

  .thumb-link:hover {
    transform: none;
  }

  .thumb-link:active {
    border-color: var(--accent);
  }

  /* Always show subtle play cue on touch */
  .play-hint {
    opacity: 0.55;
    background: transparent;
  }

  .play-hint::before {
    border-width: 10px 0 10px 16px;
    opacity: 0.9;
  }

  .ad-placeholder { min-height: 60px; font-size: 0.75rem; }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Very small phones: single column option for readability */
@media (max-width: 360px) {
  .video-grid,
  .related-list {
    grid-template-columns: 1fr;
  }
}
