/* Games Directory (Phase 5)
   Design tokens + component styling.
   Strictly scoped to the /games archive container to prevent theme leakage.

   DIRECTORY GUARDRAILS (Phase 0 – do not violate)
   - This stylesheet must not introduce homepage-only patterns that reduce directory coverage.
   - Game artwork should be treated as vertical posters; avoid banner-style cropping in the grid.
   - Token unification (`--ip-*` -> `--ipx-*`) is handled in Phase 1.
*/

.ip-games-archive{
  /* Phase 1: Token unification (directory scoped)
     - Source of truth: --ipx-*
     - Legacy aliases: --ip-* map to --ipx-* to avoid regressions while we refactor components.
  */

  /* Backgrounds */
  --ipx-bg: #0d0d0d;
  --ipx-bg-elevated: #111111;
  --ipx-surface: #1a1a1a;
  --ipx-surface-hover: #222222;
  --ipx-surface-active: #2a2a2a;

  /* Text */
  --ipx-text: #f5f5f7;
  --ipx-text-secondary: rgba(245,245,247,.72);
  --ipx-text-muted: rgba(245,245,247,.52);

  /* Brand */
  --ipx-accent: var(--ip-primary);
  --ipx-accent-hover: #d94ff5;
  --ipx-accent-glow: rgba(200, 42, 239, 0.25);

  /* Borders */
  --ipx-border: rgba(255,255,255,.12);
  --ipx-border-strong: rgba(255,255,255,.18);

  /* Shadows */
  --ipx-shadow: 0 18px 60px rgba(0,0,0,.40);

  /* Geometry */
  --ipx-radius: 12px;
  --ipx-radius-pill: 999px;

  /* Focus ring */
  --ipx-focus: 0 0 0 3px var(--ipx-accent-glow);

  /* Legacy aliases (Phase 1) */
  --ip-bg: var(--ipx-bg);
  --ip-surface: var(--ipx-surface);
  --ip-surface-2: var(--ipx-surface-hover);
  --ip-text: var(--ipx-text);
  --ip-muted: var(--ipx-text-secondary);
  --ip-border: var(--ipx-border);
  --ip-border-strong: var(--ipx-border-strong);
  --ip-shadow: var(--ipx-shadow);
  --ip-radius: var(--ipx-radius);
  --ip-radius-pill: var(--ipx-radius-pill);
  --ip-focus: var(--ipx-focus);
  --ip-accent: var(--ipx-accent);

  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Atmosphere */
  background:
    radial-gradient(1200px 800px at 50% -10%, rgba(200,42,239,0.12), transparent 60%),
    radial-gradient(900px 700px at 20% 0%, rgba(255,255,255,0.04), transparent 55%),
    var(--ipx-bg);
  color: var(--ipx-text);
}

/* Phase 2: Directory Hero (optional)
   - Must not block access to search/grid
   - Visual only; still a directory page
*/
.ip-games-archive .ipx-directory-hero{
  position: relative;
  border: 1px solid var(--ipx-border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  height: min(45vh, 520px);
  margin: 0 0 18px;
  background: #0b0b0b;
  box-shadow: var(--ipx-shadow);
}

.ip-games-archive .ipx-hero-media,
.ip-games-archive .ipx-hero-overlay{
  position: absolute;
  inset: 0;
}

.ip-games-archive .ipx-hero-fallback{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.1);
  transform: scale(1.02);
}

/* Optional focal-point presets (admin setting) */
.ip-games-archive .ipx-hero-fallback[data-ip-fallback-pos="top"]{ object-position: center top; }
.ip-games-archive .ipx-hero-fallback[data-ip-fallback-pos="bottom"]{ object-position: center bottom; }
.ip-games-archive .ipx-hero-fallback[data-ip-fallback-pos="left"]{ object-position: left center; }
.ip-games-archive .ipx-hero-fallback[data-ip-fallback-pos="right"]{ object-position: right center; }

.ip-games-archive .ipx-hero-video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

/* Phase 2: Optional YouTube hero video (muted autoplay) */
.ip-games-archive .ipx-hero-youtube{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.ip-games-archive .ipx-hero-youtube iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ip-games-archive .ipx-directory-hero.ipx-hero--yt-ready .ipx-hero-youtube{ opacity: 0.92; }
.ip-games-archive .ipx-directory-hero.ipx-hero--yt-ready .ipx-hero-video{ opacity: 0; }

.ip-games-archive .ipx-directory-hero.ipx-hero--loading .ipx-hero-video{ opacity: 0; }
.ip-games-archive .ipx-directory-hero.ipx-hero--video-ready .ipx-hero-video{ opacity: 0.92; }

.ip-games-archive .ipx-hero-overlay{
  background:
    radial-gradient(circle at center, rgba(0,0,0,.25) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.82) 100%),
    linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 62%, rgba(0,0,0,0) 100%);
}

.ip-games-archive .ipx-hero-content{
  position: relative;
  z-index: 2;
  padding: 24px;
  max-width: 980px;
  margin: 0 auto;
}

@media (min-width: 768px){
  .ip-games-archive .ipx-hero-content{ padding: 34px; }
}

.ip-games-archive .ipx-hero-kicker{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ipx-text-secondary);
  margin-bottom: 14px;
}

