/* Components and the shell: rail, top bar, tab bar, buttons, cards, rows,
   heroes, covers, dialogs, menus, toasts, forms, skeletons. */

/* The glow behind the top of each page, tinted by the art on screen. A
   registered custom property, so the colour cross-fades between slides. */
@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(76, 125, 255, 0.1);
}

/* =========================================================== shell ===== */

.shell {
  --glow: rgba(76, 125, 255, 0.1);
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  transition: --glow 900ms ease;
}

.shell-glow {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  height: min(1100px, 130vh);
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 58% at 42% 0%, var(--glow), transparent 72%),
    radial-gradient(ellipse 40% 36% at 88% 8%, var(--glow), transparent 70%);
  opacity: 0.85;
}

.main {
  position: relative;
  z-index: 1;
  margin-left: var(--rail-width);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
}

.main:focus {
  outline: none;
}

/* While a game streams, the launcher underneath is kept (going back is
   instant) but not painted. */
.is-playing .shell {
  visibility: hidden;
}

.page {
  position: relative;
  padding-top: calc(var(--topbar-height) + var(--banner-height) + var(--safe-top) + 4px);
  padding-bottom: 72px;
}

/* Pages that open with art let it run under the transparent top bar. */
.page:has(> .hero:first-of-type),
.page:has(> .page-skeleton > .hero:first-child),
.page:has(> .welcome) {
  padding-top: var(--banner-height);
}

.page-enter {
  animation: page-in var(--dur-slow) var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- rail (desktop and tablet) ---------- */

.rail {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  padding: calc(18px + var(--safe-top)) 14px calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left));
  overflow-y: auto;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-name {
  font: 700 19px/1 var(--font-display);
  letter-spacing: -0.02em;
}

.rail .brand {
  height: 52px;
  padding: 0 10px;
  margin-bottom: 22px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
}

.nav-item[aria-current="page"] .icon {
  color: var(--accent);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  margin-top: -9px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.rail-section {
  margin-top: 28px;
}

.rail-section-title {
  padding: 0 14px 10px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background-color var(--dur) var(--ease);
}

.recent-item:hover {
  background: var(--surface);
}

.recent-thumb {
  position: relative;
  width: 30px;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
}

.recent-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.recent-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.recent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.rail-foot {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-raised);
  transition: background-color var(--dur) var(--ease);
}

.pc-chip:hover {
  background: var(--surface);
}

.pc-chip-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.pc-chip-icon .dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px var(--bg-raised);
}

.pc-chip[data-state="online"] .dot {
  background: var(--good);
}

.pc-chip[data-state="offline"] .dot {
  background: var(--bad);
}

.pc-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.pc-chip-title {
  font-size: 14px;
  font-weight: 650;
}

.pc-chip-meta {
  font-size: 12px;
  color: var(--text-2);
}

.mock-badge {
  align-self: flex-start;
  margin: 0 12px 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Collapsed rail: icons only, labels as tooltips. */
@media (max-width: 1199px) {
  .rail {
    align-items: center;
    padding-inline: 12px;
  }

  .rail .brand {
    padding: 0;
    width: 48px;
    justify-content: center;
  }

  .rail .brand-name,
  .nav-label,
  .rail-section,
  .pc-chip-text,
  .mock-badge {
    display: none;
  }

  .nav-item {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
  }

  .nav-item::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    padding: 7px 11px;
    border-radius: 8px;
    background: var(--surface-active);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-4px, -50%);
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
    box-shadow: var(--shadow-pop);
  }

  .nav-item:hover::after,
  .nav-item:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .pc-chip {
    padding: 6px;
    background: transparent;
  }
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  z-index: 25;
  top: var(--banner-height);
  left: var(--rail-width);
  right: 0;
  height: calc(var(--topbar-height) + var(--safe-top));
  padding: var(--safe-top) calc(var(--gutter) + var(--safe-right)) 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -36px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--bg-rgb), 0.62), rgba(var(--bg-rgb), 0));
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease);
}

