@font-face {
    font-family: IRANYekanX;
    font-style: normal;
    font-weight: bold;
    src: url('https://dl.4-player.ir/fonts/woff/IRANYekanX-Bold.woff') format('woff'),
         url('https://dl.4-player.ir/fonts/woff2/IRANYekanX-Bold.woff2') format('woff2');
}
@font-face {
    font-family: IRANYekanX;
    font-style: normal;
    font-weight: normal;
    src: url('https://dl.4-player.ir/fonts/woff/IRANYekanX-Regular.woff') format('woff'),
         url('https://dl.4-player.ir/fonts/woff2/IRANYekanX-Regular.woff2') format('woff2');
}
:root{
  --bg:#0d1117; --bg2:#161b22; --bg3:#21262d; --border:#30363d;
  --text:#e6edf3; --muted:#8b949e; --accent:#e0b34a; --accent2:#f0cf7a;
  --radius:12px;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:'IRANYekanX',Tahoma,sans-serif;
  background:var(--bg); color:var(--text);
  min-height:100vh;
}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
img{display:block;}

/* ---------- Header ---------- */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(13,17,23,.92); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
  padding:12px 20px;
}
.head-row{
  max-width:1400px; margin:0 auto;
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.logo{
  font-size:1rem; font-weight:normal; white-space:nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.logo span{color:var(--text);}
.search-box{
  flex:1 1 220px; min-width:180px;
  display:flex; align-items:center; gap:8px;
  background:var(--bg2); border:1px solid var(--border);
  border-radius:10px; padding:8px 12px;
}
.search-box input{
  flex:1; background:none; border:none; outline:none;
  color:var(--text); font-family:inherit; font-size:.9rem;
}
.controls{display:flex; gap:10px; align-items:center;}
.sort-box select{
  background:var(--bg2); color:var(--text); border:1px solid var(--border);
  border-radius:8px; padding:8px 10px; font-family:inherit; font-size:.85rem; outline:none;
}
.view-toggle{display:flex; border:1px solid var(--border); border-radius:8px; overflow:hidden;}
.view-toggle button{
  padding:8px 14px; font-size:.85rem; background:var(--bg2); color:var(--muted);
}
.view-toggle button.active{background:var(--accent); color:#1a1a1a; font-weight:700;}

/* ---------- Filter chips ---------- */
.filters{
  max-width:1400px; margin:14px auto 0; padding:0 20px;
  display:flex; flex-direction:column; gap:10px;
}
.filter-group{display:flex; align-items:flex-start; gap:10px; flex-wrap:wrap;}
.filter-label{
  font-size:.8rem; color:var(--muted); padding-top:5px; white-space:nowrap; font-weight:700;
}
.chips{display:flex; flex-wrap:wrap; gap:8px;}
.chip{
  padding:5px 14px; font-size:.8rem;
  background:var(--bg2); border:1px solid var(--border); border-radius:999px;
  color:var(--muted); transition:all .15s;
}
.chip:hover{border-color:var(--accent); color:var(--text);}
.chip.active{background:var(--accent); border-color:var(--accent); color:#1a1a1a; font-weight:700;}

/* ---------- Grid ---------- */
main{max-width:1400px; margin:0 auto; padding:24px 20px 60px;}
.stats-line{color:var(--muted); font-size:.85rem; margin-bottom:16px;}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:18px;}
.card{
  position:relative; border-radius:var(--radius); overflow:hidden;
  background:var(--bg2); border:1px solid var(--border);
  cursor:pointer; transition:transform .15s, box-shadow .15s;
}
.card:hover{transform:translateY(-4px); box-shadow:0 10px 28px rgba(0,0,0,.5);}
.cover-wrap{position:relative; aspect-ratio:2/3; background:var(--bg3); overflow:hidden;}
.cover-wrap img{width:100%; height:100%; object-fit:cover;}
.badge-score{
  position:absolute; top:8px; left:8px; z-index:2;
  background:rgba(0,0,0,.75); color:var(--accent2);
  padding:3px 8px; border-radius:8px; font-size:.75rem; font-weight:800;
  direction:ltr;
}
/* hover overlay */
.hover-overlay{
  position:absolute; inset:0; z-index:3;
  display:flex; flex-direction:column; justify-content:flex-end;
  gap:10px; padding:14px 12px;
  background:linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,0) 80%);
  opacity:0; transition:opacity .2s; pointer-events:none;
}
.card:hover .hover-overlay{opacity:1; pointer-events:auto;}
.hover-feats{display:flex; flex-wrap:wrap; gap:6px;}
.hover-feats .hf{
  font-size:.68rem; padding:2px 8px; border-radius:999px;
  background:rgba(255,255,255,.14); color:#fff; white-space:nowrap;
}
.btn-launcher{
  padding:9px 10px; border-radius:9px; text-align:center;
  background:var(--accent); color:#1a1a1a; font-weight:800; font-size:.82rem;
  transition:background .15s;
}
.btn-launcher:hover{background:var(--accent2);}

/* ---------- List ---------- */
.list{display:flex; flex-direction:column; gap:10px;}
.list-row{
  display:flex; align-items:center; gap:14px;
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 14px; cursor:pointer; transition:border-color .15s;
}
.list-row:hover{border-color:var(--accent);}
/* مهار کردن کانتینر آیکون در حالت لیست */
.list-icon {
  position: relative;
  width: 48px;       /* یا هر اندازه‌ای که برای آیکون لیست مدنظرتان است */
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
}

.list-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* اسکلتون داخل آیکون لیست */
.list-icon .skeleton {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.list-feats{display:flex; flex-wrap:wrap; gap:6px; flex:1;}
.list-feats .hf{
  font-size:.7rem; padding:2px 9px; border-radius:999px;
  background:var(--bg3); border:1px solid var(--border); color:var(--muted);
}
.list-row .btn-launcher{padding:8px 18px; flex-shrink:0;}

/* ---------- Skeleton ---------- */
.skeleton{
  position:absolute; inset:0;
  background:linear-gradient(100deg, var(--bg3) 30%, #2a3038 50%, var(--bg3) 70%);
  background-size:200% 100%; animation:shimmer 1.3s infinite;
}
@keyframes shimmer{from{background-position:200% 0;} to{background-position:-200% 0;}}

/* ---------- Game page overlay ---------- */
.game-page{
  position:fixed; inset:0; z-index:100; overflow-y:auto;
  background:var(--bg); display:none;
}
.game-page.open{display:block;}
.hero{
  position:relative; min-height:340px;
  display:flex; align-items:flex-end; padding:40px 24px 28px;
}
.hero-bg{
  position:absolute; inset:0; background-size:cover; background-position:center;
}
.hero-bg::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(to top, var(--bg) 5%, rgba(13,17,23,.45) 60%, rgba(13,17,23,.7));
}
.hero-inner{
  position:relative; z-index:2; max-width:1100px; margin:0 auto; width:100%;
  display:flex; gap:24px; align-items:flex-end; flex-wrap:wrap;
}
.hero-cover{
  width:190px; aspect-ratio:2/3; border-radius:12px; overflow:hidden; flex-shrink:0;
  border:1px solid var(--border); background:var(--bg3); box-shadow:0 12px 32px rgba(0,0,0,.6); position: relative; display: inline-block;
}
.hero-cover img{width:100%; height:100%; object-fit:cover;}
.hero-info{flex:1; min-width:260px; display:flex; flex-direction:column; gap:12px;}
.hero-title{font-size:1.7rem; font-weight:800; line-height:1.3;}
.hero-chips{display:flex; flex-wrap:wrap; gap:6px;}
.hero-chips .hc{
  font-size:.72rem; padding:3px 10px; border-radius:999px;
  background:rgba(255,255,255,.12); color:#fff;
}
.hero-chips .hc.feat{background:rgba(224,179,74,.18); color:var(--accent2); border:1px solid rgba(224,179,74,.4);}
.btn-add{
  align-self:flex-start; display:inline-block;
  padding:13px 34px; border-radius:11px;
  background:var(--accent); color:#1a1a1a; font-weight:800; font-size:1rem;
  transition:background .15s;
}
.btn-add:hover{background:var(--accent2);}
.game-body{max-width:1100px; margin:0 auto; padding:28px 24px 60px;}
.meta-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:26px;
}
.meta-item{
  background:var(--bg2); border:1px solid var(--border); border-radius:10px; padding:12px 14px;
}
.meta-item .mk{font-size:.72rem; color:var(--muted); margin-bottom:4px;}
.meta-item .mv{font-size:.9rem; font-weight:700; direction:ltr; text-align:right;}
.desc{line-height:2; color:#c9d1d9; font-size:.95rem;  white-space: pre-line; line-height: 1.8;}
.gp-topbar{
  position:sticky; top:0; z-index:5; flex-direction: row-reverse;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:12px 20px; background:rgba(13,17,23,.9); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}

/* ---------- Video Play Button & Modal ---------- */

.btn-play-hero {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  backdrop-filter: blur(4px);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn-play-hero:hover {
  background: var(--accent, #e50914);
  border-color: var(--accent, #e50914);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
}

/* دکمه موبایل: روی عکس کاور */
.btn-play-cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10 !important;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  display: none; /* پیش‌فرض در دسکتاپ پنهان */
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  backdrop-filter: blur(4px);
}

/* حل مشکل مسدود شدن کلیک توسط لایه رویی در دسکتاپ */
.hero-inner {
  pointer-events: none;
}
.hero-inner > * {
  pointer-events: auto;
}

/* رفتار واکنش‌گرا (موبایل و تبلت) */
@media (max-width: 768px) {
  .btn-play-hero {
    display: none !important;
  }
  .btn-play-cover {
    display: flex !important;
  }
}

/* لایه تیره و تمام‌صفحه مودال */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer; /* نشان‌دهنده امکان کلیک برای بستن */
}

.video-modal.active {
  display: flex !important;
}

/* کادر ویدیو: ابعاد بهینه و بزرگ در دسکتاپ و موبایل */
.video-modal-content {
  position: relative;
  width: min(92vw, 1000px, calc((100vh - 32px) * 16 / 9));
  max-width: 100%;
  max-height: calc(100vh - 32px);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  cursor: default; /* جلوگیری از بسته‌شدن هنگام کلیک روی خود ویدیو */
}

.video-responsive {
  width: 100%;
  height: 100%;
}

.video-modal-content iframe,
.video-modal-content video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #000;
}

/* مخفی کردن دکمه ضربدر */
.video-modal-close {
  display: none !important;
}




/* ---------- Navigation & Actions Buttons ---------- */

.gp-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close, .btn-back, .btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color .2s ease,
    color .2s ease,
    background .2s ease,
    box-shadow .2s ease,
    transform .15s ease,
    opacity .2s ease;
  user-select: none;
}

.btn-close .icon,
.btn-back .icon,
.btn-nav .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close .icon svg,
.btn-back .icon svg,
.btn-nav .icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.btn-close:hover:not(:disabled), 
.btn-back:hover:not(:disabled), 
.btn-nav:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,255,255,.04);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.btn-close:hover .icon-close {
  transform: rotate(90deg) scale(1.08);
}

.btn-close:active:not(:disabled), 
.btn-back:active:not(:disabled), 
.btn-nav:active:not(:disabled) {
  transform: scale(.96);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--muted);
}

/* ---------- Navigation & Actions Buttons End ---------- */
