/* =========================================================================
   MSN Play — clean rebuild, dimensions matched to the real page (measured @1900):
   content starts at x=272 (sidebar 232 + content pad 40) · featured 520x300 ·
   hero minis 252x142 · portrait cards 214x261 · all gaps 16 · radius 16 ·
   h1 38/600 · h2 24/600 · heading color #272320 · Segoe UI.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Segoe UI Web (West European) — self-hosted (downloaded from Microsoft's CDN)
   so non-Windows devices match MSN. Windows users keep their native "Segoe UI"
   (earlier in the stack); this is the web fallback MSN itself ships.
   ------------------------------------------------------------------------- */
@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2") format("woff2"),
    url("../fonts/segoe-semilight.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2") format("woff2"),
    url("../fonts/segoe-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2") format("woff2"),
    url("../fonts/segoe-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Segoe UI Web (West European)";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2") format("woff2"),
    url("../fonts/segoe-bold.woff2") format("woff2");
}

:root {
  --font: "Segoe Sans", "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --bg: #f7f6f4;
  --bg-elev: #ffffff;
  --text: #272320;
  /* headings / primary (rgb 39,35,32) */
  --text-2: #4b4742;
  /* subtitle */
  --muted: #6b6560;
  --accent: #1371c3;
  --amber: #c0841f;
  --card: #e8e6e3;
  --line: #e4e2df;
  --hover: rgba(0, 0, 0, .06);
  --arrow-hover: #f8f4f1;
  --active: rgba(0, 0, 0, .045);
  --search-bg: rgba(0, 0, 0, .05);
  --radius: 10px;
  --radius-icon: 11px;
  --rail-w: 232px;
  --head-h: 56px;
  --flame: #ff7a18;
  --ovl: #fffbf8;
  --box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.14);
  /* overlay text on cards */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242424;
    --bg-elev: #2e2e2e;
    --text: #f3f1ee;
    --text-2: #c9c6c2;
    --muted: #b2aeaa;
    --card: #3a3a3a;
    --line: #3d3d3d;
    --hover: rgba(255, 255, 255, .08);
    --active: rgba(255, 255, 255, .10);
    --search-bg: rgba(255, 255, 255, .08);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ------------------------------------------------------------------ header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand .logo {
  width: 30px;
  height: 30px;
}

.brand .word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* mobile search: trigger hidden on desktop, dropdown bar under the top bar.
   Scoped to .topbar so it outranks .icon-btn's own `display: grid` (same
   specificity but defined later), otherwise the button shows at every size. */
.topbar .m-search-btn {
  display: none;
}

.m-search {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 12px 0;
  padding: 0 14px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.m-search[hidden] {
  display: none;
}

.m-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.m-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  /* 16px avoids iOS zoom-on-focus */
}

.m-search input::placeholder {
  color: var(--muted);
}

/* show the topbar search on phones (rail hidden) and on touch devices up to 1440
   (where the rail is collapsed and its hover-to-expand search isn't reachable) */
@media (max-width: 700px),
(hover: none) and (max-width: 1440px) {
  .topbar .m-search-btn {
    display: grid;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--hover);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.signin {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.signin:hover {
  background: var(--hover);
}

.signin svg {
  width: 16px;
  height: 16px;
}

/* notifications popover (reusable) */
.pop-wrap {
  position: relative;
  display: flex;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 384px;
  max-width: 92vw;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .20);
  padding: 16px 18px;
}

.popover[hidden] {
  display: none;
}

.popover:not([hidden]) {
  animation: pop-rise .16s ease;
}

/* dim backdrop behind the popover; sits below it, above the page */
.pop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, .45);
  animation: pop-fade .15s ease;
}

.pop-overlay[hidden] {
  display: none;
}

@keyframes pop-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pop-rise {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pop-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.pop-head .pop-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.pop-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}

.pop-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pop-icon:hover {
  background: var(--hover);
}

.pop-icon svg {
  width: 20px;
  height: 20px;
}

.pop-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}

.pop-tab {
  position: relative;
  background: none;
  border: 0;
  padding: 4px 0 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.pop-tab.active {
  color: var(--text);
  font-weight: 600;
}

.pop-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}

.pop-seeall {
  margin-left: auto;
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
}

.pop-seeall:hover {
  text-decoration: underline;
}

.pop-body {
  margin-top: 10px;
  min-height: 128px;
  max-height: 60vh;
  /* inner padding leaves room for the pop-out delete buttons (top/right -6px) */
  padding: 8px;
  /* only this area scrolls; scrollbar hidden */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pop-body::-webkit-scrollbar {
  display: none;
}

.pop-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 150px;
  padding: 16px;
  text-align: center;
}

