/* ===== GAMES PAGE ===== */
#page-games {
  padding: 0;
  padding-top: calc(var(--nav-height) + 12px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: center;
}

#page-games .games-page-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 8px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(24,24,24,0.24);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#page-games .page-search-wrap {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 10px 12px;
}

#page-games .page-search-wrap svg {
  color: rgba(255,255,255,0.82);
}

#page-games #games-search {
  width: 100%;
  min-width: 0;
  color: rgba(255,255,255,0.95);
  font-weight: 500;
}

#page-games #games-search::placeholder {
  color: rgba(255,255,255,0.6);
}

#page-games .games-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  order: 2;
  flex: 0 0 auto;
  overflow: visible;
}


  
#games-content {
  width: 100%;
  box-sizing: border-box;
}

#games-content {
  margin: 0 auto 20px;
  padding: 12px 0 4px;
  width: min(100%, 1600px);
  max-width: 1600px;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
  position: relative;
  z-index: 1;
}

#games-pagination {
  width: 100%;
  padding: 0 0 24px;
  position: relative;
  z-index: 1;
}

.game-action-btn,
.game-library-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-active);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.game-action-btn:hover,
.game-library-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.game-library-btn.active {
  color: var(--bg-primary);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.game-library-dropdown {
  position: relative;
  z-index: 1001;
  overflow: visible;
}

.game-library-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--bg-active);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 1002;
}

.game-library-dropdown-menu.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.game-library-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.game-library-option:first-child {
  border-radius: 8px 8px 0 0;
}

.game-library-option:last-child {
  border-radius: 0 0 8px 8px;
}

.game-library-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.game-library-option svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.game-library-option:hover svg {
  opacity: 1;
}

.game-action-btn svg {
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* Category label */
.games-category-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
  padding: 16px 20px 8px;
}

/* Grid — 8 columns */
.games-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 20px 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Game card — same structure as app card */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  animation: appCardIn 0.35s ease forwards;
  opacity: 0;
  position: relative;
}
.game-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.game-card:active { transform: translateY(-1px) scale(0.99); }

/* Thumb banner */
.game-thumb {
  width: 100%; height: 80px;
  background: var(--bg-active);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.game-banner-bg {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-size: 180px 180px;
  background-position: center;
  filter: blur(14px) saturate(1.2);
  transform: scale(1.15);
  transition: opacity var(--transition);
}
.game-card:hover .game-banner-bg { opacity: 0.14; }

.game-icon-large {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.game-icon-large img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.game-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
  display: flex; align-items: flex-end; padding: 8px;
  opacity: 0; transition: opacity var(--transition);
}
.game-card:hover .game-thumb-overlay { opacity: 1; }

.game-play-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.92); color: #000;
  border-radius: 20px; padding: 4px 10px;
  font-size: 11px; font-weight: 700;
}

/* Card body */
.game-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 4px; flex: 1;
}
.game-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-footer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 4px;
}
.game-open-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  padding: 4px 9px; border-radius: 20px;
  background: var(--bg-active); border: 1px solid var(--border);
  transition: all var(--transition);
}
.game-card:hover .game-open-btn {
  color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-hover);
}
.game-category-tag {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}

/* Section divider */
.games-divider {
  height: 1px; background: var(--border); margin: 4px 20px 0; opacity: 0.4;
}

@media (max-width: 1700px) {
  .games-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
  .games-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #games-content { margin: 0 12px 16px; }
}

/* Movies page */
#page-movies { padding: 0; padding-top: var(--nav-height); overflow: hidden; }
.movies-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 16px; color: var(--text-muted); font-size: 13px;
}
.movies-spinner {
  width: 28px; height: 28px; border: 2px solid var(--border);
  border-top-color: var(--text-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
