* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  height: 100lvh;
  background-image: linear-gradient(
    to bottom,
    rgba(210, 53, 165),
    rgba(210, 53, 165),
    rgba(79, 51, 176, 1),
    rgba(79, 51, 176, 1),
    rgba(79, 51, 176, 1),
    rgba(79, 51, 176, 1),
    rgba(210, 53, 165)
  );
}

body.dark-theme {
  background-image: linear-gradient(
    to bottom,
    rgba(79, 51, 176, 1),
    rgba(79, 51, 176, 1),
    rgba(210, 53, 165),
    rgba(210, 53, 165),
    rgba(79, 51, 176, 1)
  );
}

nav {
  width: 100%;
  background-color: #2b2c6d;
  border-bottom: 0.2rem solid #bc13fe;
  user-select: none;
  position: fixed;
  z-index: 1;
}

nav.dark-theme {
  background-color: #1c1d52;
}

#exit-nav-div {
  width: 100%;
  height: 100lvh;
  position: fixed;
  z-index: 1;
  margin-top: 30px;
}

#exit-nav-div.hidden {
  display: none;
}

.replay-game-div {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 1;
}

.replay-game-div div {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  font-size: 50px;
  user-select: none;
  cursor: pointer;
  color: #fff653;
  text-shadow: 0 0 7px #fbf116;
  font-family: monospace;
  font-weight: bold;
}

.replay-game-div.hidden {
  display: none;
}

.figure-up.try-again,
.figure-up.try-again,
.figure-up.try-again {
  opacity: 0.7;
  filter: blur(1px);
}

#hidden-top-nav {
  width: 100%;
  background-color: #2b2c6d;
  border-bottom: 0.2rem solid #bc13fe;
  user-select: none;
  height: 90px;
}

nav > div {
  margin: auto;
}

#side-bar {
  display: none;
}

#top-nav-div {
  display: flex;
  width: 100%;
  margin-bottom: 2px;
  font-size: 2.5rem;
  text-align: center;
  color: #fff653;
  text-shadow: 0 0 7px #fbf116;
}

#top-nav-div div {
  margin: auto;
}

#top-nav-div .nav-title {
  text-decoration: underline;
  font-size: 1.3rem;
  font-family: monospace;
  text-shadow: 0 0 7px #fbf116, 0 0 10px #fbf116;
}

#game-title {
  font-size: 1.5em;
  font-family: "Brush Script MT", cursive;
  color: #fff;
  text-shadow: 0 0 7px #bc13fe, 0 0 21px #bc13fe, 0 0 42px #bc13fe,
    0 0 82px #bc13fe;
  min-width: 8ch;
}

#settings-btn {
  cursor: pointer;
  font-size: small;
}

/* bottom side of nav bar for settings */
#config-nav-div {
  height: 30px;
  width: 100%;
  text-align: center;
  color: #fff;
}

.open-settings {
  display: flex;
}

.close-settings {
  display: none;
}

#config-nav-div div {
  margin: auto;
}

#select-mode {
  display: flex;
}

#select-mode div {
  margin-left: 10px;
  font-style: italic;
  cursor: pointer;
}

#select-mode div:first-of-type {
  color: aqua;
  text-shadow: 0 0 7px rgb(165, 255, 255);
  font-style: normal;
  cursor: default;
}

.selected-mode-btn {
  text-decoration: underline;
  color: #fff653;
  text-shadow: 0 0 7px #fbf116;
  font-size: larger;
}

#select-theme {
  display: flex;
}

#select-theme div {
  margin-left: 5px;
  font-style: italic;
  cursor: pointer;
}

#select-theme div:first-of-type {
  color: aqua;
  text-shadow: 0 0 7px rgb(165, 255, 255);
  font-style: normal;
  margin-right: 5px;
  cursor: default;
}

.selected-theme-btn {
  text-decoration: underline;
  color: #fff653;
  text-shadow: 0 0 7px #fbf116;
  font-size: larger;
}

footer {
  margin-top: 20px;
  user-select: none;
}

footer header {
  margin-bottom: 10px;
  text-align: center;
  text-decoration: underline;
  font-family: "Brush Script MT", cursive;
  font-size: 2.5rem;
  font-weight: 500;
  color: aqua;
  text-shadow: 0 0 7px rgb(165, 255, 255);
}

