/* Web demo pages (/games/<slug>/play/): the game in a portrait frame as big as the screen allows. */

.play-page {
  min-height: 100dvh;
}

.play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 0.5rem;
}

.play-back {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.play-home img {
  display: block;
  width: 9rem;
  height: auto;
}

.play-main {
  max-width: none;
  padding: 0 1rem 1.5rem;
}

/* 9:16, as tall as the window allows under the bar and the note, never wider than the screen. */
.stage {
  position: relative;
  width: min(100%, calc((100dvh - 7.5rem) * 0.5625));
  min-width: min(100%, 18rem);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border: 4px solid var(--ink);
  border-radius: 28px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 10px 0 rgba(43, 45, 66, 0.18);
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
  /* Taps and drags go to the game, not to scrolling or zooming the page. */
  touch-action: none;
  outline: none;
}

.stage canvas.ready {
  visibility: visible;
}

.poster,
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: var(--cream) url("egg-spots.svg") repeat;
  background-size: 640px 640px;
}

.poster[hidden],
.loading[hidden],
.poster-message[hidden] {
  display: none;
}

.poster-logo {
  width: 78%;
  height: auto;
}

/* Raised like the in-game buttons: thick Ink outline, darker base under the face. */
.play-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.75rem 2rem;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--sunshine);
  color: var(--ink);
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  box-shadow: 0 8px 0 #c9951a;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.play-button:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #c9951a;
}

.play-button:focus-visible {
  outline: 4px solid var(--sky);
  outline-offset: 4px;
}

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

.play-icon {
  width: 0;
  height: 0;
  border-top: 0.6em solid transparent;
  border-bottom: 0.6em solid transparent;
  border-left: 0.95em solid var(--ink);
}

.poster-note,
.poster-message {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

.poster-message {
  color: var(--ink);
  font-weight: 700;
}

.loading p {
  margin: 0;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
}

.progress {
  width: 70%;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--sky);
  transition: width 200ms ease;
}

.play-note {
  max-width: 34rem;
  margin: 1rem auto 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .play-button,
  .progress-bar {
    transition: none;
  }
}
