.steam-games {
  --steam-row-hover: rgba(255, 255, 255, 0.56);
  --steam-row-active: rgba(255, 255, 255, 0.68);
  --steam-border: rgba(28, 34, 42, 0.12);
  --steam-text: #24272d;
  --steam-muted: #697386;
  --steam-accent: #168f7d;
  --steam-accent-soft: rgba(22, 143, 125, 0.14);
  --steam-row-shadow: 0 10px 24px rgba(22, 28, 38, 0.09);
  --steam-cover-bg: rgba(28, 34, 42, 0.08);
  --steam-slot-well: rgba(28, 34, 42, 0.055);
  --steam-slot-edge: rgba(28, 34, 42, 0.17);
  --steam-slot-depth: rgba(22, 28, 38, 0.12);
  --steam-skeleton: rgba(28, 34, 42, 0.1);

  padding: 0 1.5rem;
  color: var(--steam-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.steam-games__title {
  margin: 0 0 1.2rem;
  padding-bottom: 0.8rem;
  color: var(--steam-text);
  font-size: 1.4em;
  font-weight: 700;
}

.steam-games__list {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--steam-border);
  background: transparent;
  transition: height 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.steam-games__list[data-steam-games-settled="1"]:not([data-steam-games-resizing="1"]) {
  overflow: visible;
}

.steam-games__list:not([data-steam-games-settled]) > .steam-games__state:only-child {
  display: grid;
  min-height: 480px;
  box-sizing: border-box;
  place-items: center;
}

.steam-games__item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--steam-border);
  outline: none;
  left: 0;
  transition: background-color 180ms ease, box-shadow 180ms ease, left 180ms ease;
}

.steam-games__item:last-child {
  border-bottom: 0;
}

.steam-games__item::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--steam-accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.steam-games__item:hover,
.steam-games__item:focus-visible {
  z-index: 0;
  background: var(--steam-row-hover);
  box-shadow: var(--steam-row-shadow);
  left: 4px;
}

.steam-games__item.steam-games__item--cover-preview {
  z-index: 3;
  box-shadow: none;
}

.steam-games__item.steam-games__item--cover-drag {
  z-index: 6;
  left: 4px;
  background: var(--steam-row-active);
  box-shadow: none;
}

.steam-games__item.steam-games__item--cover-dragging {
  z-index: 7;
}

.steam-games__item.steam-games__item--cover-drag::before {
  opacity: 0;
  transform: scaleY(0.45);
}

.steam-games__item:hover::before,
.steam-games__item:focus-visible::before {
  opacity: 1;
  transform: scaleY(1);
}

.steam-games__item.steam-games__item--cover-preview-active::before {
  opacity: 0;
  transform: scaleY(0.45);
}

/* Pointer capture can leave :hover stale when a drag is released outside the row
   and the mouse stays still. Suppress only that stale visual state until re-entry. */
.steam-games__item.steam-games__item--released-outside:not(.steam-games__item--cover-drag):hover:not(:focus-visible) {
  z-index: 1;
  left: 0;
  background: transparent;
  box-shadow: none;
}

.steam-games__item.steam-games__item--released-outside:not(.steam-games__item--cover-drag):hover:not(:focus-visible)::before {
  opacity: 0;
  transform: scaleY(0.45);
}

.steam-games__item.steam-games__item--released-outside:not(.steam-games__item--cover-drag):hover:not(:focus-visible) .steam-games__cover img {
  transform: scale(1);
}

.steam-games__cover-slot {
  position: relative;
  width: 145px;
  aspect-ratio: 460 / 215;
  flex: 0 0 auto;
  overflow: visible;
}

.steam-games__cover-slot::before {
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: var(--steam-slot-well);
  box-shadow:
    inset 0 2px 8px var(--steam-slot-depth),
    inset 0 0 0 1px var(--steam-slot-edge);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(0.965);
  transition:
    opacity 150ms ease,
    transform 260ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.steam-games__cover-slot--vacant::before {
  opacity: 1;
  transform: scale(1);
}

.steam-games__cover-drag-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  transform: translate3d(0, 0, 0);
}

.steam-games__cover {
  --steam-tilt-x: 0deg;
  --steam-tilt-y: 0deg;
  --steam-cover-lift: 0px;
  --steam-glare-x: 0px;
  --steam-glare-y: 0px;
  --steam-glare-opacity: 0;

  /* Reserve 132% raster detail, then scale it down so the resting geometry is unchanged.
     The offsets preserve the previous 65% transform-origin expansion path exactly. */
  position: absolute;
  top: -16%;
  left: -20.8%;
  width: 132%;
  height: 132%;
  border-radius: 9.24px;
  transform: scale(0.75757576);
  transform-origin: 65% 50%;
  transition: transform 480ms cubic-bezier(0.22, 0.62, 0.22, 1);
}