#honor-buttons-div {
  text-align: center;
  margin-bottom: 5px;
}

#intentos-btn {
  font-size: medium;
  cursor: pointer;
  padding: 0.4em;
  color: #fff;
  font-style: italic;
}

.selected-table-btn {
  text-decoration: underline;
}

#honor-buttons-div span:nth-of-type(2) {
  color: #fff;
}

#tiempos-btn {
  font-size: medium;
  cursor: pointer;
  padding: 0.4em;
  color: #fff;
  font-style: italic;
}

#score-tables-tries {
  flex-wrap: wrap;
  max-width: 1100px;
  margin: auto;
}

#score-tables-time {
  flex-wrap: wrap;
  max-width: 1100px;
  margin: auto;
}

.showing-table {
  display: flex;
}

.hidding-table {
  display: none;
}

#creditos {
  height: 50px;
  text-align: end;
  margin-top: 20px;
  background-color: aliceblue;
}

#creditos.dark-theme {
  background-color: #1c1d52;
  color: whitesmoke;
}

/* crazy table with rounded corners and bottom border at second child */
/* https://unused-css.com/blog/css-rounded-table-corners/ */
table {
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 10px;
  border: 1px solid black;
}
table > thead > tr:nth-child(2) > th,
table > thead > tr:nth-child(2) > td,
table > tfoot > tr:nth-child(2) > th,
table > tfoot > tr:nth-child(2) > td,
table > tr:nth-child(2) > td,
table > tr:nth-child(2) > th,
table > thead:nth-child(2),
table > tbody:nth-child(2),
table > tfoot:nth-child(2) {
  border-bottom: 1px solid black;
}

th {
  padding: 0 8px 0 8px;
}

td {
  padding: 8px;
  text-align: center;
}

.table-title {
  font-size: xx-large;
}

.config-1 {
  background-color: #cf54ff;
  margin: auto;
  margin-top: 0;
  margin-bottom: 5px;
  font-family: "Courier New", Courier, monospace;
  min-width: 300px;
}

.config-2 {
  background-color: #f87599;
  margin: auto;
  margin-top: 0;
  margin-bottom: 5px;
  font-family: "Courier New", Courier, monospace;
  min-width: 300px;
}

.config-3 {
  background-color: #feb845;
  margin: auto;
  margin-top: 0;
  font-family: "Courier New", Courier, monospace;
  min-width: 300px;
}

