body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
}

* {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input { -webkit-user-select:text;}

#app {
  height: 100vh;
  display: flex;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  flex-direction: column;
  text-align: center;
  color: #2c3e50;
  font-family: "Arial", Helvetica, sans-serif; 
}

.formula-form input {
  max-width: 40px;
  text-align: center;
  font-size: 20px;
  padding: 10px;
}

.header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 50px;
  background-color: #ddd;
  box-shadow: 0px 1px 2px 0px #eee;
}

.header > button {
  padding: 5px 10px;
  font-size: 12px;
  min-width: 68px;
}

.settings-button, .reload-button {
  margin: 6px 10px 0 6px;
}

.settings-button, .reload-button > svg {
  cursor: pointer;
}

.button:hover {
  cursor: pointer;
  background-color: #ccc;
}

.judge {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-direction: column;
  justify-content: flex-start;
}

.round-over {
  margin: 0;
}

.panels {
  display: flex;
  max-width: 100%;
  height: 100%;
  position: relative;
}

.panel {
  width: 50%;
  display: flex;
  flex-direction: column;
  padding-top: 0.5em;
  height: calc(100% - 135px);
}

.timer {
  left: 50%;
  font-size: 1.5em;
  font-weight: bold;
}

.timeline-wrapper {
  position: fixed;
  overflow: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  border-top: 1px solid #ccc;
  width: 100%;
  bottom: 0;
  background-color: white;
}

.timeline {
  width: 90%;
  min-height: 35px;
  overflow: auto;
  max-height: 100px;
  display: flex;
  flex-direction: row;
  /* flex-wrap: wrap */
}

.step {
  border-right: 1px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  width: calc(10% - 1px);
  min-height: 35px;
  border-bottom: 1px solid #ccc;
}

.step:hover {
  cursor: pointer;
  background-color: rgb(236, 236, 236);
  box-shadow: 1px 1px 1px #ccc;
}

.step.active {
  background-color: rgb(110, 110, 110);
  box-shadow: 1px 1px 1px rgb(110, 110, 110);
}

.player-scores {
  display: flex;
  align-self: center;
  flex-direction: column;
  top: 50px;
}

.player-scores.player1 {
  margin-left: 0.5em;
  align-self: flex-start;
}

.player-scores.player2 {
  margin-right: 0.5em;
  align-self: flex-end;
}

.scores {
  padding: 0;
  margin: 0;
  font-size: 2.5em;
}

.names {
  margin-top: 0.5em;
}

button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  border: 1px solid rgb(209, 209, 209);
  border-radius: 3px;
  background-color: rgb(255, 255, 255);
  padding: 1em;
  margin: 0.25em;
  display: flex;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
  color: black;
}

button:hover {
  cursor: pointer;
  background-color: #CCC;
}

button:focus {
  outline: none;
}

button.start {
  background-color: rgb(65, 233, 43);
  border: unset;
  padding: 1em;
}

button.pause {
  padding: 0.3em 0.3em;
}

button.start:hover {
  background-color: rgb(56, 204, 68);
}

button.error {
  background-color: rgb(255, 158, 158);
  border: unset;
}

button.technical-fine {
  width: 10em;
  max-height: 2em;
  min-height: 2em;
  padding: 0;
  margin-top: 2em;
  display: flex;
  align-items: center;
}

button.technical-fine.right {
  align-self: flex-end;
}

button.error:hover {
  background-color: rgb(179, 113, 113);
}

button.beat {
  background-color: rgb(238, 255, 0);
  border: unset;
  min-height: 3em;
}

button.beat:hover {
  background-color: rgb(184, 197, 0);
}

button.back {
  position: fixed;
  bottom: 0;
  right: 0;
  min-height: 37px;
  width: 10%;
  padding: 0;
  align-self: flex-end;
  margin-top: 1em;
  display: flex;
  align-items: center;
  align-self: center;
  z-index: 10;
  border-radius: 0;
  margin: 0;
}

button.back {
  margin-top: 0.25em;
  height: 2em;
}

button.saved {
  pointer-events:none !important;
  background-color: rgb(56, 204, 68)
}

button.update-data {
  padding: 0.9em;
  align-items: center;
  margin: 0;
  border-radius: 999px;
  position: relative;
  margin-top: -3px !important;
  margin-right: 10px;
}

button.update-data > .success {
  position: absolute;
  color: white;
  font-weight: 600;
  font-size: 1em;
  top: 0.4em;
  left: 0.15em;
}

button.update-data > .fail::before, button.update-data > .fail::after  {
  content: '';
  width: 1em;
  background-color: white;
  height: 3px;
  position: absolute;
  top: 0.8em;
  left: 0.4em;
  transform: rotate(45deg);
}

button.update-data > .fail::after {
  transform: rotate(-45deg);
}

.panel .buttons {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  height: 100%;
}

.panel.short-panel > div > button, .panel.short-panel > div > div > button {
  padding: 0.5em 0.5em;
  height: unset;
}

.settings {
  overflow: auto;
  margin: 0 0 56.5px 0;
}

