.endGame,
.endRound,
.startRound,
.equalContainer,
.pause-screen {
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-color);
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
}

.border {
  position: relative;
}

.endGame .border,
.endRound .border,
.startRound .border,
.equalContainer .border,
.pause-screen .border {
  width: 500px;
  max-width: 90%;
}

.name,
.pause-title {
  font-family: snapp, sans-serif;
  font-size: 1rem;
  color: #ffffff;
  padding: 1.2rem 2rem;
  border-radius: 0 0 2rem 2rem;
  margin: auto;
  width: 250px;
  text-align: center;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  top: -0.5rem;
}

.pause-title {
  background: var(--title-gradient);
}

.game,
.winner-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

.game h3 {
  font-family: vazir, sans-serif;
  font-size: 1.1rem;
  color: var(--text-color);
  font-weight: 900;
  background-color: var(--word-bg);
  padding: 1rem 1.5rem;
  margin: 0 auto;
  border-radius: 1.5rem;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}

.game .timer1 {
  color: var(--text-color);
  font-family: snapp;
  font-size: 1.5rem;
  margin-top: 1rem;
  transition: color 0.3s ease;
}

.btn-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.correctButton {
  font-family: snapp, sans-serif;
  font-size: 1rem;
  color: #ffffff;
  background-color: var(--heading-color);
  padding: 0.8rem 1.5rem;
  border: 3px solid var(--button-border);
  border-radius: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  width: 100%;
  max-width: 250px;
}

.btn-container span {
  font-size: 0.8rem;
  transition: all 0.3s ease;
  font-family: snapp;
  width: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 1.2rem;
  white-space: nowrap;
  color: #fa6876;
  background: rgb(194 170 170 / 15%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.button {
  margin-top: 0.5rem;
}

.correctButton:hover,
.restart-button:hover,
.continue:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
  background-color: var(--button-hover);
  cursor: pointer;
}

.btn-container span:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
  background: rgba(194, 170, 170, 0.226);
  cursor: pointer;
}

.nextPerson {
  position: absolute;
  transform: translateX(-50%);
  left: 50%;
  bottom: -2rem;
  color: var(--text-color);
  font-size: 0.9rem;
  font-family: snapp, sans-serif;
}

.round {
  position: fixed;
  transform: translateX(-50%);
  left: 50%;
  bottom: 1rem;
  color: var(--text-color);
  font-size: 0.9rem;
  font-family: snapp, sans-serif;
}

.groupsInformation {
  position: fixed;
  transform: translateX(-50%);
  left: 50%;
  top: 1rem;
  color: var(--text-color);
  font-size: 0.7rem;
  font-family: vazir, sans-serif;
  font-weight: 700;
  width: 500px;
  max-width: 90%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.groupsInformation .info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.groupsInformation .info .infos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.groupsInformation .names {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: var(--text-color);
  width: 120px;
}

.groupsInformation .timer2 {
  font-size: 0.7rem;
  text-align: left;
  color: var(--text-color);
  font-weight: 700;
}

.groupsInformation .processContainer2 {
  flex-grow: 1;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.groupsInformation .process2 {
  height: 100%;
  border-radius: 1rem;
  position: absolute;
  left: 0;
  top: 0;
  box-shadow: 0 2px 4px rgba(124, 106, 255, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  gap: 0.5rem;
}

.winner-section img {
  width: 60px;
}

.winner-name {
  font-family: snapp, sans-serif;
  font-size: 1.2rem;
  color: var(--text-color);
  text-align: center;
}

.winner-score {
  font-family: vazir, sans-serif;
  font-size: 0.8rem;
  color: var(--heading-color);
  font-weight: 800;
  background-color: rgba(151, 153, 254, 0.1);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1.5rem;
  background-color: var(--word-bg);
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  width: 80%;
}

.team-name {
  font-family: vazir, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-color);
}

.team-position {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: snapp;
  font-size: 1rem;
  color: #ffffff;
}

.position-1 {
  background-color: #ffd166;
}

.position-2 {
  background-color: #d8e2dc;
}

.position-3 {
  background-color: #efb495;
}

.position-4 {
  background-color: #cdb4db;
}

p {
  font-size: 0.95rem;
  font-family: snapp, sans-serif;
  line-height: 1.6;
  text-align: center;
}

p.losers {
  color: #d46d78;
}

/* Control team info display based on team count */
.groupsInformation .info:nth-child(3),
.groupsInformation .info:nth-child(4) {
  display: none;
}

body[data-teams="3"] .groupsInformation .info:nth-child(3) {
  display: flex;
}

body[data-teams="4"] .groupsInformation .info:nth-child(3),
body[data-teams="4"] .groupsInformation .info:nth-child(4) {
  display: flex;
}

.info:last-child:nth-child(odd) {
  grid-column: 1 / -1; 
  justify-self: center; 
  width: 50%; 
}

.team-card {
  display: none;
}

body[data-teams="2"] .team-card:nth-child(1),
body[data-teams="2"] .team-card:nth-child(2),
body[data-teams="3"] .team-card:nth-child(1),
body[data-teams="3"] .team-card:nth-child(2),
body[data-teams="3"] .team-card:nth-child(3),
body[data-teams="4"] .team-card {
  display: flex;
}

.pause-button {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--heading-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 106, 255, 0.12);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pause-button:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--button-hover);
}

.pause-button-resume,
.pause-button-exit {
  display: block;
  border: none;
  border-radius: 1.3rem;
  font-size: 16px;
  cursor: pointer;
  padding: 1rem;
  font-family: vazir;
  font-weight: 700;
  width: 150px;
  white-space: nowrap;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.pause-button-resume {
  background-color: #65a591;
  color: #ffffff;
  border: 2px solid #4d8a76;
}

.pause-button-exit {
  background-color: #d24e5b;
  color: #ffffff;
  border: 2px solid #b93c49;
}

.pause-button-resume:hover,
.pause-button-exit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.pause-button-resume:hover {
  background-color: #5b9784;
}

.pause-button-exit:hover {
  background-color: #c24452;
}

.pause-button-resume:active,
.pause-button-exit:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pause-screen .flex {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media screen and (max-width: 500px) {
  .name,
  .pause-title {
    font-size: 1rem;
  }

  .round,
  .nextPerson {
    font-size: 0.75rem;
  }

  .groupsInformation {
    font-size: 0.6rem;
  }

  .pause-button {
    bottom: 0.5rem;
    right: 0.5rem;
    width: 45px;
    height: 45px;
  }

  .groupsInformation .names {
    width: 80px;
  }
}

@media screen and (max-width: 425px) {
  .btn-container span {
    font-size: 0.7rem;
    width: 80px;
  }

  .correctButton {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .game h3 {
    font-size: 1rem;
    height: 65px;
  }

  .game .timer1 {
    font-size: 1.2rem;
  }
}
@media screen and (max-width: 375px) {
  .name,
  .pause-title {
    width: 220px;
    font-size: 1rem;
    padding: 1rem 1.5rem;
  }

  .team-card {
    width: 90%;
  }
}

@media screen and (max-width: 320px) {
  .name,
  .pause-title {
    width: 180px;
    font-size: 0.9rem;
  }

  .groupsInformation .names {
    width: 60px;
  }
}
