/* phase 3 catalog + detail */
.catalog-page{
  display:grid;
  gap:18px;
}

.catalog-hero{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
  align-items:center;
  padding:22px;
  border-radius:28px;
  background:linear-gradient(180deg, rgba(20,29,45,.95), rgba(14,22,34,.92));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.catalog-hero h1{
  margin:0 0 8px;
  font-size:clamp(30px, 5vw, 46px);
  line-height:1.06;
}

.catalog-hero p{
  margin:0;
  color:var(--muted);
}

.catalog-hero-side{
  display:flex;
  justify-content:flex-end;
}

.category-badge-big{
  min-width:180px;
  min-height:180px;
  border-radius:28px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border:1px solid var(--line);
  font-size:70px;
}

.catalog-filters{
  display:grid;
  grid-template-columns:1.4fr .9fr .9fr .8fr auto auto;
  gap:12px;
  padding:18px;
  border-radius:24px;
  background:linear-gradient(180deg, rgba(18,25,39,.96), rgba(14,20,31,.96));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.catalog-filters input,
.catalog-filters select{
  width:100%;
  min-height:48px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:#1a2438;
  color:#fff;
  padding:0 14px;
  outline:none;
}

.catalog-count{
  color:var(--muted);
  margin:2px 0 0;
  font-size:14px;
}

.game-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
}

.catalog-card{
  border-radius:24px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(27,37,58,.97), rgba(19,27,42,.97));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.catalog-card-cover{
  aspect-ratio:16/10;
  background:#182235;
}
.catalog-card-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.catalog-card-body{
  padding:16px;
  display:grid;
  gap:12px;
}

.catalog-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.catalog-title-row h3{
  margin:0;
  font-size:20px;
  line-height:1.24;
}

.kp-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.kp-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.chip-category{
  background:rgba(125,92,255,.16);
  color:#d0b3ff;
}
.chip-version{
  background:rgba(255,105,180,.15);
  color:#ffbedb;
}
.chip-language{
  background:rgba(104,161,255,.16);
  color:#c6dcff;
}
.chip-platform{
  background:rgba(77,191,148,.15);
  color:#b7f1da;
}
.chip-genre{
  background:rgba(138,115,255,.12);
  color:#d9cdff;
}
.chip-access-public{
  background:rgba(62,177,121,.14);
  color:#92f4be;
}
.chip-access-premium{
  background:rgba(146,93,255,.16);
  color:#d0b3ff;
}

.catalog-actions{
  display:flex;
  gap:10px;
}

.catalog-actions a{
  flex:1;
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  font-weight:800;
}

.btn-detail{
  position:relative;
  overflow:hidden;
  background:linear-gradient(90deg,#ff5fa9,#ff86c3);
  color:#fff;
  box-shadow:0 10px 24px rgba(255,95,169,.25);
}
.btn-detail::after{
  content:"";
  position:absolute;
  inset:-40% auto -40% -30%;
  width:36%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform:rotate(20deg);
  animation: clingSweep 2.6s linear infinite;
}
@keyframes clingSweep{
  0%{left:-35%}
  100%{left:120%}
}

.empty-box{
  border-radius:24px;
  padding:26px;
  border:1px dashed rgba(255,255,255,.12);
  color:var(--muted);
  background:rgba(255,255,255,.03);
}

/* detail */
.detail-page{
  display:grid;
  gap:18px;
}

.detail-hero{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:18px;
}

.detail-cover-card,
.detail-info-card,
.detail-panel{
  border-radius:28px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(20,29,45,.95), rgba(14,22,34,.92));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.detail-cover{
  aspect-ratio:4/5;
  background:#182235;
}
.detail-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.detail-info-card{
  padding:22px;
  display:grid;
  gap:14px;
}

.detail-info-card h1{
  margin:0;
  font-size:clamp(34px, 5vw, 52px);
  line-height:1.05;
}

.detail-sub{
  color:var(--muted);
}

.detail-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.detail-btn{
  min-height:48px;
  padding:0 16px;
  border-radius:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  border:1px solid rgba(255,255,255,.08);
}

.detail-btn.public{
  background:#273652;
  color:#fff;
}
.detail-btn.premium{
  background:linear-gradient(90deg,#7d5cff,#a56cff);
  color:#fff;
}
.detail-btn.locked{
  background:#38263f;
  color:#ffd4ea;
}
.detail-btn.back{
  background:rgba(255,255,255,.05);
  color:#fff;
}

.detail-grid{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:18px;
}

.detail-panel{
  padding:22px;
}

.detail-panel h2{
  margin:0 0 14px;
  font-size:24px;
}

.detail-panel p{
  margin:0;
  color:var(--muted);
  line-height:1.75;
}

.info-list{
  display:grid;
  gap:12px;
}
.info-item{
  display:grid;
  gap:6px;
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.03);
}
.info-item strong{
  color:#fff;
}
.info-item span{
  color:var(--muted);
}

.comment-list{
  display:grid;
  gap:12px;
}
.comment-item{
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.comment-item-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:#fff;
  font-weight:700;
}
.comment-item small{
  color:var(--muted);
}
.comment-item p{
  margin:10px 0 0;
}

.related-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:14px;
}

.related-card{
  border-radius:22px;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(27,37,58,.97), rgba(19,27,42,.97));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}
