html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #101a3a 0%, #050713 55%, #01020a 100%);
  font-family: Arial, Helvetica, sans-serif;
  color: white;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

.hud {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(80, 200, 255, 0.9);
  font-weight: bold;
  letter-spacing: 0.5px;
}

.panel {
  background: rgba(10, 20, 50, 0.45);
  border: 1px solid rgba(120, 220, 255, 0.35);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.78em;
  box-shadow: 0 0 25px rgba(50, 160, 255, 0.18), inset 0 0 20px rgba(90, 180, 255, 0.08);
  backdrop-filter: blur(6px);
}

.title {
  font-size: 14px;
  color: #bdefff;
  margin-bottom: 2px;
}

.small {
  font-size: 13px;
  opacity: 0.78;
  font-weight: normal;
  line-height: 1.45;
}

.centerMessage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}

.centerCard {
  max-width: 520px;
  margin: 20px;
  padding: 26px 30px;
  border-radius: 24px;
  background: rgba(5, 10, 30, 0.72);
  border: 1px solid rgba(140, 230, 255, 0.42);
  box-shadow: 0 0 50px rgba(80, 190, 255, 0.23), inset 0 0 24px rgba(140, 220, 255, 0.08);
  backdrop-filter: blur(8px);
}

.centerCard h1 {
  margin: 0 0 10px;
  font-size: 42px;
  color: #d8f8ff;
  text-shadow: 0 0 24px rgba(80, 220, 255, 0.9);
}

.centerCard p {
  margin: 8px 0;
  color: #d7e9ff;
  line-height: 1.5;
}

.key {
  display: inline-block;
  min-width: 18px;
  padding: 2px 7px;
  margin: 0 2px;
  border: 1px solid rgba(180, 240, 255, 0.55);
  border-radius: 7px;
  background: rgba(100, 180, 255, 0.15);
  color: #fff;
  font-weight: bold;
}

.powerButton {
  pointer-events: auto;
  margin-top: 4px;
  margin-bottom: 4px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(180, 240, 255, 0.6);
  border-radius: 8px;
  background: rgba(60, 180, 255, 0.18);
  color: #eaffff;
  font-weight: bold;
  font-size: 0.82em;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(70, 190, 255, 0.18);
}

.powerButton:hover {
  background: rgba(80, 210, 255, 0.28);
}

.powerButton.active {
  background: rgba(255, 180, 50, 0.32);
  border-color: rgba(255, 225, 120, 0.9);
  box-shadow: 0 0 24px rgba(255, 190, 60, 0.45);
}

.powerButton:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* defaults = desktop; JS adds class "is-touch" to <body> for mobile */
.touch-hint  { display: none; }
.desktop-hint { display: inline; }

body.is-touch .touch-hint   { display: block; }
body.is-touch .desktop-hint { display: none; }
body.is-touch #kb-panel     { display: none !important; }

#touch-pad {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  user-select: none;
  -webkit-user-select: none;
}

body.is-touch #touch-pad { display: flex !important; }

.tc-row {
  display: flex;
  gap: 14px;
}

.tc-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(100, 220, 255, 0.5);
  background: rgba(10, 30, 60, 0.65);
  color: #d8f8ff;
  font-size: 22px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  touch-action: none;
}

.tc-btn:active {
  background: rgba(40, 120, 200, 0.55);
  border-color: rgba(140, 240, 255, 0.9);
}

.tc-fire {
  width: 140px;
  height: 54px;
  border-radius: 27px;
  border: 2px solid rgba(255, 100, 100, 0.65);
  background: rgba(80, 10, 10, 0.65);
  color: #ffcfcf;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  touch-action: none;
}

.tc-fire:active {
  background: rgba(180, 30, 30, 0.6);
  border-color: rgba(255, 160, 160, 0.9);
}

.tc-pow {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  border: 2px solid rgba(100, 220, 255, 0.45);
  background: rgba(10, 30, 70, 0.65);
  color: #cdefff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  touch-action: manipulation;
}
.tc-pow:active {
  background: rgba(60, 160, 255, 0.4);
  border-color: rgba(140, 240, 255, 0.9);
}
.tc-pow.locked {
  opacity: 0.4;
}
.tc-bottom-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}
