/**
 * 休闲游戏中心的响应式视觉样式与交互动效
 *
 * @author Lehman+AI
 * @blog https://www.lehman.top
 * @since 2026/08/12 17:13
 */

:root {
  --bg: #0d0e12;
  --panel: #15161b;
  --panel-hover: #1b1c22;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f1e8;
  --muted: #9a9aa3;
  --lime: #c7ff3d;
  --purple: #9d7cff;
  --pink: #ff7db6;
  --cyan: #62d7e8;
  --orange: #ff9b55;
  --content-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  color: #0b0c0f;
  background: var(--lime);
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(130px);
  pointer-events: none;
}

.ambient--one {
  top: -160px;
  right: -100px;
  background: var(--purple);
}

.ambient--two {
  top: 48%;
  left: -260px;
  background: var(--lime);
}

.site-header,
.hero,
.library,
.about,
.site-footer {
  width: min(calc(100% - 48px), var(--content-width));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-family: "Arial Black", "PingFang SC", sans-serif;
  font-size: 0.79rem;
  letter-spacing: 0.16em;
}

.brand__mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--lime);
  border-radius: 50%;
  color: var(--lime);
  font-size: 0.72rem;
  transform: rotate(-12deg);
}

.top-nav {
  display: flex;
  gap: 38px;
  color: var(--muted);
  font-size: 0.81rem;
}

