/* Shared page for the Unity Web builds in Games/<game>/ (see play.js). */
:root {
  --accent: #1896d2;
  --accent-2: #35e888;
  --bg: #05070b;
  --line: rgba(255, 255, 255, 0.1);
  --bar-h: 56px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(24, 150, 210, 0.2), transparent 60%), var(--bg);
  color: #f2f5f8;
  font-family: "Poppins", system-ui, sans-serif;
  overflow: hidden;
}

.play-bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.9);
}

.play-bar h1 {
  margin: 0 auto 0 0;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-bar a,
.play-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.play-bar a:hover,
.play-bar button:hover {
  background: var(--accent);
}

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

/* Portrait games: the stage keeps 9:16 and fits the space left under the bar. */
.play-stage {
  height: calc(100% - var(--bar-h));
  display: grid;
  place-items: center;
  padding: 12px;
}

.play-frame {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: #000;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.play-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
  background: var(--bg);
  transition: opacity 0.4s;
}

.play-loading.done {
  opacity: 0;
  pointer-events: none;
}

.play-loading p {
  margin: 0;
  font-size: 14px;
  color: #9aa6b2;
}

.play-progress {
  width: min(240px, 60vw);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.play-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s;
}

.play-error {
  color: #ff8a8a !important;
  max-width: 280px;
}

/* Phones: no frame, the game uses the whole screen under the bar. */
@media (max-width: 600px) {
  .play-stage {
    padding: 0;
  }

  .play-frame {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
  }

  .play-bar .label {
    display: none;
  }
}
