.msg-overlay{
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: fixed;
  z-index:9;

  visibility: visible;
  backdrop-filter: blur(0);
  background-color: transparent;

  transition: 
    /* delay the invisbility till game restarts animation ends */ 
    visibility 0s var(--restart-duration),
    filter 0.3s ease,
    background 0.3s ease ;
  
  
  
}
.msg-overlay.background-dim{
  backdrop-filter: blur(var(--bg-blur));
  background-color: var(--bg-dim);
}
.msg-overlay.hidden{
  visibility: hidden;
}

.message{
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translate(-50%,0%);
  background-color: white;
  padding: 5px 15px;
  border-radius: 5px;
  color: black;
  font-size: 1.5rem;
  transition: all 0.5s ease-in-out;   
  text-wrap: nowrap;
  text-transform: capitalize;
}

.hidden .message{
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%,-70%);
}

/* Overlay Panels */

section.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  padding: 5% 10%;
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transition: transform 0.4s ease, background 0.2s ease, filter 0.2s, opacity 0.5s  ease-in-out;
}

section.overlay .overlay-content >.hidden{
  display: none;
}

.overlay.hidden {
  background-color: transparent;
  backdrop-filter: blur(0px);
  pointer-events: none;
  transform: translateY(-110%);
  opacity: 0;
}

.overlay-content{
  border-radius: 15px;
  padding: 20px;
  border: 1px ridge #363636;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  background-color: var(--body-bg);
  min-height: 70vh;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  
}

.panel h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Guide Panel Start */

.guide-step {
  margin-bottom: 1.5rem;
}

.wordbox {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.flip-box {
  width: 50px;
  height: 50px;
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}
.flip-inner.flipped{
  transform: rotateY(180deg)
}

.flip-front,
.flip-back {
  display: flex;
  justify-content: center;
  align-items: center;

  position: absolute;
  width: 100%;
  height: 100%;
  text-align: center;
  font-weight: bold;
  font-size: 1.5rem;
  border-radius: 5px;
  backface-visibility: hidden;
  border: 2px solid #3a3a3c;
}

.flip-front {
  background: #121213;
  color: white;
}

.flip-back {
  transform: rotateY(180deg);
  color: white;
}

.legend {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
}

.legend div {
  padding: 5px 10px;
  text-align: center;
}
.tile {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-weight: bold;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.final-note {
  text-align: center;
  margin-top: 2rem;
  font-size: 1rem;
  color: #ccc;
}

.overlay .right{
  background-color: var(--color-right);
}

.overlay .misplaced{
  background-color: var(--color-misplaced);
}

.overlay .wrong{
  background-color: var(--color-wrong);
    
}

.panel{
  padding: 1em 0 ;
}


/* Setting Panel */
.setting{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 70%;
  margin: auto;
}
.setting .slider_container{
  display: flex;
  align-items: center;
}

.setting .slider_container span{
  width: 20px;
  text-align: center;
}

@media only screen and (max-width:650px) {
  .setting{
    display: flex;
    flex-direction: column;
    width: 100%;
  }
}



