/* === CONTROLS === */
.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: var(--bg-secondary);
  border-top: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  z-index: 20;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  padding: 0 0.5rem;
}

/* === D-PAD === */
.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.dpad-middle {
  display: flex;
  gap: 0;
}

.btn-dpad {
  width: 52px;
  height: 52px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  touch-action: manipulation;
}

.btn-dpad:active {
  background: var(--btn-primary);
  transform: scale(0.9);
}

.btn-up {
  margin-bottom: -2px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-down {
  margin-top: -2px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.btn-left {
  margin-right: -2px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-right {
  margin-left: -2px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* === ACTION BUTTONS === */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-action {
  width: 70px;
  height: 60px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  touch-action: manipulation;
  font-family: var(--font-main);
}

.btn-action small {
  font-size: 0.45rem;
  margin-top: 2px;
  color: var(--text-secondary);
}

.btn-action:active {
  transform: scale(0.9);
}

.btn-attack:active {
  background: #4a2020;
  border-color: #e74c3c;
}

.btn-dynamite:active {
  background: #4a3a00;
  border-color: #ffd700;
}

/* === DYNAMITE SUBMENU === */
.dynamite-menu {
  position: fixed;
  bottom: 190px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.6rem;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  z-index: 30;
  animation: slideUp 0.2s;
}

.btn-dyn {
  width: 50px;
  height: 50px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
}

.btn-dyn:active {
  transform: scale(0.9);
  background: var(--btn-primary);
}

.btn-cancel {
  background: #3a1a1a;
  border-color: #e74c3c;
}

/* === RESPONSIVE === */
@media (max-height: 600px) {
  .controls {
    height: 140px;
  }
  
  .btn-dpad {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  
  .btn-action {
    width: 60px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .game-viewport {
    bottom: 140px;
  }
}

@media (max-height: 500px) {
  .controls {
    height: 120px;
  }
  
  .game-viewport {
    bottom: 120px;
  }
}

/* === LANDSCAPE WARNING === */
@media (orientation: landscape) and (max-height: 500px) {
  body::after {
    content: '📱 Please rotate to portrait mode';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-accent);
    z-index: 1000;
    text-align: center;
    padding: 2rem;
  }
}