.topbar.is-solid {
  background: var(--bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.topbar.is-solid::before {
  opacity: 0;
}

.topbar-brand {
  display: none;
}

.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-pad {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--good);
}

.topbar-pc {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 16px 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background-color var(--dur) var(--ease);
}

.topbar-pc:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar-pc .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.topbar-pc[data-state="online"] .dot {
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(60, 207, 142, 0.18);
}

.topbar-pc[data-state="offline"] .dot {
  background: var(--bad);
}

.topbar .topbar-phone {
  display: none;
}

.topbar-phone[aria-current="page"] {
  color: var(--accent);
}

/* ---------- tab bar (phones) ---------- */

.tabbar {
  display: none;
}

@media (max-width: 719px) {
  .rail {
    display: none;
  }

  .topbar {
    padding-left: calc(var(--gutter) + var(--safe-left));
    gap: 4px;
  }

  .topbar-brand {
    display: flex;
  }

  .topbar-brand .brand-mark {
    width: 30px;
    height: 30px;
  }

  .topbar-brand .brand-name {
    font-size: 18px;
  }

  .topbar .search,
  .topbar-pc {
    display: none;
  }

  .topbar .topbar-phone {
    display: grid;
  }

  .tabbar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-height) + var(--safe-bottom));
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: var(--bg-raised);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06);
  }

  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .tab .icon {
    width: 24px;
    height: 24px;
  }

  .tab[aria-current="page"] {
    color: var(--text);
  }

  .tab[aria-current="page"] .icon {
    color: var(--accent);
  }

  .tab:focus-visible {
    outline-offset: -4px;
    border-radius: 12px;
  }
}

/* ---------- banner (a warning from the PC) ---------- */

.banner {
  position: fixed;
  z-index: 40;
  top: 0;
  left: var(--rail-width);
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) calc(var(--gutter) - 8px) 10px var(--gutter);
  background: #2a2214;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(242, 181, 68, 0.22);
}

.banner > .icon {
  color: var(--warn);
}

.banner-text {
  flex: 1;
  min-width: 0;
}

/* ---------- toasts ---------- */

.toast-region {
  position: fixed;
  z-index: 80;
  left: calc(var(--rail-width) / 2 + 50%);
  bottom: calc(24px + var(--tabbar-height) + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 10px 10px 18px;
  border-radius: 14px;
  background: #262b36;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.is-shown {
  opacity: 1;
  transform: none;
}

.toast-text {
  padding-right: 8px;
}

.toast-good .toast-icon {
  color: var(--good);
}

.toast-bad .toast-icon {
  color: var(--bad);
}

.toast-action {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--accent-text);
  font-weight: 700;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ========================================================= buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Play buttons use the accent itself: their labels are 19 px bold or larger,
   which white on the accent serves well (large text, over 3:1). */
.btn-play {
  background: var(--accent);
  color: #fff;
}

.btn-play:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-play:active:not(:disabled) {
  background: var(--accent-pressed);
}

/* Smaller primary buttons sit on the deeper end of the accent, so their
   regular-size white labels keep at least 4.5:1. */
.btn-primary {
  background: var(--accent-pressed);
  color: #fff;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: #4069ea;
}

.btn-primary:active:not(:disabled) {
  background: #3459c9;
}

.btn-play {
  box-shadow: 0 12px 32px -12px rgba(76, 125, 255, 0.85);
}

.btn-play:hover:not(:disabled) {
  box-shadow: 0 16px 40px -12px rgba(106, 147, 255, 0.9);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.17);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-danger {
  background: var(--bad);
  color: #1b0707;
}

.btn-danger:hover:not(:disabled) {
  background: #ff7878;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  gap: 8px;
  font-size: 14px;
}

.btn-sm .icon {
  width: 17px;
  height: 17px;
}

.btn-lg {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

/* Hero buttons: 19 px bold labels count as large text, so white on the accent reads well. */
.btn-xl {
  height: 56px;
  padding: 0 30px 0 26px;
  font-size: 19px;
  font-weight: 700;
  gap: 12px;
}

.btn-xl .icon {
  width: 24px;
  height: 24px;
}

.btn-secondary.btn-xl {
  padding: 0 28px;
}

.btn-hero {
  height: 68px;
  min-width: 248px;
  padding: 0 44px 0 36px;
  gap: 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-hero .icon {
  width: 28px;
  height: 28px;
}

.btn.is-busy .icon {
  animation: spin 900ms linear infinite;
}

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

.btn-round {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  transition: background-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}

.btn-round:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-round:active {
  transform: scale(0.95);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* ========================================================= badges ===== */

.source-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: var(--radius-pill);
  background: rgba(10, 11, 14, 0.82);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.card-art > .badge,
.cover > .badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
}

.badge-owned {
  background: rgba(10, 11, 14, 0.82);
  color: var(--good);
}

.badge-inline {
  background: var(--good-soft);
  color: var(--good);
  flex: none;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--good);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(3);
    opacity: 0;
  }
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(60, 207, 142, 0.16);
  color: #7ff0bd;
  font-size: 13px;
  font-weight: 650;
}

.live-chip-quiet {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--dur) var(--ease);
}