.form {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.jsons-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-height: 11em;
  overflow: scroll;
  width: 100%;
  overflow-x: hidden;
}

.json-list-element {
  margin: 5px 0;
}

.remove-json {
  margin-left: 10px;
  color: red;
  border-radius: 100px;
  padding: 0px 6px 2px 6px;
}

.remove-json:hover {
  cursor: pointer;
  color: white;
  background-color: red;
}

.json-title {
  margin-left: 10px;
}

.block h3 {
  margin: 0;
}

.settings .block.json, .settings .block.google, .settings .block.common, .settings .block.discipline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  margin-top: 1.5em;
}

.settings .block.discipline {
  margin-top: 0.5em;
}

.settings .block.discipline .discipline-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.discipline-label {
  display: flex;
  align-items: flex-end;
}

.discipline-title {
  width: 100%;
  display: flex;
  justify-content: center;
}

.settings .block.common {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 100%;
}

.settings .block.common .settings-input-form {
  justify-content: flex-start;
}

.settings-input-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.settings-input-form.column {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
}

.settings-input-form button {
  text-transform: capitalize;
  margin: 0;
  width: calc(100% + 0.1em)
}

.settings-input-form.clear {
  width: 100%;
}

.settings-input-form.clear > button {
  margin: 0.1em 0;
}

.settings-buttons {
  display: flex;
  position: fixed;
  width: 100%;
  bottom: 0;
  background-color: #ddd;
  flex-direction: row;
  justify-content: space-between;
  box-shadow: 0px 1px 2px 0px #eee;
}

.settings .buttons {
  display: flex;
}

.settings .buttons button {
  width: 100%;
}

button.disabled {
  background-color: #ccc;
  cursor: initial;
}

button.disabled:hover {
  background-color: #ccc;
  cursor: initial;
}

.beat-block {
  display: flex;
  width: 100%;
}

.beat-block button {
  width: 50%;
}

.beat-block .no-target-goal {
  width: 100%;
}

.setup {
  height: 100%;
  width: 100%;
  overflow: auto;
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form {
  max-width: 100%;
  display: flex;
}

.input-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0.5em;
}

.input-form label {
  display: flex;
  width: 100%;
  font-weight: 600;
  margin-bottom: 0.25em;
}

.input-form input {
  padding: 0.5em 0.25em;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 20px;
  outline: none;
  width: calc(100% - 0.5em);
}

.input-form input:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25)
}

.input-form input::placeholder {
  font-size: 14px;
}

.input-form button {
  border-radius: 5px;
  padding: 0.5em 1em;
  font-size: 16px;
  outline: none;
}

.input-form button:hover {
  cursor: pointer;
}

.input-form button:focus {
  background-color: rgb(249, 255, 250);
}

.input-form button.confirm {
  border: 2px solid rgb(56, 204, 68);
  background-color: rgb(65, 233, 43);
  align-self: flex-end;
}

.input-form button.confirm:hover {
  background-color: rgb(56, 204, 68);
}

.stats { 
  font-size: 12px;
}

.show-stats-form {
  display: flex;
  flex-direction: row-reverse;
}

.show-stats-form .stats-checkbox-disabled {
  display: none;
}

