

body {
    font-size: 2rem;
    display: flex;
    flex-direction: column;
}


/* ✅ PANTALLA BIENVENIDA ========= */
.bienvenida {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
}

.bienvenida.visible{
  display: flex;
}

.bienvenida h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 5rem;
  margin-top: 0;
}

.bienvenida-botones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bienvenida button {
  padding: 1rem 3rem;
  margin: 0 1rem;
  min-width: 20rem;
}


/* ✅ HEADER ========= */
.cabecera {
  padding: 0.5rem 2rem;
  background: var(--bg2);
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  padding: 3rem;
}

.nivel{
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cabecera-titulo {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.5rem;
  text-transform: uppercase;
  line-height: 1;
  margin: 1rem 0;
  color: var(--fontColor2);
}

.cabecera-num {
  font-family: var(--font-display);
  color: var(--orange);
  font-weight: 400;
  font-size: 3.5rem;
  line-height: 0.9;
}

.contadores {
  display: flex;
  gap: 2rem;
}

.contador-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* ✅ MAIN MESA - CARDS  ========= */
main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 5rem;
}


h1 {
    text-align: center;
    font-family: var(--font);
    font-weight: 600;
    font-style: normal;
    color: var(--fontColor);
    margin: 1rem;
    line-height: 3.5rem;
}


.btn-repartir {
  bottom: 5rem;
  background: var(--gradient);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
  color: white;
  padding: 1.5rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 300;
  font-style: normal;
  font-size: 1.5rem;

  &:hover{
      background: #333138;
  }
}

button{
  color: white;
  background: var(--gradient);
  border: 0;
  margin: 0;
  text-transform: capitalize;
  font-family: var(--font);
  font-size: 1.5rem;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
}

.mesa {
  max-width: 75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin:2rem;
  gap: 1.5rem;
}


/* ✅ ANIMACION REPARTIR INICIO =========== */
@keyframes aparecer {
  from {
      opacity: 0;
      transform: scale(0.5);
  }
  to {
      opacity: 1;
      transform: scale(1);
  }
}

.aparecer{
  animation: aparecer 0.6s forwards;
}

.tarjeta {
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 0.3em;
    background-image: var(--gradient);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.6s; 
}


.tarjeta__contenido {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    transform: rotateY(-180deg);
    backface-visibility: hidden;
    background-color: white;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25), 4px 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 0.3em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
}

.descubierta {
  transform: rotateY(-180deg);
}


/* ANIMACIONES DE ACIERTO / ERROR  ========== */
@keyframes error {
  10%,
  90% {
    transform: rotateY(-180deg) translateX(-1px);
  }
  20%,
  80% {
    transform: rotateY(-180deg) translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: rotateY(-180deg) translateX(-4px);
  }
  40%,
  60% {
    transform: rotateY(-180deg) translateX(4px);
  }
}

@keyframes acierto {
  from {
    transform: rotateY(-180deg) scale3d(1, 1, 1);
    opacity: 1;
  }

  25% {
    transform: rotateY(-180deg) scale3d(1.1, 1.1, 1.1);
    opacity: 1;
  }

  to {
    transform: rotateY(-180deg) scale3d(1, 1, 1);
    opacity: 0;
  }
}

.acertada {
  pointer-events: none;
}

.acertada .tarjeta__contenido {
  animation: acierto 1.3s ease-in-out forwards;
}

.error {
  animation: error 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}




/* ✅ MODALES =============== */

/* Los modales Completos */
.sube-nivel,
.game-over,
.end-game {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100%;
  max-height: 100%;
  background: rgba(0, 0, 0, 0.599);
}

/* Modales visibles */
.sube-nivel.visible,
.game-over.visible,
.end-game.visible {
  display: flex;
}

.modal {
  position: relative;
  background: white;
  border-radius: 1rem;
  padding: 3rem 3rem;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.modal h2 {
  font-style: italic;
  color: var(--orange);
  font-family: var(--font-display);
  margin: 0;
}

.modal p {
  font-size: 1.5rem;
  color: var(--fontColor);
}

.modal button {
  margin: 3rem 0;
}


.modal .reiniciar {
  background: var(--bg2);
  margin: 0;
}


/* OCULTAR SONIDO */
.sonido{
  display: none;
}

/* OCULTAR TEMPORIZADOR */
.cronometro-oculto{
  display: none;
}



/* ✅ SIDEBAR MENU  =====*/

/* Boton Menu */
.control-nivel{
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  line-height: 2;
  font-weight: 700;
  text-align: center;
  align-self:self-end;
  background: none;
  padding: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 1px solid var(--hotpink);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.605), 4px 4px 10px rgba(0, 0, 0, 0.529);
}

.control-oculto{
  display: none;
}

.oculta-menu {
  visibility: hidden;
}

/* Barra */
.selecciona-nivel{
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem;
  gap: 2rem;
  background: var(--bg2);
  position: fixed;
  width: 200px;
  right: 0;
  top: 0;
  bottom: 0;
  transform: translateX(250px);
  transition: transform .3s;
}

.selecciona-nivel.visible{
  transform: translateX(0);
}

.selecciona-nivel .nivel{
  background: var(--bg2);
  padding: 1rem 2rem;
  &:hover{
    background: none;
    border: 1px solid var(--hotpink);
    color: var(--fontColor2);
  }
}

.selecciona-nivel ul{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding-left: 0;
}

.selecciona-nivel li{
  background: var(--bg2);
  border-radius: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.cierra-niveles{
  margin: 0;
  padding: 0;
  font-size: 4rem;
  font-family: sans-serif;
  font-weight: 400;
  background: var(--bg2);
  border: 1px solid var(--fontColor2);
  &:hover{
    border: 1px solid var(--hotpink);
  }
}

.config{
  margin: 0;
  padding: 0;
  font-size: 3rem;
  background: var(--bg2);
  &:hover{
    border: 1px solid var(--hotpink);
  }
}

/* ✅ FOOTER ========= */
footer {
    text-align: center;
    padding: 1rem;
    font-size: 1.5rem;
    background: var(--bg2);
    color: var(--fontColor2);
    margin-top: 2rem;

    p{
        font-weight: 400;
        font-style: normal;
        font-size: 1.5rem;
    }

    span {
        color: var(--orange);
    }
}