.ip-games-archive .ipx-hero-title{
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

@media (min-width: 768px){
  .ip-games-archive .ipx-hero-title{ font-size: 46px; }
}

.ip-games-archive .ipx-hero-desc{
  font-size: 18px;
  color: var(--ipx-text-secondary);
  margin: 0 0 16px;
  max-width: 62ch;
}

.ip-games-archive .ipx-hero-note{
  font-size: 16px;
  color: var(--ipx-text);
  margin: 0 0 10px;
  max-width: 62ch;
  font-weight: 600;
  opacity: 0.95;
}

.ip-games-archive .ipx-hero-cta{
  padding: 12px 16px;
}

/* Hero fallback states */
.ip-games-archive .ipx-directory-hero.ipx-hero--no-video .ipx-hero-video{ display: none; }
.ip-games-archive .ipx-directory-hero.ipx-hero--video-failed .ipx-hero-video{ display: none; }
.ip-games-archive .ipx-directory-hero.ipx-hero--reduced-motion .ipx-hero-video{ display: none; }


.ip-games-archive a{ color: inherit; }

/* Accessible focus styling */
.ip-games-archive :is(a, button, input, select, textarea):focus{ outline: none; }
.ip-games-archive :is(a, button, input, select, textarea):focus-visible{ box-shadow: var(--ipx-focus); border-color: rgba(200,42,239,.55); }

/* Components */
.ip-games-archive .ip-input,
.ip-games-archive .ip-select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ipx-border);
  background: var(--ipx-surface);
  color: var(--ipx-text);
}

.ip-games-archive .ip-select{ cursor: pointer; }

.ip-games-archive .ip-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ipx-border);
  background: var(--ipx-surface);
  color: var(--ipx-text);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.ip-games-archive .ip-btn--primary{
  background: var(--ipx-accent);
  border-color: rgba(200,42,239,.55);
  color: #ffffff;
}

.ip-games-archive .ip-btn--secondary{
  background: var(--ipx-surface-hover);
  border-color: var(--ipx-border-strong);
}

.ip-games-archive .ip-btn--ghost{
  background: transparent;
}

.ip-games-archive .ip-btn:hover{ border-color: var(--ipx-border-strong); }
.ip-games-archive .ip-btn--primary:hover{ filter: brightness(1.03); }

.ip-games-archive .ip-seg{
  padding: 10px 12px;
  border: 1px solid var(--ipx-border);
  background: var(--ipx-surface);
  color: var(--ipx-text);
  cursor: pointer;
}

.ip-games-archive .ip-directory-view{
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ipx-border);
}

.ip-games-archive .ip-directory-view .ip-seg{ border: 0; border-right: 1px solid var(--ipx-border); }
.ip-games-archive .ip-directory-view .ip-seg:last-child{ border-right: 0; }

.ip-games-archive [data-ip-view="grid"] [data-ip-directory-view="grid"],
.ip-games-archive [data-ip-view="list"] [data-ip-directory-view="list"]{
  background: var(--ipx-surface-hover);
}

.ip-games-archive .ip-games-container{
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

@media (min-width: 768px){
  .ip-games-archive .ip-games-container{
    padding: 40px 24px;
  }
}


.ip-games-archive .ip-directory-header{
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

/* Phase 3: Search bar redesign (premium, centered) */
.ip-games-archive .ipx-directory-search{
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  display: block;
}

.ip-games-archive .ipx-directory-search-input{
  width: 100%;
  padding: 18px 54px;
  padding-left: 22px;
  font-size: 17px;
  border-radius: 16px;
  background: var(--ipx-surface);
  border: 1px solid var(--ipx-border);
  color: var(--ipx-text);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.22);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.ip-games-archive .ipx-directory-search-input::placeholder{ color: var(--ipx-text-muted); }

.ip-games-archive .ipx-directory-search-input:focus{
  border-color: rgba(200,42,239,.65);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.22), 0 0 0 4px var(--ipx-accent-glow);
}

.ip-games-archive .ipx-directory-search-icon{
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ipx-text-muted);
  pointer-events: none;
}

.ip-games-archive .ipx-directory-search-submit{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}

.ip-games-archive .ipx-directory-search-submit svg{ display: block; }

/* Legacy layout rules (kept for compatibility; overridden by .ipx-directory-search) */
.ip-games-archive .ip-directory-search{ display:flex; gap:8px; }
.ip-games-archive .ip-directory-search input[type="search"]{ flex:1; min-width:0; }

/* Phase 3: Controls layout */
.ip-games-archive .ip-directory-controls{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.ip-games-archive .ipx-directory-bar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0 6px;
}

.ip-games-archive .ipx-directory-bar__left{
  min-width: 220px;
}

.ip-games-archive .ipx-directory-bar__center{
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 240px;
}

.ip-games-archive .ipx-directory-bar__center .ipx-directory-quick{
  margin: 0;
  justify-content: center;
}

.ip-games-archive .ipx-directory-bar__right{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Phase 4: Sort compact + aligned right */
.ip-games-archive .ipx-directory-bar__right{
  align-items: flex-end;
}

.ip-games-archive .ipx-sort-wrap{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.ip-games-archive .ipx-sort-label{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ipx-text-muted);
  line-height: 1;
  margin-top: 2px;
}

.ip-games-archive .ipx-sort-select{
  font-size: 13px;
  padding: 8px 10px;
  min-height: 0;
  border-radius: 10px;
  width: auto;
  max-width: 220px;
  flex: 0 0 auto;
  display: inline-block;
}

@media (max-width: 768px){
  .ip-games-archive .ipx-directory-bar__right{
    align-items: center;
  }
  .ip-games-archive .ipx-sort-wrap{
    align-items: center;
  }
}

@media (max-width: 768px){
  .ip-games-archive .ipx-directory-toolbar{
    justify-content: center;
  }
  .ip-games-archive .ipx-directory-bar{
    flex-direction: column;
    align-items: stretch;
  }
  .ip-games-archive .ipx-directory-bar__right{
    justify-content: center;
  }
  .ip-games-archive .ip-directory-meta{
    justify-content: center;
    text-align: center;
  }
}

.ip-games-archive .ip-directory-active-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.ip-games-archive .ip-directory-chip{
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius-pill);
  background: var(--ipx-surface);
  color: var(--ipx-text);
}