.pop-empty[hidden] {
  display: none;
}

.pop-empty .pe-ico {
  width: 40px;
  height: 40px;
  color: var(--muted);
  margin-bottom: 10px;
}

.pop-empty .pe-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.pop-empty .pe-sub {
  margin-top: 4px;
  max-width: 240px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

/* games grid inside the popover: 2 per row */
.pop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.pop-grid:empty {
  display: none;
}

.ncard {
  position: relative;
  min-width: 0;
}

.ncard-link {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  /* match the home-page cards; stored 249x162 thumb is cropped via object-fit */
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}

.ncard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* game name overlay, fades in on hover (same idea as .mini .mcap) */
.ncard-link .ncap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 10px 7px;
  color: var(--ovl);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.ncard:hover .ncap {
  opacity: 1;
}

.ncard-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-elev);
  ;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.ncard-del:hover {
  background: var(--arrow-hover);
}

.ncard-del svg {
  width: 13px;
  height: 13px;
  color: var(--text)
}

.pop-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------------------------------------------- shell */
.shell {
  display: flex;
  align-items: flex-start;
}

.rail {
  position: sticky;
  top: var(--head-h);
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: calc(100vh - var(--head-h));
  overflow: hidden;
}

/* actual sidebar panel; on small screens it collapses and floats on hover */
.rail-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 10px 16px 14px 24px;
}

/* vertical carousel track: only this area scrolls (search/arrows/support stay put) */
.rail-track {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: none;
}

.rail-track::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* divider between the menu_header group and the sidebar_menu group */
.rail-sep {
  flex: 0 0 auto;
  height: 1px;
  margin: 10px 8px;
  background: var(--line);
}

.rail-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
}

.rail-arrow:hover {
  background: var(--hover);
  color: var(--text);
}

.rail-arrow svg {
  width: 18px;
  height: 18px;
}

.rail-arrow[hidden] {
  display: none;
}

.rail::-webkit-scrollbar {
  width: 8px;
}

.rail::-webkit-scrollbar-thumb {
  background: #d2d0cd;
  border-radius: 4px;
}

.rail .search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--search-bg);
  color: var(--muted);
  border: 1px solid transparent;
}

.rail .search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.rail .search input {
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--text);
  font-size: 14px;
  width: 100%;
}

.rail .search input::placeholder {
  color: var(--muted);
}

.navitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  min-height: 40px;
  font-weight: 500;
}

.navitem:hover {
  background: var(--hover);
}

.navitem.active {
  background: var(--active);
  /* font-weight: 600; */
}

.navitem.active::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  border-radius: 2px;
  background: var(--muted);
  transform: translateY(-50%);
  left: 0;
  height: 50%;
}

.navitem .ic {
  width: 22px;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  flex: 0 0 auto;
}

.navitem .ic svg {
  width: 18px;
  height: 18px;
}

.navitem.more {
  justify-content: center;
  color: var(--muted);
  margin-top: 2px;
}

.navitem.more svg {
  width: 18px;
  height: 18px;
}

.rail .support {
  flex: 0 0 auto;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 32px 10px 40px;
  /* Column-count grid, exactly like the reference: a card row always shows a
     whole number of cards (--n) that fill the row width, stepped by breakpoint
     (see the ladder in the media queries). --col is that card width; --col-resume
     is the smaller "Continue playing" card. Because the hero's featured spans
     2 columns, --n columns => 2*(--n - 2) mini cards, i.e. 8/6/4 at --n 6/5/4.
        1920: --n 6  (8 minis) · resume 10
        1536: --n 5  (6 minis) · resume 8
        1440/1366: --n 4 (4 minis) · resume 7  */
  --gap: 16px;
  --n: 6;
  --n-resume: 10;
  --col: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n));
  --col-resume: calc((100% - (var(--n-resume) - 1) * var(--gap)) / var(--n-resume));
}

/* -------------------------------------------------------------------- hero */
.hero h2 {
  margin: 16px 0 2px;
  font-size: 30px;
  line-height: 40px;
  font-weight: 600;
  color: var(--text);
}

.hero .sub {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 400;
  color: var(--text-2);
}

/* the whole hero row is ONE horizontal carousel: featured (2x2) + minis (2 rows).
   --hc (= --col) is the column width; the exact card COUNT is set per breakpoint
   so 1366/1440/1536/1920 each show a whole number of cards (see .content). */
