body.games {
  --world-nav-height: 72px;
  --world-ink: #3b1428;
  --world-retro: #f2a9c2;
  --world-retro-deep: #8a2f59;
  --world-cyber: #5bffb5;
  --world-cyber-deep: #0a1016;
  --world-space-xs: 8px;
  --world-space-sm: 14px;
  --world-space-md: 24px;
  --world-space-lg: 40px;
  --world-space-xl: 64px;
}

body.games [id] { scroll-margin-top: calc(var(--world-nav-height) + 20px); }

body.games .world-switch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--world-nav-height) + 52px) 20px 68px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% -10%, rgba(230, 126, 0, .16), transparent 46%),
    linear-gradient(180deg, #050505 0%, #080808 68%, #0b0b0d 100%);
  border-bottom: 0;
}

body.games .world-switch::before,
body.games .world-bridge::before {
  content: '';
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(230, 126, 0, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 126, 0, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: fox-world-grid 28s linear infinite;
}

body.games .world-switch::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(720px, 76vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(230, 126, 0, .7), transparent);
}

body.games .world-switch .container { position: relative; z-index: 1; }
body.games .world-switch-head { max-width: 760px; margin: 0 auto 34px; }
body.games .world-switch-head span {
  color: var(--primary-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
}
body.games .world-switch-head h2 {
  margin: 14px 0 0;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.04em;
}

body.games .world-grid { gap: 24px; }

body.games .world-card {
  min-height: 286px;
  padding: 30px 32px 28px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .36);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

body.games .world-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .48);
}
body.games .world-card-retro:hover { border-color: rgba(255, 165, 210, .72); }
body.games .world-card-cyber:hover { border-color: rgba(91, 255, 181, .62); }

body.games .world-card > small,
body.games .world-card > strong,
body.games .world-card > em,
body.games .world-card > span:not(.world-art) {
  position: relative;
  z-index: 1;
}

body.games .world-card small {
  color: rgba(255, 255, 255, .74);
  font-size: 10px;
  letter-spacing: .24em;
}
body.games .world-card strong {
  margin: 12px 0 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}
body.games .world-card em {
  max-width: 420px;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .82);
  font-size: 13.5px;
  line-height: 1.65;
}
body.games .world-card > span:not(.world-art) {
  margin-top: 20px;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 3px;
  background: rgba(0, 0, 0, .3);
  color: #fff;
  font-size: 10px;
  letter-spacing: .14em;
}
body.games .world-card-cyber > span:not(.world-art) {
  border-color: rgba(91, 255, 181, .7);
  background: rgba(7, 42, 31, .62);
  color: #c5ffe4;
}

body.games .world-card .world-art,
body.games .world-card-retro .world-art,
body.games .world-card-cyber .world-art {
  position: absolute;
  z-index: 0;
  top: 26px;
  right: 28px;
  display: block;
  width: 102px;
  height: 118px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  pointer-events: none;
}

