/*
 * @license
 * Copyright 2020 Google Inc. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =============================================================================
 */

:root {
  --canvas-width: 885px;
  --canvas-height: 435px;
  --background-color: rgba(255, 11, 174, 1);
  /* --background-color: rgba(30, 30, 30, 1); */
  --black-color: rgba(0, 0, 0, 1);
  /* --background-color: rgb(0, 0, 0); */

  --text-color: #373fff;
  --text-background-color: rgba(255, 255, 255, 1);

  --input-thumb-size: 8px;
  --input-thumb-size-small: 5px;
  --border-width: 8px;
  --bright-green: rgba(127, 246, 102, 1);
  /* --shadow: 10px 10px 5px black; */
  --shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.8), 0 12px 25px 0 rgba(0, 0, 0, 0.7);

  --no-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0), 0 12px 25px 0 rgba(0, 0, 0, 0);
}

* {
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
  user-select: none;
}

html {
  height: 100%;
  width: 100%;
}

/* 
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
} */

body {
  font-family: helvetica, arial, sans-serif;

  margin: 0 auto 0 auto;
  background-color: var(--background-color);
  /* background-image: url("./assets/bg-1.png"); */
  /* background-color: var(--text-color); */

  position: relative;
  height: 100%;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
}

#container {
  width: 100%;
  max-width: 900px;
}

h3 {
  font-size: 1.2rem;
}
button {
  font-size: 1rem;
}

p {
  margin: 0;
}

span,
p,
option,
label {
  font-size: 0.8rem;
}

select {
  font-size: 0.6rem;
  padding: 0.2rem;
  border: solid var(--black-color) 0.25rem;
}

input {
  font-size: 0.8rem;
  height: var(--input-thumb-size);
}

iframe {
  pointer-events: none;
}

#title {
  font-style: italic;
  width: 420px;
  font-size: 1.9rem;
  color: var(--text-color);
  background-color: var(--text-background-color);
  border: solid var(--text-color) var(--border-width);
  padding: 0.5rem;
  margin: 0 0 1rem 0;
}

button {
  color: var(--text-color);
  background-color: var(--text-background-color);
  border: solid var(--text-color) var(--border-width);
}

.small-button {
  width: 60px;
  height: 25px;
  font-size: 0.7rem;
  padding: 0;
}

#control-div {
  display: none;
  align-items: stretch;
  align-content: stretch;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  /* max-width: 1100px; */
}

#control-div .block {
  margin: 10px 15px 10px 0;
  /* padding: 5px; */
  min-width: 250px;
  min-height: 120px;
  border: solid var(--text-color) var(--border-width);
  /* border-color: var(--text-color); */

  color: var(--text-color);
  background-color: var(--text-background-color);
}

#mixing-div {
  display: none;
}

/* canvas */

#background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  /* width: var(--canvas-width); */
  /* height: var(--canvas-height); */
  z-index: -1;
}

#main-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#canvas-div {
  /* display: none; */
  /* margin: 1rem 0 0.5rem 0; */
  position: relative;
  width: 100%;
  padding-top: 48%;
  /* max-width: 800px; */
  /* height: 435px; */
  border: solid var(--text-color) var(--border-width);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#canvas-overlay {
  /* pointer-events: none; */
  position: absolute;
  background-color: rgba(0, 0, 0, 0.95);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* melody panel */

#melody-panel-div {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;

  /* display: flex; */
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#melody-panel {
  position: relative;
  background-color: var(--text-background-color);
  border: solid var(--text-color) var(--border-width);
  width: 65%;
  height: 80%;
  padding: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;
}

#melody-panel-close {
  top: 0;
  right: 0;
  padding: 0.8rem;
}

#melody-panel-right {
  display: none;
  top: 40%;
  right: 5px;
}
#melody-panel-left {
  display: none;
  top: 40%;
  left: 5px;
}

.melody-panel-button {
  font-size: 2rem;
  padding: 0;
  position: absolute;
  opacity: 0.7;

  color: rgba(0, 0, 0, 1);
  border: none;
  background-color: transparent;
}

.melody-panel-button:hover {
  opacity: 1;
}

.panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: scroll;
  padding: 2rem 3rem;
}

.panel h3 {
  font-size: 1rem;
}

.panel label {
  min-width: 8rem;
  margin-right: 1rem;
}

.panel-control-div div {
  margin: 0.7rem 0;
  display: flex;
  align-items: center;
}

#interpolation-div {
  padding: 1.5rem 1.2rem;
  text-align: center;
}
#interpolation-div p,
#interpolation-div a {
  width: 80%;
  font-size: 0.6rem;
}
#interpolation-div select {
  font-size: 0.6rem;
  margin: 0 0.5rem;
}
#interpolation-div {
  display: flex;
  align-items: center;
}
#interpolation-div div {
  margin: 0.5rem 0 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
#interpolation-div canvas {
  margin-top: 0.5rem;
  width: 100%;
  height: 30%;
}
/* buttons */

