:root {
  --bg: #f4f3f0;
  --fg: #1d1d1b;
  --muted: #6b6a66;
  --line: #d9d7d1;
  --stage: #000;
  --measure: 60rem;
  color-scheme: light;
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --fg: #e9e7e2;
    --muted: #9a9892;
    --line: #2c2c2a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

a { color: inherit; }

.site,
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site {
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-tagline,
.meta,
.notice {
  color: var(--muted);
}

.site-tagline { margin: 0.25rem 0 0; }

/* Index */

.shelf-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.shelf-title .count { margin-left: 0.5em; opacity: 0.7; }

.grid {
  list-style: none;
  margin: 0 0 3.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 2rem 1.5rem;
}

.card a {
  display: block;
  text-decoration: none;
}

.card img,
.placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  image-rendering: pixelated;
  background: var(--line);
  border-radius: 4px;
}

.card h3 {
  font-size: 1.05rem;
  margin: 0.75rem 0 0;
}

.card a:hover h3,
.card a:focus-visible h3 { text-decoration: underline; }

/* Coming soon */

.placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--muted) 10%, transparent) 10px 11px),
    var(--line);
}

.placeholder-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--muted);
}

.placeholder .badge {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--fg);
  color: var(--bg);
}

.coming-soon {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 2rem;
  text-align: center;
  border-radius: 4px;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--muted) 10%, transparent) 10px 11px),
    var(--line);
}

.coming-soon p { margin: 0.5rem 0 0; }

.card p { margin: 0.2rem 0 0; }

/* Game page */

.back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  text-decoration: none;
}

.back:hover { color: var(--fg); }

.game h1 {
  font-size: 1.75rem;
  margin: 0;
}

.game .meta { margin: 0.25rem 0 1.25rem; }

.player {
  display: flex;
  flex-direction: column;
  background: var(--stage);
  border-radius: 4px;
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: #111;
  color: #ddd;
  font-size: 0.875rem;
}

.toolbar .label {
  margin-right: auto;
  padding-left: 0.25rem;
  opacity: 0;
}

.toolbar button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}

.toolbar button:hover { border-color: #444; }
.toolbar button[aria-pressed="true"] { background: #333; border-color: #555; }
.toolbar button:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 1px; }

/* Inline, the frame is as wide as the page allows while its height stays
   within the window, so a portrait game is visible whole. */
.frame {
  position: relative;
  width: min(100%, calc(88vh * var(--aspect, 4 / 3)));
  margin: 0 auto;
  aspect-ratio: var(--aspect, 4 / 3);
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Presentation fills the window; full screen fills the display. */

.player[data-mode="presentation"],
.player:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10;
  border-radius: 0;
}

.player[data-mode="presentation"] .frame,
.player:fullscreen .frame {
  flex: 1;
  width: 100%;
  margin: 0;
  aspect-ratio: auto;
}

.player[data-mode="presentation"] .label,
.player:fullscreen .label { opacity: 1; }

body.presenting { overflow: hidden; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  margin: 2rem 0 4rem;
}

@media (max-width: 44rem) {
  .about { grid-template-columns: 1fr; }
}

.about p { margin: 0 0 1em; }

.about h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.about dl { margin: 0 0 1.5rem; }
.about dt { font-weight: 600; }
.about dd { margin: 0 0 0.6rem; }