/* Phase 5: Filters panel redesign (visual only) */
.ip-games-archive .ip-directory-filters-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--ipx-transition);
  z-index: 9998;
}

.ip-games-archive .ip-directory-filters-backdrop.is-visible{ opacity: 1; }

.ip-games-archive .ip-directory-filters{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(480px, 90vw);
  z-index: 9999;
  display: flex;
  flex-direction: column;

  background: rgba(20,20,20,.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--ipx-border);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);

  transform: translateX(100%);
  transition: transform var(--ipx-transition-slow);

  padding: 0;
  overflow: hidden;
}

.ip-games-archive .ip-directory-filters.is-open{ transform: translateX(0); }

/* WP Admin Bar compatibility: prevent the filters drawer from overlapping the admin toolbar.
   When logged in, WP adds body.admin-bar and exposes a CSS var for its height. */
body.admin-bar .ip-games-archive .ip-directory-filters{
  top: var(--wp-admin--admin-bar--height, 32px);
  height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

@media (max-width: 782px){
  body.admin-bar .ip-games-archive .ip-directory-filters{
    top: var(--wp-admin--admin-bar--height, 46px);
    height: calc(100vh - var(--wp-admin--admin-bar--height, 46px));
  }
}

.ip-games-archive .ip-directory-filters-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--ipx-border);
}

.ip-games-archive .ip-directory-filters-header strong{
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ipx-text);
}

.ip-games-archive .ip-directory-filters-body{
  overflow: auto;
  padding: 0;
}

.ip-games-archive .ip-directory-filter-group{
  padding: 20px 24px;
  border-bottom: 1px solid var(--ipx-border);
}

.ip-games-archive .ip-directory-filter-group > h3{
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ipx-text-muted);
}

.ip-games-archive .ip-directory-facet-items{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ip-games-archive .ip-directory-facet-item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ipx-text-secondary);
  background: var(--ipx-surface);
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius);
  cursor: pointer;
  transition: background var(--ipx-transition), border-color var(--ipx-transition), color var(--ipx-transition), transform var(--ipx-transition-fast);
}

.ip-games-archive .ip-directory-facet-item:hover{
  background: var(--ipx-surface-hover);
  border-color: var(--ipx-border-hover);
  color: var(--ipx-text);
  transform: translateY(-1px);
}

/* Accessibility: the real focus target is the (visually hidden) checkbox.
   Use focus-within so keyboard users get a visible focus ring on the chip. */
.ip-games-archive .ip-directory-facet-item:focus-within{
  outline: none;
  box-shadow: 0 0 0 3px var(--ipx-accent-glow);
  border-color: rgba(200,42,239,.55);
}

.ip-games-archive .ip-directory-facet-item input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ip-games-archive .ip-directory-facet-item.is-selected{
  background: rgba(200, 42, 239, .15);
  border-color: var(--ipx-accent);
  color: var(--ipx-accent);
}

.ip-games-archive .ip-directory-facet-empty{
  margin: 0;
  color: var(--ipx-text-muted);
}

.ip-games-archive .ip-directory-filters-footer{
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--ipx-border);
  display: flex;
  gap: 12px;
  background: rgba(20,20,20,.92);
}

@media (max-width: 768px){
  .ip-games-archive .ip-directory-filters{
    width: 100%;
    height: 85vh;
    top: auto;
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: 1px solid var(--ipx-border);
    border-radius: var(--ipx-radius-xl) var(--ipx-radius-xl) 0 0;
    transform: translateY(100%);
  }
  .ip-games-archive .ip-directory-filters.is-open{ transform: translateY(0); }
  .ip-games-archive .ip-directory-filters-header{ position: relative; }
  .ip-games-archive .ip-directory-filters-header::before{
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--ipx-border-hover);
  }
}

/* Results */
.ip-games-archive .ip-directory-results-grid{
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px){
  .ip-games-archive .ip-directory-results-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}

@media (min-width: 1024px){
  .ip-games-archive .ip-directory-results-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
}

@media (min-width: 1400px){
  .ip-games-archive .ip-directory-results-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Phase 4: Poster-first (vertical) premium cards */
.ip-games-archive .ipx-game-card{
  position: relative;
  background: var(--ipx-surface);
  border-radius: var(--ipx-radius-lg);
  /*
   * The slide-out "Add to List" drawer must render outside the card bounds.
   * Poster/image areas still clip their own media via their own overflow rules.
   */
  overflow: visible;
  border: 1px solid var(--ipx-border);
  box-shadow: var(--ipx-shadow-sm);
  transition: transform var(--ipx-transition-slow), box-shadow var(--ipx-transition-slow), border-color var(--ipx-transition);
}

.ip-games-archive .ipx-game-card:hover{
  transform: translateY(-8px) scale(1.02);
  border-color: var(--ipx-border-hover);
  box-shadow: var(--ipx-shadow-lg);
  z-index: 4;
}

.ip-games-archive .ipx-game-card.panel-open{
  z-index: 6;
}

.ip-games-archive .ipx-game-card__link{
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.ip-games-archive .ipx-game-card__poster{
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #0d0d0d);
}

.ip-games-archive .ipx-game-card__poster-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--ipx-transition-slow);
}

.ip-games-archive .ipx-game-card:hover .ipx-game-card__poster-img{
  transform: scale(1.08);
}