.show-stats-form div {
  white-space: nowrap;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.show-stats-form input {
  min-width: unset;
  font-size: 10px;
  width: 2em;
  height: 2em;
}

.round-stats {
  display: flex;
  width: 100%;
  flex-direction: row;
  font-size: 24px;
  font-weight: 600;
  justify-content: center;
}

.round-stats span {
  margin: 1em;
  padding: 0.1em 0.5em;
  border:1px solid #888;
  display: flex;
  justify-content: center;
  align-items: center;
}

.round-stats > div {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.ff-block {
  /* for magnet to top BS-12 */
  /* width: 100%; */
  display: flex;
  margin-bottom: 2em;
  /* for magnet to top BS-12 */
  position: fixed;
  /* for magnet to top BS-12 */
  top: 3em;
}

.ff-block.right {
  justify-content: flex-end;
  /* for magnet to top BS-12 */
  right: 0;
}

.ff-block button {
  max-height: 2em;
}

.table-title {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding: 0 1rem;
  text-transform: uppercase;
  font-weight: bold;
  align-items: center;
  padding-top: 1px;
}

.table-title.loading {
  font-weight: 100;
  text-transform: lowercase;
  font-style: italic;
}

.table-title > span {
  max-width: 110px;
  overflow: hidden;
}

.auth {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: auto;
}

.auth .title {
  margin: 50px 0;
}

.auth .error {
  display: flex;
  width: 90%;
  max-width: 500px;
  justify-content: flex-end;
  color: rgb(179, 113, 113);
  margin-bottom: -18px;
}

.auth input {
  display: flex;
  height: 50px;
  max-width: 500px;
  margin: 20px 0;
  width: 90%;
  border-radius: 3px;
  border: 1px solid grey;
  outline: none;
  font-size: 30px;
  caret-color: rgb(56, 204, 68);
}

.auth button {
  display: flex;
  height: 50px;
  max-width: 300px;
  width: 80%;
  margin-top: 50px;
}

@media screen and (max-width: 500px) {
  button.update-data > .success {
    left: 0.30em;
    top: 0.30em;
  }

  .timer {
    font-size: 1em;
  }
  button {
    text-transform: lowercase;
  }

  button.start.update-data {
    padding: 0.9em;
  }

  .header {
    height: 30px;
  }

  .header > button {
    min-width: 132px;
  }

  .table-title > span {
    max-width: 40px;
    overflow: hidden;
  }

  .player-scores {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 10px;
  }

  .player-scores > .names {
    margin: 0;
  }

  .player-scores.player1 > .scores {
    margin: 0 10px 0 0;
  }

  .player-scores.player2 > .scores {
    margin: 0 0 0 10px;
  }

  .round-over {
    margin-top: 0.5em;
    background: lightblue
  }

  .round-stats > button {
    max-width: 130px;
  }

  .round-stats > div, .round-stats > span {
    font-size: 16px;
  }

  .settings {
    margin: 0 0 46px 0;
  }

  button {
    font-size: 12px;
  }

  .header > span.email {
    display: none;
  }

  .show-stats-form div {
    font-size: 16px;
  }

  .show-stats-form input {
    font-size: 10px;
  }
}

@media screen and (max-height: 850px) {
  .stats {
    display: none;
  }
  .show-stats-form .stats-checkbox {
    display: none;
  }
  .show-stats-form .stats-checkbox-disabled {
    display: flex;
  }
}

@media screen and (max-height: 600px) {
  .header {
    height: 30px;
  }

  .header > button {
    min-width: 132px;
  }

  .step, .timeline {
    min-height: 20px;
  }

  button.back {
    min-height: 22px;
    height: 1.5em;
  }

  .judge.game-stop button.disabled {
    display: none;
  }

  .judge.game-stop button.start, .button.beat {
    padding: 1em;
  }

  button {
    padding: 0.8em;
    text-transform: lowercase;
  }

  button.update-data > .success {
    left: 0.30em;
    top: 0.30em;
  }

  button.technical-fine {
    min-height: 2em;
  }

  button.beat {
    min-height: 3em;
  }

  button.start, button.pause.disabled, button.error.pause {
    padding: 0.5em;
  }

  button.start.update-data {
    padding: 0.9em;
  }
  
  button.technical-fine {
    margin-top: 1.25em;
    width: 7.5em;
    max-width: calc(100% - 5px);
  }

  .ff-block {
    margin-bottom: 1.25em;
  }

  .round-over {
    width: 19%;
    display: flex;
    justify-self: center;
    align-self: center;
    position: fixed;
    justify-content: center;
    top: 166px;
  }

  .panel {
    position: fixed;
    height: calc(100% - 220px);
  }

  .panel.player1 {
    left: env(safe-area-inset-right, 0);
  }

  .panel.player2 {
    right: env(safe-area-inset-right, 0);
  }

  .round-stats > div, .round-stats > span {
    font-size: 16px;
  }

  .player-scores {
    justify-content: center;
    align-items: center;
    font-size: 10px;
  }

  .player-scores > .names {
    margin: 0;
  }

  .player-scores > .scores {
    margin: 0 10px;
  }
}


@media screen and (max-height: 500px) {
  .judge.game-stop button.disabled {
    display: none;
  }

  .judge.game-stop button.start {
    padding: 0.5em;
  }

  button {
    padding: 0.5em;
  }

  button.beat {
    min-height: 2.5em;
  }

  button.technical-fine {
    min-height: 2em;
  }

  button.start {
    padding: 0.25em;
  }

  button.start.update-data {
    padding: 0.9em;
  }
  
  button.technical-fine {
    margin-top: 1.25em;
    width: 7.5em;
  }
  
  .ff-block {
    margin-bottom: 1.25em;
  }

  .ff-block > button.error {
    max-height: 2em;
  }

  .round-over {
    width: 19%;
    display: flex;
    justify-self: center;
    align-self: center;
    position: fixed;
    justify-content: center;
    top: 166px;
  }

  .panel {
    position: fixed;
    height: calc(100% - 200px);
  }

  .round-stats > div, .round-stats > span {
    font-size: 16px;
  }

  .round-stats > span {
    margin: 0.7em;
  }

  .player-scores {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 10px;
  }

  .player-scores > .names {
    margin: 0;
  }

  .player-scores > .scores {
    margin: 0 10px;
  }

  .buttons {
    width: 75%;
  }

  .panel.player2 {
    align-items: flex-end;
  }
}


@media screen and (max-height: 450px) {
  button.technical-fine {
    margin-top: 1.25em;
  }
}

@media screen and (max-height: 400px) {
  .panel {
    position: fixed;
    height: calc(100% - 170px);
  }

  .player-scores {
    font-size: 8px;
    top: 35px;
  }

  .timer {
    font-size: 1em;
  }

  button {
    padding: 0.8em;
    min-height: 2em;
    font-size: 10px;
  }
}

@media screen and (max-width: 950px) and (max-height: 450px) {
  button.technical-fine.error {
    min-width: 50px;
  }
}