/** Copyright (C) Microsoft Corporation. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* minimal css reset */
html, body, div, h1, h2, h3, h4, h5, h6, a, p, img, ul, li, button { padding: 0; margin: 0; border: 0; outline: 0; }

html, body {
  width: 100vw; /* fullscreen */
  height: 100vh; /* fullscreen */
  overflow: hidden;
  user-select: none;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: #000000;
  touch-action: pinch-zoom; /* prevents navigating back with one finger */
}

/* game layers fill entire page */
#game-canvas, #game-bg, #game-gradient, #game-ui, #game-tint {
  overflow: hidden;
  position: absolute;
  user-select: none;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
}

/* from edge */
#hamburger-container {
  overflow: visible;
  position: absolute;
  top: 10px;
  right: 8px;
}

html[dir="rtl"] #hamburger-container {
  right: unset;
  left: 10px;
}

html[dir="rtl"].icon-arrow-right,
html[dir="rtl"].icon-arrow-left {
  /* undo RTL */
  transform: scale(-1, 1);
}

#modal-root {
  position: fixed;
}



/* page structure */

#game-gradient {
  z-index: 1;
  pointer-events: none;
}

@media (forced-colors:active) {
  /* CanvasText, LinkText, VisitedText, ActiveText, GrayText, Field, FieldText, HighlightText, Highlight (txt bg), ButtonText, ButtonFace (btn bg) */
  #game-bg { background: Canvas !important; }
}

#game-bg {
  background-repeat: repeat;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges; /* important */
  z-index: 2;
  pointer-events: none;
}

#game-canvas {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges; /* important */
  z-index: 3;
}

/* overlay */

#game-tint {
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.1) 100%);
  transition: opacity 0.35s, visibility 0s 0.35s;
  transition-timing-function: cubic-bezier(0.30, 0.20, 0.20, 1.00);
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

#game-tint.visible {
  pointer-events: inherit;
  transition: opacity 0.35s; /* instant visibility */
  visibility: visible;
  opacity: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* main game ui */

#game-ui {
  width: calc(100vw - 32px); /* fullscreen minus 32 padding */
  height: calc(100vh - 32px); /* fullscreen minus 32 padding */
  padding: 16px;
  z-index: 5;
}

#ui-title,
#ui-subtitle {
  width: calc(100vw - 32px); /* fullscreen minus 32 padding */
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
}

#ui-title {
  margin-top: calc(10vh - 40px);
  line-height: 48px;
  font-size: 48px;
}

#ui-subtitle {
  margin-top: 10px;
  line-height: 24px;
  font-size: 24px;
}

/* shrinks title for super small screens */
@media screen and (max-height: 480px) {
  #ui-title { line-height: 36px; font-size: 36px; }
  #ui-subtitle { line-height: 20px; font-size: 20px; }
}

/* hides mode title on tiny screens */
@media screen and (max-height: 360px) {
  #ui-subtitle { visibility: hidden; }
}

/* hides game title on tiny screens */
@media screen and (max-height: 280px) {
  #ui-title { visibility: hidden; }
}

#ui-selector {
  position: absolute;
  top: calc(40vh - 64px);
  left: calc(50vw - 240px);
  width: 480px; /* fullscreen minus 32 padding */
  height: 128px;
  display: flex;
    justify-content: space-between;
  align-items: center;
}

#ui-selector span {
  border-radius: 4px;
  background-color: rgba(255,255,255,0);
  transition: background-color 0.1s;
}

#ui-selector span:hover {
  background: rgba(255,255,255,0.4);
  cursor: pointer;
}

/* shrink menu arrows on narrow screens */
@media screen and (max-width: 520px) {
  #ui-selector { left: calc(50vw - 220px); width: 440px; }
}

/* hide menu arrows on narrow screens */
@media screen and (max-width: 420px) {
  #ui-selector span { visibility: hidden;  }
}

