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

body {
  display: flex;
  height: 100vh;
  background-color: #f4f4f4;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: hidden;
}



/* Logo */
#logo {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
}
#logo img {
  width: 70px;
  height: auto;
}
#name {
  font-size: 32px;
  font-weight: bold;
}

/* Layout */
#main-content {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  padding-top: 100px;
}

#left-panel {
  width: 40%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 3rem;
}

#title {
  font-weight: bold;
  font-size: 38px;
  margin-bottom: 10px;
  margin-left: 130px;
}

#parah {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 15px;
  margin-left: 190px;
}

.rules-button {
  margin-top: 12px;
  padding: 8px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  background-color: #333;
  color: #fff;
  cursor: pointer;
}

/* Right panel */
#right-panel {
  width: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lives, #score {
  font-size: 32px;
  font-weight: bold;
  margin: 5px 0;
}

/* Game Grid */
#game {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  gap: 10px;
  margin-top: 25px;
}

.card {
  width: 100px;
  height: 100px;
  background-color: aqua;
  color: white;
  font-size: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
}

.flipped {
  background-color: bisque;
}

/* Win/Lose */
#lost, #won {
  margin-top: 25px;
  font-size: 32px;
  font-weight: bold;
  display: none;
  text-align: center;
}

#lost { color: red; }
#won { color: black; }

#tryAgain, #winAgain {
  margin-top: 20px;
  display: none;
  font-size: 20px;
  padding: 10px 25px;
  border-radius: 12px;
  background-color: black;
  color: white;
  border: none;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.35);
  backdrop-filter: blur(5px);
  z-index: 1000;
}
.modal {
  background: #fff;
  color: #111;
  width: min(640px, 90%);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  position: relative;
}

/* ---------------------------------------------------------- */
/*                📱 MOBILE RESPONSIVENESS                    */
/* ---------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    
  }

  #main-content {
    flex-direction: column;
    padding-top: 140px;
  }

  #left-panel {
    width: 100%;
    padding-left: 0;
    align-items: center;
    text-align: center;
  }

  #title {
    font-size: 32px;
    margin-left: 10px;
  }

  #parah {
    font-size: 18px;
    margin-left: 0;
  }

  .rules-button {
    margin-left: 0;
  }

  #right-panel {
    width: 100%;
    margin-top: 20px;
    
  }

  #lives, #score {
    font-size: 26px;
  }

  #game {
  width: 100%;
  max-width: 360px;
  margin: 15px auto 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  justify-items: center;
  margin-bottom: 30px;
}

  .card {
  width: 65px;
  height: 65px;
  aspect-ratio: 1 / 1;
}


  #name {
    font-size: 26px;
  }
}



@media (min-width: 992px) {
  body {
    overflow-y: hidden;
  }

  #main-content {
    padding-top: 0;
    height: 100vh;
  }

  #right-panel {
    justify-content: center;
  }
}

