@font-face {
  font-family: Geist;
  src: url("./assets/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Geist, "Helvetica Neue", Arial, sans-serif;
  color: #eef3fb;
  background: #111111;
  --line: #26354a;
  --muted: #a2b2ca;
  --accent: #99bbff;
  --gutter: clamp(20px, 5.2vw, 76px);
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, p, ul { margin: 0; }

body { margin: 0; }

.lobby {
  display: grid;
  grid-template-rows: clamp(48px, 8dvh, 72px) minmax(0, 1fr);
  width: min(calc(100% - 2 * var(--gutter)), 1168px);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
}

.masthead {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -.02em;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #1c2d47;
  color: var(--accent);
}

.brand-mark i {
  position: relative;
  width: 3px;
  height: 7px;
  background: currentColor;
}

.brand-mark i::after {
  content: "";
  position: absolute;
  inset: -2px auto -2px 1px;
  width: 1px;
  background: currentColor;
}

.brand-mark i:nth-child(1) { transform: translateY(2px); }
.brand-mark i:nth-child(3) { transform: translateY(-2px); }

.main {
  display: grid;
  align-content: center;
  gap: clamp(20px, 4dvh, 36px);
  padding-block: 12px max(clamp(20px, 8dvh, 72px), env(safe-area-inset-bottom));
}

h1 {
  font-size: clamp(28px, 4.25vw, min(7dvh, 56px));
  line-height: 1.08;
  font-weight: 530;
  letter-spacing: -.052em;
  text-wrap: balance;
}

.games {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  list-style: none;
  padding: 0;
}

.game { min-width: 0; }

.game-link {
  display: grid;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}

.game-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.game-art {
  aspect-ratio: 3 / 2;
  max-height: 42dvh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111e2e;
  transition: border-color 160ms ease;
}

.game-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title play" "description description";
  align-items: center;
  gap: 5px 12px;
}

.game h2 {
  grid-area: title;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  font-weight: 550;
  letter-spacing: -.036em;
}

.game-description {
  grid-area: description;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-wrap: pretty;
}

.play {
  grid-area: play;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  transition: color 160ms ease;
}

.arrow {
  position: relative;
  display: inline-block;
  flex: none;
  width: 12px;
  height: 1px;
  background: currentColor;
}

.arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid;
  border-right: 1px solid;
  transform: rotate(45deg);
}

@media (hover: hover) {
  .game-link:hover .game-art { border-color: #5b78a1; }
  .game-link:hover .play { color: #d6e6ff; }
}

@media (max-width: 800px) {
  .play { font-size: 0; gap: 0; }
}

@media (max-width: 720px) and (orientation: portrait), (max-width: 520px) {
  .main { gap: 20px; }
  h1 { font-size: clamp(24px, 7.5vw, 42px); }
  .games { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .game-link {
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    align-items: center;
    gap: clamp(12px, 3.5vw, 24px);
  }
  .game-art { max-height: 19dvh; border-radius: 8px; }
  .game-copy {
    grid-template-areas: "title play" "description play";
    gap: 4px 8px;
  }
  .game-description { font-size: 12px; }
}

@media (max-height: 530px) and (min-width: 521px) and (orientation: landscape) {
  .lobby { grid-template-rows: 38px minmax(0, 1fr); }
  .main { gap: 12px; padding-block: 8px 12px; }
  h1 { font-size: clamp(21px, 8dvh, 32px); }
  .game-link { gap: 8px; }
  .game-copy { gap: 3px 6px; }
  .game h2 { font-size: clamp(15px, 2.65vw, 20px); }
  .game-description { font-size: 12px; }
  .game-art { max-height: 37dvh; }
}

@media (max-height: 410px) {
  .game-description { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .game-art, .play { transition: none; }
}