body.games .world-art-retro {
  border: 3px solid #641e45;
  border-radius: 10px 10px 18px 18px;
  background: linear-gradient(150deg, #ffc2dc, #f28cba 46%, #b7427c);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, .42), 0 8px 0 rgba(94, 24, 62, .52);
  transform: rotate(-5deg);
}
body.games .world-art-retro::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 11px;
  width: 74px;
  height: 48px;
  background: #341022;
  border: 4px solid #76274f;
  box-shadow: inset 0 0 0 4px rgba(255, 213, 232, .55);
}
body.games .world-art-retro .wa-screen {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 60px;
  height: 34px;
  background: repeating-linear-gradient(0deg, #f6ebc8 0 5px, #e6d2a5 5px 6px);
  box-shadow: inset 0 0 0 3px rgba(73, 28, 49, .4);
}
body.games .world-art-retro .wa-dpad {
  position: absolute;
  left: 18px;
  bottom: 14px;
  width: 32px;
  height: 10px;
  background: #5a1d3f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}
body.games .world-art-retro .wa-dpad::before {
  content: '';
  position: absolute;
  left: 11px;
  top: -11px;
  width: 10px;
  height: 32px;
  background: #5a1d3f;
}
body.games .world-art-retro .wa-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8c2c60;
  box-shadow: -17px 9px 0 #8c2c60;
}

body.games .world-art-cyber {
  width: 116px;
  height: 104px;
  border: 2px solid rgba(91, 255, 181, .42);
  background: linear-gradient(150deg, #102b2a, #07131c);
  box-shadow: inset 0 0 0 5px rgba(4, 16, 18, .82), 0 8px 0 rgba(4, 22, 24, .6);
}
body.games .world-art-cyber::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(91, 255, 181, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 255, 181, .07) 1px, transparent 1px);
  background-size: 12px 12px;
}
body.games .world-art-cyber .wa-terminal {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 48px;
  height: 32px;
  border: 2px solid #5bffb5;
  background: #061819;
  box-shadow: inset 9px 8px 0 -5px rgba(91, 255, 181, .7);
}
body.games .world-art-cyber .wa-shield {
  position: absolute;
  right: 15px;
  top: 16px;
  width: 34px;
  height: 42px;
  background: #5bffb5;
  clip-path: polygon(50% 0, 100% 18%, 100% 62%, 50% 100%, 0 62%, 0 18%);
}
body.games .world-art-cyber .wa-line {
  position: absolute;
  left: 14px;
  height: 2px;
  background: rgba(91, 255, 181, .7);
  box-shadow: 24px 0 0 rgba(91, 255, 181, .35);
}
body.games .world-art-cyber .wa-line-1 { top: 64px; width: 52px; }
body.games .world-art-cyber .wa-line-2 { top: 74px; width: 36px; background: #ffb454; box-shadow: none; }

body.games .world-bridge {
  --bridge-progress: .35;
  position: relative;
  height: 140px;
  overflow: hidden;
}
body.games .world-bridge::before { opacity: var(--bridge-progress); }
body.games .world-bridge-retro {
  background: linear-gradient(180deg, #0b0b0d 0%, #241026 52%, #4a1e38 100%);
}
body.games .world-bridge-retro::before {
  background-image:
    linear-gradient(rgba(242, 169, 194, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 169, 194, .07) 1px, transparent 1px);
}
body.games .world-bridge-cyber {
  background: linear-gradient(180deg, #170e18 0%, #101317 48%, #0a1016 100%);
}
body.games .world-bridge-cyber::before {
  background-image:
    linear-gradient(rgba(91, 255, 181, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 255, 181, .055) 1px, transparent 1px);
}
body.games .world-bridge .bridge-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(240px, 42vw);
  height: 1px;
  transform: translate(-50%, -50%);
  opacity: .55;
}
body.games .world-bridge .bridge-line::before,
body.games .world-bridge .bridge-line::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
}
body.games .world-bridge-retro .bridge-line { background: rgba(242, 169, 194, .55); }
body.games .world-bridge-retro .bridge-line::before,
body.games .world-bridge-retro .bridge-line::after { background: var(--world-retro); }
body.games .world-bridge-cyber .bridge-line { background: rgba(91, 255, 181, .42); }
body.games .world-bridge-cyber .bridge-line::before,
body.games .world-bridge-cyber .bridge-line::after { background: var(--world-cyber); }
body.games .world-bridge .bridge-line::before { left: -3px; }
body.games .world-bridge .bridge-line::after { right: -3px; }

body.games .arcade-hero {
  padding: 92px 0 76px;
  background:
    radial-gradient(circle at 50% 0%, #712d52 0%, #42162f 30%, #1d0d19 68%, #0d080e 100%);
  border-bottom: 1px solid rgba(242, 169, 194, .18);
}
body.games .arcade-hero::before {
  background-size: 32px 32px;
  opacity: .92;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 82%);
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
body.games .arcade-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--retro-enter, .45);
  background:
    radial-gradient(circle at 8% 62%, rgba(242, 169, 194, .18), transparent 26%),
    radial-gradient(circle at 92% 32%, rgba(255, 206, 224, .11), transparent 24%);
}

