body{
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  font-family: sans-serif;
  font-size: 14px;
  height: 100vh;
  color: #fff;
}

canvas{
  max-width: 100%;
  height: auto;
}


#parentDiv{
  position: relative;
  user-select: none;
}

#scoreContainer{
  position: absolute;
  z-index: 10;
  color: #fff;
  left: 10px;
  top: 10px;
  margin: 0;
  display: none;
}

#startScreen,
#restartScreen{
  position: absolute;
  inset: 0;
  background: url("./img/components/startScreenBackground.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

#startScreen{
  display: flex;
  overflow: hidden;
}

#restartScreen{
  display: none;
}

.screenContent{
  text-align: center;
}

/* .screenContent h1{
  color: #fff;
} */

.gameButton{
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.gameButton span{
  position: absolute;
  color: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#startScreen .screenContent{
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 430px;
  margin: 0 auto;
  text-align: center;
}

.bottomControls{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 90px;
  pointer-events: none;
}

.cornerControl,
.centerControl{
  position: absolute;
  text-align: center;
  /* color: #fff; */
}

.leftCorner{
  left: 18px;
  bottom: 0;
}

.rightCorner{
  right: 18px;
  bottom: 0;
}

.centerControl{
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
}

.keyRow{
  display: flex;
  gap: 8px;
  justify-content: center;
}

.pixelKey{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  color: #dfe9ff;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(180deg, #47556b 0%, #2a3444 100%);
  border: 2px solid #1a2230;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.45);
}

.spaceKey {
  min-width: 92px;
  letter-spacing: 1px;
}

.cornerControl p,
.centerControl p{
  margin: 6px 0 0;
  font-size: 18px;
  /* color: #fff; */
}

#settingsButton{
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 80;
  width: 50px;
  height: 50px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

#settingsButton img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease;
}

#settingsButton:hover img{
  transform: scale(1.07);
}


.settingsPopup{
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.settingsPanel{
  position: relative;
  width: min(680px, calc(100% - 40px));
  aspect-ratio: 16 / 9;
}

.settingsBg{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
}

.settingsContent{
  position: absolute;
  inset: 0;
  padding: 26px 24px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settingsContent h2{
  margin: 0 0 8px;
}

.settingsContent p{
  margin: 0 0 14px;
}

.shipOptions{
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.shipOption{
  width: 86px;
  height: 86px;
  border-radius: 10px;
  border: 2px solid #2f4250;
  background: rgba(10, 25, 35, 0.7);
  cursor: pointer;
  padding: 8px;
}

.shipOption img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shipOption.selected{
  border-color: #00e5cc;
  box-shadow: 0 0 0 2px rgba(0, 229, 204, 0.25);
}

.settingsActions{
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settingsBtn{
  min-width: 96px;
  height: 36px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.settingsBtn.secondary{
  background: #39465a;
  color: #fff;
}

.hidden{
  display: none !important;
}

.soundSettings{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.soundSettings p{
  margin: 0;
  font-size: 16px;
  color: #fff;
}

.soundOptions{
  display: flex;
  gap: 10px;
}

.soundOption{
  min-width: 88px;
  height: 36px;
  border: 2px solid #2f4250;
  border-radius: 8px;
  background: rgba(10, 25, 35, 0.7);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.soundOption.selected{
  border-color: #00e5cc;
  box-shadow: 0 0 0 2px rgba(0, 229, 204, 0.25);
}

.settingsBtn.primary{
  background: #00b8a7;
  color: #07131b;
}