a.tag:hover {
  background: var(--surface-hover);
}

.state-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.state-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

.state-good .dot {
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(60, 207, 142, 0.18);
}

.state-warn .dot {
  background: var(--warn);
}

.state-bad .dot {
  background: var(--bad);
}

/* =========================================================== chips ===== */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px var(--gutter);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips.is-overflowing {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent);
}

.chips.is-overflowing.is-scrolled {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 72px), transparent);
}

.chips.is-overflowing.is-end {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 48px);
  mask-image: linear-gradient(to right, transparent, #000 48px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  flex: none;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.chip:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.chip-count {
  font-size: 12px;
  opacity: 0.75;
}

/* =========================================================== cards ===== */

.card {
  position: relative;
}

.card-link {
  display: block;
  width: 100%;
  border-radius: var(--radius-card);
  color: inherit;
  text-align: left;
}

.card-link:focus-visible {
  outline: none;
}

.card-art {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  transform: translateZ(0);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), outline-color var(--dur) var(--ease);
}

/* A hairline inside the art keeps dark art from melting into the page. */
.card-art::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.card-cover .card-art {
  aspect-ratio: 2 / 3;
}

.card-wide .card-art {
  aspect-ratio: 16 / 9;
}

.card-store .card-art {
  aspect-ratio: 460 / 215;
}

/* Hover lifts from the whole card: the round Play button sits beside the link
   (in .card-overlay), and the art must stay up while the pointer is on it.
   Skeleton cards have no link, so they stay flat. */
.card:hover > .card-link .card-art,
.card-link:focus-visible .card-art,
[data-input="gamepad"] .card-link:focus .card-art,
[data-input="keyboard"] .card-link:focus .card-art {
  transform: scale(1.04);
  box-shadow: var(--shadow-lift);
}

.card-link:focus-visible .card-art,
[data-input="gamepad"] .card-link:focus .card-art,
[data-input="keyboard"] .card-link:focus .card-art {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 2px 0;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.3;
}

.card-wide .card-title {
  font-size: 15px;
}

/* The play button over the art; the overlay matches the art box and follows its lift. */
.card-overlay {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: transform var(--dur) var(--ease);
}

.card-cover .card-overlay {
  aspect-ratio: 2 / 3;
}

.card-wide .card-overlay {
  aspect-ratio: 16 / 9;
  place-items: end;
  padding: 16px;
}

.card:hover .card-overlay {
  transform: scale(1.04);
}

.card-play {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.82);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.card-play .icon {
  width: 26px;
  height: 26px;
  margin-left: 2px;
}

.card:hover .card-play {
  opacity: 1;
  transform: none;
}

.card-play:hover {
  background: var(--accent-hover);
}

.card-wide .card-play {
  width: 52px;
  height: 52px;
}

@media (hover: none) {
  .card-overlay {
    display: none;
  }
}

/* Wide cards: the logo or title laid over the hero art. */
.wide-art {
  position: absolute;
  inset: 0;
}

.wide-art .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.wide-art.is-poster .cover {
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  right: auto; /* .cover sets inset: 0; with a right edge the width would win and the poster overflow the card */
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.wide-backdrop {
  position: absolute;
  inset: -12%;
  width: 124% !important;
  height: 124% !important;
  filter: blur(26px) saturate(1.3) brightness(0.6);
}

.wide-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(var(--bg-rgb), 0.82) 0%, rgba(var(--bg-rgb), 0.25) 42%, transparent 64%);
}

.wide-overlay .hero-title {
  max-width: 62%;
}

.wide-overlay .hero-logo {
  max-height: 64px;
  max-width: 100%;
}

