/* The arcade's lobby, built to DESIGN.md: a traditional red-and-white seaside arcade drawn on a
   pixel grid. The games are places on the pier map; on phones the same booths stack under it. */
:root {
  --red: #d12a21;
  --white: #ffffff;
  --page: #fffaf3;
  --ink: #1f1a2e;
  --amber: #ffb400;
  --display: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  /* Awning tiles: a red and a white stripe, each ending in a stepped scallop with an ink edge
     under it (DESIGN.md: Shapes). SVG can't read the custom properties, so the hexes are the tokens'. */
  --awning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 75' shape-rendering='crispEdges'%3E%3Cpath fill='%231f1a2e' d='M0 0H48V63H44V67H40V71H32V75H16V71H8V67H4V63H0Z'/%3E%3Cpath fill='%231f1a2e' d='M48 0H96V63H92V67H88V71H80V75H64V71H56V67H52V63H48Z'/%3E%3Cpath fill='%23d12a21' d='M0 0H48V60H44V64H40V68H32V72H16V68H8V64H4V60H0Z'/%3E%3Cpath fill='%23ffffff' d='M48 0H96V60H92V64H88V68H80V72H64V68H56V64H52V60H48Z'/%3E%3C/svg%3E");
  --awning-small: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 28' shape-rendering='crispEdges'%3E%3Cpath fill='%231f1a2e' d='M0 0H24V22H22V24H20V26H16V28H8V26H4V24H2V22H0Z'/%3E%3Cpath fill='%231f1a2e' d='M24 0H48V22H46V24H44V26H40V28H32V26H28V24H26V22H24Z'/%3E%3Cpath fill='%23d12a21' d='M0 0H24V20H22V22H20V24H16V26H8V24H4V22H2V20H0Z'/%3E%3Cpath fill='%23ffffff' d='M24 0H48V20H46V22H44V24H40V26H32V24H28V22H26V20H24Z'/%3E%3C/svg%3E");
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 600 1.05rem/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The awning across the top. */
.awning {
  flex: none;
  height: 75px;
  background: var(--awning) 0 0 / 96px 75px repeat-x;
}

.masthead,
main,
footer {
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
}

/* The wordmark is a marquee sign: white type on the red panel, framed by square amber bulbs. */
.marquee {
  position: relative;
  display: inline-block;
  padding: 1.35rem 1.9rem 1.15rem;
  border: 4px solid var(--ink);
  background: var(--red);
  color: var(--white);
  font: 700 clamp(2.4rem, 5vw, 3.75rem) / 1 var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  font-variant-ligatures: none;
}

.marquee::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--amber) 50%, transparent 0) 0 0 / 20px 10px repeat-x,
    linear-gradient(90deg, var(--amber) 50%, transparent 0) 0 100% / 20px 10px repeat-x,
    linear-gradient(180deg, var(--amber) 50%, transparent 0) 0 0 / 10px 20px repeat-y,
    linear-gradient(180deg, var(--amber) 50%, transparent 0) 100% 0 / 10px 20px repeat-y;
  /* The bulbs chase round the sign once when the page opens, and again when it's pointed at. */
  animation: chase 0.25s steps(2) 5;
}

.marquee:hover::before,
.marquee:focus-visible::before {
  animation: chase-again 0.25s steps(2) 5;
}

@keyframes chase {
  to {
    background-position: 20px 0, -20px 100%, 0 -20px, 100% 20px;
  }
}

@keyframes chase-again {
  to {
    background-position: 20px 0, -20px 100%, 0 -20px, 100% 20px;
  }
}

/* The way to the player's own profile: white in an ink frame, so amber stays Play's and red Install's. */
.profile-link {
  display: inline-block;
  min-height: 44px;
  padding: 0.7rem 1rem 0.6rem;
  border: 3px solid var(--ink);
  background: var(--white);
  font: 700 1.2rem / 1 var(--display);
  font-variant-ligatures: none;
  text-decoration: none;
}

.profile-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

main {
  flex: 1;
}

.intro {
  max-width: 34rem;
  padding-block: 2rem 1.5rem;
}

.intro h1 {
  margin: 0 0 0.75rem;
  font: 700 clamp(2rem, 3vw, 2.6rem) / 1.1 var(--display);
  font-variant-ligatures: none;
}