.steam-games__cover-surface {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  isolation: isolate;
  background: var(--steam-cover-bg);
  --steam-cover-shadow-duration: 480ms;
  --steam-cover-shadow-ease: cubic-bezier(0.22, 0.62, 0.22, 1);
  box-shadow:
    0 15px 30px rgba(10, 14, 22, 0),
    0 4px 10px rgba(10, 14, 22, 0),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backface-visibility: hidden;
  transform: perspective(720px) translateZ(var(--steam-cover-lift)) rotateX(var(--steam-tilt-x)) rotateY(var(--steam-tilt-y)) rotateZ(var(--steam-drag-roll, 0deg));
  transform-origin: 65% 50%;
  transition:
    transform 120ms cubic-bezier(0.22, 0.72, 0.28, 1),
    box-shadow var(--steam-cover-shadow-duration) var(--steam-cover-shadow-ease);
  -webkit-backface-visibility: hidden;
}

.steam-games__cover-surface::after {
  position: absolute;
  z-index: 2;
  inset: -44% -34%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.36) 0, rgba(255, 255, 255, 0.13) 25%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(5, 9, 15, 0.18));
  content: "";
  opacity: var(--steam-glare-opacity);
  pointer-events: none;
  transform: translate3d(var(--steam-glare-x), var(--steam-glare-y), 0) rotate(-7deg);
  transform-origin: 50% 50%;
  transition: opacity 170ms ease, transform 110ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.steam-games__cover--preview-active {
  transform: scale(0.96212121);
  transition-duration: 420ms;
  transition-timing-function: cubic-bezier(0.22, 0.68, 0.22, 1);
}

