/* --- Global & Base Styling --- */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%);
  font-family: "Press Start 2P", "Courier New", monospace;
  color: #c0c0c0;
  overflow: hidden;
}

/* --- Game Container & Canvas --- */
#game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

canvas {
  display: block;
  border: none;
  box-shadow: none;
  background: none;
  width: 115%;
  max-width: 600px;
  height: auto;
  flex-shrink: 0;
  margin-top: -37px;
}

/* --- Controls Section Layout --- */
.controls {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
  padding-top: 20px;
}

.dpad-container,
.buttons-container,
.center-btns {
  pointer-events: auto;
}

/* --- Center buttons (Select & Start) --- */
.center-btns {
  display: flex;
  gap: 13px;
  justify-content: center;
  margin:0;
}

/* --- D-pad buttons --- */
.dpad-container {
  display: grid;
  grid-template-areas:
    ". up ."
    "left center right"
    ". down .";
  gap: 6px;
}

.dpad {
  background: linear-gradient(145deg, #444444, #222222);
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  color: #c0c0c0;
  font-size: 14px;
  font-weight: bold;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  touch-action: none;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  transition: transform 0.1s ease, background 0.1s ease;
}
.dpad:active {
  background: linear-gradient(145deg, #222222, #111111);
  box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.05);
  transform: translateY(2px);
}
.dpad.up {
  grid-area: up;
}
.dpad.down {
  grid-area: down;
}
.dpad.left {
  grid-area: left;
}
.dpad.right {
  grid-area: right;
}
.dpad.center {
  grid-area: center;
  background: #1a1a1a;
  border: 2px solid #00ffc8;
  box-shadow: inset 0 0 5px #00ffc8;
  border-radius: 50%;
  width: 60px;
  height: 60px;
}

.select-start-btn {
  width: 120px;
  height: 35px;
  line-height: 35px;
  font-size: 10px;
  border-radius: 5px;
  background: #1a1a1a;
  border: 2px solid #444444;
  box-shadow: inset 0 0 5px #444444;
  text-align: center;
  user-select: none;
  touch-action: none;
  transition: all 0.1s ease;
}
.select-start-btn:active {
  background: #222222;
  box-shadow: inset 0 0 3px #555555;
  transform: translateY(1px);
}

.buttons-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.button {
  background: #ff0073;
  border: 2px solid #ff429c;
  border-radius: 50%;
  color: #ffffff;
  font-size: 22px;
  font-weight: bold;
  width: 90px;
  height: 90px;
  text-align: center;
  line-height: 90px;
  user-select: none;
  touch-action: none;
  box-shadow: 0 0 15px #ff0073, inset 0 0 10px #ff99c9;
  transition: all 0.1s ease;
}
.button:active {
  background: #ff429c;
  box-shadow: 0 0 5px #ff0073, inset 0 0 5px #ff99c9;
  transform: scale(0.95);
}

/* Optional: Retro-style RESET button */
#reset-btn {
  background: #c62828;
  color: white;
  padding: 0px 12px;
  border-radius: 6px;
  border: 2px solid #7f0000;
  cursor: pointer;
  user-select: none;
  text-align: center;
  box-shadow: 0 3px #7f0000;
}
#reset-btn:active {
  box-shadow: none;
  transform: translateY(3px);
}
