/* ==========================================================================
   ASTEROIDS by Girassol Inteligência - Touch Controls Stylesheet
   Otimizado para controle tátil com dois polegares em smartphones e tablets
   ========================================================================== */

.touch-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px 20px 24px 20px;
  pointer-events: none; /* Deixa o centro livre */
}

.touch-group {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto; /* Reativa cliques apenas nos botões */
}

/* Painel Esquerdo: Direcional e Propulsão */
.touch-left {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(2, 62px);
  gap: 8px;
  align-items: center;
}

.touch-rot-left {
  grid-column: 1;
  grid-row: 2;
}

.touch-thrust {
  grid-column: 2;
  grid-row: 1;
  background: rgba(34, 197, 94, 0.2) !important;
  border-color: rgba(74, 222, 128, 0.6) !important;
}

.touch-rot-right {
  grid-column: 3;
  grid-row: 2;
}

/* Painel Direito: Ações de Tiro e Hiperespaço */
.touch-right {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 14px;
}

.touch-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease, background-color 0.08s ease, border-color 0.08s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.08);
}

.touch-btn span {
  font-size: 1.4rem;
  line-height: 1;
}

.touch-btn small {
  font-family: var(--font-title);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
  color: var(--text-muted);
}

/* Botão de Tiro em Destaque */
.touch-fire {
  width: 78px;
  height: 78px;
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(248, 113, 113, 0.7) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.touch-fire span {
  font-size: 1.8rem;
  color: #fca5a5;
}

.touch-fire small {
  color: #fca5a5;
}

.touch-hyper {
  width: 58px;
  height: 58px;
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

.touch-hyper span {
  font-size: 1.2rem;
}

/* Estado de Toque Pressionado */
.touch-btn:active, .touch-btn.is-active {
  transform: scale(0.92);
  background: rgba(74, 222, 128, 0.35);
  border-color: var(--primary-glow);
  box-shadow: 0 0 25px rgba(74, 222, 128, 0.6);
}

.touch-fire:active, .touch-fire.is-active {
  background: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
}

/* Em telas muito pequenas */
@media (max-width: 400px) {
  .touch-left {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 52px);
    gap: 4px;
  }
  .touch-btn {
    width: 54px;
    height: 54px;
  }
  .touch-fire {
    width: 66px;
    height: 66px;
  }
  .touch-hyper {
    width: 50px;
    height: 50px;
  }
}