.wide-title-text {
  font: 700 20px/1.1 var(--font-display);
  letter-spacing: -0.015em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.card-wide > .card-link > .card-art > .badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
}

/* Store cards. */
.store-art {
  position: absolute;
  inset: 0;
}

.store-art .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.price-discount {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--good);
  color: #062016;
  font-size: 12px;
  font-weight: 800;
}

.price-original {
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
}

.price-free {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price-soon {
  color: var(--text-2);
  font-weight: 500;
}

.price-lg {
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
}

.price-lg .price-discount,
.price-lg .price-free {
  height: 30px;
  padding: 0 10px;
  font-size: 15px;
}

.price-lg .price-original {
  font-size: 17px;
}

/* The "Add a game" tile. */
.add-tile {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(76, 125, 255, 0.14), transparent 70%),
    var(--bg-raised);
  color: var(--text-2);
  transition: color var(--dur) var(--ease);
}

.add-tile-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.add-tile-text {
  font-weight: 650;
  font-size: 14px;
}

.card-add .card-link:hover .add-tile,
.card-add .card-link:focus-visible .add-tile {
  color: var(--text);
}

.card-add .card-link:hover .add-tile-icon {
  background: var(--accent);
  transform: scale(1.06);
}

/* ===================================================== art, covers ===== */

.cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
}

.cover-mini,
.recent-thumb .cover,
.search-thumb .cover {
  position: relative;
  inset: auto;
  width: 100%;
  aspect-ratio: 2 / 3;
}

.cover > .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-img {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}

.art-img.is-loaded {
  opacity: 1;
}

/* Art still on its way from the PC (store art may first travel from the
   store's servers): a soft shimmer instead of a flat, empty box. */
.store-art:has(> .art-img:not(.is-loaded)),
.cover:has(> .art-img:not(.is-loaded)),
.wide-art:has(> .art-img:not(.is-loaded)),
.shot:has(> .art-img:not(.is-loaded)),
.search-thumb:has(> .art-img:not(.is-loaded)),
.spotlight-media:has(> .spotlight-hero:not(.is-loaded)) {
  background: linear-gradient(100deg, var(--surface) 30%, #20242d 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* The generated poster for games without art. */
.gen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  color: #fff;
  background:
    radial-gradient(120% 70% at 12% 0%, rgba(var(--gen-glow), 0.5), transparent 62%),
    radial-gradient(90% 60% at 100% 100%, rgba(var(--gen-glow), 0.16), transparent 70%),
    linear-gradient(165deg, var(--gen-from) 0%, var(--gen-to) 78%);
}

.gen::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 10%, transparent 92%);
}

.gen-p0::before {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 11px);
}

.gen-p1::before {
  background: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.6px) 0 0 / 14px 14px;
}

.gen-p2::before {
  background: repeating-radial-gradient(circle at 110% -10%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 15px);
}

.gen-p3::before {
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.08) 50%, transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 7px);
}

.gen-initial {
  position: absolute;
  right: -6cqw;
  bottom: -18cqw;
  font: 800 100cqw/0.8 var(--font-display);
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.075);
  user-select: none;
}

