@import url('https://fonts.googleapis.com/css2?family=ABeeZee:ital@0;1&family=Anton&family=Raleway:ital,wght@1,700&family=Roboto+Slab:wght@200;300&display=swap');

:root{
  font-family: "ABeeZee", sans-serif;
  font-size: 6vw;
  font-weight:400;
  --yellow: #FCD25C;
  --gray: #e6e6e6;
  --border-gray: #d6d6d6;
  --dark: #343437;
  --orange: rgb(252, 188, 92);
  --reddish: #f76257;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

*{
  margin:0;
  padding:0;
}

body{
  max-width:100%;
  color: var(--dark);
  display:flex;
  flex-direction: column;
  height:100vh;
}

.char{
  --full-size: 20vw;
  --half-size: calc(var(--full-size) / 2);
  --quarter-size: calc(var(--full-size) / 4);
  --custom-size: calc(var(--half-size) * 0.65);
  --color: var(--gray);
  display: block;
  width: var(--full-size);
  line-height: var(--half-size);
  height: var(--half-size);
  text-align: center;
  text-transform: uppercase;
  background: var(--color);
  position: relative;
  margin-bottom: var(--custom-size);
}

.char:before {
    content: " ";
    width: 0; height: 0;
    border-bottom: var(--custom-size) solid var(--color);
    border-left: var(--half-size) solid transparent;
    border-right: var(--half-size) solid transparent;
    position: absolute;
    bottom: 100%;
    left:0;
}


.char:after {
    content: "";
    width: 0;
    position: absolute;
    top: 100%;
    left:0;
    border-top: var(--custom-size) solid var(--color);
    border-left: var(--half-size) solid transparent;
    border-right: var(--half-size) solid transparent;
}

.char:active,
.char:active:before,
.char:active:after{
  --color:var(--yellow);
}
.char.mandatory,
.char.mandatory:before,
.char.mandatory:after{
  --color: var(--yellow)
}
.char.mandatory:active,
.char.mandatory:active:before,
.char.mandatory:active:after{
  
  --color: var(--orange);
}

.charGrid{
  max-width: 100%;
  display:flex;
  flex-wrap: wrap;
  gap:0.5rem;
  justify-content: center;
  margin: 1.5rem 0 0;
}

#word{
  max-width: 100%;
  overflow: hidden;
  margin-top: 1em;
  min-height:1.5em;
  text-align: center;
  font-size: 1.5em;
  text-transform: uppercase;
}

error{
  display: block;
  color: var(--reddish);
  width:100%;
  text-align: center;
  font-size: 0.8rem;
  min-height:2em;
}

.foundWords{
  max-width: 100%;
  padding: 0.5rem;
  margin:1rem 0;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.4rem;
}

.foundWords word{
  display: inline-block;
  padding:5px;
  margin: 5px;
  font-style: italic;
  text-transform: capitalize;
  background: #f2f2f2;
  border-radius: 5px;
}

actionGroup{
  width:100%;
  margin-bottom: 0.8rem;
  display:flex;
  align-items: flex-end;
  justify-content: space-around;
  position: relative;
}

actions{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

action{
  display:block;
  flex-shrink: 0;
  text-align: center;
  text-transform: uppercase;
  font-weight:bold;
  font-size: 0.6rem;
  border: 1px solid var(--border-gray);
  border-radius: 5px;
  margin-top: 0.4rem;
  padding: 0.4rem;
}

#delete{
  width: 1.3rem;
  padding: 0 0.4rem;
}

#enter{
  width: 3rem;
  height: 2rem;
  background: var(--yellow);
}

action svg{
  max-width: 100%;
  max-height: 100%
}

action:active{
  opacity:0.7;
}


#shuffle{
  width: 3rem;
  height: 3rem;
}

#shuffle svg{
  width: 100%;
  height: 100%;
}

