@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================================================
   FINAL design.css (ONE FILE for: main / tag / player)
   Requirements:
   - sharp rectangles (no rounding)
   - header scrolls away (NOT sticky)
   - thumbs grid 4 cols on desktop (3/2/1 responsive)
   - compact cards (shorter media, tighter text)
   - player: main video ~2x smaller (centered)
   - keep .thumb / .thumb-video classes for your JS
   ========================================================= */

:root{
  --bg0:#120814;
  --bg1:#1a0d22;
  --bg2:#241231;

  --text:#fff4fa;
  --muted:rgba(255,244,250,.72);

  --line:rgba(255,255,255,.12);
  --line2:rgba(255,255,255,.18);

  --a1:#f7c6d9;
  --a2:#d8b4fe;

  --max: 1360px;
  --gap: 14px;

  --radius: 0px; /* sharp */
  --shadow: 0 18px 40px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--text);
  background:
    radial-gradient(1000px 550px at 12% 0%, rgba(247,198,217,.14), transparent 58%),
    radial-gradient(900px 520px at 88% 10%, rgba(216,180,254,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, #0b0610 100%);
}
a{color:inherit;text-decoration:none}
img{max-width:100%}

/* =========================
   HEADER (scroll-away)
   ========================= */
.site-header{
  position:relative; /* NOT sticky */
  z-index:50;
  background:linear-gradient(180deg, rgba(18,8,20,.92), rgba(18,8,20,.72));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.header-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 14px;
}
.top-menu{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* tag buttons row */
.menu-left{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  max-width:100%;
}
.menu-left::-webkit-scrollbar{display:none}
.menu-left .menu-btn{flex:0 0 auto;white-space:nowrap}
.menu-right{display:flex;align-items:center;gap:10px}

.menu-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  transition: background .18s, border-color .18s, transform .18s;
}
.menu-btn:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.16);
  transform: translateY(-1px);
}

/* language dropdown */
.lang-select{position:relative}
.lang-select summary{list-style:none}
.lang-select summary::-webkit-details-marker{display:none}
.lang-btn-main{display:inline-flex;align-items:center;gap:10px}
.lang-flag-mini{width:18px;height:18px;object-fit:cover}
.lang-arrow{font-size:16px;line-height:1;opacity:.9}

.lang-dropdown-list{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:min(920px, calc(100vw - 24px));
  max-height:min(70vh, 640px);
  overflow:auto;
  background:rgba(18,8,20,.97);
  border:1px solid rgba(255,255,255,.12);
  padding:14px;
  box-shadow: var(--shadow);
  display:none;
  z-index:9999;
}
.lang-select[open] .lang-dropdown-list{
  display:grid;
  grid-template-columns:repeat(6,minmax(120px,1fr));
  gap:10px;
}
.lang-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:10px 8px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  text-align:center;
  font-weight:900;
}
.lang-item:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(255,255,255,.16);
}
.lang-item img{width:28px;height:28px;object-fit:cover}
.lang-item span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

@media(max-width:960px){
  .header-inner{padding:8px 10px}
  .menu-btn{padding:7px 10px;font-size:12px}

  .lang-select[open] .lang-dropdown-list{
    grid-template-columns:repeat(4,minmax(110px,1fr));
  }
}

