@import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');

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

body {
  font-family: 'Oswald', sans-serif;
  background: radial-gradient(circle at center, #1e1e2f, #0d0d1a);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #f1f1f1;
}

main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto; /* Optional: helps with vertical consistency */
  gap: 4rem;
  width: 100%;
  max-width: 1200px;
  align-items: start; /* <-- aligns everything at the top of its cell */
}

h1 {
  text-align: center;
  font-size: 3.5rem;
  margin-bottom: 2rem;
  color: #ffe89f;
  text-shadow: 0 0 10px rgba(255, 220, 115, 0.3);
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 2rem;
  justify-content: center;
  height: 500px;
}

.player-active {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(255, 220, 115, 0.357);
  transform: scale(1.02);
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

.player-active .name {
  color: #ffe89f;
  font-weight: 800;
  text-shadow: 0 0 5px #ffe89f44;
}

.player-winner {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3);
  transform: scale(1.05);
  transition: all 0.4s ease;
  border: 2px solid #ffd700;
  animation: pulseWinner 1s infinite alternate;
}

.player-winner .name {
  color: #ffd700;
  font-weight: 900;
  text-shadow: 0 0 8px #ffd700aa;
}

.player-winner .lives {
  color: #fff176;
}

.name,
.btn {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
}

.name {
  color: #ffdc73;
  font-size: 2.5rem;
}

.lives {
  font-weight: 400;
  font-size: 2.5rem;
}

.player-shot {
  font-weight: 700;
  font-size: 2.5rem;
  color: red;
}

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* <-- ensures vertical centering */
  gap: 1rem;
  position: relative;
  min-height: 250px; /* Try adjusting this to match .player box height */
}

.barrel {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #6c6452 0%, #4b4436 100%);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s linear;
}

.chamber-wrapper {
  position: absolute;
  width: 40px;
  height: 40px;
}

.chamber {
  width: 35px;
  height: 35px;
  background-color: #4b4436;
  border: 3px solid #a49c825b;
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.center {
  width: 35px;
  height: 35px;
  background: #4b4436;
  border-radius: 50%;
  box-shadow: inset 0 0 10px #000;
  z-index: 2;
}

@keyframes spinBarrel {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(720deg);
  }
}

.spin-barrel {
  animation: spinBarrel 1s ease-out;
}

.btn {
  background-color: #ffdc73;
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.5rem;
  text-transform: uppercase;
  transition: transform 0.2s ease, background-color 0.3s;
  color: #222;
  font-weight: bold;
  margin: 0;
}

.btn:hover {
  background-color: #ffe89f;
  transform: translateY(-2px);
}

.disabled-btn:hover {
  background-color: rgba(255, 255, 255, 0.293);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(2px);
  background-color: #ffcc4d;
}

.btn-restart {
  margin-bottom: 1rem;
  background-color: #ff6b6b;
  color: white;
}

.btn-restart:hover {
  background-color: #ff8787;
}

.disabled-btn {
  background-color: rgba(255, 255, 255, 0.126);
  color: black;
}

img {
  height: 130px;
  width: 200px;
  padding: 0;
  margin: 0;
}

.img-invert {
  transform: scaleX(-1);
}