.related-card-cover{
  aspect-ratio:16/10;
  background:#182235;
}
.related-card-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.related-card-body{
  padding:14px;
  display:grid;
  gap:10px;
}
.related-card-body h3{
  margin:0;
  font-size:18px;
  line-height:1.2;
}

@media (max-width: 980px){
  .catalog-hero,
  .detail-hero,
  .detail-grid{
    grid-template-columns:1fr;
  }

  .catalog-filters{
    grid-template-columns:1fr 1fr;
  }

  .game-grid,
  .related-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .catalog-hero-side{
    justify-content:flex-start;
  }
}

@media (max-width: 640px){
  .catalog-filters{
    grid-template-columns:1fr;
  }

  .game-grid,
  .related-grid{
    grid-template-columns:1fr;
  }

  .category-badge-big{
    min-width:120px;
    min-height:120px;
    font-size:48px;
  }
}

.btn-detail{
  position:relative;
  overflow:hidden;
  width:100%;
  min-height:48px;
  padding:0 16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  font-weight:800;
  font-size:15px;
  line-height:1;
  text-decoration:none;
  color:#fff;
  background:linear-gradient(90deg,#ff5fa9 0%, #ff78bd 45%, #ff9fd2 100%);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:
    0 10px 24px rgba(255,95,169,.24),
    inset 0 1px 0 rgba(255,255,255,.18);
}

.btn-detail::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:-35%;
  width:28%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
  transform:skewX(-22deg);
  animation:clingSweep 2.8s linear infinite;
}

.btn-detail:hover{
  transform:translateY(-1px);
  box-shadow:
    0 14px 30px rgba(255,95,169,.30),
    inset 0 1px 0 rgba(255,255,255,.2);
}

.related-card-body .btn-detail{
  margin-top:4px;
}

.detail-download-panel{
  display:grid;
  gap:16px;
}

.download-block{
  padding:16px;
  border-radius:20px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}

.download-block h3{
  margin:0 0 12px;
  font-size:22px;
  line-height:1.2;
  color:#fff;
}

.download-link-btn{
  width:100%;
  min-height:54px;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  text-decoration:none;
  font-size:18px;
  font-weight:800;
  line-height:1;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 12px 24px rgba(0,0,0,.18);
}

button.download-link-btn{
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
}

.download-link-btn.windows{
  background:linear-gradient(90deg, #3d6df2, #4f85ff);
  color:#fff;
}

.download-link-btn.android{
  background:linear-gradient(90deg, #16a34a, #22c55e);
  color:#fff;
}

.download-link-btn.locked{
  background:linear-gradient(90deg, #6b3f74, #8d4ea1);
  color:#fff0fb;
  cursor:not-allowed;
}

.kp-pagination{
  margin-top:20px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  align-items:center;
}

.kp-page-btn{
  min-width:44px;
  height:44px;
  padding:0 14px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:#eef2ff;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  font-weight:700;
}

.kp-page-btn.active{
  background:linear-gradient(90deg, #7d5cff, #b06cff);
  color:#fff;
  border-color:transparent;
}

.kp-page-dots{
  color:rgba(255,255,255,.65);
  font-weight:700;
  padding:0 4px;
}