.intro p {
  margin: 0;
  font-size: 1.15rem;
}

/* The install card (install.js): white and framed like a booth, with no awning because it isn't a
   game. The app's own icon shows what lands on the home screen. Phones meet it after the booths, so
   Play stays the first button they see; wide screens show it under the intro. */
.install {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem 0.9rem;
  margin: 2.25rem 0 0;
  padding: 1rem 1.1rem 1.15rem;
  border: 3px solid var(--ink);
  background: var(--white);
}

.install[hidden],
.install [hidden] {
  display: none;
}

.install-icon {
  width: 48px;
  height: 48px;
}

.install h2 {
  margin: 0;
  font: 700 1.6rem / 1.1 var(--display);
  font-variant-ligatures: none;
}

.install-why,
.install-button,
.install-how,
.install-done {
  grid-column: 1 / -1;
}

.install-why,
.install-how p,
.install-done {
  margin: 0;
}

.install-how ol {
  margin: 0;
  padding-left: 1.4rem;
}

.install-how li + li {
  margin-top: 0.35rem;
}

/* The browsers' own labels, so they're easy to match against the menu. */
.install-how b {
  font-weight: 800;
}

.glyph {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
}

.install-done {
  font-weight: 800;
}

/* Install is red, the arcade's own colour: amber belongs to Play. It presses like Play. */
.install-button {
  justify-self: start;
  min-height: 44px;
  padding: 0.75rem 1.2rem 0.65rem;
  border: 3px solid var(--ink);
  background: var(--red);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--white);
  font: 700 1.2rem / 1 var(--display);
  font-variant-ligatures: none;
  cursor: pointer;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}

.install-button:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.install-button:active {
  transform: translateY(4px);
  box-shadow: none;
}

.install-button:disabled {
  cursor: progress;
}

/* The pier map. Places on it are positioned in % of the art, so they stay put at any width. */
.map {
  position: relative;
}

.map-art {
  display: block;
  width: 100%;
  height: auto;
}

/* Each live game's place links to it for pointer users on wide screens; keyboards and phones use
   the booth's Play button. */
.spot {
  display: none;
  position: absolute;
  z-index: 1;
  border-radius: 50%;
}

.spot-spearfish {
  left: 22.6%;
  top: 27.7%;
  width: 27.5%;
  height: 22.4%;
}

.spot-pier {
  left: 55.5%;
  top: 37%;
  width: 37%;
  height: 37%;
}

.spot-splash {
  left: 12.5%;
  top: 53%;
  width: 13%;
  height: 11.5%;
}

.spot-ring {
  left: 45.5%;
  top: 34.5%;
  width: 10.5%;
  height: 17%;
}

.spot:hover {
  outline: 3px dashed var(--ink);
  outline-offset: 4px;
}

.booths {
  display: grid;
  gap: 2.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* A booth: white card, ink frame, and its own little awning. */
.booth {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--white);
  padding: 0 1.1rem 1.15rem;
}

.booth::before {
  content: "";
  display: block;
  height: 28px;
  margin: 0 -1.1rem 0.9rem;
  background: var(--awning-small) 0 0 / 48px 28px repeat-x;
}

.booth h3 {
  margin: 0 0 0.4rem;
  font: 700 1.6rem / 1.1 var(--display);
  font-variant-ligatures: none;
}

.blurb {
  margin: 0 0 0.6rem;
}

/* Facts carry small red squares, the grid's own bullet. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 800;
  font-size: 0.95rem;
}

.facts li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  background: var(--red);
  vertical-align: 0.15em;
}

/* Play: amber is kept for this one action. It drops onto its shadow like a cabinet button. */
.play {
  display: inline-block;
  min-height: 44px;
  margin-top: 0.95rem;
  padding: 0.75rem 1.2rem 0.65rem;
  border: 3px solid var(--ink);
  background: var(--amber);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  font: 700 1.2rem / 1 var(--display);
  font-variant-ligatures: none;
  text-decoration: none;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}

.play:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.play:active {
  transform: translateY(4px);
  box-shadow: none;
}

.booth-art {
  display: block;
  width: calc(100% + 2.2rem);
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0 -1.1rem 0.9rem;
  margin-top: -0.9rem;
  object-fit: cover;
}

/* Coming soon, for a game announced before it opens: the roller shutter is down and a red sign
   hangs on it. */