.steam-games__cover--preview-active .steam-games__cover-surface {
  --steam-cover-lift: 18px;
  --steam-cover-shadow-duration: 420ms;
  --steam-cover-shadow-ease: cubic-bezier(0.22, 0.68, 0.22, 1);

  box-shadow:
    0 15px 30px rgba(10, 14, 22, 0.28),
    0 4px 10px rgba(10, 14, 22, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.steam-games__item--cover-drag .steam-games__cover-surface {
  --steam-cover-lift: 18px;

  box-shadow:
    0 15px 30px rgba(10, 14, 22, 0.28),
    0 4px 10px rgba(10, 14, 22, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.steam-games__cover img {
  position: absolute;
  top: -1.32px;
  left: -1.32px;
  display: block;
  width: calc(100% + 2.64px) !important;
  height: calc(100% + 2.64px) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: cover;
  opacity: 0;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition:
    opacity 240ms ease,
    transform var(--steam-image-zoom-duration, 240ms) var(--steam-image-zoom-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.steam-games__cover img.is-loaded {
  opacity: 1;
}

.steam-games__cover img.is-error {
  opacity: 0.45;
}

.steam-games__item:hover .steam-games__cover img,
.steam-games__item:focus-visible .steam-games__cover img {
  transform: scale(1.035);
}

/* Desktop drag uses the same card node; native image dragging stays disabled. */
@media (hover: hover) and (pointer: fine) {
  .steam-games__cover {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }

  .steam-games__cover-drag-layer--dragging .steam-games__cover {
    cursor: grabbing;
  }
}

/* Keep both raster layers alive on desktop so hover never switches sampling/compositor mode. */
@media (hover: hover) and (pointer: fine) {
  .steam-games__cover,
  .steam-games__cover img.is-loaded:not(.is-error) {
    will-change: transform;
  }
}

/* Direct cover entry/exit uses the same breathing curve as the outer 3D scale. */
.steam-games__item--cover-preview .steam-games__cover img {
  --steam-image-zoom-duration: 480ms;
  --steam-image-zoom-ease: cubic-bezier(0.22, 0.62, 0.22, 1);
}

.steam-games__item--cover-preview-active .steam-games__cover img {
  --steam-image-zoom-duration: 420ms;
  --steam-image-zoom-ease: cubic-bezier(0.22, 0.68, 0.22, 1);
}

.steam-games__info {
  flex: 1 1 auto;
  min-width: 0;
}

.steam-games__name {
  margin: 0;
  overflow: hidden;
  color: var(--steam-text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steam-games__meta {
  margin-top: 3px;
  color: var(--steam-muted);
  font-size: 12px;
  line-height: 1.4;
}

.steam-games__time {
  min-width: 145px;
  flex: 0 0 auto;
  color: var(--steam-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.steam-games__time span {
  display: block;
}

.steam-games__recent {
  display: inline-block;
  color: var(--steam-accent);
  font-weight: 650;
}

.steam-games__recent::before {
  display: inline-block;
  width: 0.52em;
  height: 0.52em;
  margin-right: 0.45em;
  border-radius: 999px;
  background: var(--steam-accent);
  box-shadow: 0 0 0 5px var(--steam-accent-soft);
  content: "";
  vertical-align: 0.04em;
}

.steam-games__item--enter {
  animation: steam-games-item-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--steam-enter-delay, 0ms);
}

.steam-games__state--enter {
  animation: steam-games-fade-enter 220ms ease both;
}

.steam-games__item--skeleton {
  pointer-events: none;
}

.steam-games__item--skeleton::before {
  display: none;
}

.steam-games__skeleton-block,
.steam-games__skeleton-line {
  background: var(--steam-skeleton);
}

.steam-games__skeleton-block {
  box-shadow: none;
}

.steam-games__skeleton-line {
  height: 10px;
  margin-left: auto;
  border-radius: 999px;
  opacity: 0.8;
}

.steam-games__skeleton-line--name {
  width: min(72%, 250px);
  height: 13px;
  margin: 0;
}

.steam-games__skeleton-line--meta {
  width: min(46%, 150px);
  margin: 8px 0 0;
}

.steam-games__skeleton-line--time {
  width: 118px;
  margin-bottom: 7px;
}

.steam-games__skeleton-line--short {
  width: 88px;
  margin-bottom: 0;
}

.steam-games__loading-label {
  position: absolute;
  inset: 0;
  display: grid;
  color: var(--steam-muted);
  font-size: 13px;
  pointer-events: none;
  place-items: center;
  text-align: center;
}

.steam-games__state {
  padding: 2rem;
  color: var(--steam-muted);
  font-size: 14px;
  text-align: center;
}

.steam-games__source {
  margin-top: 1rem;
  color: var(--steam-muted);
  font-size: 0.85em;
  text-align: right;
}

.steam-games__source a {
  color: var(--steam-muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.steam-games__source a:hover {
  color: var(--steam-accent);
}

body.theme-dark .steam-games,
html.theme-dark .steam-games,
.theme-dark .steam-games,
[data-theme="dark"] .steam-games,
[theme="dark"] .steam-games {
  --steam-row-hover: rgba(255, 255, 255, 0.075);
  --steam-row-active: rgba(255, 255, 255, 0.1);
  --steam-border: rgba(255, 255, 255, 0.09);
  --steam-text: #f2f4f7;
  --steam-muted: #b5bdc9;
  --steam-accent: #4fd1b8;
  --steam-accent-soft: rgba(79, 209, 184, 0.16);
  --steam-row-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  --steam-cover-bg: rgba(255, 255, 255, 0.08);
  --steam-slot-well: rgba(255, 255, 255, 0.035);
  --steam-slot-edge: rgba(255, 255, 255, 0.12);
  --steam-slot-depth: rgba(0, 0, 0, 0.34);
  --steam-skeleton: rgba(255, 255, 255, 0.09);
}

body.theme-white .steam-games,
html.theme-white .steam-games,
.theme-white .steam-games,
body.theme-light .steam-games,
html.theme-light .steam-games,
.theme-light .steam-games,
body.theme-sunset .steam-games,
html.theme-sunset .steam-games,
.theme-sunset .steam-games,
[data-theme="white"] .steam-games,
[data-theme="light"] .steam-games,
[data-theme="sunset"] .steam-games,
[theme="white"] .steam-games,
[theme="light"] .steam-games,
[theme="sunset"] .steam-games {
  --steam-row-hover: rgba(255, 255, 255, 0.54);
  --steam-row-active: rgba(255, 255, 255, 0.66);
  --steam-border: rgba(32, 39, 50, 0.13);
  --steam-text: #20242a;
  --steam-muted: #5f6877;
  --steam-accent: #b65f2b;
  --steam-accent-soft: rgba(182, 95, 43, 0.14);
  --steam-row-shadow: 0 10px 24px rgba(46, 36, 28, 0.1);
  --steam-cover-bg: rgba(32, 39, 50, 0.08);
  --steam-slot-well: rgba(32, 39, 50, 0.045);
  --steam-slot-edge: rgba(32, 39, 50, 0.14);
  --steam-slot-depth: rgba(46, 36, 28, 0.12);
  --steam-skeleton: rgba(32, 39, 50, 0.09);
}

@keyframes steam-games-item-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes steam-games-fade-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 576px) {
  .steam-games {
    padding: 0 1rem;
  }

  .steam-games__list:not([data-steam-games-settled]) > .steam-games__state:only-child {
    min-height: 470px;
  }

  .steam-games__item {
    gap: 12px;
    padding: 11px 12px;
  }

  .steam-games__cover-slot {
    width: 126px;
  }

  .steam-games__info {
    display: none;
  }

  .steam-games__time {
    min-width: 118px;
    margin-left: auto;
  }

  .steam-games__skeleton-line--time {
    width: 100px;
  }

  .steam-games__skeleton-line--short {
    width: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .steam-games__list,
  .steam-games__item,
  .steam-games__item::before,
  .steam-games__cover-slot::before,
  .steam-games__cover-drag-layer,
  .steam-games__cover,
  .steam-games__cover-surface,
  .steam-games__cover img,
  .steam-games__source a {
    transition: none;
  }

  .steam-games__cover-surface::after {
    display: none;
  }

  .steam-games__item--enter,
  .steam-games__state--enter {
    animation: none;
  }

  .steam-games__item:hover,
  .steam-games__item:focus-visible {
    left: 0;
  }

  .steam-games__item:hover .steam-games__cover img,
  .steam-games__item:focus-visible .steam-games__cover img {
    transform: scale(1);
  }

  .steam-games__cover,
  .steam-games__cover img.is-loaded:not(.is-error) {
    will-change: auto;
  }
}
