*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, .9);
  --paper: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: rgba(31, 41, 51, .1);
  --green: #0f9f83;
  --blue: #118ab2;
  --coral: #ef476f;
  --amber: #f59e0b;
  --shadow: 0 18px 48px rgba(22, 30, 44, .12);
  --soft-shadow: 0 10px 28px rgba(22, 30, 44, .08);
  --radius: 8px;
  --loader-size: clamp(9.5rem, 17vw, 12rem);
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, #eaf5ef 0%, #f8f4ed 48%, #f6f7fb 100%);
  color: var(--ink);
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body.game-is-loading {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(17, 138, 178, .06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 159, 131, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 82%, transparent);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(239, 71, 111, .2), transparent 28%),
    linear-gradient(135deg, rgba(10, 18, 32, .98), rgba(12, 48, 54, .96) 52%, rgba(31, 34, 46, .98));
  transition: opacity .5s ease, visibility .5s ease, transform .5s ease;
}

.site-loader[hidden] {
  display: none !important;
}

.site-loader.site-loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
}

.site-loader::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  pointer-events: none;
}

/* Loader adapted from Uiverse.io by StealthWorm (pink-duck-62). */
.uiverse-loader {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--loader-size);
  height: var(--loader-size);
  flex-direction: column;
}

.uiverse-loader__curve {
  position: absolute;
  z-index: 2;
  width: 180%;
  height: 180%;
  fill: transparent;
  animation: uiverseLoaderRotate 8s linear infinite;
}

.uiverse-loader__curve svg {
  display: block;
  width: 100%;
  height: 100%;
}

.uiverse-loader__curve text {
  fill: #fff;
  filter: drop-shadow(0 2px 8px #000);
  font: 1.5em "Fira Sans", "Segoe UI", sans-serif;
  letter-spacing: 20px;
  text-transform: uppercase;
}

.uiverse-loader__blackhole {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--loader-size);
  height: var(--loader-size);
}

.uiverse-loader__circle {
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at center, #000 25%, #fff 35%, #fff 100%);
  box-shadow: 0 0 2rem #c2babb;
}

.uiverse-loader__circle::after {
  content: "";
  position: absolute;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 4px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at center, #000 35%, #fff 60%, #fff 100%);
  box-shadow: 0 0 5rem #c2babb;
  filter: blur(4px);
  animation: uiverseLoaderPulse 2s linear infinite alternate-reverse;
}

.uiverse-loader__circle::before {
  content: "";
  z-index: 1;
  display: flex;
  width: calc(var(--loader-size) * .5);
  height: calc(var(--loader-size) * .5);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 3px 3px 10px #c2babb, inset 0 0 1rem #fff;
  filter: blur(.5px);
  animation: uiverseLoaderRotate 3s linear infinite;
}

.uiverse-loader__disc {
  position: absolute;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--loader-size) * .625);
  height: calc(var(--loader-size) * 1.25);
  border: calc(var(--loader-size) * .125) solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 80%, #353535 90%, #fff 100%);
  box-shadow: 0 0 3rem #d7c4be;
  filter: blur(1rem) brightness(130%);
  transform: rotate3d(1, 1, 1, 220deg);
  animation: uiverseLoaderDiscPulse 2s linear infinite alternate-reverse;
}

.uiverse-loader__disc::before {
  content: "";
  position: absolute;
  z-index: 0;
  display: flex;
  width: calc(var(--loader-size) * .625);
  height: calc(var(--loader-size) * 1.25);
  border: calc(var(--loader-size) * .125) solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 80%, #353535 90%, #fff 100%);
  box-shadow: 0 0 6rem #d7c4be;
  filter: blur(3rem);
  animation: uiverseLoaderPulse 2s linear infinite alternate-reverse;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.site-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid rgba(255, 255, 255, .6);
  background: rgba(15, 23, 42, .9);
  color: #fff;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
  font-size: 1.04rem;
  font-weight: 900;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .76);
  font-weight: 800;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.side-nav a:hover,
.side-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.side-nav a:hover {
  transform: translateY(-1px);
}

.nav-icon {
  width: 24px;
  text-align: center;
}

.game-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 52px;
}

.game-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.header-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(17, 138, 178, .18);
  border-radius: var(--radius);
  color: #0f5263;
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--soft-shadow);
  font-size: .92rem;
  font-weight: 850;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.home-link:hover {
  transform: translateY(-2px);
  border-color: rgba(17, 138, 178, .32);
  box-shadow: var(--shadow);
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.search-box {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: min(100%, 440px);
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder {
  color: #9aa4b2;
}

.search-box:focus-within {
  border-color: rgba(17, 138, 178, .42);
  box-shadow: 0 0 0 4px rgba(17, 138, 178, .1);
}

.game-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.game-count strong {
  color: var(--coral);
  font-size: 1.45rem;
  line-height: 1;
}

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

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--blue));
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, var(--blue));
  border-color: color-mix(in srgb, var(--accent, var(--blue)) 34%, white);
  box-shadow: var(--shadow);
}

.game-thumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid rgba(31, 41, 51, .08);
  border-radius: 50%;
  background: rgba(17, 138, 178, .1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .84), rgba(255, 255, 255, .48)),
    color-mix(in srgb, var(--accent, var(--blue)) 14%, white);
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.game-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-desc {
  display: -webkit-box;
  overflow: hidden;
  min-height: 36px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-arrow {
  color: var(--accent, var(--blue));
  color: color-mix(in srgb, var(--accent, var(--blue)) 74%, #1f2933);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform .2s ease;
}

.game-card:hover .game-arrow {
  transform: translateX(3px);
}

.no-results {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid rgba(239, 71, 111, .2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

@keyframes uiverseLoaderRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes uiverseLoaderPulse {
  0% {
    box-shadow: 0 0 3rem #c2babb;
    transform: scale(1);
  }

  100% {
    box-shadow: 0 0 5rem #c2babb;
    transform: scale(1.09);
  }
}

@keyframes uiverseLoaderDiscPulse {
  0% {
    box-shadow: 0 0 3rem #c2babb;
    transform: rotate3d(1, 1, 1, 220deg) scale(1);
  }

  100% {
    box-shadow: 0 0 5rem #c2babb;
    transform: rotate3d(1, 1, 1, 220deg) scale(.95);
  }
}

@media screen and (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: relative;
    z-index: 3;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: auto;
    padding: 12px 16px;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .side-nav a {
    min-height: 38px;
  }

  .game-page {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }
}

@media screen and (max-width: 680px) {
  .game-header,
  .game-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .home-link,
  .search-box {
    width: 100%;
  }

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

@media screen and (max-width: 420px) {
  .site-sidebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .side-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .side-nav a {
    flex: 1 1 136px;
  }

  .game-card {
    grid-template-columns: 48px minmax(0, 1fr) 16px;
    gap: 10px;
    padding: 12px;
  }

  .game-thumb {
    width: 48px;
    height: 48px;
  }
}

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