/* GuessWho.css - TD Green Theme
   Keeps the same structure/functionality as the original GuessWho.css:
   - 7-card grid on desktop
   - responsive grid on smaller screens
   - selectable cards
   - flip-to-OUT eliminated cards
   - lobby/game sections
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #54B848, #a8e063);
  color: #1f2d1f;
}

header,
.top-header {
  background: #ffffff;
  color: #1f2d1f;
  border-bottom: 6px solid #f9d44a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

header {
  text-align: center;
  padding: 20px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 30px;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-area h1,
h1 {
  margin: 0;
  font-size: 36px;
  color: #54B848;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-actions input {
  width: 150px;
}

main {
  max-width: 1800px;
  margin: auto;
  padding: 24px;
}

.setup,
.game,
.section {
  background: #ffffff;
  color: #1f2d1f;
  padding: 24px;
  max-width: 1800px;
  margin: 0 auto 24px;
  border-radius: 24px;
  border: 6px solid #f9d44a;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.hidden {
  display: none;
}

.center {
  text-align: center;
}

#lobbySection {
  text-align: center;
}

#gameCodeText {
  font-size: 48px;
  margin: 10px 0;
  color: #54B848;
  letter-spacing: 4px;
}

#playerText {
  font-size: 18px;
  font-weight: bold;
}

.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.player-board {
  background: #f2fff0;
  padding: 16px;
  border-radius: 18px;
  border: 3px solid #54B848;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.card {
  position: relative;
  background: transparent;
  perspective: 1000px;
  border: none;
  cursor: pointer;
  overflow: visible;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.card-inner {
  position: relative;
  width: 100%;
  min-height: 430px;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.card.eliminated .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.card-front {
  background: #ffffff;
  color: #1f2d1f;
  border: 3px solid #54B848;
  box-shadow: 0 6px 0 #2f8f2f;
}

.card-back {
  background: #f9d44a;
  color: #1f2d1f;
  border: 3px solid #2f8f2f;
  box-shadow: 0 6px 0 #2f8f2f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  transform: rotateY(180deg);
}

.card img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: #f2fff0;
  border-bottom: 3px solid #54B848;
}

.card-content {
  padding: 8px;
  text-align: center;
}

.card h3 {
  margin: 4px 0 6px;
  font-size: 14px;
  line-height: 1.1;
  color: #54B848;
}

.card small {
  display: block;
  font-size: 10px;
  line-height: 1.15;
  padding-bottom: 6px;
  color: #405040;
}

.card.selected .card-front {
  outline: 5px solid #f9d44a;
  outline-offset: -5px;
}

.card.selected .card-inner {
  box-shadow: 0 0 0 5px #f9d44a;
  border-radius: 16px;
}

button {
  background: #54B848;
  color: #ffffff;
  border: 3px solid #2f8f2f;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: bold;
  cursor: pointer;
  margin: 6px;
  box-shadow: 0 5px 0 #2f8f2f;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  background: #46a83d;
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #2f8f2f;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2f8f2f;
}

input {
  padding: 12px;
  border-radius: 12px;
  border: 3px solid #54B848;
  width: 100%;
  max-width: 300px;
  background: #f2fff0;
  color: #1f2d1f;
  font-weight: bold;
}

.turn,
.turn-box {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  background: #f2fff0;
  color: #1f2d1f;
  padding: 16px;
  border-radius: 16px;
  border: 3px solid #54B848;
  margin: 20px 0;
}

.secret {
  text-align: center;
  font-size: 20px;
  background: #f2fff0;
  color: #1f2d1f;
  padding: 12px;
  border-radius: 16px;
  border: 3px solid #54B848;
  margin-bottom: 18px;
}

@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .players {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions input {
    width: 100%;
  }
}

@media (max-width: 600px) {
  main {
    padding: 14px;
  }

  .section,
  .setup,
  .game {
    padding: 18px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-inner {
    min-height: 390px;
  }

  .card img {
    height: 210px;
  }

  .logo-area h1,
  h1 {
    font-size: 30px;
  }

  #gameCodeText {
    font-size: 36px;
  }
}
