@font-face {
  font-family: 'DM Sans';
  src: url('./assets/dm-sans.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #faf5ff;
  background: #12101a;
  --ink: #faf5ff;
  --muted: #d2c5dc;
  --line: #4a3d58;
  --accent: #f6d791;
  --accent-ink: #2b1a19;
}

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

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 75% 3%, #31203b 0%, transparent 55%),
    #12101a;
}

a, button { touch-action: manipulation; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.container {
  width: min(calc(100% - 2 * clamp(1rem, 4vw, 3rem)), 72rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  transform: translateY(-150%);
  padding: 0.65rem 1rem;
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
}

.skip-link:focus { transform: translateY(0); }

.topbar {
  background: #13101acc;
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: -0.015em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid #c6a46e;
  border-radius: 0.55rem;
  background: #3b2a3e;
}

.brand-mark::before {
  width: 0.8rem;
  height: 0.8rem;
  transform: rotate(45deg);
  border: 2px solid var(--accent);
  border-radius: 0.12rem;
  content: '';
}

.language-button {
  min-height: 2.75rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #695774;
  border-radius: 0.55rem;
  background: #292033;
  color: var(--ink);
  font: inherit;
  font-size: 0.87rem;
  font-weight: 680;
  cursor: pointer;
}

.language-button:hover { background: #3e2b49; }

.game-library { padding-block: clamp(3rem, 7vw, 6rem) 4rem; }

.game-library h1 {
  margin: 0 0 clamp(1.65rem, 3vw, 2.55rem);
  font-size: clamp(2.65rem, 7vw, 5.1rem);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.062em;
}

html[lang='zh-Hans'] .game-library h1 { letter-spacing: -0.042em; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 1.25rem;
}

.game-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #21182a;
  box-shadow: 0 1rem 3rem #0a071542;
}

.game-card:only-child { max-width: 53.5rem; grid-column: 1 / -1; }

.game-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #101426;
}

.game-cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card[data-game='deal-or-not-deal'] .game-cover::before {
  position: absolute;
  z-index: 1;
  top: calc(50% - 2.8rem);
  width: 2.35rem;
  height: 1.15rem;
  border: 2px solid #e6b974;
  border-radius: 0.4rem 0.4rem 0 0;
  background: #333053;
  content: '';
}

.game-card[data-game='deal-or-not-deal'] .game-cover::after {
  z-index: 1;
  width: min(38%, 6.8rem);
  height: 3.5rem;
  border: 2px solid #f6d498;
  border-radius: 0.6rem;
  background: linear-gradient(148deg, #66527c, #2f2851 65%);
  box-shadow: inset 0 0 0 0.25rem #231b364f, inset 0 0 0 0.32rem #e8bb864d, 0 0.8rem 1.8rem #080815b3;
  content: '';
}

.game-details {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
}

.game-details h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.game-details p {
  max-width: 33ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.play-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.8rem;
  margin-top: 0.55rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.55rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.play-link:hover { background: #ffe6b3; }

@media (min-width: 45rem) {
  .game-card:only-child { grid-template-columns: 1.18fr 1fr; grid-template-rows: 1fr; }
  .game-card:only-child .game-cover { height: 100%; }
}
