/* The look of the catalog. The colors are the NES's own, as Zelda 1 uses
   them: the night blue of its status bar, the blue of its item boxes, and
   the sand of its ground. The games' own pages use the same ones. */
:root {
  --night: #14204a;
  --box-blue: #2038ec;
  --sand: #fcd8a8;
  --white: #fcfcfc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.top, main {
  width: min(100% - 2rem, 60rem);
  margin-inline: auto;
}

.top { padding-block: 3rem 2rem; }

h1, h2 {
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
}
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); color: var(--sand); }
h2 { font-size: 2rem; }

.top p { max-width: 34rem; margin: 0.75rem 0 0; font-size: 1.1875rem; }

a { color: var(--sand); }
h2 a { text-decoration: none; }
h2 a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 3px;
}

/* A game: its picture on the left, and the words beside it. On a narrow
   screen the words go under the picture. */
.game {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding-block: 2rem;
}
@media (max-width: 44rem) {
  .game { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

/* The picture, in a frame like a Zelda 1 item box: a blue line, a gap,
   and a second blue line. The frame turns sand when you point at it. */
.screen {
  display: block;
  border: 4px solid var(--box-blue);
  outline: 4px solid var(--box-blue);
  outline-offset: 4px;
  margin: 8px;
  background: #000;
}
.screen:hover { border-color: var(--sand); outline-color: var(--sand); }
.screen img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated; /* Keep the game's pixels sharp. */
}

.description { margin: 0.75rem 0 1rem; max-width: 30rem; }

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1.25rem;
  margin: 0 0 1.5rem;
}
dt { color: var(--sand); }
dd { margin: 0; }

.play {
  display: inline-block;
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 1.25rem;
  color: var(--night);
  background: var(--sand);
  padding: 0.5rem 1.25rem;
  text-decoration: none;
}
.play:hover { background: var(--white); }

.note { color: var(--sand); padding-block: 2rem; }

/* ------------------------------------------------------------------
   Accounts and lobbies
   ------------------------------------------------------------------ */

/* A link after "Play", for games that can be played online. */
.online { margin-left: 1.25rem; }

/* The bar at the top of the account and lobby pages, and the account
   link in the catalog's corner. */
.top.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 1.25rem;
}
.top { position: relative; }
.corner { position: absolute; top: 1.25rem; right: 0; }

/* A page of forms and lists, not of game pictures. */
main.narrow { width: min(100% - 2rem, 38rem); padding-bottom: 3rem; }
main.narrow h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h3 { font-family: "Pixelify Sans", system-ui, sans-serif; margin: 1.5rem 0 0.5rem; }

.form { display: grid; gap: 0.75rem; max-width: 24rem; margin-bottom: 1.5rem; }
.form label { display: grid; gap: 0.25rem; color: var(--sand); }
input, select {
  font: inherit;
  color: var(--white);
  background: #0c1533;
  border: 2px solid var(--box-blue);
  padding: 0.4rem 0.6rem;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-family: "Pixelify Sans", system-ui, sans-serif;
  color: var(--night);
  background: var(--sand);
  border: 0;
  padding: 0.45rem 1rem;
  cursor: pointer;
  justify-self: start;
}
button:hover:not(:disabled) { background: var(--white); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.quiet { color: var(--sand); background: none; border: 2px solid var(--sand); }
button.quiet:hover { background: none; color: var(--white); border-color: var(--white); }

/* The list of open lobbies, and the players of one lobby. */
.lobbies, .players, .chat { list-style: none; padding: 0; margin: 0 0 1rem; }
.lobbies li, .players li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 2px solid var(--box-blue);
}
.lobby-name, .player-name { font-weight: 700; }
.lobby-facts { flex: 1; color: var(--sand); }
.lobbies button { margin-left: auto; }
.players .empty { color: var(--sand); opacity: 0.7; }
.tag { font-size: 0.875rem; color: var(--sand); }
.tag.ready { color: #80d010; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 1rem; }

.chat {
  max-height: 12rem;
  overflow-y: auto;
  border: 2px solid var(--box-blue);
  padding: 0.5rem 0.75rem;
  min-height: 3rem;
}
.say { display: flex; gap: 0.5rem; }
.say input { flex: 1; }
.hidden-label { position: absolute; left: -9999px; }
