@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,300&display=swap');

@import './view-home.css';
@import './button.css';

:root {
  --max-width-desktop: 450px;
  --max-height-desktop: 700px;
}

/*  HIDDEN ADDRESS BAR HACK */
body[full-height-strict='true'] {
  height: 100vh;
}

body {
  height: 100%;
  overscroll-behavior: none;
  margin: 0px;
  width: 100%;
  font-family: Open Sans;
  font-size: 21px;
  font-weight: 700;
  background: #ffaea5;
  touch-action: manipulation;
  background-image: url('../static/home/background-tab.jpg');
  background-position: center;
  display: grid;
}

body * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

img {
  max-width: 100%;
}

#game-container[device-type='desktop'] {
  max-width: var(--max-width-desktop);
  max-height: var(--max-height-desktop);
}

#game-container[status='defeated'] {
  filter: grayscale(100%) contrast(120%);
}

#game-container {
  transition: filter 1s;
  /* Hack : Potential performance improvement and allows keeping the address  */
  /* bar hidden when exiting fullscreen */
  touch-action: none;
  /* end of hack */
  position: relative;
  width: 100%;
  height: 100%;
  margin: auto;
  background: #ffd1cb;
}
/** VIEW-GAME----- */

#view-game {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

/* status=defeated */
#game-container[status='defeated'] #transition,
#game-container[status='defeated'] #introduction {
  display: none;
}
#game-container[status='defeated'] #header {
  opacity: 0;
  top: -100px;
}

/* status=introduction */
#game-container[status='introduction'] #header {
  opacity: 0;
  top: -100px;
}
#game-container[status='introduction'] #defeated {
  display: none;
}

/**/
#header {
  opacity: 1;
  /* transition: opacity 1s, top 1s; */
  transition: top 1s;
  position: absolute;
  top: 10px;
  text-align: center;
  background: white;
  left: 30px;
  right: 30px;
  top: 30px;
  border-radius: 40px;
  padding: 4px;
  box-shadow: 6px 6px;
  position: absolute;
  z-index: 999;
  font-size: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.top-bar-left-col {
  display: grid;
  grid-template-columns: 40px 1fr;
  text-align: left;
  align-items: center;
}
.top-bar-left-col-icon {
  margin: auto;
  width: 30px;
  align-self: center;
}
.top-bar-right-col {
  display: grid;
  grid-template-columns: 1fr;
  text-align: right;
  padding-right: 10px;
}
.top-bar-right-col > * {
  vertical-align: middle;
  line-height: 30px;
}
#score {
  align-self: center;
  padding-right: 10px;
  font-weight: 800;
  font-size: 20px;
  text-align: right;
  color: #d62e53;
  vertical-align: top;
}

#viewport {
  position: absolute;
}
/***/

#transition {
  position: absolute;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  text-align: center;
}
#transition > * {
  width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
#transition img {
  max-width: 100%;
}

/**/
.wave-end {
  width: 300px;
  animation: fadeOut;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-delay: 0.5s;
}
.wave-end > img:nth-child(2) {
  top: -48px;
  position: relative;
}

/**/
#transition > .wave-start {
  position: absolute;
  width: 100%;
  animation: fadeOut;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-delay: 0.5s;
  opacity: 0;
  margin-top: 50%;
}
.wave-start > img:nth-child(2) {
  width: 100px;
  margin: auto;
  top: -20px;
  position: relative;
}

/**/
.game-infected {
  width: 300px;
  height: 400px;
}

#view-game .button {
  /** make it clickable **/
  z-index: 10000;
  align-self: center;
  margin-top: -100px;
}

@keyframes fadeOut {
  0% {
    opacity: 0;
    /* transform: scale(1); */
  }
  20% {
    opacity: 1;
    /* transform: scale(1); */
  }
  50% {
    opacity: 1;
    /* transform: scale(1); */
  }
  100% {
    opacity: 0;
    /* transform: scale(1.7); */
  }
}