.gen-tag {
  position: absolute;
  top: 9cqw;
  left: 9cqw;
  display: flex;
  align-items: center;
  gap: 2.6cqw;
  font: 700 5.4cqw/1 var(--font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.card-art:has(.badge-running) .gen-tag {
  visibility: hidden;
}

.gen-tag::before {
  content: "";
  width: 6cqw;
  height: 1px;
  background: currentColor;
}

.gen-icon {
  position: absolute;
  top: 22cqw;
  left: 9cqw;
  width: 24cqw;
  height: 24cqw;
  border-radius: 22%;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.gen-title {
  position: absolute;
  left: 9cqw;
  right: 8cqw;
  bottom: 10cqw;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}

.gen-title::before {
  content: "";
  display: block;
  width: 12cqw;
  height: 1.4cqw;
  margin-bottom: 5cqw;
  border-radius: 1cqw;
  background: rgba(var(--gen-glow), 0.9);
}

.gen-title-xl {
  font-size: 19cqw;
}

.gen-title-lg {
  font-size: 15cqw;
}

.gen-title-md {
  font-size: 12cqw;
}

.gen-title-sm {
  font-size: 9.5cqw;
}

/* Landscape poster (wide cards, store cards). */
.gen-wide .gen-initial {
  right: 4cqw;
  bottom: -26cqh;
  font-size: 140cqh;
}

.gen-wide .gen-tag {
  top: 12cqh;
  left: 6cqw;
  font-size: 7.5cqh;
}

.gen-wide .gen-tag::before {
  width: 4cqw;
}

.gen-wide .gen-icon {
  top: 26cqh;
  left: 6cqw;
  width: 26cqh;
  height: 26cqh;
}

.gen-wide .gen-title {
  left: 6cqw;
  right: 30cqw;
  bottom: 13cqh;
}

.gen-wide .gen-title::before {
  width: 8cqw;
  height: 2cqh;
  margin-bottom: 7cqh;
}

.gen-wide .gen-title-xl {
  font-size: 26cqh;
}

.gen-wide .gen-title-lg {
  font-size: 21cqh;
}

.gen-wide .gen-title-md {
  font-size: 17cqh;
}

.gen-wide .gen-title-sm {
  font-size: 13cqh;
}

/* Backdrop: no text, the letter blurred into the light. */
.gen-backdrop .gen-initial {
  right: 8cqw;
  bottom: -32cqh;
  font-size: 150cqh;
  filter: blur(3px);
  color: rgba(255, 255, 255, 0.07);
}

/* Thumbnails: just the letter, large and clear. */
@container (max-width: 80px) {
  .gen-initial {
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 54cqw;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.94);
  }

  .gen-tag,
  .gen-title,
  .gen-icon {
    display: none;
  }

  .gen::before {
    display: none;
  }
}

/* ============================================================ rows ===== */

.row-group {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.row {
  position: relative;
}

.row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 var(--gutter);
  margin-bottom: 12px;
}

.row-note {
  padding-top: 3px;
}

.row-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.row-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 4px 0 10px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 650;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.row-more:hover {
  color: var(--text);
}

.row-arrows {
  display: none;
  gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .row.has-overflow .row-arrows {
    display: flex;
  }
}

.row-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.row-arrow .icon {
  width: 20px;
  height: 20px;
}

.row-arrow:hover:not(:disabled) {
  background: var(--surface-hover);
}

.row-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* The track bleeds to the page edges; padding leaves room for lifted cards. */
.row-track {
  display: flex;
  gap: 16px;
  margin: -14px 0 -30px;
  padding: 14px var(--gutter) 30px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.row-track::-webkit-scrollbar {
  display: none;
}

.row-item {
  flex: none;
  scroll-snap-align: start;
}

.row-cover .row-item {
  width: var(--cover-width);
}

.row-wide .row-item {
  width: var(--wide-width);
}

.row-store .row-item {
  width: var(--store-width);
}

@media (max-width: 719px) {
  .row-group {
    gap: 32px;
  }

  .row-track {
    gap: 12px;
  }
}

/* ============================================================ hero ===== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* At least 60 % of the screen, and taller when its text needs the room. */
.hero-home {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(460px, 58vh, 680px);
  margin-bottom: 8px;
}

.hero-stage {
  position: absolute;
  inset: 0;
}

/* The art dissolves into the page (and its glow) at the bottom and left. */
.hero-media {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, rgba(0, 0, 0, 0.55) 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 40%, rgba(0, 0, 0, 0.55) 72%, transparent 100%);
}

.hero-stage .hero-media {
  opacity: 0;
  transition: opacity 800ms ease;
}

.hero-stage .hero-media.is-active {
  opacity: 1;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 30%;
  /* Bright key art is calmed a little so the UI keeps its weight. */
  filter: brightness(0.86) saturate(1.04);
}

.hero-media.is-poster {
  background: var(--bg-raised);
}

.hero-backdrop-blur {
  position: absolute;
  top: -12%;
  left: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(56px) saturate(1.35) brightness(0.62);
}

.hero-media.is-poster .gen {
  filter: saturate(1.1);
}

.hero-poster {
  position: absolute;
  z-index: 1;
  top: calc(var(--topbar-height) + 18px);
  bottom: 13%;
  right: max(var(--gutter), 7%);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: rotate(2deg);
}

.hero-poster .cover {
  position: absolute;
  inset: 0;
}

.hero-scrim {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--bg-rgb), 0.94) 0%, rgba(var(--bg-rgb), 0.78) 24%, rgba(var(--bg-rgb), 0.22) 52%, rgba(var(--bg-rgb), 0) 72%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.55) 0%, rgba(var(--bg-rgb), 0) 26%),
    radial-gradient(70% 60% at 100% 0%, rgba(var(--bg-rgb), 0.28), transparent 70%);
}

