@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Press+Start+2P&display=swap");
:root {
  --bg-color: #3b2a57;
  --console-color: #a988e3;
  --console-shadow-light: #c5a7ff;
  --console-shadow-dark: #8d6fc7;
  --screen-bg: #1a1a1a;
  --button-color: #333;
  --text-color: #dcdcdc;
  --score-color: #fca311;
}

body {
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  font-family: "Poppins", sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.console {
  position: relative;
  width: 680px;
  height: 400px;
  background: var(--console-color);
  border-radius: 35px;
  box-shadow: inset 6px 6px 12px var(--console-shadow-dark),
    inset -6px -6px 12px var(--console-shadow-light),
    15px 15px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 25px;
  box-sizing: border-box;
}

.controls {
  flex-basis: 25%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
  box-sizing: border-box;
}

.screen-area {
  flex-basis: 75%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen {
  width: 100%;
  height: 90%;
  background: var(--screen-bg);
  border-radius: 10px;
  border: 10px solid #a181e0;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

#pong {
  background-color: black;
  width: 100%;
  height: 100%;
}

.score {
  position: absolute;
  top: 20px;
  color: var(--score-color);
  font-family: "Press Start 2P", cursive;
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#left-score {
  left: 25%;
  transform: translateX(-50%);
}

#right-score {
  right: 25%;
  transform: translateX(50%);
}

.button {
  user-select: none;
  transition: transform 0.05s ease-in-out, box-shadow 0.05s ease-in-out;
  cursor: pointer;
}

.arrow {
  width: 0;
  height: 0;
  border-style: solid;
}
.start-btn {
  height: 28px;
  background: var(--button-color);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  color: var(--text-color);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4), inset 1px 1px 2px #555,
    inset -1px -1px 2px #222;
}

.start-btn.pressed {
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4), inset 2px 2px 3px #222,
    inset -1px -1px 2px #555;
  transform: translateY(1px);
}
.navigation-buttons {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

.nav-btn {
  width: 70px;
  height: 70px;
  background: var(--button-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4), inset 1px 1px 2px #555,
    inset -1px -1px 2px #222;
}

.nav-btn.pressed {
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4), inset 2px 2px 3px #222,
    inset -1px -1px 2px #555;
  transform: translateY(1px);
}

/* Default: Up/Down arrows for large screens */
.up .arrow {
  border-width: 0 12px 16px 12px;
  border-color: transparent transparent #555 transparent;
}

.down .arrow {
  border-width: 16px 12px 0 12px;
  border-color: #555 transparent transparent transparent;
}

/* Responsive layout for smaller screens */
@media (max-width: 620px) {
  .console {
    width: 95vw;
    max-width: 460px;
    height: 460px;
    flex-direction: column;
    padding: 20px;
  }
  .screen-area {
    order: 1; /* Screen comes first */
    width: 100%;
    height: auto;
  }
  .controls {
    order: 2; /* Controls come second */
    width: 100%;
    height: auto;
    justify-content: center;
    gap: 20px;
    padding: 30px 0; /* Space between screen and buttons */
  }
  .navigation-buttons {
    flex-direction: row; /* Horizontal buttons */
    gap: 30px;
    justify-content: center;
  }
  .screen {
    height: 280px;
  }
  #left-score {
    left: 20%;
  }
  #right-score {
    right: 20%;
  }

  /* Change arrows to Left/Right for small screens */
  /* .up .arrow {
    border-width: 12px 16px 12px 0;
    border-color: transparent #555 transparent transparent;
  }

  .down .arrow {
    border-width: 12px 0 12px 16px;
    border-color: transparent transparent transparent #555;
  } */
}

@media (max-width: 420px) {
  .nav-btn {
    width: 60px;
    height: 60px;
  }
  /* Smaller Left/Right arrows */
  /* .up .arrow {
    border-width: 10px 14px 10px 0;
  }
  .down .arrow {
    border-width: 10px 0 10px 14px;
  } */
  .score {
    font-size: 1.5rem;
  }
}
