/* Interim GM Games: the testers' site. Colours and lettering are BRAND.md's. */
:root {
  --navy: #13233F;
  --red: #D62828;
  --paper: #FFFDF7;
  --ink: #1B1B1F;
  --quiet: rgba(255, 253, 247, .7);
  --line: rgba(255, 253, 247, .16);
  --caps: Futura, "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  --heavy: "Arial Black", "Arial Bold", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0; background: var(--navy); color: var(--paper);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1040px; margin: 0 auto; padding: 40px 16px 56px; }

.caps { font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--quiet); margin: 0; }

.studio { text-align: center; }
.studio img { display: block; width: min(340px, 78%); height: auto; margin: 0 auto 6px; }

.lead { text-align: center; margin: 44px auto 40px; max-width: 620px; }
.lead h1 { font-family: var(--heavy); font-weight: 900; font-size: clamp(26px, 4.6vw, 38px); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
.lead p { margin: 0; color: var(--quiet); text-wrap: pretty; }
.lead a { color: var(--paper); text-underline-offset: 3px; }

/* the games in the test, two across; under them the ones still to come, three across and a size down */
.games { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 760px; }
.soon { margin-top: 52px; }
.soon h2 { text-align: center; margin: 0 0 18px; }
.soon .games { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.soon .game { padding-bottom: 16px; }
.soon .game .name { font-size: 18px; }
.game {
  display: grid; align-content: start; gap: 4px; height: 100%; padding: 0 0 18px; overflow: hidden;
  color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s, transform .15s;
}
.game img { display: block; width: 100%; height: auto; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.game > span { padding: 0 18px; }
.game .name { font-family: var(--heavy); font-weight: 900; font-size: 22px; line-height: 1.2; }
.game .go {
  justify-self: start; margin: 14px 18px 0; padding: 9px 22px; border-radius: 999px;
  background: var(--red); color: var(--paper);
  font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
}
a.game:hover { border-color: var(--paper); transform: translateY(-2px); }
a.game:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.game.off img, .game.off .name, .game.off .caps { opacity: .45; }
.game.off .go { background: none; border: 1px solid var(--line); color: var(--quiet); letter-spacing: .14em; }

/* soon.html: every game on one board, four across, each with its status and a red light beside it */
.soon.all { margin-top: 0; }
.soon.all .games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game .status { margin-top: 10px; font-family: var(--caps); font-weight: 700; font-size: 12px; line-height: 1.5; letter-spacing: .14em; text-transform: uppercase; }
.game .status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--red); vertical-align: 1px; }

/* A tile that opens its game's scouting report is a button; it looks as a tile does. */
.lead .hint { margin-top: 22px; }
button.game { width: 100%; font: inherit; color: inherit; text-align: left; background: none; cursor: pointer; }
button.game:hover { border-color: var(--paper); transform: translateY(-2px); }
button.game:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }

/* The scouting report: a paper card over the dimmed page, the game's art across its top. The browser centres a
   popover and closes it on Esc or a click outside. */
.about {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto;
  border: 0; border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(10px) rotate(-1.5deg) scale(.96);
  transition: opacity .18s, transform .18s, overlay .18s allow-discrete, display .18s allow-discrete;
}
.about:popover-open { opacity: 1; transform: none; }
@starting-style { .about:popover-open { opacity: 0; transform: translateY(10px) rotate(-1.5deg) scale(.96); } }
.about::backdrop { background: rgba(8, 15, 29, .74); }
.about > img { display: block; width: 100%; height: auto; }
.about .sheet { padding: 20px 24px 24px; }
.about .caps { color: rgba(27, 27, 31, .62); font-size: 12px; letter-spacing: .18em; }
.about h2 { font-family: var(--heavy); font-weight: 900; font-size: 26px; line-height: 1.15; margin: 6px 0 8px; text-align: left; }
.about .pitch { margin: 0 0 4px; font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.about dl { margin: 0; }
.about dt { margin-top: 14px; color: var(--red); font-family: var(--caps); font-weight: 700; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.about dd { margin: 3px 0 0; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.about .close {
  margin-top: 20px; padding: 9px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--navy); color: var(--paper);
  font-family: var(--caps); font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
}
.about .close:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
/* a browser with no popovers shows the tiles alone */
@supports not selector(:popover-open) { .about { display: none; } }

/* The door and the office (both written by _worker.js): one field and one button. A new password comes on a
   paper slip, to be copied before the page is left. */
.studio a { display: block; }
.lead .note { margin-top: 14px; color: var(--paper); font-weight: 600; }
form.door { display: grid; gap: 8px; max-width: 340px; margin: 26px auto 0; text-align: left; }
form.door input, form.door select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 253, 247, .06); color: var(--paper); color-scheme: dark; font: inherit; font-size: 18px;
}
form.door input { letter-spacing: .08em; text-transform: uppercase; }
form.door input:focus-visible, form.door select:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
form.door button {
  justify-self: start; margin-top: 8px; padding: 11px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--red); color: var(--paper);
  font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
}
form.door button:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.slip { display: grid; gap: 6px; max-width: 440px; margin: 26px auto 0; padding: 18px 20px 16px; border-radius: 14px; background: var(--paper); color: var(--ink); text-align: left; }
.slip .caps { color: rgba(27, 27, 31, .62); font-size: 12px; letter-spacing: .18em; }
.slip input { width: 100%; margin-bottom: 6px; padding: 10px 12px; border: 1px solid rgba(27, 27, 31, .25); border-radius: 8px; background: #fff; color: var(--ink); font: 600 16px/1.2 ui-monospace, Menlo, Consolas, monospace; }
.slip p:last-child { margin: 2px 0 0; color: rgba(27, 27, 31, .78); font-size: 14px; }
.lead .doors { margin-top: 26px; }
.lead .fine { margin-top: 14px; font-size: 14px; }
.lead .fine code { color: var(--paper); font: 13px ui-monospace, Menlo, Consolas, monospace; }

.rules { margin: 48px auto 0; max-width: 620px; }
.rules h2 { margin: 0 0 12px; }
.rules ul { margin: 0; padding: 0 0 0 20px; color: var(--quiet); }
.rules li { margin: 0 0 8px; text-wrap: pretty; }
.rules li::marker { color: var(--red); }

footer.caps { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }

@media (max-width: 960px) {
  .soon.all .games { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; }
}
@media (max-width: 760px) {
  main { padding-top: 28px; }
  .games { grid-template-columns: 1fr; max-width: 420px; }
  .soon .games { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; gap: 12px; }
  .soon .game > span { padding: 0 12px; }
  .soon .game .name { font-size: 15px; }
  .soon .game .caps { font-size: 11px; letter-spacing: .16em; }
  .soon.all .games { max-width: 420px; }
  .game .status { font-size: 11px; letter-spacing: .1em; }
}
@media (prefers-reduced-motion: reduce) {
  .game, .about { transition: none; }
  a.game:hover, button.game:hover { transform: none; }
  .about { transform: none; }
}
