@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url("/assets/fonts/manrope-800.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #171a19;
  --surface: #232824;
  --ink: #faf8ef;
  --secondary: #cdd4c8;
  --lime: #e2fd51;
  --rule: #60685d;
  --gutter: clamp(0.875rem, 3vw, 2.5rem);
  font-family: Manrope, system-ui, sans-serif;
  background: var(--background);
  color: var(--ink);
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  line-height: 1.5;
}

h1, h2, p, figure {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.25em;
}

button {
  font: inherit;
  color: inherit;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

::selection {
  background: var(--lime);
  color: var(--background);
}

.wrap {
  width: min(82rem, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset: 0.5rem auto auto var(--gutter);
  z-index: 1;
  padding: 0.625rem 0.875rem;
  transform: translateY(-200%);
  color: var(--background);
  background: var(--lime);
}

.skip-link:focus {
  transform: none;
}

#choose:focus {
  outline: none;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.25rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-weight: 800;
  color: var(--lime);
  text-decoration: none;
}

.languages {
  display: flex;
  gap: 0.125rem;
  font-weight: 800;
  font-size: 0.8125rem;
}

.languages a {
  display: grid;
  place-items: center;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  text-decoration: none;
}

.languages a[aria-current] {
  color: var(--lime);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.languages a:hover {
  color: var(--lime);
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-block: clamp(0.875rem, 2vw, 1.5rem) 1rem;
}

.intro h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.intro p {
  color: var(--secondary);
  font-size: 0.875rem;
}

main {
  padding-bottom: 1.5rem;
}

.arcade {
  display: grid;
  grid-template-columns: clamp(13rem, 21vw, 19rem) minmax(0, 1fr);
  border-block: 1px solid var(--rule);
}

.game-nav {
  border-inline-end: 1px solid var(--rule);
}

.game-list {
  display: flex;
  flex-direction: column;
}

.arcade-ready .game-list {
  min-height: 100%;
}

.game-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  padding: 0.625rem clamp(0.625rem, 1.35vw, 1rem);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.arcade-ready .game-tab {
  flex: 1;
}

.arcade-ready .game-tab:last-child {
  border-bottom: 0;
}

.game-tab[aria-selected="true"] {
  color: #1e230f;
  background: var(--lime);
}

.game-tab:hover:not([aria-selected="true"]) {
  background: var(--surface);
}

.game-tab:focus-visible {
  outline-offset: -4px;
}

.tab-label {
  display: grid;
  min-width: 0;
  gap: 0.125rem;
}

.tab-label strong {
  font-weight: 800;
  font-size: clamp(1rem, 1.6vw, 1.375rem);
  line-height: 1.12;
}

.tab-label small {
  font-size: 0.8125rem;
  color: var(--secondary);
}

.game-tab[aria-selected="true"] small {
  color: inherit;
}

.arrow {
  position: relative;
  display: inline-block;
  width: 0.9em;
  height: 0.75em;
  flex: none;
}

.arrow::before, .arrow::after {
  content: "";
  position: absolute;
}

.arrow::before {
  inset: 50% 0 auto 0;
  border-top: 1.5px solid;
}

.arrow::after {
  inset: 50% 0.04em auto auto;
  width: 52%;
  height: 55%;
  border-top: 1.5px solid;
  border-right: 1.5px solid;
  transform: translateY(-43%) rotate(45deg);
}

.arrow-out {
  transform: rotate(-45deg);
}

.game-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
}

.game-panel + .game-panel {
  border-top: 1px solid var(--rule);
}

.arcade-ready .game-panel {
  border-top: 0;
}

.game-panel:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.previews {
  --art-height: clamp(17.5rem, 34vw, 30rem);
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: clamp(0.375rem, 1vw, 0.875rem);
  min-width: 0;
  min-height: var(--art-height);
  padding: clamp(0.5rem, 1vw, 0.875rem);
}

.game-river .previews { background: #3f4732; }
.game-space .previews { background: #202f48; }
.game-front .previews { background: #484b38; }
.game-cats .previews { background: #573646; }
.game-football .previews { background: #582531; }

.shot {
  display: grid;
  align-items: center;
  justify-items: center;
  height: calc(var(--art-height) - 1.75rem);
  max-width: 46%;
}

.game-cats .shot {
  max-width: 30%;
}

.game-football .shot {
  max-width: 87%;
}

.shot img {
  width: auto;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.shot-extra {
  height: 8.5rem;
}

.gallery-ready .shot-extra, .gallery-link {
  display: none;
}

.game-copy {
  align-self: center;
  padding: clamp(0.875rem, 1.7vw, 1.5rem);
}

.game-copy h2 {
  max-width: 24ch;
  font-size: clamp(1.75rem, 3.35vw, 3.125rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.genre {
  font-size: 0.8125rem;
  color: var(--secondary);
  margin-top: 0.375rem;
}

.description {
  margin-top: 0.625rem;
  max-width: 48ch;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin-top: 0.625rem;
}

.play, .news, .gallery-ready .gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
}

.play {
  color: var(--lime);
}

.play:hover, .news:hover, .gallery-link:hover {
  text-decoration: underline;
}

.gallery {
  width: min(48rem, calc(100% - 1.25rem));
  max-height: calc(100% - 1.25rem);
  margin: auto;
  padding: 0.875rem;
  background: var(--background);
  color: var(--ink);
  border: 1px solid var(--rule);
}

.gallery::backdrop {
  background: #0d100ee0;
}

.gallery-header, .gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gallery-header h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.gallery-figure {
  margin-block: 0.625rem;
}

.gallery-figure img {
  width: auto;
  height: auto;
  max-height: min(66svh, 43rem);
  margin-inline: auto;
  object-fit: contain;
}

.gallery-figure figcaption {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--secondary);
  font-size: 0.875rem;
}

.gallery-button {
  min-height: 2.75rem;
  padding-inline: 0.625rem;
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.gallery-button:hover:not(:disabled) {
  background: var(--surface);
}

.gallery-button:disabled {
  color: #969e93;
  cursor: default;
}

.gallery-count {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 65rem) {
  .game-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-copy {
    align-self: start;
  }

  .previews {
    --art-height: clamp(14rem, 33vw, 22rem);
  }
}

@media (max-width: 48rem) {
  .arcade {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-nav {
    border-inline-end: 0;
    border-bottom: 1px solid var(--rule);
  }

  .intro {
    padding-block: 0.625rem 0.75rem;
  }

  .intro h1 {
    font-size: clamp(1.8rem, 6.5vw, 3.125rem);
  }

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

  .game-tab {
    min-height: 2.75rem;
    padding-block: 0.375rem;
  }

  .game-tab:nth-child(odd):not(:last-child) {
    border-inline-end: 1px solid var(--rule);
  }

  .game-tab:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .tab-label strong {
    font-size: clamp(0.875rem, 3.5vw, 1.125rem);
  }

  .tab-label small, .game-tab .arrow {
    display: none;
  }

  .previews {
    --art-height: clamp(10.75rem, 46vw, 16rem);
  }

  .game-actions {
    margin-top: 0.25rem;
  }
}