.circle {
  position: absolute;
  top: -1.2rem;
  left: 50%;
  transform: translate(-50%, 0%);
  width: 0.8rem;
  height: 0.8rem;
  /* border-radius: 0.5rem; */
  /* background-color: var(--bright-green); */
  background-image: url('./assets/stars-3.png');
  background-size: 100% 100%;
}

.hidden {
  display: none;
}

.display-block {
  display: block;
}

.disabled {
  pointer-events: none;
}

.transparent {
  opacity: 0.6;
}

.disabledbutton {
  pointer-events: none;
  opacity: 0.4;
}

.large-on-hover {
  /* opacity: 0.3; */
  transform: scale(1);
}
.large-on-hover:hover {
  /* opacity: 1; */
  transform: scale(1.05);
}

.large-on-hover-micro {
  /* opacity: 0.3; */
  transform: scale(1);
}
.large-on-hover-micro:hover {
  /* opacity: 1; */
  transform: scale(1.02);
}

#clock-text {
  position: absolute;
  top: 10%;
  left: 0;
  /* padding: 0.7rem 0 0 0.3rem; */
  color: var(--bright-green);
  width: 90%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.6rem;
  /* font-size: auto; */
}

/* NES */
#time-progress {
  width: 100%;
}
.nes-progress {
  width: auto;
  height: 15px;
  color: var(--text-color);
}

#warning-overlay {
  display: none;
}

/* range input */
input[type='range']::-webkit-slider-thumb {
  box-shadow: 0px 0px 0px #ffffff;
  border: 0px solid #000000;
  height: var(--input-thumb-size);
  width: var(--input-thumb-size);
  border-radius: 0px;
  background: #000000;
  cursor: pointer;
  -webkit-appearance: none;
}
input[type='range']::-moz-range-thumb {
  box-shadow: 0px 0px 0px #ffffff;
  border: 0px solid #000000;
  height: var(--input-thumb-size);
  width: var(--input-thumb-size);
  border-radius: 0px;
  background: #000000;
  cursor: pointer;
}
input[type='range']::-ms-thumb {
  margin-top: 1px;
  box-shadow: 0px 0px 0px #ffffff;
  border: 0px solid #000000;
  height: var(--input-thumb-size);
  width: var(--input-thumb-size);
  border-radius: 0px;
  background: #000000;
  cursor: pointer;
}

#buttons-div {
  display: none;
}

#interpolation-slider-2 {
  display: block;
  position: absolute;
  left: 5%;
  top: 25%;
  height: 5%;
  width: 75%;
  margin: 0;
  z-index: 1;
}

#board-input {
  position: absolute;
  top: 6%;
  left: 5%;
  width: 89%;
  height: 83%;
  font-size: 0.5rem;
  color: white;
  resize: none;
  border: none;
  background-color: transparent;
}

#board-input:focus {
  outline: none;
}

footer {
  text-align: center;
  margin-top: 1rem;
}

#info-div p,
#info-div a {
  font-size: 0.6rem;
  margin: 0;
  padding: 0;
  padding-left: 0;
}

#youtube-div {
  display: none;
  color: var(--text-color);
  position: absolute;
  right: 10%;
  top: 5%;
  width: 30%;
  max-width: 500px;
  height: 20%;

  /* padding: 1rem; */
  border: solid var(--text-color) var(--border-width);
  background-color: white;
  z-index: 5;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#youtube-div h3 {
  margin: 0 auto 0 auto;
  padding: 0.2rem;
  width: 100%;
  background-color: var(--text-color);
  text-align: center;
  font-size: 0.7rem;
}
#youtube-div a {
  color: var(--text-background-color);
}
#youtube-content-div {
  padding: 0.4rem;
}
#youtube-div p,
#youtube-div li {
  font-size: 0.4rem;
}
#youtube-buttons {
  position: absolute;
  padding: 0.4rem 0.4rem 0.4rem 0.6rem;
  bottom: 0;
  right: 0;
  z-index: 1;
  background-color: var(--text-color);
}
#youtube-buttons button {
  padding: 0rem;
  margin: 0;
  font-size: 0.4rem;
}
#collapse-youtube-div-button {
  color: var(--text-background-color);
  padding: 0;
  position: absolute;
  right: 0;
  top: 0;
  opacity: 0.5;
  font-size: 0.8rem;

  border: none;
  background-color: transparent;
}
#collapse-youtube-div-button:hover {
  opacity: 1;
}

#bubble-div {
  display: none;
  position: absolute;
  padding: 0.1rem;
  bottom: 90%;
  left: 65%;
  width: 5rem;
  z-index: 2;
  font-size: 0.5rem;
}

#shareButtonDiv {
  position: absolute;
  z-index: 4;
  right: 0;
  top: 0;
  width: 5.4rem;
}
#shareButton {
  width: 5rem;
  height: 2rem;
  font-size: 0.7rem;
  padding: 0;
}

