html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050914;
  font-family: Arial, Helvetica, sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, #172347 0%, #050914 58%, #02040a 100%);
}

#game-container {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

#power-controls {
  flex: 0 0 auto;
  min-height: 86px;
  padding: 10px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(2, 4, 10, 0.25) 0%,
      rgba(2, 4, 10, 0.9) 100%
    );
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.power-button {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.82);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.38);
  transition:
    transform 0.12s ease,
    filter 0.18s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.power-button:active {
  transform: scale(0.94);
}

.power-button:hover {
  filter: brightness(1.08);
}

.power-label {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.power-subtitle {
  font-size: 0.62rem;
  line-height: 1;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.emp-button {
  background:
    radial-gradient(circle at 35% 25%, #ffffff 0%, #7ee8ff 18%, #1269ff 58%, #041b57 100%);
}

.air-button {
  background:
    radial-gradient(circle at 35% 25%, #ffffff 0%, #ffd16d 18%, #ff4a2f 58%, #4a0505 100%);
}

.power-button.used,
.power-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(1);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at 35% 25%, #9a9a9a 0%, #5a5a5a 42%, #242424 100%);
  box-shadow: none;
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(87, 158, 255, 0.22), transparent 28rem),
    rgba(2, 5, 13, 0.86);
  backdrop-filter: blur(8px);
}

.start-card {
  width: min(92vw, 520px);
  padding: 24px 20px 22px;
  border-radius: 26px;
  color: #ffffff;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(12, 24, 52, 0.94), rgba(5, 10, 24, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.start-card h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 10vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(255, 80, 60, 0.42);
}

.start-intro {
  margin: 0 auto 16px;
  max-width: 440px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.45;
}

.instruction-list {
  margin: 0 auto 14px;
  max-width: 440px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.instruction-list p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.95rem;
  line-height: 1.35;
}

.instruction-list p:last-child {
  margin-bottom: 0;
}

.start-tip {
  margin: 0 0 18px;
  color: #ffdd66;
  font-weight: 800;
  font-size: 0.96rem;
}

.start-button {
  width: 100%;
  max-width: 280px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  color: #07111f;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #ffd0d0 42%, #cdefff 100%);
  box-shadow: 0 16px 34px rgba(255, 95, 95, 0.24);
}

.start-button:active {
  transform: scale(0.97);
}

canvas {
  display: block;
  margin: 0;
  padding: 0;
}

@media (max-width: 520px) {
  #power-controls {
    min-height: 78px;
    padding: 8px 12px 12px;
    gap: 14px;
  }

  .power-button {
    width: 66px;
    height: 66px;
  }

  .power-label {
    font-size: 0.9rem;
  }

  .power-subtitle {
    font-size: 0.56rem;
  }

  .start-card {
    padding: 21px 16px 18px;
    border-radius: 22px;
  }

  .start-intro,
  .instruction-list p,
  .start-tip {
    font-size: 0.9rem;
  }
}

@media (max-height: 520px) {
  #power-controls {
    min-height: 68px;
    padding: 6px 10px 8px;
  }

  .power-button {
    width: 58px;
    height: 58px;
  }

  .power-label {
    font-size: 0.78rem;
  }

  .power-subtitle {
    font-size: 0.5rem;
  }

  .start-overlay {
    align-items: flex-start;
    overflow-y: auto;
  }

  .start-card {
    margin: 10px 0;
    padding: 16px 14px;
  }

  .start-card h1 {
    font-size: 2rem;
  }

  .instruction-list {
    padding: 10px 12px;
  }
}