/* Games page: flat dark layout, wide card grid, source dropdown inside the search bar. */

html.games-mode body {
  background: #09090b;
}
html.games-mode .hdr {
  background: #0b0b0e;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.games-mode #view {
  padding: 1.5rem 3rem 3rem;
}
html.games-mode .hdr-search-slot #search {
  background: #0f0f13;
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding-right: 20rem;
}

/* ---- source dropdown (sits where the old Cloud switch was) ---- */
.search-count.has-dd {
  pointer-events: none;
}
.src-dd {
  position: relative;
  pointer-events: auto;
}
.src-dd-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8.5rem;
  max-width: 13rem;
  height: 34px;
  padding: 0 0.7rem 0 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.src-dd-btn:hover,
.src-dd.open .src-dd-btn {
  background: rgba(125, 255, 138, 0.1);
  border-color: rgba(125, 255, 138, 0.5);
  color: #7dff8a;
}
.src-dd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-dd-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.src-dd.open .src-dd-btn svg {
  transform: rotate(180deg);
}
.src-dd-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: 15rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121216;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.src-dd-menu[hidden] {
  display: none;
}
.src-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #d4d4d8;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.src-dd-item:hover,
.src-dd-item:focus-visible {
  background: rgba(125, 255, 138, 0.1);
  color: #7dff8a;
  outline: none;
}
.src-dd-item[aria-selected="true"] {
  color: #fff;
  background: rgba(125, 255, 138, 0.1);
}
.src-dd-count {
  color: #71717a;
  font-size: 12px;
}

/* ---- section tabs: Games / Cloud Games ---- */
.gp-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.gp-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #a1a1aa;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.gp-tab:hover {
  color: #7dff8a;
  background: rgba(125, 255, 138, 0.1);
}
.gp-tab[aria-selected="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}
.gp-tab small {
  color: #71717a;
  font-size: 12px;
}

/* ---- card grid ---- */
.gp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
}
.gp-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #101014;
  color: #d4d4d8;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.gp-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform 0.15s;
}
.gp-cell > .gp-card {
  flex: 1;
}
.gp-cell:hover {
  transform: translateY(-2px);
}
.gp-cell:hover .gp-card {
  border-color: rgba(125, 255, 138, 0.6);
  background: #14141a;
}
.gp-cell:hover .gp-name {
  color: #7dff8a;
}
/* Favorite star in the thumbnail's top-right corner */
.gp-star {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(125, 255, 138, 0.35);
  border-radius: 8px;
  background: rgba(8, 10, 12, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #7dff8a;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.gp-star svg {
  transition: transform 0.15s, fill 0.15s;
}
.gp-star:hover,
.gp-star:focus-visible {
  background: rgba(125, 255, 138, 0.2);
  border-color: rgba(125, 255, 138, 0.9);
  outline: none;
}
.gp-star:hover svg,
.gp-star:focus-visible svg {
  transform: scale(1.18);
}
.gp-star[aria-pressed="true"] {
  background: rgba(125, 255, 138, 0.16);
  border-color: rgba(125, 255, 138, 0.6);
}
.gp-star[aria-pressed="true"] svg {
  fill: currentColor;
}
.gp-art {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 70% 30%, rgba(125, 255, 138, 0.16), transparent 60%), #0b0b0e;
}
.gp-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gp-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7dff8a;
  font-size: 2.2rem;
  opacity: 0.7;
}
.gp-name {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  padding: 0.6rem 0.8rem;
  background: #0d0d10;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
/* The page is a column so the switcher sits at the very bottom even on short pages. */
.games-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 8.5rem);
}
.gp-pager {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-top: auto;
  padding-top: 2rem;
}
.gp-pager[hidden] {
  display: none;
}
.gp-pg-btn,
.gp-pg-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: #d4d4d8;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gp-pg-btn {
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.gp-pg-btn:first-child {
  border-radius: 10px 0 0 10px;
}
.gp-pg-btn:last-child {
  border-radius: 0 10px 10px 0;
}
.gp-pg-btn:hover:not(:disabled) {
  color: #7dff8a;
  background: rgba(125, 255, 138, 0.1);
  border-color: rgba(125, 255, 138, 0.5);
}
.gp-pg-btn:disabled {
  color: #52525b;
  cursor: default;
}
.gp-pg-info {
  margin: 0 -1px;
  color: #a1a1aa;
  letter-spacing: 0.04em;
}
.gp-empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #a1a1aa;
  font-size: 14px;
}
.gp-empty strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #e4e4e7;
  font-size: 15px;
  font-weight: 600;
}
.gp-empty[hidden] {
  display: none;
}

@media (max-width: 900px) {
  html.games-mode #view {
    padding: 1rem 1rem 2rem;
  }
  .gp-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
  }
  .gp-pg-btn,
  .gp-pg-info {
    height: 40px;
    padding: 0 0.8rem;
    font-size: 12px;
  }
  .gp-name {
    min-height: 3rem;
    font-size: 13px;
  }
}
@media (max-width: 640px) {
  html.games-mode .hdr-search-slot #search {
    padding-right: 8rem;
  }
  html.games-mode #search-count-text,
  html.games-mode .search-count-divider {
    display: none;
  }
  .src-dd-btn {
    min-width: 5.5rem;
    max-width: 6.5rem;
  }
}

/* Credit + "Select your blocker" popups (games with blockers, see js/games.js) */
.lv-pop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: lv-pop-fade 0.15s ease-out;
}
.lv-pop {
  width: 100%;
  max-width: 31rem;
  padding: 1.25rem 1.4rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(16, 16, 24, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
}
.lv-pop-title {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}
.lv-pop-msg {
  margin: 0.2rem 0 1.1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #e4e4e7;
}
.lv-pop-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.lv-pop-opt {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.lv-pop-opt:hover,
.lv-pop-opt:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(125, 255, 138, 0.5);
  outline: none;
}
.lv-pop-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
}
.lv-pop-close {
  padding: 0.35rem 0.2rem;
  background: none;
  color: #a1a1aa;
  font-size: 0.95rem;
  font-weight: 500;
}
.lv-pop-close:hover,
.lv-pop-close:focus-visible {
  color: #fff;
  outline: none;
}
.lv-pop-ok {
  min-width: 5.5rem;
  padding: 0.55rem 1.2rem;
  border: 0;
  border-radius: 10px;
  background: #7dff8a;
  color: #0a0a0f;
  font-size: 0.95rem;
  font-weight: 700;
}
.lv-pop-ok:hover,
.lv-pop-ok:focus-visible {
  background: #a3ffac;
  outline: none;
}
@keyframes lv-pop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-pop-overlay { animation: none; }
}