loading{
  width:100%;
  max-width:100%;
  height:100%;
  position:absolute;
  top:0;
  left:0;
  background-color: var(--yellow);
  font-size: 0.5rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

loading.failed{
  background-color: var(--reddish);
  transition: background-color 0.7s;
}

loadding.failed #retries{
  animation: fadeup 2s 0 ;
}

loading.failed img{
  display: none;
}

loading img{
  width: 7rem;
  flex-shrink: 0;
}

interact{
  position: fixed;
  bottom:0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

reference{
  font-size:0.5rem;
  display: none
}

reference.show{
  opacity:0.6;
  display:block
}

#counters{
  font-style: italic;
  padding:0.5rem 0.5rem 0.8rem;
  display: flex;
  font-size: 0.85rem;
  justify-content: space-between;
}

#counter, #letters{
  position:relative;
}
#counter:after{
  content:"palavras";
}
#letters:after{
  content:"pontos";
}
#counter:after,
#letters:after{
  font-size:0.5em;
  position:absolute;
  top:100%;
  left:50%;
  transform:translate(-50%);
  line-height: 1em;
  width:max-content;
  text-align: center;
}

#menu{
  padding: 0.5rem;
  display:flex;
  justify-content: space-between;
}

#menu .right, #menu .left{
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#menu svg{
  width: 1rem;
  height: 1rem;
}

#menu svg#openChallenge{
  height: 1.2rem;
  width: 1.2rem;  
}

#menu svg#help{
  width: 1.1rem;
  height: 1.1rem;
}

#tiers{
  width:100%;
  background:green;
  display:flex;
  background: #efefef;
  justify-content:center;
  position: relative;
  height:0.6rem;
}

tier{
  display: block;
  background-color: var(--yellow);
  width:1px;
}

tier.active{
  transition: width 0.3s 0.3s ease-in;
}

tier.active + next{
  transition: width 0.5s ease-in-out;
}

next{
  width:1px;
  height:100%;
  background: var(--yellow);
  opacity:0.4;
  position: absolute;
}

#tierLabel{
  position:absolute;
  bottom: calc(100% + 0.5rem);
  color: var(--yellow);
  font-weight: bolder;
}

score{
  font-size:1.5rem;
  font-weight: bold;
  color: var(--orange);
  animation: fadeup 0.6s ease-in;
  animation-fill-mode: forwards;
  position:absolute;
}

.modal{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  opacity: 0;
  pointer-events: none;
  z-index: 99;
}


.modal.show{
  opacity: 1;
  transition: .3s;
  pointer-events: all;
}

.modal .container{
  border: 1px solid var(--border-gray);
  padding: 1.4rem 0.7rem;
  position: relative;
  background: white;
  box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  width: 80vw;
  border-radius: 5px;
}

.modal h2{
  text-align: center;
  margin: 1rem;
}

.modal h3{
  margin: 0.7rem 0;
}

.modal p{
  margin-bottom: 0.4rem;
}

.modal p:last-of-type{
  margin-bottom: 1rem;
}

tiers ul,li{
  list-style: none;
}

tiers li{
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
}

.modal action{
  padding: 0.4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  text-align: center;
}

.modal action svg{
  max-height: 1rem;
}

#close.icon{
  position: absolute;
  right: 0;
  top: 0;
  margin: 0.5rem;
  padding: 0.3rem;
  width: 1rem;
  height: 1rem;
}

@keyframes fadeup{
  from{
    top: 50%;
    opacity:100%;
    transform: scale(1.2)
  }
  to{
    top:-100%;
    opacity: 0;
    transform: scale(0.5)
  }
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--yellow);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--yellow);
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.switch warn{
  display: block;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  width: 10rem;
  font-size: 0.4rem;
  font-style: italic;
  transition:  all 11s;
  transition: opacity 0.2s, margin 0.3s 0.3s;
}

input:not(:checked) ~ warn{
  opacity: 1;
  margin-top:30px;
  margin-bottom: 1rem;
  transition:  opacity 0.3s 0.3s, margin 0.3s;
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}