/* Homepage skin: a white canvas, blush surfaces and an artwork-first catalogue.
   Kept local so the shared lounge styles on game pages stay independent. */
body.rediff-lounge.home-page {
  --background: #fff;
  --surface: #fff;
  --text: #22232a;
  --muted: #656671;
  --border: #e6dde1;
  --brand-soft: #fff0f2;
  --home-shadow: #22232a0a;
  background-color: var(--background);
  background-image: none;
}

.home-page .catalog { padding-block: 12px 42px; }
.home-page .catalog .search { width: clamp(144px, 20vw, 240px); min-width: 0; min-height: 46px; flex-shrink: 0; border-color: #e7d9df; border-radius: 999px; background: #fff; box-shadow: 0 3px 8px #7b3f5105; }
.home-page .search input { font-size: 13px; }
.home-page .search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px #de293615; }
.home-page .search input:focus-visible { outline: none; }

/* A floating glass capsule keeps the game grid visible around the navigation. */
.home-page .category-bar {
  --category-top-gap: 14px;
  top: calc(var(--rediff-header-height, 0px) + var(--category-top-gap) + env(safe-area-inset-top, 0px));
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  gap: 16px;
  min-height: 74px;
  margin-inline: auto;
  margin-bottom: 12px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--background);
}
.home-page .category-bar::before {
  inset: 0;
  border: 1px solid #ffffffc7;
  border-radius: inherit;
  background: linear-gradient(135deg, #fffffff5, #fcf4f7f5);
  box-shadow: inset 0 1px 0 #fffffff2, inset 0 -1px 0 #ffffff66,
    0 0 0 1px #8e99ad18, 0 10px 30px -12px #29334d40, 0 2px 6px #29334d0a;
}
.home-page .category-bar.is-stuck { background: transparent; border-color: transparent; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home-page .category-bar.is-stuck::before {
    background: linear-gradient(135deg, #ffffff9c, #fff0f457);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
  }
}
.home-page .category-heading { padding-right: 16px; border-color: #dadde5; }
.home-page .category-heading h2 { color: #464853; }
.home-page .category-spark { color: var(--brand); }
.home-page .catalog .filters { scrollbar-color: #c8cad4 transparent; padding: 4px; }
.home-page .catalog .chip { gap: 8px; min-height: 44px; padding: 10px 15px; background: #fff; border-color: #e1e3e9; color: #5f616d; font-size: 12px; transition: transform .16s, background .16s, border-color .16s, box-shadow .16s; }
.home-page .catalog .chip:hover { background: #fff6f7; color: var(--brand); border-color: #efc4cd; transform: translateY(-1px); }
.home-page .catalog .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 9px #de293619; }
.home-page .catalog .chip .num { color: #70727e; background: #f0f1f5; font-size: 10px; }
.home-page .catalog .chip.active .num { color: #fff; background: #ffffff26; }
.home-page .category-bar.is-stuck .chip:not(.active) { background: #ffffff94; border-color: #ffffffc2; color: #505360; box-shadow: inset 0 1px 0 #ffffffd9, 0 2px 5px #29334d05; }
.home-page .category-bar.is-stuck .chip:not(.active):hover { background: #ffffffe0; border-color: #fff; color: var(--brand); }
.editor-pick { padding-block-end: 16px; }
.editor-pick-card {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(200px, 25vw, 330px);
  padding: clamp(20px, 4vw, 48px);
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: #0d152c;
  color: #fff;
  text-decoration: none;
  scroll-margin-top: calc(var(--catalog-nav-height, 80px) + 16px);
}
.editor-pick-card img, .editor-pick-card::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.editor-pick-card img { z-index: -2; object-fit: cover; object-position: 62% center; }
.editor-pick-card::before { z-index: -1; content: ''; background: linear-gradient(90deg, #080e24ed, #080e24b5 27%, #080e2445 60%, transparent 83%); }
.editor-pick-copy { display: grid; gap: 8px; justify-items: start; }
.editor-pick-copy .eyebrow { font-size: 12px; color: #ffd9a8; }
.editor-pick-copy strong { font-size: clamp(36px, 6vw, 72px); line-height: 1; letter-spacing: -.055em; }
.editor-pick-cta { margin-block-start: 6px; padding: 11px 19px; border-radius: 999px; background: #ffbb73; color: #14192b; font-size: 14px; font-weight: 750; }
.editor-pick-card:hover .editor-pick-cta { background: #fff; }
.editor-pick-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.editor-pick .home-play-session { max-width: none; }

.catalog-collections { padding-block-start: 22px; }
.catalog-collection + .catalog-collection { margin-block-start: 28px; }
.catalog-collection-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  margin-block-end: 9px;
}
.home-page .catalog-collection-header h2 {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 800;
  scroll-margin-top: calc(var(--catalog-nav-height, 74px) + 16px);
}
.catalog-view-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 8px;
  border-radius: 9px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}
.catalog-view-link:hover { background: #fff1f4; }
.catalog-view-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.catalog-browse-all, .catalog-collection-toggle { padding-inline: 12px; background: #fff; border: 1px solid #e6dfe6; text-decoration: none; }
.catalog-collection-toggle { display: flex; width: fit-content; margin: 14px auto 0; }
.catalog-collection-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 17px; }
.home-page .catalog-collection:not(.catalog-collection-top):not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 11) { display: none; }
.home-page .catalog-collection-top:not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 21) { display: none; }

.home-page .library-toolbar { margin-bottom: 12px; }
.home-page .library-title { gap: 10px 13px; }
.home-page .library-title h1 { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 19px; font-weight: 800; }
.home-page .library-title h1::before { content: ''; width: 4px; height: 18px; flex-shrink: 0; border-radius: 3px; background: var(--brand); }
.home-page .catalog .result-count { color: var(--muted); font-size: 11px; }

/* Inset name badges keep the artwork visible across the whole card. */
.home-page .catalog .grid { --catalog-columns: 5; --catalog-column-gap: 17px; gap: 19px var(--catalog-column-gap); }
/* Wrapping rows center their remaining cards without stretching them. */
.home-page .catalog .grid:not(.is-playing) { display: flex; flex-wrap: wrap; justify-content: center; }
.home-page .catalog .grid:not(.is-playing) > .card { flex: 0 0 calc((100% + var(--catalog-column-gap)) / var(--catalog-columns) - var(--catalog-column-gap)); }
.home-page .catalog .card {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 3px 9px #20212b0b;
  transition: transform .38s cubic-bezier(.22,1,.36,1), box-shadow .38s cubic-bezier(.22,1,.36,1);
}
.home-page .catalog .card-surface { display: block; width: 100%; border-radius: inherit; }
.home-page .catalog .card-art { position: relative; isolation: isolate; aspect-ratio: 16 / 10; width: 100%; border: 0; border-radius: 16px; overflow: hidden; background: #e7e9f0; }
.home-page .catalog .card-art::after { display: none; }
.home-page .catalog .card .lounge-art { transform: none; filter: saturate(1.12); transition: transform .55s cubic-bezier(.22,1,.36,1); }
.home-page .catalog .card .card-thumbnail { object-fit: cover; filter: none; }
.home-page .card-caption {
  position: absolute;
  z-index: 2;
  inset: auto 10px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.home-page .catalog .card .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-width: 0; max-width: 100%; overflow: hidden; padding: 6px 9px; border-radius: 9px; background: var(--surface); box-shadow: 0 2px 8px #22232a12; color: var(--text); font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.home-page .card-launch { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-family: Arial, sans-serif; font-size: 11px; line-height: 1; transition: background .35s, color .35s, border-color .35s, transform .38s cubic-bezier(.22,1,.36,1); }
.home-page .catalog .card:not(.is-preview-ready) .card-launch {
  border-color: #ffffff70;
  background: #19132a;
  color: #efff9a;
  box-shadow: 0 2px 8px #1c133450;
}
.home-page .catalog .card:not(.is-preview-ready):is(:hover, :focus-visible) .card-launch {
  border-color: #efff9a;
  background: #efff9a;
  color: #19132a;
}
.home-page .catalog .card:hover { transform: none; box-shadow: 0 3px 9px #20212b0b; }
.home-page .catalog .card:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; transform: none; }
.home-page .catalog .card:focus-visible .card-launch { background: var(--brand); border-color: var(--brand); color: #fff; }
.home-page .catalog .card:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .home-page .catalog .card:hover,
  .home-page .catalog .card.is-expanded:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px #de293650, 0 7px 14px -6px #25263426, 0 18px 32px -12px #25263438; }
  .home-page .catalog .card:hover .lounge-art { transform: scale(1.04); }
  .home-page .catalog .card:hover .card-launch { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.08); }
}

/* Preview captions stay hidden, including on cards around an active player. */
.home-page .game-preview-caption { inset: 0 0 auto; padding: 10px; justify-content: flex-start; background: none; font-size: 10px; }
.home-page .catalog .game-preview-caption { display: none; }
.home-page .game-preview-label {
  max-width: 100%;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #ffffff30;
  border-radius: 100px;
  background: #14131dc9;
  box-shadow: 0 2px 8px #00000018, inset 0 1px 0 #ffffff0d;
  color: #fffffff2;
  font-weight: 600;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.home-page .game-preview-label::before { width: 0; height: 0; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 5px solid currentColor; border-radius: 0; background: none; }
.home-page .game-preview-hint { display: none; }
.home-page .catalog .empty { padding: 40px 24px; border: 1px dashed #d1d4df; border-radius: 18px; background: #fff; color: var(--muted); }

/* The inline player retains its grid slots while its surrounding cards
   use the same thumbnail treatment as the main catalogue. */
.home-page .home-player { background: #fff; border-color: #e4dfe5; box-shadow: 0 12px 36px -24px #33263138; }
.home-page .home-play-title { color: var(--text); }
.home-page .home-play-hint, .home-page .home-play-next-label { color: var(--muted); }
.home-page .home-play-control { border-color: transparent; background: transparent; color: #626471; }
.home-page .home-play-control:hover, .home-page .home-play-next:hover { background: var(--brand-soft); color: var(--brand); }
.home-page .home-play-loading, .home-page .home-play-error { background: var(--background); color: #525461; }
.home-page .home-play-fallback { color: #a7273a; }
.home-page .home-play-spinner { border-color: #e2d4d8; border-top-color: var(--brand); }
.home-page .home-play-next-name { color: var(--text); }
.home-page .catalog .grid.is-playing { gap: 12px; }
.home-page .catalog .grid.is-playing > .card { translate: var(--last-row-offset, 0px) 0; }
.home-page .catalog .home-compact-card,
.home-page .catalog .home-compact-card:hover,
.home-page .catalog .home-compact-card:focus-visible { padding: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; transform: none; }
.home-page .catalog .home-compact-card:not(.is-preview-ready) .card-surface { display: block; height: 100%; }
.home-page .catalog .home-compact-card:not(.is-preview-ready) .card-art { height: 100%; border-radius: 12px; }
.home-page .catalog .home-compact-card:not(.is-preview-ready) .card-caption { inset: auto 6px 6px; }
.home-page .catalog .home-compact-card:not(.is-preview-ready) .name { padding: 4px 6px; border-radius: 7px; color: var(--text); font-size: 13px; font-weight: 750; letter-spacing: -.025em; line-height: 1.2; }
.home-page .catalog .home-compact-card:not(.is-preview-ready) .card-launch { display: none; }
/* A separate title strip keeps names and launch controls off the gameplay. */
.home-page .catalog .card.is-preview-ready .card-art { background: #142433; }
.home-page .catalog .card.is-preview-ready .lounge-art { opacity: 0; }
.home-page .catalog .card.is-preview-ready .game-preview { bottom: 40px; }
.home-page .catalog .card.is-preview-ready .card-caption { inset: auto 8px 6px; align-items: center; }
.home-page .catalog .card.is-preview-ready .name { display: block; padding: 3px 6px; font-size: 16px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.home-page .catalog .card.is-preview-ready .card-launch { display: grid; }
/* The same shared popup serves browsing and the cards beside a player. */
.home-page .catalog .card.is-expanded { height: var(--card-resting-height); transform: none; }
.home-page .catalog .card.is-expanded.is-preview-ready .card-surface { display: block; padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #de293650, 0 8px 16px -6px #25263426, 0 20px 36px -12px #25263445; }
.home-page .catalog .card.is-expanded.is-preview-ready .card-art { height: var(--card-open-height); aspect-ratio: auto; border-radius: 16px; }
.home-page .catalog .card.is-expanded.is-preview-ready .name { color: var(--text); font-size: 16px; }
.home-page .catalog .home-compact-card.is-expanded.is-preview-ready .name { font-size: 14px; }
.home-page .catalog .card.is-preview-contained .card-launch { display: none; }
.home-page .home-player:fullscreen { background: var(--home-play-background); }
.home-page .home-player:fullscreen .home-play-header,
.home-page .home-player:fullscreen .home-play-footer { background: #fff; }

@media (max-width: 1199px) {
  .home-page .catalog .grid { --catalog-columns: 4; }
  .home-page .category-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }
}
@media (max-width: 900px) {
  .catalog-collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .home-page .catalog-collection:not(.catalog-collection-top):not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 9) { display: none; }
  .home-page .catalog-collection-top:not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 17) { display: none; }
  .home-page .catalog .grid { --catalog-columns: 3; --catalog-column-gap: 16px; row-gap: 18px; }
}
@media (max-width: 700px) {
  .catalog-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .home-page .catalog-collection:not(.catalog-collection-top):not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 5) { display: none; }
  .home-page .catalog-collection-top:not(.is-expanded) .catalog-collection-grid > .card:nth-child(n + 9) { display: none; }
  .catalog-collection + .catalog-collection { margin-block-start: 22px; }
  .home-page .catalog .search { width: clamp(160px, 32vw, 180px); padding-inline: 10px; gap: 6px; }
  .home-page .search input { font-size: 16px; }
  .home-page .category-bar { --category-top-gap: 10px; width: 100%; min-height: 68px; gap: 8px; padding: 6px 8px; justify-content: flex-start; }
  .home-page .catalog .filters { flex: 1 1 auto; }
  .home-page .catalog .chip { min-height: 44px; padding-inline: 13px; font-size: 11px; }
  .home-page .catalog .chip-symbol { display: grid; }
  .home-page .catalog .grid { --catalog-columns: 2; --catalog-column-gap: 13px; row-gap: 15px; }
  .home-page .library-toolbar { margin-bottom: 14px; }
  .home-page .catalog .card-art { aspect-ratio: 16 / 11; }
  .home-page .catalog .card .name { font-size: 18px; }
}
@media (max-width: 759px) {
  .home-page .catalog .grid.is-playing { gap: 10px; }
}
@media (max-width: 420px) {
  .catalog-view-link { font-size: 12px; }
  .catalog-browse-all { padding-inline: 8px; }
  .home-page .catalog .grid { --catalog-column-gap: 12px; row-gap: 14px; }
  .home-page .catalog .card, .home-page .catalog .card-art { border-radius: 13px; }
  .home-page .card-caption { inset: auto 8px 8px; gap: 6px; }
  .home-page .catalog .card .name { padding: 5px 7px; border-radius: 8px; font-size: 15px; }
  .home-page .card-launch { width: 23px; height: 23px; flex-basis: 23px; font-size: 10px; }
  .home-page .library-title h1 { font-size: 18px; }
  .home-page .catalog .result-count { font-size: 10px; }
}
@media (max-width: 359px) {
  .home-page .catalog .card .name { font-size: 14px; }
  .home-page .card-launch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .catalog .card, .home-page .catalog .card .lounge-art,
  .home-page .card-launch, .home-page .catalog .chip { transition: none; }
  .home-page .catalog .card:hover, .home-page .catalog .card.is-expanded:hover, .home-page .catalog .card:active,
  .home-page .catalog .card:hover .lounge-art, .home-page .catalog .card:hover .card-launch,
}