#ui-instruct {
  position: absolute;
  top: calc(100vh * 0.6 - 32px); /* minus half height */
  width: calc(100vw - 32px); /* fullscreen minus 32 padding */
  text-align: center;
}

#instruct-content {
  display: inline-block;
  padding: 16px 12px;
}

#instruct-content.tinted {
  background-color: rgba(255,255,255,0.6);
  box-shadow: 0px 16px 24px rgba(0,0,0,0.16);
  border-radius: 4px;
}

@supports not (-moz-appearance:none) {
  #instruct-content.tinted {
      backdrop-filter: blur(32px);
      -webkit-backdrop-filter: blur(32px);
  }
} /* Backdrop filter is broken on Firefox */

#instruct-icon { /* xbox + ps */
  display: inline-block;
  vertical-align: middle;
  width: 32px;
  height: 32px;
}

#instruct-action { /* spacebar, double tap, double click */
  display: inline-block;
  margin: 0 8px;
  vertical-align: middle;
}

#instruct-action.outline { /* spacebar, double tap, double click */
  padding: 4px 12px 5px;
  border: 2px solid #000000;
  border-radius: 4px;
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
}

#instruct-text {
  display: inline-block;
  margin: 0 8px;
  vertical-align: middle;
  font-size: 24px;
  font-weight: 600;
}

#ui-notify {
  position: absolute;
  top: calc(100vh * 0.75 - 24px);
  width: calc(100vw - 32px); /* fullscreen minus 32 padding */
  text-align: center;
  transition: opacity 0.5s, visibility 0s 0.5s;
  transition-timing-function: cubic-bezier(0.30, 0.20, 0.20, 1.00);
  visibility: hidden;
  opacity: 0;
}

#ui-notify.visible {
  transition: opacity 0.35s; /* instant visibility */
  visibility: visible;
  opacity: 1;
}

#notify-content {
  display: inline-block;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 4px;
  color: #FFFFFF;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}

#notify-shareLink {
  display: inline-flex;
  vertical-align: -33%;
  align-items: center;
  font-weight: normal;
  background-color: rgba(255,255,255,0.2);
  padding: 4px 8px 2px;
  margin-inline-start: 12px;
  border-radius: 4px;
  cursor: pointer;
  color: currentColor;
  font-family: inherit;
}

#notify-shareLink:hover {
  background-color: rgba(255,255,255,0.3);
}

#notify-shareText {
}

/* game stats and ui */

#ui-dash {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

#dash-stats {
  display: flex;
  width: 280px;
  margin: 0 auto;
}

#stats-score,
.stats-icons {
  display: flex;
  justify-content: center;
  height: 22px;
  flex-basis: 136px;
}

.stats-icons {
  flex-basis: 72px;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges; /* important */
}

.stats-icons div {
  width: 22px;
  height: 22px;
  margin-inline-end: 2px;
  background-size: 1920px 512px;
}

.life-full { background-position: -1px -1px; }
.life-empty { background-position: -1px -25px; }
.boost-full { background-position: -25px -1px; }
.boost-empty { background-position: -25px -25px; }
.shield { background-position: -49px -1px; }
.infinite { background-position: -49px -25px; }

#score-icon {
  display: inline-block;
  vertical-align: middle;
  height: 22px;
  margin-inline-end: 4px;
}

#score-text {
  vertical-align: middle;
  font-size: 16px;
  font-weight: bold;
  line-height: 22px;
}

.icon-star {
  vertical-align: top;
}

.icon-fill {
  fill: #000000;
}

#ui-notify .icon-fill {
  fill: #FFFFFF;
}

@media (forced-colors:active) {
  /* CanvasText, LinkText, VisitedText, ActiveText, GrayText, Field, FieldText, HighlightText, Highlight (txt bg), ButtonText, ButtonFace (btn bg) */
  .icon-fill { fill: CanvasText !important; }
}