.card {
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card:active {
  transform: scale(0.97);
  transition: transform 0.2s;
}

.card.flip {
  transform: rotateY(180deg);
}

.cards-table-x8 {
  width: calc(40% - 10px);
  height: calc(60% - 85px);
  margin: auto;
  margin-top: 5px;
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}

.cards-table-x8 .card {
  width: calc(25% - 10px);
  height: calc(25% - 10px);
  margin: 5px;
  position: relative;
  box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
  border-radius: 15px;
  cursor: pointer;
}

.cards-table-x8.hidding-cards-table {
  display: none;
}

.cards-table-x18 {
  width: calc(100% - 10px);
  height: calc(100% - 85px);
  max-width: 1000px;
  max-height: 640px;
  min-height: 350px;
  margin: auto;
  margin-top: 5px;
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}
.cards-table-x18 .card {
  width: calc(16.667% - 10px);
  height: calc(16.667% - 10px);
  margin: 5px;
  position: relative;
  box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
  border-radius: 15px;
  cursor: pointer;
}

.cards-table-x18.hidding-cards-table {
  display: none;
}

.cards-table-x32 {
  width: calc(100% - 10px);
  height: calc(100% - 100px);
  max-width: 1000px;
  min-height: 350px;
  margin: auto;
  margin-top: 5px;
  margin-bottom: 5px;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
}

.cards-table-x32 .card {
  width: calc(12.5% - 10px);
  height: calc(12.5% - 10px);
  margin: 5px;
  position: relative;
  box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
  border-radius: 15px;
  cursor: pointer;
}

.cards-table-x32.hidding-cards-table {
  display: none;
}

.card .figure-up {
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  font-size: 35px;
  border-radius: 12px;
  position: absolute;
  user-select: none;
  backface-visibility: hidden;
  transform: rotateY(180deg);
}

.cards-table-x8 .card .figure-up {
  font-size: 45px;
}

.card .figure-up.dark-theme {
  background-color: #6668b4;
}

.card .figure-down {
  background-color: #f6e3fd;
  display: flex;
  color: #bc13fe;
  border: 2px solid #bc13fe;
  justify-content: flex-start;
  align-items: end;
  width: 100%;
  height: 100%;
  font-size: small;
  font-weight: bolder;
  font-family: "Brush Script MT", cursive;
  border-radius: 12px;
  position: absolute;
  padding-left: 5px;
  padding-bottom: 5px;
  user-select: none;
  backface-visibility: hidden;
}

.card .figure-down.dark-theme {
  background-color: #2b2c6d;
  border: 2px solid #cf54ff;
  color: #cf54ff;
}

@media screen and (max-height: 400px) and (orientation: landscape) {
  body {
    margin-left: 90px;
  }

  .cards-table-x8 {
    width: calc(90% - 10px);
    height: calc(100% - 10px);
    margin: auto;
    margin-top: 5px;
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
  }
  .cards-table-x8 .card {
    width: calc(25% - 10px);
    height: calc(25% - 10px);
    margin: 5px;
    position: relative;
    box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
    border-radius: 15px;
    cursor: pointer;
  }

  .cards-table-x18 {
    width: calc(100% - 100px);
    min-width: 400px;
    display: flex;
  }

  .cards-table-x32 {
    width: calc(100% - 10px);
    height: calc(160% - 85px);
    max-height: none;
    min-height: 600px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
  }

  .cards-table-x32 .card {
    width: calc(12.5% - 10px);
    height: calc(12.5% - 10px);
    margin: 5px;
    position: relative;
    box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
  }

  #hidden-top-nav {
    display: none;
  }

  #side-bar {
    user-select: none;
    text-align: center;
    color: #fbf116;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 90px;
    background-color: #2b2c6d;
    border-right: 0.2rem solid #bc13fe;
  }

  #side-bar.dark-theme {
    background-color: #1c1d52;
  }

  #side-bar div {
    font-size: xx-large;
    margin: auto;
    text-shadow: 0 0 7px #fbf116, 0 0 10px #fbf116;
  }

  #side-bar .center-div {
    display: flex;
    flex-direction: row;
  }

  #side-bar .game-title {
    font-size: 2em;
    font-family: "Brush Script MT", cursive;
    color: #fff;
    text-shadow: 0 0 7px #bc13fe, 0 0 21px #bc13fe, 0 0 42px #bc13fe,
      0 0 82px #bc13fe;
  }

  #side-bar .nav-title {
    text-decoration: underline;
    font-size: 1.3rem;
    font-family: monospace;
    text-shadow: 0 0 7px #fbf116, 0 0 10px #fbf116;
  }

  nav {
    display: none;
  }
}
/* phone vertical view */
@media (orientation: portrait) {
  #game-title {
    font-size: 1em;
  }

  #hidden-top-nav {
    height: 76px;
  }

  .cards-table-x8 {
    width: calc(100% - 10px);
    height: calc(60% - 85px);
    margin: auto;
    margin-top: 5px;
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
  }
  .cards-table-x8 .card {
    width: calc(25% - 10px);
    height: calc(25% - 10px);
    margin: 5px;
    position: relative;
    box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
    border-radius: 15px;
    cursor: pointer;
    user-select: none;
    min-width: 75px;
    min-height: 75px;
  }

  .cards-table-x18 {
    width: calc(100% - 10px);
    height: calc(100% - 85px);
    max-height: none;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
  }

  .cards-table-x18 .card {
    width: calc(25% - 10px);
    height: calc(11.11% - 10px);
    margin: 5px;
    position: relative;
    box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
    min-width: 65px;
    min-height: 65px;
  }

  .cards-table-x32 {
    width: calc(100% - 10px);
    height: calc(160% - 85px);
    margin: auto;
    display: flex;
    flex-wrap: wrap;
  }

  .cards-table-x32 .card {
    width: calc(25% - 10px);
    height: calc(6.25% - 10px);
    margin: 5px;
    position: relative;
    box-shadow: 0px 5px 7px 0px rgba(0, 6, 56, 0.7);
    min-width: 60px;
    min-height: 60px;
  }
}
