/*
 * The arcade's own pages: the lobby and the frame a game is played in. A game brings its own look
 * and none of this reaches inside it.
 */

:root {
  color-scheme: light dark;

  --ink: #1b1a17;
  --ink-quiet: #5c574e;
  --ground: #faf7f2;
  --raised: #ffffff;
  --line: #e2dcd1;
  --accent: #7a5c2e;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgb(27 26 23 / 0.06), 0 8px 24px rgb(27 26 23 / 0.08);

  --stage: #0e0d0b;
  --stage-ink: #ece7dd;
  --stage-quiet: #a49c8d;
  --stage-line: #2b2924;
  --stage-accent: #d9b978;

  --radius: 12px;
  --gap: 1rem;
  --measure: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece7dd;
    --ink-quiet: #a49c8d;
    --ground: #171613;
    --raised: #21201b;
    --line: #35332c;
    --accent: #d9b978;
    --accent-ink: #1b1a17;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

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

/* The lobby */

.topbar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}

.topbar__trail {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar__brand { color: var(--ink); text-decoration: none; }
.topbar__sep { color: var(--ink-quiet); font-weight: 400; }
.topbar__here { color: var(--accent); text-decoration: none; }

.main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.hero { text-align: center; padding: 2rem 0 2.25rem; }
.hero h1 { margin: 0 0 0.25rem; font-size: 2.5rem; letter-spacing: -0.02em; }
.lede { margin: 0; color: var(--ink-quiet); font-size: 1.1rem; }
.empty { text-align: center; color: var(--ink-quiet); }

.games {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 26rem));
  justify-content: center;
  gap: 1.5rem;
}

.game__link {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease;
  position: relative;
}

.game__link:hover { transform: translateY(-3px); border-color: var(--accent); }

.game__cover {
  display: block;
  width: 100%;
  aspect-ratio: 40 / 21;
  object-fit: cover;
  background: var(--line);
}

.game__text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 1.15rem;
}

.game__title { font-size: 1.3rem; font-weight: 750; letter-spacing: -0.01em; }
.game__blurb { color: var(--ink-quiet); }

.game__input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  padding-right: 5rem;
}

.tag {
  font-size: 0.8rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-quiet);
}

.game__play {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  .game__link { transition: none; }
  .game__link:hover { transform: none; }
}

/* Playing a game: a thin bar, and the game in everything below it */

.player {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--stage);
  color: var(--stage-ink);
  overflow: hidden;
}

.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--stage-line);
  font-size: 0.95rem;
}

.bar__back {
  color: var(--stage-accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.bar__back:hover { text-decoration: underline; }

.bar__title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar__button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  background: transparent;
  color: var(--stage-ink);
  cursor: pointer;
}

.bar__button:hover { border-color: var(--stage-accent); }
.bar__button[hidden] { display: none; }

.player :focus-visible { outline-color: var(--stage-accent); }

/* Only where there is nothing but a touchscreen to play with */
.player__notice {
  display: none;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: #3a2f1c;
  color: var(--stage-ink);
  font-size: 0.9rem;
}

@media (hover: none) and (pointer: coarse) {
  .player__notice { display: block; }
}

.player__frame {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #000;
}