.hero-grid {
  --hc: var(--col, 252px);
  display: grid;
  /* rows are auto: each mini sets its own height via aspect-ratio (16:9 of the
     resolved column width). We can't derive the height from --hc here because
     --hc is a % of width, and a % in grid-template-rows/height would resolve
     against HEIGHT instead -> the old --hr collapsed the rows to ~0. */
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  grid-auto-columns: var(--hc);
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.hero-grid::-webkit-scrollbar {
  display: none;
}

/* each card is a snap point so the overall "next" scroll always lands on a
   clean card edge (no half-cut cards on the left/right after scrolling) */
.hero-grid>.featured,
.hero-grid>.mini {
  scroll-snap-align: start;
}

/* featured spans 2 columns x 2 rows (520x300); auto-rotates 4 games inside */
.featured {
  grid-row: 1 / span 2;
  grid-column: 1 / span 2;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.feat-slides {
  position: absolute;
  inset: 0;
}

/* each slide is a link (click image -> game page); only the active one fades
   in and receives clicks, so the visible game is always the one you navigate to */
.feat-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}

.feat-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.feat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured .shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .18) 34%, rgba(0, 0, 0, 0) 56%);
}

.feat-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-icon);
  border: 0;
  background: var(--cg-infopane-nav-button-bg, rgba(0, 0, 0, 0.55));
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: var(--box-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, background .18s ease;
}

/* infinite loop: no edge logic — arrows just reveal on hover */
.featured:hover .feat-arrow {
  opacity: 1;
  pointer-events: auto;

}

.feat-arrow.prev {
  left: 10px;
}

.feat-arrow.next {
  right: 10px;
}

.feat-arrow svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.feat-arrow:hover {
  background: var(--cg-infopane-nav-button-bg-hover, rgba(0, 0, 0, 1));
}


.fbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ovl);
}

.frow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 auto;
  max-width: 66%;
}

.frow .ficon {
  width: auto;
  height: 48px;
  border-radius: var(--radius-icon);
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  aspect-ratio: 16 / 9;
}

.ftext {
  min-width: 0;
}

.ftitle {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fsub {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pp {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 2px;
}

.pp svg {
  width: 15px;
  height: 15px;
  display: block;
}

.carousel .dashes {
  display: flex;
  gap: 5px;
}

.carousel .dash {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .5);
}

.carousel .dash.on {
  background: #fff;
  width: 26px;
}

.play-now {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 22px;
  background: rgba(10, 10, 10, .5);
  backdrop-filter: blur(6px);
  color: #eef2fb;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.play-now:hover {
  background: rgba(10, 10, 10, .68);
}

/* hero mini: landscape 16:9 grid cells inside the hero carousel. aspect-ratio
   (not height:100%) gives each cell a real height -> it sizes the auto rows,
   and the featured spans both of them. */
.mini {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.mini>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.mini:hover>img {
  transform: scale(1.04);
}

.mini .mcap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 12px 10px;
  color: var(--ovl);
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(to top, rgba(0, 0, 0, .68), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .2s ease;
}

.mini:hover .mcap {
  opacity: 1;
}

/* generic horizontal scroller with edge arrows */
.caro {
  position: relative;
  min-width: 0;
}

.caro-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-icon);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--box-shadow);
}

.caro-arrow:hover {
  background: var(--arrow-hover);
}

.caro-arrow.prev {
  left: -14px;
}

.caro-arrow.next {
  right: -14px;
}

.caro-arrow[hidden] {
  display: none;
}

.caro-arrow svg {
  width: 18px;
  height: 18px;
}

.hero-caro .caro-arrow.prev {
  left: -6px;
}

.hero-caro .caro-arrow.next {
  right: -6px;
}

/* ---------------------------------------------------- pick up where you left off */
.resume {
  margin-top: 26px;
}

.resume h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.resume-row {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.resume-row::-webkit-scrollbar {
  display: none;
}

.resume-card {
  position: relative;
  /* smaller column unit -> 10/8/7 cards fit at 1920/1536/1440 */
  flex: 0 0 var(--col-resume, 168px);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  scroll-snap-align: start;
}

.resume-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* game name overlay, fades in on hover (same as .mini .mcap) */
.resume-card .mcap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 10px 8px;
  color: var(--ovl);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.resume-card:hover .mcap {
  opacity: 1;
}

/* ----------------------------------------------------------------- section */
.section {
  margin-top: 34px;
  position: relative;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--text);
}

