/* TotalVibe 게임 사이트 개선 CSS - 2026-11-09 */

/* ========== 게임 페이지 (/games/) ========== */

.game-toolbar {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
  padding: 16px 20px;
  border-bottom: 1px solid #2a3044;
  margin-bottom: 24px;
}

.toolbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.sort-dropdown {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #3a4858;
  background: #141820;
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  min-width: 140px;
}

.sort-dropdown:hover {
  border-color: #7c3aed;
}

.category-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #3a4858;
  background: transparent;
  color: #b4c1d1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 13px;
}

.filter-btn:hover {
  border-color: #7c3aed;
  color: #fff;
}

.filter-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #5038a3 100%);
  border-color: #f43f5e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ========== 게임 상세 페이지 (/games/new/[slug]/) ========== */

.game-detail-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid #2a3a4e;
}

.game-header h1 {
  font-size: 24px;
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.game-controls {
  display: flex;
  gap: 8px;
}

.game-controls button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #3a4858;
  background: #141820;
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.game-controls button:hover {
  background: #7c3aed;
  border-color: #f43f5e;
  color: #fff;
}

.game-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0f1a;
  border: 2px solid #2a3a4e;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-viewport {
  width: 100%;
  height: 100%;
}

.game-viewport iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* 전체화면 모드 */
.game-player.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  z-index: 9999;
  border: 0;
  margin: 0;
  padding: 0;
}

.game-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-container {
  background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  min-height: 100px;
  border: 1px solid #2a3a4e;
}

.related-games {
  background: #0f1419;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #2a3a4e;
}

.related-games h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #fff;
}

.game-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.game-carousel-item {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid #2a3a4e;
}

.game-carousel-item:hover {
  transform: translateY(-4px);
  border-color: #7c3aed;
}

.game-carousel-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.game-carousel-item p {
  padding: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #b4c1d1;
  background: #141820;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 홈페이지 (/) ========== */

.hero-banner {
  background: linear-gradient(135deg, #1a2f5c 0%, #0f1419 100%);
  padding: 60px 20px;
  text-align: center;
  border-bottom: 1px solid #2a3a4e;
  margin-bottom: 40px;
}

.banner-content h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 16px 0;
  color: #fff;
  font-weight: 900;
}

.banner-content p {
  font-size: 18px;
  color: #b4c1d1;
  margin: 0;
}

.featured-section,
.new-section,
.category-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.featured-section h2,
.new-section h2,
.category-section h2 {
  font-size: 24px;
  margin: 0 0 20px 0;
  color: #fff;
  font-weight: 800;
}

.game-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.category-grid a {
  padding: 24px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
  border: 1px solid #2a3a4e;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.category-grid a:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5038a3 100%);
  border-color: #f43f5e;
  transform: translateY(-4px);
}

.ad-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  min-height: 120px;
  background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
  border-radius: 10px;
  border: 1px solid #2a3a4e;
}

.cta-section {
  max-width: 1200px;
  margin: 60px auto 40px;
  padding: 40px 20px;
  text-align: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #5038a3 100%);
}

.cta-section h2 {
  font-size: 28px;
  margin: 0 0 24px 0;
  color: #fff;
}

.cta-button {
  display: inline-block;
  padding: 16px 32px;
  background: #fff;
  color: #7c3aed;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 800;
  font-size: 16px;
  transition: all 0.2s;
}

.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ========== 모바일 최적화 ========== */

@media (max-width: 768px) {
  .toolbar-container {
    flex-direction: column;
    gap: 12px;
  }

  .sort-dropdown {
    width: 100%;
  }

  .category-filter {
    width: 100%;
  }

  .game-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .game-header h1 {
    font-size: 18px;
  }

  .game-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .game-player {
    min-height: 350px;
    aspect-ratio: auto;
  }

  .game-carousel {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    padding: 40px 20px;
  }

  .banner-content h1 {
    font-size: 28px;
  }

  .cta-section {
    padding: 24px 16px;
  }

  .cta-section h2 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .game-header h1 {
    font-size: 16px;
  }

  .game-controls button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .sort-dropdown {
    font-size: 12px;
    padding: 6px 10px;
  }
}


/* Integrated TotalVibe real Adsterra zones, responsive without hidden ad requests */
.tvx-ad{margin:18px auto 26px;max-width:100%;clear:both;text-align:center;box-sizing:border-box}
.tvx-ad-label{display:block;font:600 10px/1.5 system-ui,sans-serif;letter-spacing:.12em;color:#64748b;text-transform:uppercase;margin-bottom:8px}
.tvx-ad-inner{width:max-content;max-width:100%;margin:0 auto;overflow:hidden}
.tvx-ad-728x90 .tvx-ad-inner{width:728px;min-height:90px}
.tvx-ad-300x250 .tvx-ad-inner{width:300px;min-height:250px}
.tvx-ad-320x50 .tvx-ad-inner{width:320px;min-height:50px}
.tvx-ad-mobile{display:none}
.tvx-ad-desktop{display:block}
.tvx-sortbar{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:14px 0}
.tvx-sortbar label{font:600 14px/1.4 system-ui,sans-serif;color:inherit}
.tvx-sortbar select{background:#101928;color:#f1f5f9;border:1px solid #66788d;border-radius:8px;padding:9px 12px;max-width:100%}
#games-grid .g-game-card[hidden]{display:none!important}
@media(max-width:819px){
 .tvx-ad-mobile{display:block}
 .tvx-ad-desktop{display:none}
 .tvx-sortbar{justify-content:flex-start}
 .tvx-sortbar select{min-width:140px}
}


/* 2026-11-09 independent QA: narrow-page overflow fixes */
@media (max-width:600px) {
 .tv-global-ad[data-tv-ad-category="board"] {
  width:100%!important;max-width:100%!important;box-sizing:border-box!important;
 }
}
@media (min-width:640px) and (max-width:819px) {
 header a[href="/compare/best-budget-projectors-2026"] { display:none!important; }
}