.top-nav a,
.random-link {
  transition: color 180ms ease;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.random-link:hover,
.random-link:focus-visible {
  color: var(--lime);
}

.random-link {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 30px;
  padding: 11px 0 11px 20px;
  border-left: 1px solid var(--line);
  font-size: 0.78rem;
}

.hero {
  position: relative;
  min-height: 720px;
  padding: 112px 0 88px;
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px var(--lime);
  animation: pulse 1.8s ease-in-out infinite;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(4.4rem, 8.8vw, 8.4rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.hero__accent {
  position: relative;
  display: inline-block;
  color: var(--lime);
  font-style: italic;
}

.hero__accent::after {
  position: absolute;
  right: -36px;
  bottom: 4px;
  width: 65%;
  height: 7px;
  border-radius: 999px;
  background: var(--purple);
  content: "";
  transform: rotate(-2deg);
}

.hero__copy {
  max-width: 520px;
  margin: 40px 0 34px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 50px;
  padding: 9px 9px 9px 20px;
  border: 1px solid rgba(199, 255, 61, 0.42);
  border-radius: 999px;
  color: var(--lime);
  font-size: 0.82rem;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  color: #11130c;
  background: var(--lime);
  transform: translateY(-2px);
}

.primary-action__arrow {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  color: #0d0e12;
  background: var(--lime);
}

.hero__orbit {
  position: absolute;
  top: 94px;
  right: 0;
  width: min(36vw, 445px);
  aspect-ratio: 1;
  contain: paint;
}

.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.orbit--outer {
  border-style: dashed;
  animation: spin 30s linear infinite;
}

.orbit--inner {
  inset: 18%;
  border-color: rgba(157, 124, 255, 0.45);
  animation: spin-reverse 22s linear infinite;
}

.orbit__core {
  position: absolute;
  inset: 35%;
  display: grid;
  z-index: 2;
  place-items: center;
  border-radius: 42% 58% 57% 43% / 50% 38% 62% 50%;
  color: #12130f;
  background: var(--lime);
  box-shadow: 0 0 70px rgba(199, 255, 61, 0.18);
  cursor: pointer;
  font-family: "Arial Black", sans-serif;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  letter-spacing: 0.18em;
  animation: morph 7s ease-in-out infinite;
}

.orbit__core:hover,
.orbit__core:focus-visible {
  color: var(--text);
  background: var(--purple);
  outline: 3px solid rgba(199, 255, 61, 0.28);
  outline-offset: 5px;
}

.orbit__satellite {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
}

.orbit__satellite--one {
  top: 3%;
  left: 30%;
  color: var(--purple);
}

.orbit__satellite--two {
  right: 2%;
  bottom: 30%;
  color: var(--lime);
}

.orbit__satellite--three {
  bottom: 3%;
  left: 19%;
  color: var(--pink);
}

.hero__update {
  position: absolute;
  right: 0;
  bottom: 46px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.library {
  padding: 110px 0 130px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 52px;
}

.section-heading h2,
.about h2 {
  margin: 0;
  font-family: "Arial Black", "PingFang SC", sans-serif;
  font-size: clamp(2.3rem, 4.4vw, 4.4rem);
  letter-spacing: -0.055em;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.filter {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.filter span {
  margin-left: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.filter:hover,
.filter:focus-visible {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter.is-active {
  color: #0d0e12;
  border-color: var(--lime);
  background: var(--lime);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.game-group-heading {
  grid-column: 1 / -1;
  margin: 36px 0 5px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.game-group-heading:first-child {
  margin-top: 8px;
}

.game-group-heading h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.game-card {
  --accent: var(--lime);
  position: relative;
  display: flex;
  grid-column: span 4;
  min-height: 296px;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 33%),
    var(--panel);
  transition:
    border-color 220ms ease,
    background 220ms ease,
    transform 220ms ease;
}

.game-card--wide {
  grid-column: span 6;
}

.game-card:hover,
.game-card:focus-visible {
  z-index: 1;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background:
    radial-gradient(circle at 82% 15%, color-mix(in srgb, var(--accent) 19%, transparent), transparent 40%),
    var(--panel-hover);
  outline: none;
  transform: translateY(-5px);
}

.game-card__top,
.game-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-card__category {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.65rem;
}

.game-card__symbol {
  position: absolute;
  top: 43px;
  right: 22px;
  color: color-mix(in srgb, var(--accent) 32%, transparent);
  font-family: Georgia, serif;
  font-size: 5.5rem;
  line-height: 1;
  transform: rotate(-9deg);
  transition:
    color 220ms ease,
    transform 220ms ease;
}

.game-card:hover .game-card__symbol,
.game-card:focus-visible .game-card__symbol {
  color: color-mix(in srgb, var(--accent) 65%, transparent);
  transform: rotate(4deg) scale(1.08);
}

.game-card__body {
  position: relative;
  z-index: 1;
  max-width: 80%;
  margin-top: 62px;
}

.game-card h3 {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  letter-spacing: -0.04em;
}

.game-card__description {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.game-card__tags {
  display: flex;
  gap: 7px;
}

.game-card__tag {
  color: #777781;
  font-size: 0.64rem;
}

.game-card__arrow {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.game-card:hover .game-card__arrow,
.game-card:focus-visible .game-card__arrow {
  color: #0e0f12;
  background: var(--accent);
  transform: rotate(45deg);
}

.game-grid.is-switching .game-card {
  animation: card-in 360ms both;
}

.about {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 40px;
  align-items: center;
  min-height: 400px;
  padding: 75px 0;
  border-top: 1px solid var(--line);
}

.about__content {
  max-width: 680px;
}

.about__content p {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.9;
}

.about__seal {
  position: relative;
  display: flex;
  width: 180px;
  height: 180px;
  flex-direction: column;
  align-items: center;
  justify-self: end;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(199, 255, 61, 0.42);
  border-radius: 50%;
  color: var(--lime);
  text-align: center;
}

.about__seal::before {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(199, 255, 61, 0.28);
  border-radius: 50%;
  content: "";
  animation: spin 22s linear infinite;
}

.about__seal span {
  position: relative;
  z-index: 1;
  padding-left: 0.28em;
  font-size: 0.59rem;
  line-height: 1;
  letter-spacing: 0.28em;
}

.about__seal strong {
  position: relative;
  z-index: 1;
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 0.9;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: #686871;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

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

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

@keyframes morph {
  0%,
  100% {
    border-radius: 42% 58% 57% 43% / 50% 38% 62% 50%;
  }
  50% {
    border-radius: 59% 41% 43% 57% / 39% 56% 44% 61%;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.42;
    transform: scale(0.8);
  }
}

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

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero {
    min-height: 820px;
    padding-top: 90px;
  }

  .hero__orbit {
    top: auto;
    right: 4%;
    bottom: 70px;
    width: min(52vw, 390px);
  }

  .hero__update {
    right: auto;
    bottom: 38px;
    left: 0;
  }

  .game-card,
  .game-card--wide {
    grid-column: span 6;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about__seal {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header,
  .hero,
  .library,
  .about,
  .site-footer {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .site-header {
    min-height: 74px;
  }

  .brand {
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .brand__mark {
    width: 28px;
    height: 28px;
  }

  .random-link {
    min-height: 44px;
    gap: 8px;
    padding: 8px 0 8px 12px;
  }

  .hero {
    display: flex;
    min-height: auto;
    flex-direction: column;
    padding: 58px 0 52px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(3.2rem, 16vw, 4.65rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
  }

  .hero__accent::after {
    right: -8px;
    height: 5px;
  }

  .hero__copy {
    margin: 28px 0 24px;
    font-size: 0.91rem;
    line-height: 1.75;
  }

  .hero__copy br {
    display: none;
  }

  .primary-action {
    align-self: flex-start;
    min-height: 52px;
  }

  .hero__orbit {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: min(72vw, 290px);
    margin: 42px auto 22px;
    opacity: 0.92;
  }

  .orbit__core {
    min-width: 72px;
    min-height: 72px;
    font-size: 0.72rem;
  }

  .orbit__satellite {
    width: 36px;
    height: 36px;
  }

  .hero__update {
    position: static;
    align-self: center;
    margin-top: 4px;
  }

  .library {
    padding: 72px 0 84px;
  }

  .section-heading {
    display: block;
    margin-bottom: 34px;
  }

  .section-heading h2,
  .about h2 {
    font-size: clamp(2.15rem, 11vw, 3.1rem);
    line-height: 1.08;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter {
    min-height: 44px;
    padding: 9px 10px;
    white-space: nowrap;
  }

  .filter:first-child {
    grid-column: 1 / -1;
  }

  .game-card,
  .game-card--wide {
    grid-column: 1 / -1;
    min-height: 244px;
    padding: 21px;
  }

  .game-card__body {
    max-width: calc(100% - 24px);
    margin-top: 48px;
  }

  .game-card__symbol {
    top: 45px;
    right: 15px;
    font-size: 4.2rem;
  }

  .game-card__arrow {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  .about {
    display: block;
    min-height: auto;
    padding: 64px 0;
  }

  .about__content p {
    margin-top: 20px;
    font-size: 0.86rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .site-header,
  .hero,
  .library,
  .about,
  .site-footer {
    width: calc(100% - 24px);
  }

  .random-link span:first-child {
    display: none;
  }

  .hero {
    padding-top: 48px;
  }

  .hero h1 {
    font-size: 3.05rem;
  }

  .hero__orbit {
    width: 76vw;
  }

  .game-card__tags {
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