.hero-body {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: end;
  padding: calc(var(--topbar-height) + var(--safe-top) + 24px) var(--gutter) 68px;
}

.hero-content {
  grid-area: 1 / 1;
  max-width: 580px;
  opacity: 0;
  transform: translateY(10px);
  /* The outgoing slide's text fades out first, so two never overlap. */
  transition: opacity 180ms ease-in, transform 180ms ease-in;
}

.hero-content.is-active {
  opacity: 1;
  transform: none;
  transition: opacity 460ms var(--ease) 200ms, transform 460ms var(--ease) 200ms;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 16px;
}

.hero-kicker .t-label {
  color: rgba(243, 245, 249, 0.78);
}

.hero-title {
  margin-bottom: 16px;
}

.hero-title-text {
  display: block;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.hero-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(420px, 82%);
  max-height: 150px;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.45));
}

.hero-logo.is-dark {
  filter: brightness(0) invert(1) drop-shadow(0 6px 28px rgba(0, 0, 0, 0.45));
}

.hero-desc {
  max-width: 52ch;
  margin-bottom: 28px;
  color: rgba(243, 245, 249, 0.86);
  font-size: 16px;
  line-height: 1.55;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions .btn-secondary {
  background: var(--over-art);
}

.hero-actions .btn-secondary:hover {
  background: var(--over-art-hover);
}

.hero-dots {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: 84px;
  display: flex;
  gap: 4px;
}

.hero-dot {
  position: relative;
  width: 36px;
  height: 24px;
}

.hero-dot::before,
.hero-dot-fill {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 10px;
  height: 4px;
  border-radius: 2px;
}

.hero-dot::before {
  background: rgba(255, 255, 255, 0.26);
  transition: background-color var(--dur) var(--ease);
}

.hero-dot:hover::before {
  background: rgba(255, 255, 255, 0.45);
}

.hero-dot-fill {
  background: #fff;
  transform-origin: left center;
  transform: scaleX(0);
}

.hero-dot[aria-current="true"] .hero-dot-fill {
  transform: scaleX(1);
}

.hero.is-auto .hero-dot[aria-current="true"] .hero-dot-fill {
  animation: dot-fill var(--hero-rotate, 8s) linear forwards;
}

.hero.is-paused .hero-dot-fill {
  animation-play-state: paused !important;
}

@keyframes dot-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.hero-dot:focus-visible {
  outline-offset: 0;
  border-radius: 6px;
}

@media (max-width: 1199px) {
  .hero-poster {
    right: var(--gutter);
    bottom: 18%;
  }
}

@media (max-height: 820px) {
  .hero-logo {
    max-height: 112px;
  }

  .hero-desc {
    -webkit-line-clamp: 2;
    margin-bottom: 24px;
  }

  .hero-kicker {
    margin-bottom: 12px;
  }
}

@media (max-width: 719px) {
  .hero-home {
    min-height: clamp(420px, 56vh, 520px);
  }

  .hero-body {
    padding-bottom: 56px;
  }

  .hero-scrim {
    background:
      linear-gradient(0deg, rgba(var(--bg-rgb), 0.94) 0%, rgba(var(--bg-rgb), 0.74) 38%, rgba(var(--bg-rgb), 0.28) 68%, rgba(var(--bg-rgb), 0) 86%),
      linear-gradient(180deg, rgba(var(--bg-rgb), 0.6) 0%, rgba(var(--bg-rgb), 0) 22%);
  }

  .hero-img {
    object-position: 42% 30%;
  }

  .hero-logo {
    max-height: 96px;
    max-width: 72%;
  }

  .hero-desc {
    font-size: 15px;
    -webkit-line-clamp: 2;
    margin-bottom: 22px;
  }

  .hero-dots {
    left: var(--gutter);
    right: auto;
    bottom: 22px;
  }

  .hero-poster {
    top: calc(var(--topbar-height) + var(--safe-top) + 6px);
    bottom: auto;
    height: 44%;
    right: 50%;
    transform: translateX(50%) rotate(2deg);
  }

  .hero-actions .btn-xl {
    height: 52px;
    font-size: 18px;
    padding: 0 24px 0 20px;
  }
}

/* The Home hero's fallback poster (a game with no hero art) needs room beside
   the text: below 1024 px (phones, portrait tablets) only the blurred or
   generated backdrop shows. */
@media (max-width: 1023px) {
  .hero-home .hero-poster {
    display: none;
  }
}

/* It also ends above the carousel dots (bottom: 84px, 24px tall). */
.hero-home.has-dots .hero-poster {
  bottom: 124px;
}

/* ======================================================= skeletons ===== */

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, #20242d 50%, var(--surface) 70%) 0 0 / 300% 100%;
  border-radius: 8px;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.card.is-skeleton .card-art {
  background: none;
}

.sk-art {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.sk-text {
  width: 78%;
  height: 12px;
  margin-top: 4px;
}

.sk-short {
  width: 46%;
}

.sk-heading {
  width: 200px;
  height: 22px;
}

.hero-skeleton {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(460px, 58vh, 680px);
  background: linear-gradient(180deg, var(--bg-raised), transparent);
}

.detail-hero.hero-skeleton {
  min-height: clamp(500px, 68vh, 780px);
}

.hero-skeleton .hero-content {
  opacity: 1;
  transform: none;
}

.sk-label {
  width: 160px;
  height: 14px;
  margin-bottom: 18px;
}

.sk-title {
  width: min(420px, 80%);
  height: 54px;
  margin-bottom: 18px;
}

.sk-line {
  width: min(520px, 90%);
  height: 14px;
  margin-bottom: 10px;
}

.sk-line.sk-short {
  width: min(300px, 60%);
}

.sk-button {
  width: 150px;
  height: 56px;
  margin-top: 18px;
  border-radius: var(--radius-pill);
}

.sk-button-2 {
  width: 130px;
}

.sk-lines {
  padding: 8px var(--gutter);
}

/* Inside a details page the column already sits in the gutter. */
.detail-main .sk-lines {
  padding-inline: 0;
}

.sk-panel {
  height: 220px;
  border-radius: var(--radius-panel);
}

/* ===================================================== panels, states ===== */

.panel {
  background: var(--bg-raised);
  border-radius: var(--radius-panel);
  padding: 24px;
}

.panel-title {
  margin-bottom: 18px;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  padding: 72px var(--gutter);
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text-2);
}

.state-message {
  max-width: 48ch;
  color: var(--text-2);
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.state-quiet .state-icon {
  background: transparent;
  width: 56px;
  height: 56px;
  margin-bottom: 0;
}

.muted-note {
  color: var(--text-2);
}

.notice {
  display: flex;
  gap: 16px;
  max-width: 600px;
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius-panel);
  background: rgba(18, 20, 25, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.notice-icon {
  color: var(--accent-text);
}

.notice-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.notice-text {
  color: var(--text-2);
  font-size: 14px;
}

.notice-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ============================================================ forms ===== */

.form {
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field-label {
  font-size: 14px;
  font-weight: 650;
}

.field-hint {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.text-input:hover {
  border-color: #363c48;
}

.text-input:focus-visible,
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-input[aria-invalid="true"] {
  border-color: var(--bad);
}

input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > .icon {
  position: absolute;
  left: 15px;
  color: var(--text-2);
}

.input-with-icon > .text-input {
  padding-left: 44px;
}

.form-error {
  margin-bottom: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bad-soft);
  color: #ff9a9a;
  font-size: 14px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 22px;
  background: var(--surface);
}

.segment {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.segment:hover {
  color: var(--text);
}

.segment[aria-checked="true"] {
  background: var(--text);
  color: var(--bg);
}

/* A choice with a small second line, e.g. "1080p 60" over "up to 20 Mbps";
   its neighbours grow to the same height. */
.segmented-tall .segment {
  height: auto;
  min-height: 44px;
}

.segment.segment-has-sub {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 16px;
  line-height: 1.15;
}

.segment-sub {
  font-size: 11px;
  font-weight: 550;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--surface-active);
  transition: background-color var(--dur) var(--ease);
}

.switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
  background: #fff;
}

/* ===================================================== search ===== */

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(440px, 100%);
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-2);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-size: 15px;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.search-input:hover {
  background: rgba(255, 255, 255, 0.13);
}

.search-input:focus {
  outline: none;
  background: var(--surface-hover);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-key {
  position: absolute;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-2);
  font: 600 12px/1 var(--font);
  pointer-events: none;
}

.search:focus-within .search-key {
  display: none;
}

.search-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  left: 0;
  width: max(100%, 460px);
  max-height: min(76vh, 640px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b303b transparent;
  padding: 8px;
  border-radius: 18px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--line);
  animation: menu-in var(--dur-fast) var(--ease);
}

.search-group + .search-group {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.search-group-title {
  padding: 8px 10px 6px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background-color var(--dur-fast) var(--ease);
}

.search-item:hover,
.search-item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.search-thumb {
  position: relative;
  width: 34px;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.search-thumb-wide {
  width: 74px;
  aspect-ratio: 460 / 215;
}

.search-thumb-wide .art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.search-name {
  font-weight: 600;
  font-size: 14px;
}

.search-meta {
  font-size: 12px;
  color: var(--text-2);
}

.search-text .price {
  font-size: 13px;
}

.search-empty {
  padding: 6px 10px 10px;
  color: var(--text-2);
  font-size: 14px;
}

.search-all {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px;
  padding: 10px;
  border-radius: 12px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 650;
}

.search-all:hover,
.search-all:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.search-sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: calc(12px + var(--safe-top)) var(--gutter) var(--safe-bottom);
  border: 0;
  background: var(--bg);
  color: var(--text);
}

.search-sheet::backdrop {
  background: var(--bg);
}

.search-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.search-sheet .search {
  flex: 1;
  width: auto;
}

.search-sheet .search-panel {
  position: static;
  width: 100%;
  max-height: none;
  padding: 0;
  background: none;
  box-shadow: none;
  animation: none;
}

/* =========================================================== dialog ===== */

.dialog {
  width: calc(100vw - 32px);
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.dialog[open] {
  animation: dialog-in var(--dur-slow) var(--ease);
}

.dialog::backdrop {
  background: rgba(4, 5, 8, 0.74);
  animation: fade-in var(--dur) ease;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.dialog-wide {
  max-width: min(1200px, calc(100vw - 32px));
}

.dialog-panel {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 22px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--line);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.dialog-title {
  flex: 1;
  padding-top: 4px;
}

.dialog-close {
  margin: -4px -8px 0 0;
}

.dialog-desc {
  margin-bottom: 24px;
  color: var(--text-2);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.form .dialog-actions {
  margin-top: 12px;
}

.dialog-lightbox .dialog-panel {
  padding: 18px;
}

.dialog-lightbox .dialog-head {
  padding: 0 4px;
}

.lightbox {
  position: relative;
}

.lightbox-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  margin-top: -28px;
  background: rgba(10, 11, 14, 0.7);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.lightbox-count {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}

/* ============================================================ menu ===== */

.menu {
  position: fixed;
  z-index: 70;
  left: var(--menu-left, 0);
  top: var(--menu-top, 0);
  min-width: 232px;
  padding: 6px;
  border-radius: 16px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--line);
  animation: menu-in var(--dur-fast) var(--ease);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}

.menu-item:hover,
.menu-item:focus {
  background: var(--surface-hover);
  outline: none;
}

.menu-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.menu-item .icon {
  color: var(--text-2);
}

.menu-item.is-danger,
.menu-item.is-danger .icon {
  color: #ff8a8a;
}

.menu-item[aria-checked="false"] .menu-check {
  visibility: hidden;
}

.menu-item[aria-checked="true"] .menu-check {
  color: var(--accent-text);
}

.menu-sep {
  height: 1px;
  margin: 6px 10px;
  background: var(--line);
}

/* Controller and keyboard users get the ring on any focused control, also
   when focus moved by script (spatial navigation). */
[data-input="gamepad"] :focus:not(.card-link):not(.menu-item):not(input):not(textarea):not([tabindex="-1"]),
[data-input="keyboard"] :focus:not(.card-link):not(.menu-item):not(input):not(textarea):not([tabindex="-1"]) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
