:root{
  --success-color : hsl(115, 29%, 47%);
  --active-color : hsl(49, 51%, 47%);

  --bg-color :#eee;
  --font-color: hsl(240, 3%, 7%);
  --svg-light : #4A5568; 
}


/* body {
  --font-color: #222;
  --bg-color: #fff;
} */
body.dark-theme {
  --font-color: #eee;
  --bg-color: hsl(240, 3%, 7%);
  --svg-light : yellow; 
}

@media (prefers-color-scheme: dark) {
  /* defaults to dark theme */
  body {
    --font-color: #eee;
    --bg-color: hsl(240, 3%, 7%);
    --svg-light : yellow; 
  }
  body.light-theme {
    --font-color: hsl(240, 3%, 7%);
    --bg-color: #fff;
    --svg-light : #4A5568; 
  }
}

*,
*::after,
*::before {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}
html {
  height: -webkit-fill-available;
}
body {
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  margin: 0%;
  font-size: clamp(0.5rem, 2.5vmin, 1.5rem);
  color: var(--font-color);
}
header,
footer {
  display: flex;
  justify-content: space-around;
  height: 2.5em;
  align-items: center;
}
header {
  border-bottom: 0.1em solid hsl(240, 2%, 23%);
  height: 4.5em;
}
header nav{
  display: flex;
  justify-content: space-around;
  width: 45em; 
  align-items: center;
}
header .help, header .theme {
  width: 1.5em;
  height: 1.5em;
  font-size: 1em;
  border: 0.05em solid hsl(240, 2%, 23%);
  padding: 1em;
  border-radius: 50%;
  display: grid;
  justify-content: center;
  align-content: center;
}
.theme svg path {
 stroke: var(--svg-light);
}
main {
  display: flex;
  flex-grow: 1;
  justify-content: space-around;
  align-items: center;
}
.gridBtns button{
  font-size: 2em;
  padding: .3em .6em;
  font-weight: bold;
  border: 2px var(--success-color) solid;
  background-color: transparent;
  color : var(--font-color);
  margin: .2em;
  cursor: pointer;
}
.gridBtns button:hover{
  background-color: var(--active-color);
  border: none;
}
.moves, .gameControls{
  min-width: 10em;
  height: 70vh;
  display: none;
}
.moves.active, .gameControls.active{
  display: flex;
  flex-direction: column;
}

#playersMoves{
  max-height: 90%;
  overflow: auto;
  scroll-behavior: smooth;
}

#playersMoves::-webkit-scrollbar {
  width: 12px;               
}
#playersMoves::-webkit-scrollbar-track {
  border-radius: 20px;       
  background: rgb(94, 94, 94);      
}
#playersMoves::-webkit-scrollbar-thumb {
  background-color: azure;    
  border-radius: 20px;    
  border: 3px solid rgb(94, 94, 94);  
}

.game-grid , #botsGrid{
  display: grid;
  justify-content: center;
  align-content: center;
  gap: 0.25em;
  margin: .5em 0;
}
.grid-5{
  grid-template-columns: repeat(5, 5.5em);
  grid-template-rows: repeat(5, 5.5em); 
}
.grid-6{
  grid-template-columns: repeat(6, 5em);
  grid-template-rows: repeat(6, 5em); 
}
.grid-7{
  grid-template-columns: repeat(7, 4em);
  grid-template-rows: repeat(7, 4em); 
}
#botsGrid.grid-5{
  grid-template-columns: repeat(5, 3em);
  grid-template-rows: repeat(5, 3em); 
}
#botsGrid.grid-6{
  grid-template-columns: repeat(6, 2.5em);
  grid-template-rows: repeat(6, 2.5em); 
}
#botsGrid.grid-7{
  grid-template-columns: repeat(7, 2em);
  grid-template-rows: repeat(7, 2em); 
}

#botsGrid .tile{
  font-size: 1em; 
}

.bingo-tiles , .mango-tiles{
  display: grid;
  justify-content: center;
  align-content: center;
  grid-template-columns: repeat(5, 3em);
  grid-template-rows: repeat(1, 3em);
  gap: 0.25em;
  margin: .5em 0;
}
#bingoTiles .tile[data-state="correct"]:nth-child(even){
  background-color: var(--active-color);
}
#bingoTiles .tile:nth-child(even){
  border: 0.05em solid var(--active-color);
}
#bingoTiles .tile:nth-child(odd){
  border: 0.05em solid var(--success-color);
}

.tile {
  font-size: 2em;
  color: var(--font-color);
  background-color: var(--bg-color);
  border: 0.05em solid hsl(240, 2%, 23%);
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.tile[data-state="active"] {
  border: none;
  background-color: var(--active-color);
}
.tile[data-state="correct"] {
  border: none;
  background-color: var(--success-color);
}

.gameControls{
  justify-content: center;
  align-items: center;
}

.controls {
  display: flex;
  justify-content: center;
  padding-bottom: .5em;
}

.controls .row{
  width: 45em;
  display: flex;
  justify-content: space-around;
}

.controls .btn{
  padding: 1em 1.5em;
}
.controls .fill-btn {
  font-weight: bold;
}

footer {
  border-top: 0.1em solid hsl(240, 2%, 23%);
}

@media only screen and (max-width: 768px) {

  main{
    flex-direction: column;
  }
  .moves, .gameControls{
    width: 90%;
    height: 10vh;
  }
  #playersMoves {
    display: flex;
    flex-direction: row; 
    flex-wrap: wrap;
    height: 100%;
  }

  #playersMoves p{
    margin:2px 3px;
  }

  #botsGrid.grid-7{
    grid-template-columns: repeat(7, 3.5em);
    grid-template-rows: repeat(7, 3.5em); 
  }
  #botsGrid.grid-6{
    grid-template-columns: repeat(6, 4em);
    grid-template-rows: repeat(6, 4em); 
  }
  #botsGrid.grid-5{
    grid-template-columns: repeat(5, 5em);
    grid-template-rows: repeat(5, 5em); 
  }

  .modal-body .bingo-tiles{
    grid-template-columns: repeat(5, 5em);
    grid-template-rows: repeat(1, 5em);
  }
}

/* MODAL */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: 200ms ease-in-out;
  z-index: 10;
  width: 500px;
  max-width: 80%;

  color: white;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(17, 25, 40, 0.75);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.125);
}

.modal.active{
  transform: translate(-50%, -50%) scale(1);
}

.modal-head , .modal-footer{
  padding:  10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-footer{
  justify-content: center;
}

.modal-head .title {
  font-size: 2rem;
  font-weight: bold;
}

 #modalClose , #restartBtn{
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-size: 2rem;
  font-weight: bold;
  padding: .25em .5em;
  color :var(--font-color);
}
#modalClose{
  color: rgb(214, 1, 1); 
}
#modalClose:hover{
  color: red;
  border-radius: 100%;
}


.modal-body {
  padding : 10px 15px;
}

#overlay{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, .5);
  transition: 200ms ease-in-out;
  display: none; 
}

#overlay.active {
  display: block;
}

/* Dance */
.tile.dance {
  animation: dance 500ms ease-in-out;
}

@keyframes dance {
  20% {
    transform: translateY(-50%);
  }  

  40% {
    transform: translateY(5%);
  }  

  60% {
    transform: translateY(-25%);
  }  

  80% {
    transform: translateY(2.5%);
  }  

  90% {
    transform: translateY(-5%);
  }  

  100% {
    transform: translateY(0);
  }
}