#shareButtonHint {
  display: none;
  text-align: center;
  background-color: #ffffff;
  position: absolute;
  right: 108%;
  top: 0.4rem;
  max-width: 18rem;
  word-wrap: none;
  font-size: 0.7rem;
  color: var(--background-color);
  padding: 0.2rem;
  border: solid var(--background-color) 0.2rem;
  opacity: 0.8;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#hiddenUrlInput {
  position: absolute;
  bottom: 100%;
  left: 100%;
}

.blink {
  animation-name: blink;
  animation-duration: 1s;
  animation-iteration-count: infinite;
}
@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media only screen and (max-width: 830px) {
  :root {
    --input-thumb-size: 8px;
    --border-width: 5px;
  }

  body {
    padding: 0.8rem;
  }
  #title {
    width: 260px;
    font-size: 1.2rem;
    border: solid var(--text-color) var(--border-width);
    padding: 0.2rem;
    margin-bottom: 0.2rem;
  }

  span,
  p,
  option,
  select,
  label {
    font-size: 0.4rem;
  }
  h3 {
    font-size: 0.6rem;
  }

  #control-div .block {
    margin: 5px 8px 5px 0;
    padding: 2px;
    min-width: 150px;
    min-height: 90px;
  }

  #time-progress {
    width: 80%;
  }
  .nes-progress {
    width: auto;
    height: 5px;
    color: var(--text-color);
  }

  #clock-text {
    font-size: 0.3rem;
  }
  #board-input {
    font-size: 0.3rem;
  }

  #warning-overlay {
    display: grid;
    place-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 6;
  }
  #warning-div {
    width: 90%;
    max-width: 500px;
    padding: 2rem 1rem;
  }
  #warning-div p {
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.5;
  }
  #warning-div div {
    padding: 0;
    margin-top: 2rem;
    text-align: center;
  }
  button {
    margin: 0;
    font-size: 0.6rem;
  }
  .panel {
    padding: 1rem 1.5rem;
  }
  .panel h3 {
    font-size: 0.6rem;
  }
  .panel label {
    min-width: 3rem;
    margin-right: 0.2rem;
  }

  #interpolation-div p,
  #interpolation-div a {
    font-size: 0.4rem;
  }
  #interpolation-div div {
    width: 80%;
  }
  #interpolation-div select {
    font-size: 0.4rem;
    margin: 0 0.5rem;
  }

  #interpolation-div canvas {
    margin-top: 0.5rem;
    width: 80%;
    height: 20%;
  }

  #melody-panel {
    width: 70%;
  }
  .melody-panel-button {
    font-size: 1rem;
  }
  #melody-panel-close {
    padding: 0.3rem;
  }

  #info h3 {
    font-size: 0.6rem;
    margin-top: 0;
  }
  #info-div p,
  #info-div a {
    font-size: 0.5rem;
    margin: 0;
    padding: 0;
    padding-left: 0;
  }

  footer {
    margin-top: 0.2rem;
  }

  /* range input */
  input[type='range']::-webkit-slider-thumb {
    box-shadow: 0px 0px 0px #ffffff;
    border: 0px solid #000000;
    height: var(--input-thumb-size-small);
    width: var(--input-thumb-size-small);
    border-radius: 0px;
    background: #000000;
    cursor: pointer;
    -webkit-appearance: none;
  }
  input[type='range']::-moz-range-thumb {
    box-shadow: 0px 0px 0px #ffffff;
    border: 0px solid #000000;
    height: var(--input-thumb-size-small);
    width: var(--input-thumb-size-small);
    border-radius: 0px;
    background: #000000;
    cursor: pointer;
  }
  input[type='range']::-ms-thumb {
    margin-top: 1px;
    box-shadow: 0px 0px 0px #ffffff;
    border: 0px solid #000000;
    height: var(--input-thumb-size-small);
    width: var(--input-thumb-size-small);
    border-radius: 0px;
    background: #000000;
    cursor: pointer;
  }

  #interpolation-slider-2 {
    border: solid #000 0.15rem;
    height: 0.6rem;
    left: 5%;
    top: 27%;
  }

  #youtube-div {
    width: 50%;
    top: 2rem;
    right: 2rem;
  }

  #shareButtonDiv {
    position: absolute;
    z-index: 4;
    right: 0;
    top: 0;
    width: 3.4rem;
  }
  #shareButton {
    width: 3rem;
    height: 1.5rem;
    font-size: 0.4rem;
    padding: 0;
  }

  #shareButtonHint {
    /* display: none; */
    text-align: center;
    background-color: #ffffff;
    position: absolute;
    right: 110%;
    top: 0.6rem;
    width: 5rem;
    word-wrap: none;
    font-size: 0.3rem;
    color: var(--background-color);
    padding: 0.2rem;
  }
}

@media screen and (min-width: 1000px) {
  #container {
    width: 85%;
    max-width: 1500px;
  }
}

@media screen and (orientation:landscape) and (max-width: 830px) {

  #container {
    width: 75%;
  }

  #clock-text {
    top: 15%;
  }

  #board-input {
    font-size: 0.4rem;
  }
}