.ip-games-archive .ipx-game-card__poster-empty{
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.ip-games-archive .ipx-game-card__overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.35) 50%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--ipx-transition);
}

/* Phase C: Status badges are ABOVE the cover image (not on the poster).
   Keep subtle and consistent with the directory's premium look. */
.ip-games-archive .ipx-game-card__top-badges{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  z-index: 5;
}

/* Note: Status badges (Early Access, Upcoming, Cancelled) are now displayed
   in the card meta section, not on the poster. See STATUS BADGES section below. */

/* Hover actions (Wishlist + Add to List) */
.ip-games-archive .ipx-game-card__hover-actions{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--ipx-transition), transform var(--ipx-transition);
  pointer-events: none;
}

.ip-games-archive .ipx-game-card:hover .ipx-game-card__hover-actions,
.ip-games-archive .ipx-game-card.panel-open .ipx-game-card__hover-actions{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ip-games-archive .ipx-action-btn,
.ip-games-archive .ipx-wishlist-btn,
.ip-games-archive .ipx-add-to-list-btn{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.40);
  color: var(--ipx-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--ipx-transition), border-color var(--ipx-transition), background var(--ipx-transition);
  font-size: 18px;
  font-weight: 600;
}

.ip-games-archive .ipx-action-btn:hover,
.ip-games-archive .ipx-wishlist-btn:hover,
.ip-games-archive .ipx-add-to-list-btn:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.55);
}

.ip-games-archive .ipx-wishlist-btn[title],
.ip-games-archive .ipx-add-to-list-btn[title]{
  position: relative;
}

.ip-games-archive .ipx-wishlist-btn:focus,
.ip-games-archive .ipx-add-to-list-btn:focus{
  outline: 2px solid var(--ipx-accent);
  outline-offset: 2px;
}

.ip-games-archive .ipx-wishlist-btn.in-wishlist{
  /* Vibrant wishlisted state - pink glow, celebratory feel */
  background: linear-gradient(135deg, rgba(200, 42, 239, 0.35), rgba(255, 69, 130, 0.35));
  border-color: #C82AEF;
  color: #fff;
  box-shadow: 
    0 0 0 2px rgba(200, 42, 239, 0.4),
    0 0 20px rgba(200, 42, 239, 0.5),
    0 4px 15px rgba(200, 42, 239, 0.3);
  transform: scale(1.05);
}

.ip-games-archive .ipx-wishlist-btn.in-wishlist:hover{
  transform: scale(1.1);
  box-shadow: 
    0 0 0 2px rgba(200, 42, 239, 0.5),
    0 0 28px rgba(200, 42, 239, 0.6),
    0 6px 20px rgba(200, 42, 239, 0.4);
}