.section-head .spacer {
  flex: 1 1 auto;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.filter .muted {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 8px;
}

.navbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.navbtn:hover {
  background: var(--hover);
}

.navbtn svg {
  width: 18px;
  height: 18px;
}

/* horizontal card row */
.row {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  /* padding: 0 4px 8px;
  margin: 0 -4px; */
  scrollbar-width: none;
}

.row::-webkit-scrollbar {
  display: none;
}

/* safety: any horizontal carousel track hides its scrollbar */
.caro-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.caro-track::-webkit-scrollbar {
  display: none;
}

.row .card {
  /* same column unit as the hero minis -> every card column lines up */
  flex: 0 0 var(--col, 252px);
  scroll-snap-align: start;
}

.row .card.portrait {
  flex-basis: clamp(170px, 11.3vw, 214px);
}

/* grid (all games) — landscape cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px 16px;
}

/* cards */
.card {
  display: block;
  cursor: pointer;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.thumb>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.card:hover .thumb>img {
  transform: scale(1.05);
}

/* Type D (landscape): dark label below the thumbnail */
.cap {
  padding: 9px 2px 0;
}

.cap .title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap .sub {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

/* Type C (portrait): white caption overlaid on the image */
.card.portrait .thumb {
  aspect-ratio: 214 / 261;
}

.cov {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 26px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, .74) 0%, rgba(0, 0, 0, .30) 46%, rgba(0, 0, 0, 0) 100%);
}

.cov .cicon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.cov .ctext {
  min-width: 0;
}

.cov .ctitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--ovl);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cov .csub {
  margin-top: 1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ovl);
  display: flex;
  align-items: center;
  gap: 5px;
}

.like {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 22px 32px 26px 40px;
  margin-top: 30px;
  font-size: 12px;
  color: var(--muted);
}

.footer a:hover {
  text-decoration: underline;
}

.pchoice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pchoice svg {
  width: 26px;
  height: 14px;
}