body.games .arcade-eyebrow {
  margin-bottom: 20px;
  padding: 8px 14px;
  border-radius: 4px;
  background: rgba(54, 14, 36, .72);
  font-size: .68rem;
  letter-spacing: .24em;
}
body.games .arcade-hero-title {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5.4vw, 3.65rem);
  letter-spacing: -.045em;
  line-height: 1.06;
}
body.games .arcade-hero-sub {
  max-width: 640px;
  margin-bottom: 52px;
  color: #e3c8d6;
  font-size: 1rem;
  line-height: 1.75;
}

body.games .retro-device {
  width: min(100%, 880px);
  filter: drop-shadow(0 40px 58px rgba(0, 0, 0, .62)) drop-shadow(0 0 42px rgba(242, 169, 194, .12));
}
body.games .console-top {
  border-radius: 42px 42px 24px 24px;
  box-shadow:
    inset 0 4px 5px rgba(255, 255, 255, .68),
    inset 0 -8px 16px var(--plastic-shadow),
    0 3px 0 rgba(255, 255, 255, .24),
    0 10px 22px rgba(66, 22, 41, .28);
}
body.games .console-bezel { border-radius: 26px; }
body.games .screen-frame { border-radius: 14px; }
body.games .console-screen { height: clamp(300px, 40vw, 400px); }
body.games .console-bottom {
  border-radius: 22px 22px 58px 58px;
  min-height: clamp(160px, 23vw, 230px);
}
body.games .dpad { gap: 4px; }
body.games .dpad-btn { border-radius: 8px; }
body.games .action-btn { border-radius: 50%; }
body.games .retro-help {
  max-width: 880px;
  margin-top: 38px;
  gap: 10px 24px;
  color: #d9bfcd;
}

body.games .retro-section { border-top: 1px solid rgba(242, 169, 194, .08); }

body.games .retro-section#story {
  position: relative;
  padding: 96px 0;
  color: var(--world-ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, .78), transparent 28%),
    linear-gradient(180deg, #f8ebe1 0%, #f3dccf 100%);
  border-top: 1px solid rgba(138, 47, 89, .16);
  border-bottom: 1px solid rgba(138, 47, 89, .16);
}
body.games #story .retro-tag {
  color: var(--world-retro-deep);
  border-color: rgba(138, 47, 89, .34);
  background: rgba(255, 255, 255, .58);
}
body.games #story .retro-heading h2 { color: var(--world-ink); }
body.games #story .retro-heading h2 em { color: var(--world-retro-deep); }
body.games #story .story-grid { gap: 56px; }
body.games #story .story-copy p { color: #6b3850; }
body.games #story .story-copy .story-lead { color: var(--world-ink); }
body.games #story .story-tagline {
  border-left-color: var(--world-retro-deep);
  color: var(--world-ink);
}
body.games #story .pixel-room {
  border-color: #a84071;
  background: linear-gradient(180deg, #f6d7e4 0%, #e8b8cd 62%, #cf8eae 100%);
  box-shadow: 0 24px 48px rgba(105, 41, 70, .22), inset 0 0 0 4px rgba(255, 255, 255, .42);
}
body.games #story .pixel-room::before {
  background-image: linear-gradient(rgba(138, 47, 89, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 47, 89, .09) 1px, transparent 1px);
}
body.games #story .pixel-tv {
  background: #a84071;
  border-color: #6b2349;
  box-shadow: 0 10px 0 #6b2349, inset 0 3px 6px rgba(255, 255, 255, .18);
}

body.games .cyber-arcade {
  padding: 96px 0 100px;
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 106, 117, .2), transparent 30%),
    radial-gradient(circle at 92% 22%, rgba(91, 255, 181, .08), transparent 28%),
    #0a1016;
  border-top: 0;
}
body.games .cyber-arcade::before {
  background-size: 42px 42px;
  opacity: var(--cyber-enter, .7);
}
body.games .cyber-banner {
  gap: 56px;
  margin-bottom: 56px;
}
body.games .cyber-eyebrow {
  color: #9dffd1;
  font-size: 11px;
  letter-spacing: .26em;
}
body.games .cyber-banner h2 {
  font-size: clamp(2.15rem, 5.8vw, 4.25rem);
  letter-spacing: -.05em;
}
body.games .cyber-banner p {
  color: #aec6c3;
  font-size: 1rem;
  line-height: 1.75;
}
body.games .cyber-cta {
  border-radius: 3px;
  padding: 15px 22px;
}
body.games .cyber-shell,
body.games .cyber-game-card,
body.games .cyber-panel,
body.games .cyber-daily-card { border-radius: 3px; }
body.games .cyber-game-card:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, .28); }