@media(max-width:640px){
  .lang-select[open] .lang-dropdown-list{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:420px){
  .lang-select[open] .lang-dropdown-list{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* =========================
   PAGE HEADERS
   ========================= */

/* Older templates may use .site-title-block */
.site-title-block{
  max-width:var(--max);
  margin:12px auto 6px;
  padding:0 14px;
}
.site-title-link{display:inline-block}
.site-title-text{
  display:inline-block;
  font-size:26px;
  font-weight:950;
  letter-spacing:.6px;
  text-transform:uppercase;
  background:linear-gradient(90deg, var(--text), rgba(247,198,217,.95), rgba(216,180,254,.95));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  line-height:1.1;
}

/* Main page hero (if you use it) */
.hero{
  max-width:var(--max);
  margin:12px auto 10px;
  padding:0 14px;
}
.hero-inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
}
.hero-left{flex:0 0 auto;min-width:240px}
.hero-title{
  margin:0;
  font-size:32px;
  font-weight:950;
  letter-spacing:.6px;
  line-height:1.05;
  text-transform:uppercase;
  background:linear-gradient(90deg, var(--text), rgba(247,198,217,.95), rgba(216,180,254,.95));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.hero-right{flex:1 1 auto;max-width:820px}
.hero-desc{
  margin:2px 0 0;
  font-size:13px;
  line-height:1.55;
  color:var(--muted);
}
.hero-notes{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  color: rgba(255,244,250,.72);
  font-size: 12px;
  font-weight: 900;
}
.hero-notes .dot{opacity:.5}
.hero-notes .note{
  padding:4px 8px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
}

/* Tag page hero (if present) */
.tag-hero{
  max-width:var(--max);
  margin:12px auto 10px;
  padding:0 14px;
}
.tag-hero-inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
}
.tag-hero-left{flex:0 0 auto;min-width:260px}
.tag-hero-right{flex:1 1 auto;max-width:820px}
.back-link{
  display:inline-block;
  margin-bottom:8px;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
  font-weight:900;
  font-size:12px;
}
.back-link:hover{background:rgba(255,255,255,.06)}
.tag-h1{
  margin:0;
  font-size:22px;
  font-weight:950;
  line-height:1.15;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.tag-desc{
  margin:2px 0 0;
  font-size:13px;
  line-height:1.55;
  color:var(--muted);
}

/* Player page hero */
.player-hero{
  max-width:var(--max);
  margin:12px auto 10px;
  padding:0 14px;
}
.player-hero-inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:14px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
}
.player-hero-left{flex:0 0 auto;min-width:280px}
.player-hero-right{flex:1 1 auto;max-width:820px}
.video-h1{
  margin:0;
  font-size:22px;
  font-weight:950;
  line-height:1.15;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.video-desc{
  margin:2px 0 0;
  font-size:13px;
  line-height:1.55;
  color:var(--muted);
}
.video-meta-row{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  color: rgba(255,244,250,.72);
  font-size: 12px;
  font-weight: 900;
}
.meta-dot{opacity:.5}
.meta-pill{
  padding:4px 8px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
}

@media(max-width:640px){
  .hero-inner,
  .tag-hero-inner,
  .player-hero-inner{flex-direction:column}
  .hero-left,.tag-hero-left,.player-hero-left{min-width:0}
  .hero-title{font-size:28px}
}

/* =========================
   MAIN / GRID
   ========================= */
main{
  max-width:var(--max);
  margin:0 auto 22px;
  padding:0 14px;
  position:relative;
}

/* Preferred: UL grid */
.thumb-grid{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:var(--gap);
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

/* Keep 4 until ~1150px */
@media(max-width:1150px){ .thumb-grid{grid-template-columns:repeat(3, minmax(0,1fr))} }
@media(max-width:860px){  .thumb-grid{grid-template-columns:repeat(2, minmax(0,1fr))} }
@media(max-width:560px){  .thumb-grid{grid-template-columns:1fr} }

/* Divider after grids */
main::after{
  content:"";
  display:block;
  height:1px;
  margin:18px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}

/* Compatibility: if engine outputs thumbs directly into <main> (no UL) */
main.thumbs-grid-fallback{
  display:grid;
  gap:var(--gap);
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
@media(max-width:1150px){ main.thumbs-grid-fallback{grid-template-columns:repeat(3, minmax(0,1fr))} }
@media(max-width:860px){  main.thumbs-grid-fallback{grid-template-columns:repeat(2, minmax(0,1fr))} }
@media(max-width:560px){  main.thumbs-grid-fallback{grid-template-columns:1fr} }

/* If you cannot add class, you can still wrap thumbs into UL for best result. */
.thumb-cell{margin:0;padding:0}

/* =========================
   THUMB CARD (JS-compatible)
   ========================= */
.thumb{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  transition: transform .18s, border-color .18s, background .18s;
}
.thumb:hover{
  transform: translateY(-1px);
  border-color: rgba(247,198,217,.28);
  background:rgba(255,255,255,.04);
}

/* CLS safe + compact height */
.thumb-link{
  position:relative;
  display:block;
  aspect-ratio:16/10;
  background:#05060a;
  overflow:hidden;
}
.thumb-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition: opacity .18s, transform .25s, filter .18s;
}
.thumb-video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s;
}

.thumb:hover .thumb-img{
  opacity:0;
  transform:scale(1.03);
  filter:contrast(1.05) brightness(.92);
}
.thumb:hover .thumb-video{opacity:1}

/* duration badge */
.thumb-duration{
  position:absolute;
  right:10px;
  top:10px;
  padding:5px 8px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;
  font-size:12px;
  font-weight:900;
  letter-spacing:.15px;
}

/* play icon (support both <div> and <span>) */
.thumb-play{
  position:absolute;
  left:10px;
  bottom:10px;
  width:40px;
  height:40px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.16);
  opacity:0;
  transition:opacity .18s, transform .18s;
  pointer-events:none;

  /* if engine inserts "▶" text inside, keep it centered */
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  font-weight:900;
  line-height:1;
}
.thumb:hover .thumb-play{opacity:1;transform:translateY(-1px)}

/* Optional badge if you added it */
.thumb-badge{
  position:absolute;
  left:10px;
  top:10px;
  padding:5px 8px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  color:#fff;
  font-size:11px;
  font-weight:950;
  letter-spacing:.35px;
}

/* meta compact */
.thumb-meta{
  padding:10px 12px 12px;
  display:grid;
  gap:8px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.14));
}
.thumb-title{
  padding:10px 12px 12px;
  font-size:14px;
  font-weight:900;
  line-height:1.2;
  max-height:2.4em;
  overflow:hidden;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.thumb-meta .thumb-title{
  padding:0;
}

/* tags */
.thumb-tags{
  padding:0 12px 12px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.thumb-meta .thumb-tags{
  padding:0;
}
.thumb-tags a.tag{
  padding:5px 8px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.12);
  font-weight:900;
  font-size:11px;
  transition: background .18s, border-color .18s, transform .18s;
}
.thumb-tags a.tag:hover{
  background:rgba(247,198,217,.10);
  border-color:rgba(247,198,217,.24);
  transform: translateY(-1px);
}

/* if no preview */
.thumb.no-preview .thumb-video{display:none!important}
.thumb.no-preview:hover .thumb-img{opacity:1!important}
.thumb.no-preview:hover .thumb-play{opacity:0!important}

@media(hover:none) and (pointer:coarse){
  .thumb-video{display:none}
  .thumb-play{display:none}
  .thumb:hover .thumb-img{opacity:1}
}

/* =========================
   PLAYER (video ~2x smaller)
   ========================= */
.player-section{
  max-width:var(--max);
  margin:10px auto 8px;
  padding:0 14px;
}

/* Make main video smaller and centered */
.player-box{
  max-width: 720px;
  margin: 0 auto;
  border:1px solid rgba(255,255,255,.12);
  background:#05060a;
  overflow:hidden;
  aspect-ratio:16/9;
  box-shadow: var(--shadow);
}
.player-box video,
.player-video{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  background:#000;
}

/* tags under player */
.player-tags{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.player-tags a.tag{
  padding:6px 10px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.12);
  font-weight:900;
  font-size:12px;
}
.player-tags a.tag:hover{
  background:rgba(216,180,254,.10);
  border-color:rgba(216,180,254,.22);
}

@media(max-width:768px){
  .player-box{max-width:100%}
}

/* =========================
   PAGINATION
   ========================= */
.bottom-pagination{
  max-width:var(--max);
  margin:18px auto 6px;
  padding:0 14px;
}
.pager{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.pager-btn{
  min-width:44px;
  height:44px;
  padding:0 14px;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.12);
  font-weight:950;
  transition: background .18s, border-color .18s, transform .18s;
}
.pager-btn:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.16);
  transform: translateY(-1px);
}
.pager-page.selected{
  background:rgba(255,255,255,.10);
  border-color:rgba(247,198,217,.24);
}
.is-disabled{opacity:.35;pointer-events:none}