.feedback {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.feedback:hover {
  background: var(--hover);
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .hero h2 {
    font-size: 28px;
    line-height: 34px;
  }

  .hero .sub {
    font-size: 18px;
  }

  .section-head h2, .resume h2 {
    font-size: 22px;
  }
}

/* ---- card-column ladder: whole number of cards that fill one row (see .content) ---- */
@media (max-width: 1536px) {
  .content {
    --n: 5;
    --n-resume: 8;
  }
}

/* ---- collapsible icon rail (1440 and down): icons only by default, expands into
   a floating overlay card on hover/focus WITHOUT shifting the page content ---- */
@media (max-width: 1440px) {
  :root {
    --rail-w: 72px;
  }

  .content {
    --n: 4;
    --n-resume: 7;
  }

  /* lift the whole rail above the content grid (sticky = its own stacking
     context, so the z-index must live here, not only on .rail-panel).
     Stays below the topbar (z-index 60) so the header keeps covering it. */
  .rail {
    overflow: visible;
    z-index: 50;
  }

  .rail-panel {
    position: absolute;
    top: 0;
    left: 12px;
    width: var(--rail-w);
    padding: 10px 12px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    overflow: hidden;
    transition: width .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  }

  /* collapsed: center icons, hide labels */
  .rail-panel .search {
    justify-content: center;
    padding: 0;
    width: 44px;
  }

  .rail-panel .search input {
    display: none;
  }

  .rail-panel .navitem {
    justify-content: center;
    padding: 0;
  }

  .rail-panel .navitem span:not(.ic) {
    display: none;
  }

  /* hover / keyboard focus -> expand into a floating card over the content */
  .rail:hover .rail-panel,
  .rail:focus-within .rail-panel {
    width: 240px;
    background: var(--bg-elev);
    /* frosted floating card, like the reference flyout */
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  }

  .rail:hover .rail-panel .search,
  .rail:focus-within .rail-panel .search {
    justify-content: flex-start;
    padding: 0 12px;
    width: 100%;
  }

  .rail:hover .rail-panel .search input,
  .rail:focus-within .rail-panel .search input {
    display: block;
  }

  .rail:hover .rail-panel .navitem,
  .rail:focus-within .rail-panel .navitem {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .rail:hover .rail-panel .navitem span:not(.ic),
  .rail:focus-within .rail-panel .navitem span:not(.ic) {
    display: inline;
  }

}

@media (max-width: 1024px) {
  .content {
    padding: 8px 24px 10px;
    --n: 3;
    --n-resume: 5;
  }

  .footer {
    padding: 22px 24px;
  }
}

@media (max-width: 820px) {

  /* denser game grid on tablets / large phones */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 18px 12px;
  }

  /* keep the 2-row hero grid (just smaller via --hc) like the real MSN;
     the fixed carousel arrows give way to touch-swipe */
  .caro-arrow {
    display: none;
  }

  .content {
    padding: 8px 16px 10px;
  }
}

/* phones: drop the icon rail and go full-width (tablets keep the compact rail) */
@media (max-width: 700px) {
  .rail {
    display: none;
  }
}

@media (max-width: 560px) {

  /* phones: 2 columns -> the hero featured fills the screen, 2 cards per game row */
  .content {
    --n: 2;
    --n-resume: 3;
  }

  .hero h2 {
    font-size: 24px;
    line-height: 28px;
  }

  .hero .sub {
    font-size: 15px;
  }

  .section-head h2, .resume h2 {
    font-size: 20px;
  }

  .carousel {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    gap: 16px 10px;
  }

  .footer {
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  }
}

/* -------------------------------------------- listing page (game_list) */
.section-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.list-intro {
  margin-top: -4px;
  margin-bottom: 1rem;
  /* max-width: 72ch; */
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
}

.ads-slot {
  display: flex;
  justify-content: center;
  margin: 10px 0 4px;
}

.list-seo {
  margin-top: 30px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.list-seo h3 {
  /* margin: 18px 0 8px; */
  color: var(--text);
  /* font-size: 18px; */
}

.list-seo ul, .pacc-body ul, .list-seo ol, .pacc-body ol {
  margin: 0 0 12px;
  padding-left: 18px;
}

.list-seo a, .pacc-body a {
  color: var(--text);
  font-weight: 500;
}

.list-seo a:hover, .pacc-body a:hover {
  text-decoration: underline;
}

.list-seo img, .pacc-body img {
  max-width: 100%;
  height: auto;
}

.list-seo h1, .list-seo h2, .list-seo h3, .list-seo h4 {
  font-weight: revert;
}

.pacc-body h1, .pacc-body h2, .pacc-body h3, .pacc-body h4 {
  font-weight: revert;
}

/* ---- tables written inside editor/SEO content (.list-seo) and the game
   "About this game" accordion (.pacc-body). Themed + horizontally scrollable:
   display:block turns each <table> into its own scroll box, so a wide table
   scrolls on its own instead of stretching the page / breaking the layout. ---- */
.list-seo table,
.pacc-body table {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.list-seo th,
.list-seo td,
.pacc-body th,
.pacc-body td {
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.list-seo th,
.pacc-body th {
  background: var(--hover);
  font-weight: 600;
  white-space: nowrap;
}

/* subtle zebra striping for readability */
.list-seo tbody tr:nth-child(even),
.pacc-body tbody tr:nth-child(even) {
  background: var(--active);
}

.list-seo table caption,
.pacc-body table caption {
  caption-side: bottom;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: left;
}

@media (max-width: 560px) {

  .list-seo th,
  .list-seo td,
  .pacc-body th,
  .pacc-body td {
    padding: 7px 9px;
    font-size: 13px;
  }
}

/* -------------------------------------------- site-wide live search results */
/* while a search is active, hide every direct child of the page content except
   the results container (works on any page: home, listing, category, 404...).
   child combinator so the suggestion .section INSIDE #home-search is kept. */
.content.searching>:not(.home-search) {
  display: none;
}

.home-search {
  margin-top: 4px;
}

.search-head {
  margin: 12px 0 18px;
}

.search-head h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.search-head .se-ico {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.search-head b {
  font-weight: 700;
}

.search-head .search-count {
  /* font-size: 15px; */
  font-weight: 600;
  color: var(--accent);
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 16px 30px;
  color: var(--text);
}

.search-empty .se-emoji {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--hover);
  color: var(--accent);
}

.search-empty .se-emoji svg {
  width: 32px;
  height: 32px;
}

.search-empty h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.search-empty p {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
}

/* pagination (shared layout: layout/pagination.php) */
#pagination {
  margin-top: 28px;
}

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination_text {
  margin-right: 4px;
  color: var(--muted);
  font-size: 14px;
}

.pagination .btn_classic,
.pagination .paging_active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-icon);
  font-size: 14px;
  font-weight: 600;
}

.pagination .btn_classic {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}

/* The layout nests <a.btn_classic> inside <button.btn_classic>: neutralise
   the wrapper button so only the inner link shows the chip styling. */
.pagination button.btn_classic {
  padding: 0;
  border: 0;
  background: none;
}

.pagination button.btn_classic>a.btn_classic {
  text-decoration: none;
}

.pagination .btn_classic:hover {
  background: var(--arrow-hover);
}

.pagination .paging_active {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

/* listing-page title scales down on phones (defined after the breakpoints above) */
@media (max-width: 560px) {
  .section-head h1 {
    font-size: 23px;
    line-height: 30px;
  }

  .list-intro {
    font-size: 14px;
  }
}