.ip-games-archive .ipx-wishlist-btn.in-wishlist .ipx-heart-icon{
  fill: #fff;
  stroke: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

/* Inline list panel (archive cards) – lives inside the same card */
.ip-games-archive .ipx-game-card__media{
  position: relative;
  overflow: visible;
}

/* List Panel - Now a dropdown matching single game page design */
.ip-games-archive .ipx-list-panel{
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  width: 280px !important;
  min-width: 280px !important;
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  max-height: 320px;
}

.ip-games-archive .ipx-game-card.panel-open .ipx-list-panel{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Panel opens on right side if near left edge */
.ip-games-archive .ipx-game-card.panel-right .ipx-list-panel{
  left: auto;
  right: 8px;
}

/* Remove poster sliding - dropdown doesn't need it */
.ip-games-archive .ipx-game-card__poster{
  position: relative;
  z-index: 5;
}

.ip-games-archive .ipx-game-card.panel-open .ipx-game-card__poster{
  transform: none;
}

.ip-games-archive .ipx-list-panel-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.ip-games-archive .ipx-list-panel-header span{
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f7;
  letter-spacing: 0.01em;
}

.ip-games-archive .ipx-list-panel-close{
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(245, 245, 247, 0.6);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s ease;
}

.ip-games-archive .ipx-list-panel-close:hover{
  background: rgba(255, 255, 255, 0.15);
  color: #f5f5f7;
}

.ip-games-archive .ipx-list-panel-content{
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}

/* Custom scrollbar for panel */
.ip-games-archive .ipx-list-panel-content::-webkit-scrollbar{
  width: 4px;
}

.ip-games-archive .ipx-list-panel-content::-webkit-scrollbar-track{
  background: transparent;
}

.ip-games-archive .ipx-list-panel-content::-webkit-scrollbar-thumb{
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.ip-games-archive .ipx-list-panel-loading,
.ip-games-archive .ipx-list-panel-empty{
  padding: 24px 16px;
  font-size: 13px;
  color: rgba(245, 245, 247, 0.5);
  text-align: center;
}

.ip-games-archive .ipx-list-panel-loading::before{
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--ipx-accent, #C82AEF);
  border-radius: 50%;
  animation: ipx-spin 0.8s linear infinite;
}

@keyframes ipx-spin{
  to{ transform: rotate(360deg); }
}

/* List options container */
.ip-games-archive .ipx-list-options{
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* List options - matching single game page style */
.ip-games-archive .ipx-list-panel-option,
.ip-games-archive .ipx-list-option{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: rgba(245, 245, 247, 0.9);
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.ip-games-archive .ipx-list-panel-option:hover,
.ip-games-archive .ipx-list-option:hover{
  background: rgba(255, 255, 255, 0.08);
}

.ip-games-archive .ipx-list-option.in-list,
.ip-games-archive .ipx-list-panel-option.in-list{
  background: rgba(48, 209, 88, 0.12);
}

.ip-games-archive .ipx-list-option.in-list:hover,
.ip-games-archive .ipx-list-panel-option.in-list:hover{
  background: rgba(48, 209, 88, 0.18);
}

.ip-games-archive .ipx-panel-check{
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ip-games-archive .ipx-list-option.in-list .ipx-panel-check,
.ip-games-archive .ipx-list-panel-option.in-list .ipx-panel-check{
  background: rgba(48, 209, 88, 0.95);
  border-color: rgba(48, 209, 88, 0.95);
}

.ip-games-archive .ipx-panel-check svg{
  width: 10px;
  height: 10px;
  opacity: 0;
  stroke: #fff;
  transition: opacity 0.15s ease;
}

.ip-games-archive .ipx-list-option.in-list .ipx-panel-check svg,
.ip-games-archive .ipx-list-panel-option.in-list .ipx-panel-check svg{
  opacity: 1;
}

.ip-games-archive .ipx-panel-name,
.ip-games-archive .ipx-list-name{
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 14px;
}

.ip-games-archive .ipx-list-panel-footer{
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 12px 12px;
  flex-shrink: 0;
}

.ip-games-archive .ipx-list-panel-footer .ip-create-list-link,
.ip-games-archive .ipx-list-panel-footer .ipx-create-list-link{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  color: #f5f5f7;
  background: rgba(200, 42, 239, 0.2);
  border: 1px solid rgba(200, 42, 239, 0.35);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.ip-games-archive .ipx-list-panel-footer .ip-create-list-link:hover,
.ip-games-archive .ipx-list-panel-footer .ipx-create-list-link:hover{
  background: rgba(200, 42, 239, 0.3);
  border-color: rgba(200, 42, 239, 0.5);
}

/* Dark modal styles for Create List on /games (match single game) */
body.ipx-modal-open .ip-modal-overlay{
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.ipx-modal-open .ip-modal-content{
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

body.ipx-modal-open .ip-modal-header,
body.ipx-modal-open .ip-modal-footer{
  background: #0d0d0d;
  border-color: #2a2a2a;
}

body.ipx-modal-open .ip-modal-header h3{
  color: #f5f5f7;
}

body.ipx-modal-open .ip-modal-close{
  color: rgba(245, 245, 247, 0.5);
}

body.ipx-modal-open .ip-modal-close:hover{
  background: #252525;
  color: #f5f5f7;
}

body.ipx-modal-open .ip-modal-body{
  background: #1a1a1a;
}

body.ipx-modal-open .ip-form-field label{
  color: #f5f5f7;
}

body.ipx-modal-open .ip-form-field input,
body.ipx-modal-open .ip-form-field select,
body.ipx-modal-open .ip-form-field textarea{
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: #f5f5f7;
}

body.ipx-modal-open .ip-form-field input:focus,
body.ipx-modal-open .ip-form-field select:focus,
body.ipx-modal-open .ip-form-field textarea:focus{
  outline: none;
  border-color: rgba(200, 42, 239, 0.75);
  box-shadow: 0 0 0 3px rgba(200, 42, 239, 0.20);
}

.ip-games-archive .ipx-create-list-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  color: #f5f5f7;
  background: rgba(200, 42, 239, 0.15);
  border: 1px solid rgba(200, 42, 239, 0.3);
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.ip-games-archive .ipx-create-list-link:hover{
  background: rgba(200, 42, 239, 0.25);
  border-color: rgba(200, 42, 239, 0.5);
  text-decoration: none;
}

.ip-games-archive .ipx-create-list-link .ipx-plus{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
}

.ip-games-archive .ipx-game-card:hover .ipx-game-card__overlay{
  opacity: 1;
}

.ip-games-archive .ipx-game-card__rating-badge{
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--ipx-radius-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
}

.ip-games-archive .ipx-game-card__body{
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.ip-games-archive .ipx-game-card__title{
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ipx-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Genres subtitle - appears under title */
.ip-games-archive .ipx-game-card__genres{
  font-size: 13px;
  color: var(--ipx-text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-games-archive .ipx-game-card__sub-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ip-games-archive .ipx-game-card__sub{
  font-size: 13px;
  color: var(--ipx-text-muted);
}

/* ============================================
   CARD FOOTER - Date left, Rating right
   ============================================ */
.ip-games-archive .ipx-game-card__footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  min-height: 24px;
}

.ip-games-archive .ipx-game-card__footer-left{
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
}

.ip-games-archive .ipx-game-card__footer-left .ipx-game-card__sub{
  font-size: 12px;
  color: var(--ipx-text-muted);
  white-space: nowrap;
  line-height: 24px;
}

.ip-games-archive .ipx-game-card__footer-right{
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ============================================
   RATING BADGE - Thumbs + Percentage
   Color-coded by recommendation type
   ============================================ */
.ip-games-archive .ipx-game-card__rating-badge{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  height: 24px;
  box-sizing: border-box;
}

.ip-games-archive .ipx-rating-icons{
  font-size: 12px;
  line-height: 1;
}

.ip-games-archive .ipx-rating-pct{
  line-height: 1;
}

/* Complete It - Orange (#ff8000) - Double thumbs up */
.ip-games-archive .ipx-rating--complete{
  background: rgba(255, 128, 0, 0.15);
  color: #ff8000;
}

/* Play It - Green (#1eff00) - Single thumbs up */
.ip-games-archive .ipx-rating--play{
  background: rgba(30, 255, 0, 0.12);
  color: #1eff00;
}

/* Skip It - Grey (#9d9d9d) - Thumbs down */
.ip-games-archive .ipx-rating--skip{
  background: rgba(157, 157, 157, 0.12);
  color: #9d9d9d;
}

/* Phase 3: Card metadata row (legacy - kept for compatibility). */
.ip-games-archive .ipx-game-card__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

/* ============================================
   RECOMMENDATION BADGE - Legacy badge styles
   Matches single-game.css color system
   ============================================ */
.ip-games-archive .ipx-game-card__rec-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ip-games-archive .ipx-game-card__rec-badge .ipx-rec-label{
  line-height: 1;
}

.ip-games-archive .ipx-game-card__rec-badge .ipx-rec-count{
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.2);
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

/* Complete It - Orange (matches --ipx-rec-complete: #ff8000) */
.ip-games-archive .ipx-rec--complete{
  border-color: rgba(255, 128, 0, 0.4);
  background: rgba(255, 128, 0, 0.12);
}
.ip-games-archive .ipx-rec--complete .ipx-rec-label{
  color: #ff8000;
}

/* Play It - Green (matches --ipx-rec-play: #1eff00) */
.ip-games-archive .ipx-rec--play{
  border-color: rgba(30, 255, 0, 0.35);
  background: rgba(30, 255, 0, 0.10);
}
.ip-games-archive .ipx-rec--play .ipx-rec-label{
  color: #1eff00;
}

/* Skip It - Grey (matches --ipx-rec-skip: #9d9d9d) */
.ip-games-archive .ipx-rec--skip{
  border-color: rgba(157, 157, 157, 0.35);
  background: rgba(157, 157, 157, 0.10);
}
.ip-games-archive .ipx-rec--skip .ipx-rec-label{
  color: #9d9d9d;
}

/* Unrated - Muted */
.ip-games-archive .ipx-rec--unrated{
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.ip-games-archive .ipx-rec--unrated .ipx-rec-label{
  color: var(--ipx-text-muted);
  font-weight: 600;
}

/* ============================================
   STATUS BADGE OVERLAY - On poster image
   ============================================ */
.ip-games-archive .ipx-game-card__status-overlay{
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  pointer-events: none;
}

/* ============================================
   STATUS BADGES - Availability indicators
   With backdrop for visibility on any background
   ============================================ */
.ip-games-archive .ipx-game-card__status-badge{
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 5px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ip-games-archive .ipx-status--early_access{
  background: rgba(200, 42, 239, 0.85);
  color: #fff;
}

.ip-games-archive .ipx-status--upcoming{
  background: rgba(200, 42, 239, 0.85);
  color: #fff;
}

.ip-games-archive .ipx-status--cancelled{
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

/* ============================================
   META ITEMS - Secondary info badges
   ============================================ */
.ip-games-archive .ipx-game-card__meta-item{
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: var(--ipx-text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Legacy emoji-based recommendation (Phase 2 compatibility) */
.ip-games-archive .ipx-game-card__meta-item--rec{
  gap: 6px;
  font-weight: 600;
  color: var(--ipx-text-secondary);
}

.ip-games-archive .ipx-game-card__meta-item--rec .ipx-rec-emoji{
  font-size: 14px;
  line-height: 1;
}

.ip-games-archive .ipx-game-card__meta-item--rec .ipx-rec-count{
  font-size: 12px;
  opacity: 0.95;
}

.ip-games-archive .ipx-game-card__rating-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.ip-games-archive .ipx-game-card__rating-bar{
  flex: 1;
  min-width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}

.ip-games-archive .ipx-game-card__rating-fill{
  height: 100%;
  border-radius: 2px;
  background: var(--ipx-accent);
  transition: width var(--ipx-transition);
}

.ip-games-archive .ipx-game-card__rating-text{
  font-size: 12px;
  font-weight: 600;
  color: var(--ipx-text-secondary);
}

.ip-games-archive .ipx-game-card__reviews{
  font-size: 12px;
  color: var(--ipx-text-muted);
}

.ip-games-archive .ipx-game-card__tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* Legacy bordered tag styles - now using .ipx-game-card__genres subtitle instead
.ip-games-archive .ipx-game-card__tag{
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ipx-text-secondary);
  background: transparent;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.15s ease;
}

.ip-games-archive .ipx-game-card__tag.ipx-tag--more{
  color: var(--ipx-text-muted);
  font-weight: 600;
  border-style: dashed;
}

.ip-games-archive .ipx-game-card:hover .ipx-game-card__tag{
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}
*/

/* Legacy directory card styles (pre Phase 4) intentionally left in file history.
 * Current rendering uses .ipx-game-card.
 */

.ip-games-archive .ip-directory-empty{
  padding: 24px;
  border: 1px dashed var(--ipx-border);
  border-radius: var(--ipx-radius);
  color: var(--ipx-text-secondary);
}

/* List view */
.ip-games-archive[data-ip-view="list"] .ip-directory-results-grid{
  grid-template-columns: 1fr;
}

.ip-games-archive[data-ip-view="list"] .ipx-game-card:hover{ transform: none; }

.ip-games-archive[data-ip-view="list"] .ipx-game-card__link{
  display: flex;
  gap: 16px;
  align-items: center;
}

.ip-games-archive[data-ip-view="list"] .ipx-game-card__poster{
  width: 96px;
  flex: 0 0 auto;
  border-radius: var(--ipx-radius);
}

.ip-games-archive[data-ip-view="list"] .ipx-game-card__body{
  padding: 14px 16px;
}

.ip-games-archive .ip-directory-results.is-loading{
  opacity: .6;
  pointer-events: none;
}

.ip-games-archive .ip-directory-pagination{
  margin-top: 16px;
}

/* Pagination (avoid theme accent leakage) */
.ip-games-archive .ip-directory-pagination .page-numbers{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  margin: 4px 4px 0 0;
  border-radius: 10px;
  border: 1px solid var(--ipx-border);
  background: var(--ipx-surface);
  color: var(--ipx-text);
  text-decoration: none;
}

.ip-games-archive .ip-directory-pagination .page-numbers.current{
  background: var(--ipx-accent);
  border-color: rgba(200,42,239,.55);
  color: #fff;

}

/* Phase 7: Enhanced pagination (Load More) */
.ip-games-archive .ip-directory-pagination{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.ip-games-archive .ipx-pagination-seo{
  width: 100%;
  text-align: center;
}

.ip-games-archive .ipx-pagination-enhanced{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.ip-games-archive .ipx-load-more.is-loading{
  opacity: .75;
  pointer-events: none;
}

.ip-games-archive .ipx-end-message{
  padding: 10px 14px;
  border: 1px solid var(--ipx-border);
  border-radius: 999px;
  background: rgba(20,20,20,0.72);
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

.ip-games-archive .ip-directory-pagination .page-numbers.disabled{
  opacity: .55;
  pointer-events: none;
}

/* Phase E: Typeahead (branded, accessible) */
.ip-games-archive .ip-directory-search{position:relative}
.ip-games-archive .ip-directory-typeahead{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  margin-top:10px;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  z-index: 80;
  max-height: 360px;
  overflow: auto;
}

.ip-games-archive .ip-directory-typeahead__list{
  display:flex;
  flex-direction:column;
}

.ip-games-archive .ip-directory-typeahead__item{
  appearance:none;
  width:100%;
  text-align:left;
  border:0;
  background: transparent;
  color: var(--ipx-text);
  padding: 12px 14px;
  cursor:pointer;
}

.ip-games-archive .ip-directory-typeahead__item-inner{
  display:flex;
  gap: 12px;
  align-items:center;
}

.ip-games-archive .ip-directory-typeahead__thumb{
  width: 38px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

.ip-games-archive .ip-directory-typeahead__text{
  display:flex;
  flex-direction:column;
  min-width: 0;
}

.ip-games-archive .ip-directory-typeahead__label{
  font-size: 14px;
  font-weight: 600;
  color: var(--ipx-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-games-archive .ip-directory-typeahead__meta{
  margin-top: 6px;
  display:flex;
  gap: 8px;
  align-items:center;
}

.ip-games-archive .ip-directory-typeahead__badge{
  display:inline-flex;
  align-items:center;
  height: 22px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--ipx-border);
  color: var(--ipx-text-secondary);
  background: rgba(255,255,255,0.04);
}

.ip-games-archive .ip-directory-typeahead__badge--company{
  border-color: rgba(200,42,239,.35);
  color: rgba(200,42,239,.95);
  background: rgba(200,42,239,.10);
}

.ip-games-archive .ip-directory-typeahead__badge--game{
  border-color: rgba(255,255,255,0.12);
}

.ip-games-archive .ip-directory-typeahead__item:hover,
.ip-games-archive .ip-directory-typeahead__item:focus-visible,
.ip-games-archive .ip-directory-typeahead__item.is-active{
  background: rgba(255,255,255,0.06);
  outline: none;
}

.ip-games-archive .ip-directory-typeahead__item:focus-visible{
  box-shadow: 0 0 0 3px var(--ipx-accent-glow);
}

/* Phase 6: Quick filters */
.ip-directory-quick{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.ip-pill{appearance:none;border:1px solid rgba(255,255,255,0.14);background:rgba(255,255,255,0.03);color:inherit;border-radius:999px;padding:8px 12px;font-size:13px;cursor:pointer}
.ip-pill:hover{background:rgba(255,255,255,0.06)}

/* Phase 3: Premium quick filter pills */
.ip-games-archive .ipx-directory-quick{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

.ip-games-archive .ipx-quick-pill{
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ipx-text-secondary);
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius-pill);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
  transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.ip-games-archive .ipx-quick-pill:hover{
  color: var(--ipx-text);
  border-color: var(--ipx-border-strong);
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.08) 100%);
  transform: translateY(-1px);
}

.ip-games-archive .ipx-quick-pill.is-active{
  color: #fff;
  background: var(--ipx-accent);
  border-color: rgba(200,42,239,.60);
  box-shadow: 0 0 40px var(--ipx-accent-glow);
}

.ip-games-archive .ipx-quick-pill[data-ip-quick="coming_soon"]::before{ content: "🚀 "; }
.ip-games-archive .ipx-quick-pill[data-ip-quick="new_releases"]::before{ content: "✨ "; }
.ip-games-archive .ipx-quick-pill[data-ip-quick="clear"]::before{ content: "↩︎ "; }

/* Phase 6: Restore + Error banners */
.ip-directory-restore,.ip-directory-error{margin:12px 0;padding:12px 14px;border-radius:14px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.03)}
.ip-directory-restore .ip-banner-actions,.ip-directory-error .ip-banner-actions{display:flex;gap:10px;margin-top:10px;flex-wrap:wrap}
.ip-directory-error{border-color:rgba(255,120,120,0.25);background:rgba(255,80,80,0.06)}
.ip-directory-meta{display:flex;gap:10px;flex-wrap:wrap}
.ip-directory-meta [data-ip-directory-range]{opacity:.8}

/* Phase 6: Active filter chips */
.ip-games-archive .ip-directory-active-filters{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius);
}

.ip-games-archive .ip-directory-chip{
  appearance: none;
  border: 1px solid var(--ipx-border-strong);
  background: var(--ipx-surface);
  color: var(--ipx-text);
  border-radius: var(--ipx-radius-pill);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.ip-games-archive .ip-directory-chip:hover{
  background: var(--ipx-surface-hover);
  border-color: var(--ipx-border-strong);
  transform: translateY(-1px);
}

.ip-games-archive .ip-directory-clear-all{
  margin-left: auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ipx-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}

.ip-games-archive .ip-directory-clear-all:hover{
  color: var(--ipx-accent-hover);
  text-decoration: underline;
}

/* Phase 6: Skeleton loaders */
.ip-games-archive .ipx-skeleton-card{
  background: var(--ipx-surface);
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius-lg);
  overflow: hidden;
}

.ip-games-archive .ipx-skeleton-poster{
  aspect-ratio: 3 / 4;
  background: linear-gradient(90deg, var(--ipx-surface) 0%, rgba(255,255,255,0.06) 50%, var(--ipx-surface) 100%);
  background-size: 200% 100%;
  animation: ipx-shimmer 1.35s ease-in-out infinite;
}

.ip-games-archive .ipx-skeleton-body{ padding: 14px 16px; }

.ip-games-archive .ipx-skeleton-line{
  height: 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 10px;
}

.ip-games-archive .ipx-skeleton-line--short{ width: 60%; margin-bottom: 0; }

@keyframes ipx-shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

/* Phase 6: Empty state - polished for launch */
.ip-games-archive .ipx-empty-state{
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  max-width: 600px;
  margin: 40px auto;
}

.ip-games-archive .ipx-empty-state__icon{
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.6;
  filter: grayscale(0.3);
}

.ip-games-archive .ipx-empty-state__title{
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ipx-text);
}

.ip-games-archive .ipx-empty-state__description{
  font-size: 15px;
  color: var(--ipx-text-secondary);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.ip-games-archive .ipx-empty-state__actions{
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ip-games-archive .ipx-empty-state__actions .ip-btn{
  min-width: 140px;
}


/* Phase 1: Typography + hierarchy */
.ip-games-archive .ip-directory-title{
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Phase 8: Motion (progressive enhancement)
 * - Never block core interactions.
 * - Respect reduced motion.
 */
.ip-games-archive.ipx-motion .ipx-game-card.ipx-reveal{
  opacity: 0;
  transform: translateY(16px);
}

.ip-games-archive.ipx-motion .ipx-game-card.ipx-reveal.ipx-reveal-in{
  opacity: 1;
  transform: none;
  transition: opacity 0.40s ease, transform 0.40s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Avoid aggressive hover transforms on touch devices */
@media (hover: none){
  .ip-games-archive .ipx-game-card:hover{
    transform: none;
  }
  .ip-games-archive .ipx-game-card:hover .ipx-game-card__poster-img{
    transform: none;
  }
  .ip-games-archive .ipx-game-card:hover .ipx-game-card__overlay{
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce){
  .ip-games-archive .ipx-skeleton-poster{ animation: none; }
  .ip-games-archive .ipx-game-card,
  .ip-games-archive .ipx-game-card__poster-img,
  .ip-games-archive .ipx-game-card__overlay,
  .ip-games-archive .ipx-game-card__rating-fill{
    transition: none !important;
  }
  .ip-games-archive.ipx-motion .ipx-game-card.ipx-reveal{
    opacity: 1;
    transform: none;
  }
}

/* Phase 9: Admin-only debug overlay
 * - Must never affect layout for normal users.
 * - Displayed only when rendered by PHP for admins.
 */
.ip-games-archive .ipx-directory-debug{
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--ipx-border);
  border-radius: var(--ipx-radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.ip-games-archive .ipx-directory-debug__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ip-games-archive .ipx-directory-debug__hint{
  font-size: 12px;
  color: var(--ipx-text-muted);
}

.ip-games-archive .ipx-directory-debug__pre{
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--ipx-radius);
  background: rgba(0,0,0,0.35);
  color: var(--ipx-text-secondary);
  border: 1px solid var(--ipx-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

/* ==========================================================================
   DARK MODAL STYLES (match single-game Create New List)
   The create-list modal is global markup rendered by public.js.
   On /games we rely on body.ipx-modal-open to apply the dark theme.
   ========================================================================== */

body.ipx-modal-open .ip-modal-overlay{
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.ipx-modal-open .ip-modal-content{
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

body.ipx-modal-open .ip-modal-header{
  background: #0d0d0d;
  border-bottom: 1px solid #2a2a2a;
}

body.ipx-modal-open .ip-modal-header h3{
  color: #f5f5f7;
}

body.ipx-modal-open .ip-modal-close{
  color: rgba(245, 245, 247, 0.5);
}

body.ipx-modal-open .ip-modal-close:hover{
  background: #252525;
  color: #f5f5f7;
}

body.ipx-modal-open .ip-modal-body{
  background: #1a1a1a;
  flex: 1;
  overflow-x: hidden;
}

body.ipx-modal-open .ip-modal-footer{
  background: #0d0d0d;
  border-top: 1px solid #2a2a2a;
}

body.ipx-modal-open .ip-form-field label{
  color: #f5f5f7;
}

body.ipx-modal-open .ip-form-field input,
body.ipx-modal-open .ip-form-field select,
body.ipx-modal-open .ip-form-field textarea{
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: #f5f5f7;
}

body.ipx-modal-open .ip-form-field input:focus,
body.ipx-modal-open .ip-form-field select:focus,
body.ipx-modal-open .ip-form-field textarea:focus{
  border-color: var(--ip-primary);
  box-shadow: 0 0 0 3px rgba(200, 42, 239, 0.18);
  outline: none;
}
