body {
  text-align: center;
  /* Deep Space Gradient - slightly darker for contrast with bright buttons */
  background: radial-gradient(circle at center, #1a0b2e, #10101a, #000000);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'Press Start 2P', cursive;
}

/* Chrome/Silver Title Effect */
#level-title {
  font-size: 3rem;
  margin-top: 20px;
  background: linear-gradient(to bottom, #ffffff, #dcdcdc, #888888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0px 2px 0px rgba(0, 0, 0, 0.5));
  text-transform: uppercase;
  letter-spacing: 5px;
}

.header {
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.content {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: center;
  gap: 100px;
  /* Increased Spacing */
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Metallic Arcade Buttons --- */

.game-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  border: 10px solid #222;
}

.btn {
  margin: 10px;
  height: 180px;
  width: 180px;
  border-radius: 20px;
  border: none;
  cursor: pointer;

  /* 3D Depth Effect (Unpressed) */
  box-shadow:
    0 15px 0 #111,
    0 20px 20px rgba(0, 0, 0, 0.4),
    inset 0 5px 10px rgba(255, 255, 255, 0.4),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2);

  transition: all 0.1s cubic-bezier(0.4, 0, 1, 1);
  position: relative;
}

/* Metallic Gradients */
.red {
  background: linear-gradient(145deg, #ff4d4d, #990000);
}

.blue {
  background: linear-gradient(145deg, #4da6ff, #004080);
}

.green {
  background: linear-gradient(145deg, #4dff4d, #006600);
}

.yellow {
  background: linear-gradient(145deg, #ffff4d, #999900);
}

/* Animated State: "Flash" (Game Logic uses .pressed) */
.pressed {
  transform: scale(0.98);
  box-shadow:
    0 0 20px 10px rgba(255, 255, 255, 0.7),
    /* Strong outer glow */
    inset 0 0 20px rgba(255, 255, 255, 1);
  /* Inner bright light */
  filter: brightness(2.5) contrast(1.2);
  /* Massive brightness boost to look like LED */
  z-index: 10;
}

/* User Click State: "Physical Push" */
.btn:active {
  transform: translateY(15px);
  box-shadow:
    0 0 0 #111,
    inset 0 10px 20px rgba(0, 0, 0, 0.6);
  filter: brightness(1.2);
}


/* --- Glass Leaderboard --- */
.leaderboard {
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 300px;
  border-radius: 15px;
}

.leaderboard h2 {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  letter-spacing: 2px;
}

#leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 0.7rem;
}

#leaderboard-table th {
  color: #888;
  padding: 5px;
  font-size: 0.6rem;
  text-transform: uppercase;
}

#leaderboard-table td {
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

/* Rank Highlights */
#leaderboard-table tbody tr:nth-child(1) td {
  background: linear-gradient(to right, #bf953f, #fcf6ba, #bf953f);
  color: #000;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#leaderboard-table tbody tr:nth-child(2) td {
  background: linear-gradient(to right, #8e9eab, #eef2f3, #8e9eab);
  color: #000;
  font-weight: bold;
}

#leaderboard-table tbody tr:nth-child(3) td {
  background: linear-gradient(to right, #6d3921, #d68955, #6d3921);
  color: #fff;
}


/* --- Modal --- */
.modal {
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

.modal-content {
  background: #1a1a2e;
  padding: 40px;
  border: 1px solid #444;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 50px rgba(0, 150, 255, 0.2);
  max-width: 90%;
}

.modal-content h2 {
  color: #4da6ff;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.modal-content input {
  padding: 15px;
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  margin: 20px 0;
  width: 200px;
  text-align: center;
  background-color: #0f0c29;
  border: 2px solid #333;
  color: #fff;
  border-radius: 5px;
  outline: none;
}

.modal-content input:focus {
  border-color: #4da6ff;
}

.modal-content button {
  padding: 15px 30px;
  font-family: 'Press Start 2P', cursive;
  background: linear-gradient(to bottom, #28a745, #1e7e34);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 5px 0 #10461d;
  transition: transform 0.1s;
}

.modal-content button:active {
  transform: translateY(5px);
  box-shadow: none;
}

/* --- Layout Legacy Support --- */
.row {
  display: flex;
  justify-content: center;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #111;
  padding: 40px;
  border-radius: 50%;
  border: 15px solid #333;
  box-shadow: inset 0 0 50px #000, 0 20px 50px rgba(0, 0, 0, 0.5);
}


/* --- Responsive --- */

@media (max-width: 1000px) {
  .content {
    flex-direction: column-reverse;
    align-items: center;
    gap: 20px;
  }

  .leaderboard {
    width: 90%;
  }
}

@media (max-width: 600px) {
  #level-title {
    font-size: 1.5rem;
  }

  .game-container {
    padding: 20px;
    border-width: 8px;
  }

  .btn {
    height: 120px;
    width: 120px;
    margin: 5px;
    box-shadow: 0 10px 0 #111, 0 15px 15px rgba(0, 0, 0, 0.4), inset 0 5px 10px rgba(255, 255, 255, 0.4);
  }

  .pressed,
  .btn:active {
    transform: translateY(10px);
  }
}