/* Shared typography and layout for every page. */
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/DMMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Regular-latin.5418d02db551.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins-Bold-latin.d411e3bce1a8.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #000;
  background: #fff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 3.375rem 1.5rem 4.5rem;
  /* Match the centered 800px reference column, with room for long descriptions. */
  padding-left: max(1.5rem, calc((100% - 50rem) / 2 + 0.125rem));
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

p + p {
  margin-top: 1rem;
}

a,
a:visited,
a:hover,
a:active {
  color: #000;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
pre:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

.site-title {
  font-size: 2rem;
  line-height: 1.5;
}

.logo-accent {
  color: #3b6eff;
}

main {
  max-width: 64rem;
  margin-top: 2.9375rem;
}

.link-list {
  padding: 0;
  list-style: none;
}

.game-links li + li {
  margin-top: 1.1875rem;
}

p.back-link {
  margin-top: 2rem;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-weight: 400;
  font-variant-ligatures: none;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: #f3f5f8;
  color: #254a97;
  font-size: 0.9em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.code-section {
  margin-top: 1.75rem;
}

.code-section + .code-section {
  margin-top: 2.5rem;
}

.code-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

pre {
  max-width: 100%;
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid #e1e5ed;
  border-radius: 0.5rem;
  background: #f8f9fc;
  color: #242c3b;
  font-size: 0.875rem;
  line-height: 1.75;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
}

pre code {
  font-size: inherit;
}

.token-comment { color: #626e80; }
.token-keyword { color: #7044ad; }
.token-type,
.token-function { color: #2455a4; }
.token-number { color: #a04720; }
.token-string { color: #28703e; }
.token-directive { color: #984568; }

.code-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.copy-status {
  color: #505d72;
  font-size: 0.75rem;
}

.copy-button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 6.25rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e1e5ed;
  border-radius: 0.375rem;
  background: #fff;
  color: #242c3b;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

.copy-button img {
  width: 0.875rem;
  height: 1rem;
}

/* Temporary selection target for browsers without the Clipboard API. */
.clipboard-fallback {
  position: fixed;
  top: 0;
  left: -9999px;
  font-size: 16px;
}

@media (max-width: 40rem) {
  body {
    padding: 2rem 1.25rem 3rem;
  }

  main {
    margin-top: 1.75rem;
  }

  .site-io {
    padding-inline: clamp(1rem, 5vw, 1.25rem);
  }

  .site-io .site-title {
    line-height: 1.25;
  }

  .site-io .site-title a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }

  .site-io .game-links a,
  .site-io .back-link a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-block: 0.5rem;
  }

  .site-io .game-links li + li {
    margin-top: 0.25rem;
  }

  pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }
}
