:root {
  color-scheme: dark;
  --game-aspect-width: 9;
  --game-aspect-height: 16;
  --desktop-game-max-width: 430px;
  --desktop-game-max-height: 95vh;
  --desktop-height-limited-width: 53.4375vh;
  --desktop-width-limited-height: 764.4444px;
  --page-background: #151a22;
}

html {
  width: 100%;
  height: 100%;
  -ms-touch-action: none;
  touch-action: none;
  background: var(--page-background);
}

body,
canvas,
div,
main {
  display: block;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;

  display: grid;
  place-items: center;

  cursor: default;
  color: #888;
  background: var(--page-background);
  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;
}

@supports (height: 100dvh) {
  body {
    height: 100dvh;
  }
}

#GameFrame {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #171717;
}

@supports (height: 100dvh) {
  #GameFrame {
    height: 100dvh;
  }
}

/*
 * Keep the native full-screen mobile frame. On desktop-class landscape
 * pointers, give Cocos a centered 9:16 frame instead of the browser window.
 * Cocos still applies the scene's original 1080x1920 resolution policy to
 * this frame, so the complete canvas (including boards and dialogs) scales
 * as one unit without changing game-space coordinates.
 */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) and (min-aspect-ratio: 1/1) {
  #GameFrame {
    width: min(var(--desktop-game-max-width), var(--desktop-height-limited-width));
    height: min(var(--desktop-game-max-height), var(--desktop-width-limited-height));
    aspect-ratio: var(--game-aspect-width) / var(--game-aspect-height);
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.38);
  }
}

@supports (height: 1dvh) {
  :root {
    --desktop-game-max-height: 95dvh;
    --desktop-height-limited-width: 53.4375dvh;
  }
}

#Cocos2dGameContainer {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: horizontal;
  -webkit-box-align: center;
  -webkit-box-pack: center;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

a:link,
a:visited,
a:active,
a:hover {
  color: #666;
}

p.header {
  font-size: small;
}

p.footer {
  font-size: x-small;
}

#splash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #171717 url(./splash.png) no-repeat center;
  background-size: 45%;
}

.progress-bar {
  position: absolute;
  left: 27.5%;
  top: 80%;
  width: 45%;
  height: 3px;
  padding: 2px;
  border-radius: 7px;
  box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-in-out;
  background-color: #3dc5de;
}

.stripes span {
  background-size: 30px 30px;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  animation: animate-stripes 1s linear infinite;
}

@keyframes animate-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 60px 0;
  }
}