.booth-soon {
  display: grid;
}

.booth-soon::before {
  grid-row: 1;
}

.shutter {
  grid-area: 2 / 1;
  height: 7.5rem;
  margin: -0.9rem -1.1rem 0.9rem;
  background: repeating-linear-gradient(180deg, #d9d3c9 0 10px, #b9b2a6 10px 12px);
}

.booth-soon h3 {
  grid-row: 3;
  margin: 0;
}

.sign {
  grid-area: 2 / 1;
  place-self: center;
  margin: -0.9rem 0 0;
  padding: 0.35rem 0.8rem;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 0.95rem;
}

/* Wide screens: the booths stand on the map, each pointing at its place. */
@media (min-width: 1000px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "intro pier"
      "install pier"
      "more pier";
    column-gap: 2.5rem;
    align-items: start;
  }

  .intro {
    grid-area: intro;
  }

  .install {
    grid-area: install;
    margin: 0;
  }

  .more {
    grid-area: more;
  }

  .pier {
    grid-area: pier;
    margin-top: -3.5rem;
  }

  /* Room above the map for the Spearfish and Ring Fling booths and below it for the Pier Pressure
     and Splash Hit booths: they're positioned on the art, so they don't make the section grow. */
  .map {
    margin: 17rem 0 18rem;
  }

  .spot {
    display: block;
  }

  .booths {
    display: block;
    margin: 0;
  }

  .booth {
    position: absolute;
    z-index: 2;
    transform: translateX(-50%);
  }

  /* The map is the picture here. */
  .booth-art {
    display: none;
  }

  /* A stepped pointer from the booth to its place. */
  .booth::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 24px;
    height: 12px;
    background: var(--ink);
    transform: translateX(-50%);
  }

  .booth-spearfish {
    left: 26%;
    bottom: 71.3%;
    width: 21rem;
    margin-bottom: 12px;
  }

  .booth-spearfish::after,
  .booth-ring::after {
    top: calc(100% + 3px);
    clip-path: polygon(0 0, 100% 0, 100% 34%, 83% 34%, 83% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 17% 67%, 17% 34%, 0 34%);
  }

  /* Hangs under the hall's open doors and points up at them. */
  .booth-pier {
    left: 72%;
    top: 71%;
    width: 21rem;
    margin-top: 12px;
  }

  .booth-pier::after,
  .booth-splash::after {
    bottom: calc(100% + 3px);
    clip-path: polygon(33% 0, 67% 0, 67% 34%, 83% 34%, 83% 67%, 100% 67%, 100% 100%, 0 100%, 0 67%, 17% 67%, 17% 34%, 33% 34%);
  }

  /* Stands over the right of the pier, beside the Spearfish booth, and points down from near its
     left edge at the hoopla stall in the middle: `left` places that edge, not the middle. */
  .booth-ring {
    left: 50%;
    bottom: 66.5%;
    width: 20rem;
    margin-bottom: 12px;
    transform: none;
  }

  .booth-ring::after {
    left: 12px;
  }

  /* Hangs under the diving board at the end of the left jetty and points up at it. */
  .booth-splash {
    left: 22%;
    top: 66%;
    width: 21rem;
    margin-top: 12px;
  }
}

/* Between 1000 and 1200 px the map is narrow: the two booths under it slim down to stay clear of
   each other, and grow taller, so there's more room below. */
@media (min-width: 1000px) and (max-width: 1199px) {
  .map {
    margin-bottom: 22rem;
  }

  .booth-pier,
  .booth-splash {
    width: 17rem;
  }

  .map {
    margin-top: 21rem;
  }

  .booth-spearfish {
    left: 23%;
    width: 16rem;
  }

  .booth-ring {
    left: 47%;
    width: 16rem;
  }
}

.more {
  margin: 2rem 0 3rem;
}

footer {
  padding-block: 1.25rem 2rem;
  border-top: 2px solid var(--ink);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

@media (max-width: 999px) {
  .masthead {
    justify-content: center;
    text-align: center;
  }

  .intro {
    margin-inline: auto;
    text-align: center;
  }

  .play,
  .install-button {
    display: block;
    text-align: center;
  }

  .install-button {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee::before,
  .marquee:hover::before,
  .marquee:focus-visible::before {
    animation: none;
  }

  .play,
  .install-button {
    transition: none;
  }
}