@keyframes fox-world-grid {
  from { background-position: 0 0; }
  to { background-position: 32px 32px; }
}

@media (max-width: 900px) {
  body.games .world-grid { grid-template-columns: 1fr; }
  body.games .world-card { min-height: 244px; }
  body.games .world-bridge { height: 104px; }
  body.games .cyber-banner { grid-template-columns: 1fr; gap: 34px; }
  body.games .cyber-banner-art { min-height: 220px; }
  body.games .arcade-hero { padding-top: 68px; }
}

@media (max-width: 600px) {
  body.games .world-switch {
    padding: calc(var(--world-nav-height) + 38px) 16px 48px;
    min-height: auto;
  }
  body.games .world-switch-head { margin-bottom: 26px; }
  body.games .world-card { min-height: 236px; padding: 24px; }
  body.games .world-card .world-art,
  body.games .world-card-retro .world-art,
  body.games .world-card-cyber .world-art {
    top: 20px;
    right: 20px;
    transform: scale(.72);
    transform-origin: top right;
  }
  body.games .world-art-retro { transform: scale(.72) rotate(-5deg); }
  body.games .world-card strong { font-size: 1.55rem; }
  body.games .world-card em { font-size: 13px; }
  body.games .arcade-hero { padding: 56px 0 48px; }
  body.games .arcade-hero-sub { margin-bottom: 36px; }
  body.games .console-screen { height: clamp(260px, 66vw, 340px); }
  body.games .dpad { grid-template-columns: repeat(3, clamp(34px, 10vw, 44px)); grid-template-rows: repeat(3, clamp(34px, 10vw, 44px)); }
  body.games .action-btn { width: clamp(54px, 15vw, 66px); height: clamp(54px, 15vw, 66px); }
  body.games .retro-help { margin-top: 28px; }
  body.games .retro-section#story { padding: 68px 0; }
  body.games .story-grid { gap: 34px; }
  body.games .cyber-arcade { padding: 68px 0 76px; }
}

html[data-theme="light"] body.games a:focus-visible,
html[data-theme="light"] body.games button:focus-visible,
html[data-theme="light"] body.games input:focus-visible,
html[data-theme="light"] body.games select:focus-visible { outline-color: var(--primary); }

html[data-theme="light"] body.games .world-switch {
  color: #1a1a2e;
  background:
    radial-gradient(circle at 50% -10%, rgba(230, 126, 0, .14), transparent 46%),
    linear-gradient(180deg, #fafafa 0%, #f0f0f2 68%, #e9e9ec 100%);
}
html[data-theme="light"] body.games .world-switch::before {
  background-image:
    linear-gradient(rgba(230, 126, 0, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 126, 0, .07) 1px, transparent 1px);
}
html[data-theme="light"] body.games .world-switch::after {
  background: linear-gradient(90deg, transparent, rgba(230, 126, 0, .6), transparent);
}
html[data-theme="light"] body.games .world-switch-head span { color: var(--primary-dark); }
html[data-theme="light"] body.games .world-switch-head h2 { color: #1a1a2e; }

html[data-theme="light"] body.games .world-bridge-retro {
  background: linear-gradient(180deg, #e9e9ec 0%, #6b3659 44%, #4a1e38 100%);
}
html[data-theme="light"] body.games .world-bridge-retro::before {
  background-image:
    linear-gradient(rgba(230, 126, 0, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 126, 0, .07) 1px, transparent 1px);
}

@media (prefers-reduced-motion: reduce) {
  body.games *,
  body.games *::before,
  body.games *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  body.games .world-bridge::before { opacity: 1; }
  body.games .arcade-hero::after { opacity: 1; }
}
