:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #102033;
  background: #eaf8ff;
  --ink: #102033;
  --muted: #5f7184;
  --line: rgba(31, 75, 105, 0.16);
  --glass: rgba(255, 255, 255, 0.76);
  --sea-blue: #1597d3;
  --deep-sea: #0d5d82;
  --sun-coral: #ff805c;
  --sand: #ffe5b7;
  --leaf: #35c999;
  --lilac: #9a83ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background-image: url("./assets/seaside-girl-dog-right-bg.png");
  background-position: center bottom;
  background-size: cover;
  background-attachment: fixed;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 12px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.top-nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 46px rgba(18, 66, 95, 0.14);
  backdrop-filter: blur(20px) saturate(1.15);
}

.brand-mark,
.nav-actions,
.status-strip,
.filter-list,
.game-card-footer {
  display: flex;
  align-items: center;
}

.brand-mark,
.nav-actions a,
.filter-button,
.game-card {
  border-radius: 8px;
  text-decoration: none;
}

.brand-mark {
  gap: 10px;
  min-width: 0;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(23, 130, 174, 0.16);
}

.brand-mark strong {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.nav-actions {
  gap: 8px;
}

.nav-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: #21384c;
  font-weight: 800;
}

.nav-actions .nav-play {
  background: linear-gradient(135deg, var(--sun-coral), #ffb16f);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(255, 128, 92, 0.26);
}

.catalog-section {
  width: min(980px, 100%);
  min-height: 0;
  margin-inline: auto;
  padding-top: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.section-kicker {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--deep-sea);
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

h2,
p {
  margin: 0;
}

.status-strip {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
}

.status-strip span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.status-strip strong {
  color: #0b8564;
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 38px rgba(18, 66, 95, 0.1);
  backdrop-filter: blur(20px) saturate(1.12);
}

.filter-list {
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(31, 75, 105, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #294359;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: rgba(13, 93, 130, 0.24);
  background: var(--sea-blue);
  color: #ffffff;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 0;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: page-fade 180ms ease;
}

.game-card {
  --accent: var(--sea-blue);
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  color: inherit;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, white), rgba(255, 255, 255, 0.82) 50%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 48px rgba(18, 66, 95, 0.13);
  backdrop-filter: blur(18px) saturate(1.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: auto 10px 8px;
  height: 4px;
  border-radius: 8px;
  background: var(--accent);
}

a.game-card:hover {
  border-color: rgba(13, 93, 130, 0.22);
  box-shadow: 0 26px 58px rgba(18, 66, 95, 0.2);
  transform: translateY(-3px);
}

.game-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: #142b3d;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 26px rgba(18, 66, 95, 0.1);
}

.game-meta {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 5px;
}

.game-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
}

.game-title-row h2 {
  margin: 0;
  color: #102033;
  font-size: 16px;
  line-height: 1.16;
  letter-spacing: 0;
}

.game-meta p {
  color: #5f7184;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  font-size: 12px;
  line-height: 1.35;
}

.game-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 8px;
  color: #142b3d;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.78);
}

.status-available {
  background: var(--sand);
}

.status-coming-soon {
  color: #6e7584;
}

.game-card-footer {
  justify-content: space-between;
  gap: 10px;
  color: #294359;
  font-size: 12px;
  font-weight: 800;
}

.is-disabled {
  cursor: not-allowed;
}

.is-disabled .game-icon,
.is-disabled .game-meta {
  opacity: 0.46;
}

.coming-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.62);
  color: #102033;
  backdrop-filter: blur(1px) saturate(1.08);
}

.coming-overlay strong {
  font-size: 24px;
  line-height: 1.15;
}

.coming-overlay span {
  color: #5f7184;
  font-size: 14px;
}

.catalog-pager {
  min-height: 42px;
  display: grid;
  grid-template-columns: 42px minmax(0, auto) 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 8px;
}

.catalog-pager button {
  width: 42px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: #0d5d82;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(18, 66, 95, 0.1);
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.catalog-pager button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #ffffff;
}

.catalog-pager button:disabled {
  cursor: default;
  opacity: 0.38;
}

.catalog-pager div {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  box-shadow: 0 12px 26px rgba(18, 66, 95, 0.1);
  backdrop-filter: blur(16px);
}

.catalog-pager strong {
  color: var(--deep-sea);
}

.catalog-pager span {
  font-size: 12px;
  font-weight: 800;
}

@keyframes page-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accent-green {
  --accent: var(--leaf);
}

.accent-amber {
  --accent: var(--sand);
}

.accent-blue {
  --accent: var(--sea-blue);
}

.accent-gray {
  --accent: #d6e1e7;
}

.accent-ink {
  --accent: #a7bac7;
}

.accent-red {
  --accent: var(--sun-coral);
}

.accent-purple {
  --accent: var(--lilac);
}

@media (max-width: 980px) {
  body {
    background-position: 30% bottom;
  }

  .catalog-section {
    width: 100%;
  }

  .catalog-heading {
    align-items: start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    background-position: 30% bottom;
  }

  .site-shell {
    width: min(100% - 20px, 1180px);
    padding-block: 8px;
  }

  .top-nav,
  .nav-actions {
    align-items: stretch;
  }

  .brand-mark strong {
    display: none;
  }

  .nav-actions a {
    padding: 0 10px;
  }

  .filter-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-button {
    min-width: 0;
    padding: 0 8px;
  }

  .games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .game-card {
    grid-template-columns: 1fr;
    padding: 6px;
    gap: 4px;
  }

  .game-icon {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .game-title-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .game-title-row h2 {
    font-size: clamp(11px, 3.2vw, 14px);
  }

  .game-status,
  .game-meta p,
  .game-card-footer {
    display: none;
  }

  .catalog-pager {
    grid-template-columns: 36px minmax(0, auto) 36px;
    gap: 6px;
    padding-top: 6px;
  }

  .catalog-pager button {
    width: 36px;
    height: 32px;
  }

  .catalog-pager div {
    min-height: 32px;
    padding-inline: 10px;
  }

  .catalog-pager span {
    display: none;
  }
}