/* =========================
   BOTTOM TAGS
   ========================= */
.bottom-tags{
  max-width:var(--max);
  margin:14px auto 28px;
  padding:14px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.08);
}
.bottom-tags nav{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
}
.bottom-tags a.bottom-tag-item{
  padding:8px 12px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.12);
  font-weight:950;
  font-size:13px;
  transition: background .18s, border-color .18s, transform .18s;
}
.bottom-tags a.bottom-tag-item:hover{
  background:rgba(216,180,254,.10);
  border-color:rgba(216,180,254,.22);
  transform: translateY(-1px);
}

/* =========================
   FOOTER
   ========================= */
.site-footer{
  padding:18px 14px 24px;
  text-align:center;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.12);
}
.trade-link{font-weight:900;color:rgba(255,244,250,.78)}
.trade-link a{color:rgba(247,198,217,.95);font-weight:950}

/* FIX: show play triangle inside .thumb-play (square icon) */
.thumb-play{
  position:absolute;
  left:10px;
  bottom:10px;
  width:40px;
  height:40px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.16);
  opacity:0;
  transition:opacity .18s, transform .18s;
  pointer-events:none;

  font-size:0;
  line-height:0;
}

.thumb-play::before{
  content:"";
  position:absolute;
  left:15px;
  top:12px;
  width:0;
  height:0;
  border-left:12px solid rgba(255,255,255,.92);
  border-top:8px solid transparent;
  border-bottom:8px solid transparent;
}

.thumb:hover .thumb-play{
  opacity:1;
  transform:translateY(-1px);
}

/* FORCE line breaks for long H1 titles (2–3 words per line) */
.hero-title,
.tag-h1,
.video-h1,
.site-title-text{
  display:block;
  max-width:520px;
  line-height:1.15;

  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;

  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
}

/* ===== PLAYER TITLE FIX: 2 lines, ~5–6 words per line ===== */
.video-h1{
  display:block;
  max-width:760px;
  line-height:1.15;

  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;

  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}

@media (max-width:640px){
  .video-h1{
    max-width:100%;
    -webkit-line-clamp:3;
  }
}
.top-menu{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}

.menu-right{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}