/* RESET + BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: space-between;
  height: 100vh;
}

/* GAME + STATS LAYOUT */
.game-container,
.stats-container {
  padding: 20px;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

.game-container {
  width: 70%;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
}

.stats-container {
  width: 45%;
  background-color: #e0e0e0;
  border: 1px solid #ccc;
}

/* HEADER */
h1 {
  margin-bottom: 20px;
  text-align: center;
}

/* WORDLE GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  grid-template-rows: repeat(6, 50px);
  gap: 10px;
  justify-content: center;
  margin: 0 auto 20px;
}

.cell {
  width: 50px;
  height: 50px;
  background-color: #cecdcd;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
}

.cell.correct { background-color: #6aaa64; }
.cell.present { background-color: #c9b458; }
.cell.absent  { background-color: #787c7e; }

/* BUTTON */
button {
  padding: 10px 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}

/* POPUP */
.popup {
  position: absolute;
  top: 25%;
  left: 30%;
  transform: translate(-50%, -50%);
  width: 300px;
  padding: 20px;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  color: #000;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.popup button {
  margin: 10px;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background-color: #4caf50;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.popup button:hover {
  background-color: #45a049;
}

/* TIMER */
.timer-box {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  color: #333;
  width: fit-content;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timer-icon {
  width: 32px;
  height: 32px;
  margin-right: 6px;
}

/* OPPONENT INFO */
.opponent-info {
  display: flex;
  align-items: center;
  background-color: #1e1e1e;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: white;
  width: 250px;
  margin: 0 auto;
}

.opponent-info .avatar {
  margin-right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.opponent-info .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opponent-info .info {
  flex: 1;
}

.opponent-info .name {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 4px;
}

.opponent-info .stats {
  font-size: 14px;
  margin-bottom: 4px;
}

.opponent-info .rank {
  font-size: 12px;
  color: #f5a623;
}

/* MUSIC TOGGLE BUTTON */
.musicToggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  font-size: 24px;
  border: none;
  border-radius: 50%;
  background-color: #333;
  color: white;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
    transform: scale(0.85); /* zooms out entire layout */
    transform-origin: top center;
  }

  body {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .game-container,
  .stats-container {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: none;
    margin-bottom: 20px;
  }

  .grid {
    grid-template-columns: repeat(5, 36px);
    grid-template-rows: repeat(6, 36px);
    gap: 8px;
  }

  .cell {
    width: 8vw;
    height: 8vw;
    max-width: 36px;
    max-height: 36px;
    font-size: 14px;
  }

  .popup {
    width: 90%;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .opponent-info {
    width: 90%;
    flex-direction: column;
    text-align: center;
  }

  .opponent-info .avatar {
    margin-bottom: 10px;
    margin-right: 0;
  }

  .musicToggle {
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}


