@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: none;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  background-color: lightslategray;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  animation: fadeIn 0.2s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== TITLE ===== */
h1 {
  color: white;
  font-size: 28px;
  padding: 6px 40px;
  background-color: black;
  border-radius: 50px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 3px;
  word-spacing: 3px;
  text-align: center;
}

/* ===== CARD ===== */
.card {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.75;
  font-weight: 500;
}

/* ===== MODE & DIFFICULTY BUTTONS ===== */
.mode-btns,
.diff-btns {
  display: flex;
  gap: 8px;
}

.mode-btn,
.diff-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 2px solid transparent;
  font-weight: 500;
}

.mode-btn.active,
.diff-btn.active {
  background: black;
  border-color: white;
}

.mode-btn:hover:not(.active),
.diff-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.28);
}

/* ===== PLAYER INPUTS ===== */
.player-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 15px;
  border: 2px solid transparent;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.25);
}

/* ===== BUTTONS ===== */
button {
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background-color: black;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

button:active {
  transform: scale(0.95);
}

#play-btn {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  background: #27ae60;
  border-radius: 10px;
  margin-top: 4px;
}

#play-btn:hover {
  background: #2ecc71;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  padding: 9px 18px;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.game-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== GAME SCREEN ===== */
.matchup-info {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.9;
  text-align: center;
}

.session-score {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 22px;
  border-radius: 50px;
}

.session-score .divider {
  opacity: 0.4;
}

.container {
  display: grid;
  grid-template-columns: repeat(3, auto);
  border: 3px solid black;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.box {
  width: 120px;
  height: 120px;
  border: 2px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 25px;
  background: rgba(255,255,255,0.05);
  transition: background 0.12s;
}

.box:hover {
  background: rgba(255, 255, 255, 0.18);
}

.box img {
  width: 75px;
  pointer-events: none;
}

.status {
  margin: 4px 0;
  padding: 10px 36px;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 500;
  background-color: white;
  color: black;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== WIN ANIMATION ===== */
.win {
  animation: winAnim 0.7s ease-in-out infinite alternate;
}

@keyframes winAnim {
  0%   { background-color: #27ae60; }
  100% { background-color: #82e0aa; }
}

/* ===== LEADERBOARD ===== */
#leaderboard-table-wrapper {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 16px;
  overflow-x: auto;
  min-height: 120px;
}

#lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#lb-table th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  white-space: nowrap;
}

#lb-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#lb-table tbody tr:last-child td {
  border-bottom: none;
}

/* Medalhas dos top 3 */
#lb-table tbody tr:nth-child(1) td:nth-child(1) { color: gold;    font-weight: 700; font-size: 16px; }
#lb-table tbody tr:nth-child(2) td:nth-child(1) { color: silver;  font-weight: 700; font-size: 16px; }
#lb-table tbody tr:nth-child(3) td:nth-child(1) { color: #cd7f32; font-weight: 700; font-size: 16px; }

#lb-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.07);
}

#lb-loading {
  text-align: center;
  opacity: 0.65;
  padding: 24px;
  font-size: 15px;
}
